Fully compliant with Package.json in the COMMONJS specification

Source: Internet
Author: User

As is known to all, Package.json is a document written by Commonjs to describe a narrative package, and a fully compliant Package.json file should contain a field.

Name: The names of the packages must be unique. Consists of lowercase English letters, numbers, and underscores. Cannot include spaces.

Description: A brief description of the package.

Version: A string that conforms to the revision number of the semantic eight identification specification.

Keywords: key word group. Often used in search.

Maintainers: Maintainer array, each element to include name, email (optional), Web (optional) field.

Contributors: The contributor array, in the same format as the maintainers. The author of the package should be the first element of the contributor array.

Bugs: The address where the bug was submitted can be a URL or an email address.

Licenses: An array of licenses, each element to include the type (the name of the license) and the URL (the address that is linked to the license text) field.

Repositories: Warehouse managed address array.

Each element includes the type (the name of the license) and the URL (the address that is linked to the license text) field.

Dependencies: A dependency of a package, an associative array. Consists of the package name and version number.


Here is an example of a Package.json demo that fully complies with the COMMONJS specification:

{"Name": "MyPackage", "description": "Sample Package for Commonjs.this package demonstrates the required elements of a Commo NJS package. "" Version ":" 0.7.0 "," keywords ": [" Package "," example "]," maintainers ": [{" Name ":" Bill Smith "," email ": [Email protected] "}]," contributors ": [{" Name ":" Byvoid "," Web ":" Http://www.byvoid.com "}]," bugs ": {" Mail ":" [email protected] "," Web ":" Http://www.example.com/bugs "}," licenses ": [{" Type ":" GPLv2 "," url ":" Http://www.example.org/licenses/gp1.html "}]," Repositories ": [{" type ":" Git "," url ":" Http://github.com/BYVoid/mypackage.git "}]," dependencies ": {" WebKit ":" 1.2 "," SSL ": {" GnuTLS ": [" 1.0 "," 2.0 "]," OpenSSL ":" 0.9.8 "}}}


Fully compliant with Package.json in the COMMONJS specification

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.