decamelize
Convert a camelized string into a lowercased one with a custom separator: unicornRainbow → unicorn_rainbow
Last updated 5 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 (5 months ago)

10 Versions

  • 3.2.0                                ...           5 months ago
  • 3.1.1                                ...           6 months ago
  • 3.1.0                                ...           6 months ago
  • 3.0.0                                ...           6 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 20,491
This Week 92,353
This Month 341,419
Last Day 24,987
Last Week 106,205
Last Month 588,715
Dependencies (1)
Dev Dependencies (3)
Dependents (542)

Copyright 2014 - 2016 © taobao.org |