arrow-left

All pages
gitbookPowered by GitBook
1 of 2

Loading...

Loading...

decamelize

decamelize

Convert a camelized string into a lowercased one with a custom separator Example: unicornRainbow → unicorn_rainbow

hashtag
Install

hashtag
Usage

hashtag
API

hashtag
decamelize(input, [separator])

hashtag
input

Type: string

hashtag
separator

Type: string Default: _

hashtag
Related

See for the inverse.

hashtag
License

MIT ©

$ npm install --save decamelize
camelcasearrow-up-right
Sindre Sorhusarrow-up-right
const decamelize = require('decamelize');

decamelize('unicornRainbow');
//=> 'unicorn_rainbow'

decamelize('unicornRainbow', '-');
//=> 'unicorn-rainbow'