Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Convert a string to a snake case.
JavaScript CSS
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.gitignore
History.md
Makefile
Readme.md
component.json
index.js
package.json

Readme.md

to-snake-case

Convert a string to a snake case.

Installation

$ component install ianstormtaylor/to-snake-case
$ npm install to-snake-case

Example

var snake = require('to-snake-case');

snake('camelCase');  // "camel_case"
snake('space case'); // "snake_case"
snake('dot.case');   // "dot_case"
snake('weird[case'); // "weird_case"

API

toSnakeCase(string)

Returns the snake-case variant of a string.

License

MIT

Something went wrong with that request. Please try again.