Quantcast
Viewing all articles
Browse latest Browse all 6

Automatically add npm modules to package.json on install

For an easy productivity win; you can automatically add an npm Node.js module dependency into the package.json file during the initial installation:

npm install module_name --save

If you now check out your package.json file, it will have updated the dependencies object automatically for you (it will have grabbed the latest version – and appends it with a tilde):

{
  "name": "save-dev",
  "version": "0.0.1",
  "dependencies": {
    "module_name": "~0.4.2"
  }
}

You can also automatically add module dependencies to the package.json in Grunt projects in case you’re interested.


Viewing all articles
Browse latest Browse all 6

Trending Articles