decamelize
Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow
Last updated 7 months ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install decamelize 
SYNC missed versions from official npm registry.

decamelize Build Status

Convert a camelized string into a lowercased one with a custom separator
Example: unicornRainbowunicorn_rainbow

Install

$ npm install decamelize

Usage

const decamelize = require('decamelize');

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

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

API

decamelize(input, [separator])

input

Type: string

separator

Type: string
Default: _

Related

See camelcase for the inverse.

License

MIT © Sindre Sorhus

Current Tags

  • 3.2.0                                ...           latest (7 months ago)

10 Versions

  • 3.2.0                                ...           7 months ago
  • 3.1.1                                ...           8 months ago
  • 3.1.0                                ...           8 months ago
  • 3.0.0                                ...           8 months ago
  • 2.0.0                                ...           2 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.2                                ...           4 years ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 560
This Week 82,469
This Month 417,736
Last Day 27,349
Last Week 147,047
Last Month 562,785
Dependencies (1)
Dev Dependencies (3)
Dependents (574)

Copyright 2014 - 2016 © taobao.org |