Cordova CLI Source Analysis (ii)--PACKAGE.JSON__JS

Source: Internet
Author: User

Each package needs to contain a Package.json file in its top-level directory, which is not only a description of the package, but also a configuration option when NPM installs the package

More parameters refer to the reference documentation https://npmjs.org/doc/json.html

{
  ' name ': ' Cordova ', '
  version ': ' 3.0.4 ',
  ' Preferglobal ': ' true ',//If the installation package is a command-line application, it should be installed in global mode. If the user installs in local mode, the warning warns
  "description": "Cordova Command line interface tool",
  "main": "Cordova",
  // Indicates that when a module is invoked, Node.js will look for the path that main points to as the interface of the module, where node will look for the Cordova file in the same directory and try to load the module from it;
  //If there is no Cordova, Node will still try to find cordova.js or Cordova.node as the interface for the package.
  //The equivalent of this is the initialization function, which returns the contents of the object
  "engines" in this file: {
      "node": ">=0.9.9"
      //Specifies the version of node used
  },
  " Enginestrict ': True,
set this parameter
  ' bin ': {
' Cordova ': './bin/cordova ' If it is determined that the module can only work as specified by the engines parameter
//When the user enters the command line, the parse parameter executes the file
Cordova File
#!/usr/bin/env node
var CLI = require ('.. /src/cli ');
New CLI (PROCESS.ARGV);


  }, "scripts": {"test": "Jasmine-node--color Spec"//Store some default Run command script information//cordova test execution Jasmine-node--color spec 
  }, "repository": {"type": "Git", "url": "Https://git-wip-us.apache.org/repos/asf/cordova-cli.git"//Storage location}, "Bugs": {"url": "Https://issues.apache.org/jira/browse/CB", "email": "dev@cordova.apache.org"}, "keyword S ": [" Cordova "," Client "," CLI "]," dependencies ": {" Colors ":" >=0.6.0 "," ElementTree ":" 0.1.3 " , "Plugman": "0.10.0", "plist": "0.4.x", "Xcode": "0.5.1", "Express": "3.0.0", "Shelljs": "0.1.2", "NCA Llbacks ":" 1.0.0 "," Request ":" 2.22.0 "," Ripple-emulator ":" 0.9.18 "," Semver ":" 1.1.0 "," Glob ":" 3.2.x "," F Ollow-redirects ": 0.0.x", "Prompt": "0.2.7", "tar": "0.1.x", "Open": "0.0.3", "NPM": "1.3.x", "Optimist": ' 0.6.0 '},/* Dependent Module list version number must match exactly >version must be greater than the current version number >=version must be greater than or equal to <version less than <=version less than or equal to ~1.2 .3: = >=1.2.3-0 <1.3.0-0 1.3.0-beta does not meet ~1.2.3 support conditions ~1.2: = >=1.2.0-0 <1.3.0-0 with 1.2-based version 1.2.x: = >=1.2.0-0 <1.3.0-0 with 1.2 start version ~ 1: = >=1.0.0-0 <2.0.0-0 with 1-Starting version 1.x: = >=1.0.0-0 <2.0.0-0 with 1-Starting version 1.2.x 1.2.0, 1.2.1, etc., no more than 1.3.0 http://...
See link Address * matching any version "" matches any version version1-version2 equivalent to >=version1 <=version2. Range1 | | Range2 Range1 or range2 can be git ...
  See git address user/repo see ' GitHub ' Address/"devdependencies": {"Jasmine-node": "1.8.x"},//The module used in development phase, the module that does not need to depend when user use "Author": "Anis Kadri",//Developer "contributors": [{"Name": "Brian Leroux", "email": "B@brian.io"}, {"Name": "Fil Ma  J "," Email ":" maj.fil@gmail.com "}, {" Name ":" Mike Reinstein "," email ":" reinstein.mike@gmail.com "}, {" Name ":" Darry Pogue "," email ":" darryl@dpogue.ca "}, {" Name ":" Michael Brooks "," email ":" michael@michaelbrooks.ca "}, {" Name ":" Br Aden Shepherdson "," email ":" braden@chromium.org "}, {" Name ":" Gord Tanner "," email ":" gtanner@gmail.com "}, {" Name ": "Tim Kim", "email": "Timk@adObe.com "}, {" Name ":" Benn mapes "," email ":" Benn.Mapes@gmail.com "}, {" Name ":" Michael Wolf "," email ":" Michael.wol F@Cynergy.com "}, {" Name ":" Andrew Grieve "," email ":" agrieve@chromium.org "}, {" Name ":" Bryan Higgins "," email ":" b Higgins@blackberry.com "}, {" Name ":" Don Coleman "," email ":" dcoleman@chariotsolutions.com "}, {" Name ":" Germano Gab Bianelli "," email ":" tyron.mx@gmail.com "}, {" Name ":" Ian clelland "," email ":" iclelland@chromium.org "}, {" Name ":" Lucas holmqust ", email": "lholmqui@redhat.com"}, {"Name": "Matt LeGrand", "email": "mlegrand@gmail.com"}, {"Name" : "Michal Mocny", "email": "mmocny@gmail.com"}, {"Name": "Sam breed", "email": "sam@quickleft.com"}, {"Name": "Tom My-carlos Williams "," email ":" tommy@devgeeks.org "}, {" Name ":" Rubén Norte "," email ":" rubennorte@gmail.com "}//Contributor person letter "License": "Apache version 2.0"}



Related Article

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.