camels
v0.0.1
Published
Easily convert to and from camelCase and under_score notation.
Downloads
4
Readme
node-camels
Easily convert to and from camelCase and under_score notation.
Meta
- Author: Randall Degges
- Email: [email protected]
- Twitter: @rdegges
- Site: http://www.rdegges.com
- Status: production ready
Installation
To install camels
using npm, simply run:
$ npm install camels
In the root of your project directory.
Usage
Once you have camels
installed, you can use it to easily convert function names
to and from camelCase. camels
adds several string methods which you can call
directly after require
'ing this module:
var camels = require('camels');
console.log('hiThere'.toUnderscore()); // hi_there
console.log('hiTHERE'.toUnderscore()); // hi_there
console.log('hiThereDude'.toUnderscore()); // hi_there_dude
console.log('hi_there'.toCamelCase()); // hiThere
console.log('hi_there_dude'.toCamelCase()); // hiThereDude
NOTE: This library assumes that the string you're calling the desired method
on is 'properly' formed. For instance, if you run s.toCamelCase()
, the
library presumes that your string, s
, is already underscored.
Changelog
v0.0.1: 9-28-2014
- First release!