scott113341 / npm-install-version

Installs node modules to versioned or custom directories.
MIT License
56 stars 11 forks source link

[FEATURE PROPOSAL] npm-versions.json #28

Open ilan-schemoul opened 7 years ago

ilan-schemoul commented 7 years ago

Hello, Wouldn't this would be a good idea to have a npm-versions.json (or whatever) to follow npm scheme because I may use this in production. In my use case I need to have both the @next and the current version of a UI framework. In any way in package.json I may put "postinstall": "niv material-ui@next" but being able to do a niv material-ui@next --save so in a npm-versions.json there will be as a dependency material-ui@next and then in package.json one'd put "postinstall": "niv i. But it's maybe a dumb idea.

SidneyNemzer commented 7 years ago

I think it's a great idea! Saving your dependencies is a key part of package management.

Another possible way to save the versions would be to add a key to the package.json file, like so:

{
  "name": "...",
  "version": "1.0.0",
  "dependencies": {
    "react": "^0.23.0"
  },
  "npm-install-version": {
    "material-ui": [
       "0.2.0",
       "@next"
     ]
  }
}
scott113341 commented 7 years ago

@NitroBAY and @SidneyNemzer this is a great idea. I'd happily accept a PR adding this functionality!!