Utilex
Utilex is a module that provides extra functions.
Installation
npm install utilex
Usage
var utilex = ;
args
Returns command line arguments
// command: node app.js --arg1 arg1Val --arg2 -arg3 arg3Val arg4 arg5 -c test/data-simple.jsonutilex;// {// "arg1": "arg1Val",// "arg2": "",// "arg3": "arg3Val",// "arg4": "",// "arg5": "",// "c": "test/data-simple.json"// }
consoleClear
Clears console
node -e 'require("./lib/utilex").consoleClear()'
dirIsWritable
Checks whether given directory is writable or not
utilex; // true
download
Downloads file
utilex;// ./google-logo.png is downloaded.
jsonLoad
Loads JSON file
utilex; // { hello: 'world' }
strLen
Returns the length of given string
utilex; // 8utilex; // 12
tasker
Returns a tasker
tasker - simple
var tasker = utilex; taskerresults = ; // array for resultstasker; // add a task tasker;// [ 1, 2, 3, 4, 5 ]
tasker - async
var tasker = utilex; var { ;}; tasker;tasker; tasker; // hello// world// hello world// done!
uid
Returns an unique id
utilex; // '43cdacfded3a47298b32bfa47269fdd2b55b33d6'
License
Licensed under The MIT License (MIT)
For the full copyright and license information, please view the LICENSE.txt file.