camelize-identifier

1.0.0 • Public • Published

camelize-identifier Build Status

Convert a string into a valid JS identifier

Installing

$ npm install camelize-identifier

API

camelize(name:String) -> identifier:String

Given a name, camelize converts it to a camel cased JavaScript identifier. If name has a leading _, it will be preserved. If the name is a reserved word, begins with an illegal leading character (anything but a letter, $, or _), contains illegal characters (e.g. !), camelize will throw.

For a full set of handled cases, see the tests.

Package Sidebar

Install

npm i camelize-identifier

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • bendrucker