0.1.3 • Published 10 years ago

npm-exec v0.1.3

Weekly downloads
12
License
-
Repository
github
Last release
10 years ago

npm-exec

Warning this is just getting started, but is already somewhat usable.

Usage

cd mymodule
npm-exec 'echo $npm_package_name'
# mymodule
cd node_modules/mydependency
npm-exec 'echo $npm_package_name'
# mydependency

What it does

Loads the same environment variables that would be present for npm run-script <blah>, but executes arbitrary bash command lines (even on windows! Thanks to bashful).

What it might do

Allow saving of command lines into package.json automatically (like npm install --save does now). E.g. you might run: npm-exec --save test "mocha tests/*" and after that your npm test command would be all set up.

Watch out for your shell!

Your shell will expand environment variables first, so if you want to reference npm package variables in your command line, they need to be wrapped in single quotes.

Install

npm install -g npm-exec

It's really only useful if it's installed globally (boo! hiss!) maybe it will get integrated into npm one day. Follow the issue that prompted me to write this module for more information.

License

MIT

0.1.3

10 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.0

11 years ago