Nodejs's Package.json

Source: Internet
Author: User

package.jsonThe file describes all the information about the NPM package, including the author, profile, package dependencies, build, etc., in a strict JSON format

Under the E:/nodejs/mychat

Execute, NPM Init

Enter Yes to complete the setup of the Package.json package

{  "name": "Chat",  "version": "1.0.0", "  description": "Chat",  "main": "Chat.js",  "scripts": {    "Test": "Echo \" Error:no test specified\ "&& exit 1"  },  "author": "Beibei",  "license": "ISC",  "Dependencies": {    "mysql": "^2.13.0",    "Socket.io": "^1.7.3"  }}

Name

nameAnd version is the most important two fields in Package.json, is also the unique identity published on the NPM platform, if these two fields are not set correctly, the package cannot be published and downloaded.

Version

The version number of the package. such as "1.0.0"

Description

The package description information will be displayed in npm search the returned results to help the user select the appropriate package

Keywords

Package keyword information, is an array of strings, ditto will also be displayed in npm search the results

Homepage

The home address of the package

Bugs

Bug tracking Home Address for packages

License

The open source protocol name for the package.

Author

The author of the package.

Main

The entry file for the package

Repository

The warehouse address of the package

Scripts

By setting this, you can make NPM invoke some command scripts to encapsulate some functionality.

Dependencies

Specify other packages that depend on what is needed when the package is published, that is, the package that is needed on the wire. Use the following command to install:

NPM Install--save PackageName

Devdependencies

These dependencies are only needed at the time of development. Use the following command to install:

Nodejs's Package.json

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.