Aaron Aaron - 5 months ago 15
Node.js Question

Is there a node/npm equivalent for Ruby's `bundle open #{gem_name}`?

bundle open #{gem_name}
opens a gem you have installed in the application specified by
BUNDLER_EDITOR
or
EDITOR
if the former is not present.

Obviously it is possible to open the actual location instead, I'm just wondering if node/npm have a similar helper feature.

Answer

You can use the npm edit <pkg> command to do this

Description

Opens the package folder in the default editor (or whatever you've configured as the npm editor config -- see npm-config.)

After it has been edited, the package is rebuilt so as to pick up any changes in compiled packages.

For instance, you can do npm install connect to install connect into your package, and then npm edit connect to make a few changes to your locally installed copy.