Skip to content
Snake case a string in JavaScript
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore update to standard style Mar 29, 2015
.travis.yml Replace `sentence-case` with `no-case` core Jun 11, 2016
LICENSE Initial commit. Mar 24, 2014
README.md
package.json Update dependencies to enable Greenkeeper 🌴 (#8) May 6, 2017
snake-case.d.ts
snake-case.js
test.js Replace `sentence-case` with `no-case` core Jun 11, 2016

README.md

Snake Case

NPM version NPM downloads Build status Test coverage Greenkeeper badge

Snake case a string.

Supports Unicode (non-ASCII characters) and non-string entities, such as objects with a toString property, numbers and booleans. Empty values (null and undefined) will result in an empty string.

Installation

npm install snake-case --save

Usage

var snakeCase = require('snake-case')

snakeCase('string')        //=> "string"
snakeCase('camelCase')     //=> "camel_case"
snakeCase('sentence case') //=> "sentence_case"

snakeCase('MY STRING', 'tr') //=> "my_strıng"

Typings

Includes a TypeScript definition.

License

MIT

You can’t perform that action at this time.