Sign Up for Free

RunKit +

Try any Node.js package right in your browser

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:

var johnCname = require("john-cname")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

john-cname v0.1.0

A bad pun that turns domains into CNAME files

john-cname

A bad pun that turns domains into CNAME files

Build Status

Install

NPM:

$ npm install john-cname

Yarn:

$ yarn add john-cname

Usage

const cname = require('john-cname')

cname('http://cname.cool/', 'build')
// Outputs a properly formatted CNAME file in ./build

API

cname(domain, [path])

domain

Type: string Domain the CNAME file should contain. Protocols and trailing slashes are automatically removed.

cname('http://cname.cool/', 'build')
// -> cname.cool

path

Type: string Path to output the CNAME file.

cname('http://cname.cool/', 'build')
// -> ./build/CNAME

License

MIT © Nick Pfisterer

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free