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

10 Versions

  • 3.2.0                                ...           9 months ago
  • 3.1.1                                ...           10 months ago
  • 3.1.0                                ...           10 months ago
  • 3.0.0                                ...           10 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 1,021
This Week 16,957
This Month 383,084
Last Day 15,936
Last Week 145,208
Last Month 658,177
Dependencies (1)
Dev Dependencies (3)
Dependents (603)

Copyright 2014 - 2017 © taobao.org |