elpax.blogg.se

Npm save package
Npm save package





Learn more about installing packages with npm. You can learn more about the different fields and how they are used in our What Is package.json tutorial.Īfter you've created a package.json, you are free to install dependencies for your project using npm install. It is best practice to at least provide the information npm init asks for, but the decision is up to you. If you are going to be publishing your package for others to use, you should make sure you fill out all the fields that npm init prompts you for, because they help others find your project on and point people to where they can go to find help.Įven though most package.json fields are optional, they can be very useful to other tools that interact with your project and rely on information in the file.

npm save package

NPM requires a unique name field and a version number before publishing.

npm save package

There are more requirements if you intend to publish the package to the NPM registry to distribute to others. You're not required to use any of them, and the only true requirement is that the file is valid JSON. With one important exception, all fields in a package.json are optional. The important part is generating a package.json so you can begin to install dependencies.

npm save package

It's okay to accept the defaults if you don't know what to put for a field. The package.json fields you'll be prompted for are name, version, description, main, test command, git repository, keywords, author, and license. Either accept the defaults suggested by npm, or type a new value and hit enter. Fill out the prompts for fields in your package.json.







Npm save package