Why is this so much simpler than npm/npm#4058?
The code in https://github.com/npm/npm/pull/4058, of which I believe most of is extracted from npm as it exists today, seems a lot larger. Is this module just as capable? If so, can we use it in npm itself? :)
Is this module just as capable?
This module is really just:
- set me up the correct npm $PATH
- exec shell command with $PATH set in the env
The 'heavy lifting' is done by https://github.com/timoxley/npm-path.
npm-run currently doesn't handle whatever nasty business is going on in there with the npm config environment, nor does it execute package.json scripts. Might be 1 or 2 additional modules to be made breaking that out. A big plus breaking these up finely is the functionality becomes a lot easier to wrangle into a test.
I'd really like to see every npm command be a self-contained module. npm becomes just a container for integration.