RichJS 
A JavaScript library for rich prototypes
This is a simple library designed to give a belt of good utility functions throughout your well known data types
How to use
var Rich = require('rich-js');
Rich.Core.applyAll();
Rich.Array.applyRichPrototype();
npm install --save rich-js
Safety
This library try not to clash with any possible standard when naming methods. And in case it clashes, it will not override the method and will output a warn in the console.
Prefix
In case you want to prefix the new methods, you can do by:
Rich.Util.prefix = 'r';
Rich.Number.applyRichPrototype();
(1).rseconds();
Adding your own custom prototypes
Rich.Util.applyToPrototype(Number, 'square', function() {
return this.valueOf() * this.valueOf();
});
(3).square();
Documentation
- Number
- Object
- Array
Examples
A few examples of what this library offers
(3).minutes();
(3).times(function(i) {
console.log(i);
});
(3).isEven();
(3).isOdd();
({
prop: {
name: 'Test'
}
}).getProperty('prop.name');
[{a: 1}, {a: 1}, {a: 2}].groupBy('a');