This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
john-cname with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
A bad pun that turns domains into CNAME files
$ npm install john-cname
$ yarn add john-cname
const cname = require('john-cname') cname('http://cname.cool/', 'build') // Outputs a properly formatted CNAME file in ./build
Domain the CNAME file should contain. Protocols and trailing slashes are automatically removed.
cname('http://cname.cool/', 'build') // -> cname.cool
Path to output the CNAME file.
cname('http://cname.cool/', 'build') // -> ./build/CNAME
MIT © Nick Pfisterer