zkat / npx

execute npm package binaries (moved)
https://github.com/npm/npx
Other
2.63k stars 105 forks source link

turn npx into a lib + bin combo #57

Closed zkat closed 7 years ago

zkat commented 7 years ago

So, npx is getting bundled with npm itself soon! Some changes needed to happen here:

  1. npm needs to be able to install a version of npx that doesn't bundle npm, and be able to bundle it
  2. the npx bundled with npm must always default to using that version of npm, even if the version of npm in $PATH is different
  3. npx must still be installable on the registry as a standalone package, and still bundle a pinned version of npm that it's guaranteed to work with

This PR, with credit to @iarna and @aearly, is my attempt at solving this. It adds a Makefile for building up the "standalone" npx by copying some files over and stuff, and creates a new package, libnpx, which is now the toplevel package. The npx-subpackage will always be pinned to this version of npx, and will bundle npm, as well as inject the path to that npm into the args parser.

I'm marking this as breaking because folks can no longer do require('npx') to get a programmatic version of npx -- they must now use libnpx itself, instead.