Utility for your node JS application.
Using npm
npm install node-utilify --save
Or directly on your browser, simply download your file from the following:
- utilify.js Development version
- utilify.min.js Deployment version
<script type="application/javascript" src="utilify.js"></script>
<script type="application/javascript" src="utilify.min.js"></script>
- Ajax: XHR wrapper for frontend.
- EventManager: Custom event manager.
const Utilify = require('node-utilify');
Utilify.isArray([]); // true
const httpStatusCodes = Utilify.EnumGenerator({505:'Internal Server Error',404: 'Not Found'});
console.log(httpStatusCodes[505]); // 'Internal Server Error'
console.log(httpStatusCodes['Internal Server Error']); // 505
console.log(Utilify.getCurrentEpochTime()); // 1605467433
const defaultsFnc = Utilify.defaultsGenerator({id:1,name:'Sidd'});
console.log(defaultsFnc({name:'JS'})); // {id:1,name:'JS'}
Utilify.CacheMgr.set('key1', 10);
console.log(Utilify.CacheMgr.get('key1')); // 10
Utilify.CacheMgr.remove('key1');
console.log(Utilify.CacheMgr.get('key1')); // undefined
Utilify.Ajax.post('https://reqres.in/api/users', {
name: "paul rudd",
movies: ["Role Models"]
}).then(console.log).catch(console.warn);
Checkout DOCUMENTATION.md for complete documentation or View Documentation online at https://siddhesh321995.github.io/node-utilify/
- Data type check functions.
- Frontend XHR wrapper.
- EnumGenerator, defaultsGenerator functions.
- 0 Dependancy.
Let me know in issues/github page or on email which javascript functions to include in next release. Check all the Contributors to this library.