Npm save package
3 Project Dependencies The npm Commands (npm init and npm install) Let us see an example of a package.json file with dependencies and devDependencies.įig.
Npm save package install#
You can install a new package as dev-dependencies by running the command npm install –save-dev. ( More on the npm install in the later section) Project Development DependenciesĪnother critical thing to understand is the separation of dependencies needed for production and dependencies needed for development.įor example, in production, you’re not going to watch your JS, CSS, HTML, or any related file for changes and refresh the running app. You can install a new package by running the install command npm install. Moreover, if an individual package also has dependencies, it is installed along with the package. These dependencies are the packages that the project relies on to function properly. Project Dependencies (regular dependencies and devDependencies) Project or Regular DependenciesĪ particular section of the package.json file holds and contains dependencies. "description": "this a description of the sample package name",
Npm save package how to#
If you’re a bit intimidated by the command line when using npm, don’t be you only need to know when to use it and how to use it properly.Īnother thing to point out, if you think that there are many configurations needed to start your project, my advice is to start with the minimum configuration and build from there.
Are you a software developer? And you started to use npm and curious what is package.json file?