On most Node.JS tutorials, you might see that to add dependency, you will be asked to open up your project’s package.json and manually edit the
dependencies section. After editing, you will save it and go to console to type
While this is true, however, there is another shortcut way to do this. With only one step, you can install the dependency and add config into
package.json. Here is how you do it:
$npm install package-name --save
Pretty simple, isn’t it?