3 ms·
I think it's used so you can easily run a command using the same environment other npm commands run under. https://docs.npmjs.com/cli/v10/commands/npm-run-scri
by dingosity 3y ago
I think it's used so you can easily run a command using the same environment other npm commands run under.
https://docs.npmjs.com/cli/v10/commands/npm-run-script https://docs.npmjs.com/cli/v10/commands/npm-run-script
Which is to say... I think you can do everything the `npm run <foo>` command does from the command line, but it would require typing a lot more characters. You would have to do something like this to get what running `npm run` does automagically:
NODE_PATH=./node_modules/.bin node -r ./node_modules/env foo.js
which is more characters to type than
npm foo