arei / npmbox

Utility for creating (boxing) and using (unboxing) an archive of a complete (including all dependencies) npm install.
MIT License
245 stars 34 forks source link

Add option.save when the unboxing is not global #25

Closed armornick closed 9 years ago

armornick commented 9 years ago

Right now, unboxing something into a local project doesn't add the dependency to the package.json. This is a bit annoying because it means we have to manually add the dependency to the package.json by going into the module and finding the version number and name.

It seems more proper to add the save option to the npm command when unboxing. I have already hacked this into my own install of npmbox by doing the following in npmunbox.js (starting from line 33):

var options = {
    verbose: argv.v || argv.verbose || false,
    silent: argv.s || argv.silent || false,
    global: argv.g || argv.global || false,
    save: !argv.g || !argv.global || true
};

It would be nice if this could be added in the official package. If necessary, I will make a proper pull request with my change.

arei commented 9 years ago

I added --save, --save-* (all the other --save variants) and --prefix to npmunbox.