hyphenize

0.0.2 • Public • Published

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

Package Sidebar

Install

npm i hyphenize

Weekly Downloads

20

Version

0.0.2

License

MIT

Last publish

Collaborators

  • ragingwind