hyphenize

Normalize key for object. Convert string from unfitting string as a object key to fitting string in style of hyphen

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
hyphenize
100.0.29 years ago9 years agoMinified + gzip package size for hyphenize in KB

Readme

hyphenize Build Status
Normalize key for object. Convert string from unfitting string as a object key to fitting string in style of hyphen

Install

$ npm install --save hyphenize

Usage

var hyphenize = require('hyphenize');

hyphenize('lowerUpper'); //=> 'lower-upper'
hyphenize('lowerUpper'); //=> 'lower-upper'
hyphenize('_lowerUpper'); //=> '_lower-upper'
hyphenize('.lowerUpper'); //=> 'lower-upper'
hyphenize('/lowerUpper'); //=> 'lower-upper'
hyphenize(' /._lowerUpper'); //=> '_lower-upper'
hyphenize('lower-Upper'); //=> 'lower-upper'
hyphenize('lower Upper'); //=> 'lower-upper'
hyphenize('lower.Upper'); //=> 'lower-upper'
hyphenize('lower.Upper'); //=> 'lower-upper'
hyphenize('lower upper'); //=> 'lower-upper'

API

hyphenize(input)

input

Type: string
Target string

License

MIT © Jimmy Moon