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