npmlog is a simple logger that npm uses to log it's messages, this module provides custom levels and colored output.
By default, logs are written to stderr, to send log messages to outputs other than streams you can use log.stream member, or you can just listen to the events that it emits.
Get it: : npm install --save npmlog
Sample usage:
12345678
varlog=require('npmlog')// additional stuff ---------------------------+// message ----------+ |// prefix ----+ | |// level -+ | | |// v v v vlog.info('fyi','I <3 nmotw: %j',node_modules);
notie - A clean and simple notification plugin with alert/growl style, has no dependencies, help us to take an input,
confirmation or alter the users in a more appealing manner.
It's uses material design, you can override or add styling in a separate .css file.
notie.input('What city do you live in?','Submit','Cancel','text','Enter your city:',function(value_entered){notie.alert(1,'You entered: '+value_entered,2);},'New York');
Creates and returns a new debounced version of the passed function that will postpone its execution until after wait milliseconds have elapsed since the last time it was invoked.
The ability to append and overwrite word / value pairs from the AFINN wordlist.
A build process that makes updating sentiment to future versions of the AFINN word list trivial.
Get it:npm install --save sentiment
Sample usage:
12345678910111213141516171819202122232425
>varsentiment=require('sentiment');>sentiment('Cats are stupid');{score:-2,comparative:-0.6666666666666666,tokens:['cats','are','stupid'],words:['stupid'],positive:[],negative:['stupid']}>sentiment('Cats are cool');{score:1,comparative:0.3333333333333333,tokens:['cats','are','cool'],words:['cool'],positive:['cool'],negative:[]}>sentiment('Cats are cool',{'cats':5,'cool':10});{score:15,comparative:5,tokens:['cats','are','cool'],words:['cool','cats'],positive:['cool','cats'],negative:[]}
hide certain restricted fields whiling logging objects.
This module obfuscated any of password, pass, token, auth, secret or passphrase attribute's value to '[SECRET]'.
Very useful when logging an object that has sensitive data!
Install it:npm install --save hide-secrets
Sample usage:
var hide = require('hide-secrets')
var obj = {
innerObject: {
password: 'abc123',
email: '[email protected]',
token: 'my-secret-token'
},
auth: '' // empty strings are left empty.
}
hide(obj)
GIF FTW!
Thanks to Benjamin Coe for helping us hide our secrets ;)
Other stuff that can be safely removed or converted without affecting SVG rendering result.
Get it:npm install --global svgo
Sample usage on CLI:
123456789101112131415161718192021
Usage:
svgo [OPTIONS] [ARGS]
Options:
-h, --help : Help
-v, --version : Version
-i INPUT, --input=INPUT : Input file, "-" for STDIN
-s STRING, --string=STRING : Input SVG data string
-f FOLDER, --folder=FOLDER : Input folder, optimize and rewrite all *.svg files
-o OUTPUT, --output=OUTPUT : Output file or folder (by default the same as the input), "-" for STDOUT
-p PRECISION, --precision=PRECISION : Set number of digits in the fractional part, overrides plugins params
--config=CONFIG : Config file to extend or replace default
--disable=DISABLE : Disable plugin by name
--enable=ENABLE : Enable plugin by name
--datauri=DATAURI : Output as Data URI string (base64, URI encoded or unencoded)
--pretty : Make SVG pretty printed
--show-plugins : Show available plugins and exit
Arguments:
INPUT : Alias to --input
OUTPUT : Alias to --output
Basically, instapromise is one of it's kind a module that is cheeky, tiny and takes a diffrenet apporach on promisifying async functions,
you need to just require('instapromise') and then you could just use a .promise!