Naming
naming case convention
Installation
npm install naming
Usage
var naming =/** parse string **/var str = 'apple-bananaCherry_durian'// appleBananaCakeDurian// AppleBananaCakeDurian// apple_banana_cake_durian// apple-banana-cherry-durian// APPLE_BANANA_CHERRY_DURIANnaming // ['apple', 'banana', 'cherry', 'durian']/** parse object **/var obj = red_apple: 0 yellow_banana: 1 green_cake: 2// { redApple: 0, yellowBanana: 1, greenCake: 2 }/** parse object deeply **/var obj =apple_list:red_apple: 0green_apple: 1yellow_banana: 2// => { appleList: { redApple: 0, greenApple: 1 }, yellowBanana: 2 }
Note
The consecutive '_' in the beginning or end, and $' before the actual word, and consecutive numbers will be treated as a word, such as follow
var str = '__$$apple-bananaCherry_durian2012__'// __$$appleBananaCherryDurian2012__// __$$AppleBananaCherryDurian2012__// __$$-apple-banana-cherry-durian-2012__// __$$_apple_banana_cherry_durian_2012__// __$$_APPLE_BANANA_CHERRY_DURIAN_2012__
License
MIT (http://www.opensource.org/licenses/mit-license.php)