rjr-helper
v0.1.2
Published
This library will help you to deal with helper function from rjr library.
Downloads
18
Maintainers
Readme
rjr-helper
Installation
> npm install -save rjr-helper
Import
const helper = require('rjr-helper')
API Reference
Array
array.filter(data,callback)
data : Object
data - data (array)
limit - array (string) eg : ['2-3']
equality - true/false
Example :
helper.array.filter({
data : _data,
limit : ['3-6'],
equality : true
},function(err,data){
conole.log(data)
});
array.dimension(array,callback)
Example :
helper.array.dimension([1,2,3],function(err,data){
console.log(data)
});
Object
object.filter(data,callback)
data : Object
data - object (array) eg : [{...},{...}]
get - array (string) eg : ['name','city']
take - number | optional
Example :
helper.object.filter({
data : data,
get : ['name'],
take : 2
},function(err,data){
console.log(data)
});
object.isNested(data,callback)
data : Object
Example :
object.isNested(data,function(err,data){
console.log(data)
});
object.leaf(data,callback)
data : Object
Example :
object.leaf(data,function(err,data){
console.log(data)
});
object.removeNegative(data,callback)
data : Object
Example :
object.isNested(data,function(err,data){
console.log(data)
});
CLI (Print colorfull text on console)
'message' : string and print function is wrapped with console.log()
print.fcyan(message)
print.fblack(message)
print.fyellow(message)
print.fblue(message)
print.fmagenta(message)
print.fcyan(message)
print.fwhite(message)
License
(MIT, Apache, etc.)