empower.js
Empower regular JavaScript objects with shorthand routines
Getting Started
empower.js works in Node and browsers, and supports amd loaders.
Install it via NPM:
npm install empowerjs
or with Bower:
bower install empowerjs
Functions
Empower(object|string|number|array|function)
Creates an empowered version of the passed object
var man = name: 'superman' age: 29 spouse: undefined faceMask: null species: 'kryptonians' father: name: 'Zor-El' category: 'superhero' { thisage++; }; $man = ;$manvalue; //return original man object$manname; //superman$man; //man = {name: 'superman'}; (undefined and null values removed)$man$name; // man.name = s u p e r m a n$man$name; // man.name = n a m r e p u s$man$father$name; // man.father.name = 'lE-roZ'$man$species; // man.species = 'kryptonian'$man$category; // man.category = 'heroes'$man$grow; // man.age = 30$man$grow; // will run man.grow() every 2 seconds$man$grow; // will cancel previous periodic run
Documentation
Coming soon.
Running the tests
empower.js comes with automated tests that can be run by installing devDependencies
and running:
npm test
Contributing
Please feel free to add more functions to the suite and submit pull requests to us. If you have a better version of an existing function, that will be highly valued, too.
Authors
- Riten Vagadiya ritenv
License
This project is licensed under the MIT License - see the LICENSE.md file for details