add-to-path
Status:
This micro-lib allows you to alter the $PATH
in a cross-platform way.
Main Usage
var path = require('path');
var addToPath = require('add-to-path');
var restorePath = addToPath(path.join(process.cwd(), 'node_modules', '.bin'));
restorePath();
addToPath(['/foo/bar/.bin', '/bar/foo/.bin']);
options
platform
Allows you to specify your own platform. Defaults to process.platform
. Currently the only meaningful value is
'win32'
. This option is mainly available for testing purposes.
append
Defaults to undefined
, but when set to true
will add the directory you pass to the end (rather than the beginning).
Other info
LICENSE -> MIT
Much of the original code for this came from npm/npm