
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
execute local bin files in a module
$ [sudo] npm install nbin -g
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(dir)
✓ should accept a valid module directory and read from the `./node_modules/.bin` directory
nbin(dir).exec(bin, args)
✓ should execute a given `bin` and return a stream
2 passing (16 ms)
nbin can be used via the command line executable or programmatically
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 forever
help: usage: forever [action] [options] SCRIPT [script-options]
help:
help: Monitors the script specified in the current process or as a daemon
help:
help: actions:
help: start Start SCRIPT as a daemon
help: stop Stop the daemon SCRIPT
help: stopall Stop all running forever scripts
help: restart Restart the daemon SCRIPT
help: restartall Restart all running forever scripts
help: list List all running forever scripts
help: config Lists all forever user configuration
help: 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: 1000ms
warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms
info: Forever processing file: bin/myapp
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
list all bins found in your module
$ nbin ls
cwd: /Users/jwerle/repos/nbin
.bin: /Users/jwerle/repos/nbin/node_modules/.bin
o _mocha (/Users/jwerle/repos/nbin/node_modules/.bin/_mocha)
o mocha (/Users/jwerle/repos/nbin/node_modules/.bin/mocha)
nbin can be used programmatically too.
dir - module directoryexample
var mods = nbin(__dirname)
console.log(mods.bins); // ['mocha', 'forever']
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 executed binvar stream = nbin(__dirname).exec('mocha')
stream.on('data', function (chunk) {
// do something with chunk
});
stream.on('error', function () {
// handle error
});
MIT
FAQs
execute local bin files in a module
We found that nbin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.