nbin
execute local bin files in a module
install
$ sudo npm install nbin -g
usage
nbin(1)
allows you to execute the bin
files found in node_modules/.bin
from the command line without having to type the path explicitly
$ nbin mocha -a "\-R spec" nbin ✓ should accept a valid module directory and read from the `./node_modules/.bin` directory nbin.exec ✓ should execute a given `bin` and return a stream 2 passing
api
nbin
can be used via the command line executable or programmatically
command line
nbin(1)
accepts a bin
name a single argument and will execute it and pipe back to stdout
of the executing tty
$ npm install forever$ nbin foreverhelp: usage: forever [action] [options] SCRIPT [script-options]help:help: Monitors the script specified in the current process or as a daemonhelp:help: actions:help: start Start SCRIPT as a daemonhelp: stop Stop the daemon SCRIPThelp: stopall Stop all running forever scriptshelp: restart Restart the daemon SCRIPThelp: restartall Restart all running forever scriptshelp: list List all running forever scriptshelp: config Lists all forever user configurationhelp: set <key> <val> Sets the specified forever config <key>help: clear <key> Clears the specified forever config <key>help: logs ...
you can start a daemon with forever
using nbin
from your local node_modules
directory by using the --args
flag
$ nbin forever --args "start bin/myapp"warn: --minUptime not set. Defaulting to: 1000mswarn: --spinSleepTime not set. Your script will exit
you can stop it the same way too
$ nbin forever --args "stop bin/myapp"
NOTE: you must escape certain characters like -
with \-
so arguments are passed properly
ls
list all bins found in your module
$ nbin ls cwd: /Users/jwerle/repos/nbin .bin: /Users/jwerle/repos/nbin/node_modules/.bin o _mocha o mocha
programmatic
nbin
can be used programmatically too.
nbin(dir)
dir
- module directory
example
var mods = console; // ['mocha', 'forever']
.nbin(dir).exec(bin, args)
execute a bin
on a given module directory with an optional arguments array and returns a stream
bin
- bin to executeargs
- (optional) array of arguments to pass to executedbin
var stream = stream; stream;
license
MIT