npm-run icon indicating copy to clipboard operation
npm-run copied to clipboard

Why is this so much simpler than npm/npm#4058?

Open domenic opened this issue 11 years ago • 2 comments

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? :)

domenic avatar Apr 21 '14 03:04 domenic

Is this module just as capable?

This module is really just:

  1. set me up the correct npm $PATH
  2. 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.

timoxley avatar Apr 21 '14 03:04 timoxley

I'd really like to see every npm command be a self-contained module. npm becomes just a container for integration.

timoxley avatar Apr 21 '14 04:04 timoxley