diff options
author | isaacs <i@izs.me> | 2014-01-03 20:43:28 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2014-01-03 20:43:28 +0400 |
commit | 0c8952fb1948e998e9896acb597b18908d200577 (patch) | |
tree | f70202324da57a4bc588719964bfd5fe750ab644 | |
parent | 0f48c715166e2ae02eefc74eac6d6f6edf428f2a (diff) |
doc: Correct outdated stuff in json documentation
-rw-r--r-- | doc/files/package.json.md | 59 |
1 files changed, 23 insertions, 36 deletions
diff --git a/doc/files/package.json.md b/doc/files/package.json.md index 86eb925e6..8e6f97de8 100644 --- a/doc/files/package.json.md +++ b/doc/files/package.json.md @@ -9,32 +9,6 @@ file. It must be actual JSON, not just a JavaScript object literal. A lot of the behavior described in this document is affected by the config settings described in `npm-config(7)`. -## DEFAULT VALUES - -npm will default some values based on package contents. - -* `"scripts": {"start": "node server.js"}` - - If there is a `server.js` file in the root of your package, then npm - will default the `start` command to `node server.js`. - -* `"scripts":{"preinstall": "node-waf clean || true; node-waf configure build"}` - - If there is a `wscript` file in the root of your package, npm will - default the `preinstall` command to compile using node-waf. - -* `"scripts":{"preinstall": "node-gyp rebuild"}` - - If there is a `binding.gyp` file in the root of your package, npm will - default the `preinstall` command to compile using node-gyp. - -* `"contributors": [...]` - - If there is an `AUTHORS` file in the root of your package, npm will - treat each line as a `Name <email> (url)` format, where email and url - are optional. Lines which start with a `#` or are blank, will be - ignored. - ## name The *most* important things in your package.json are the name and version fields. @@ -122,16 +96,8 @@ You can check [the full list of SPDX license IDs](https://spdx.org/licenses/). Ideally you should pick one that is [OSI](http://opensource.org/licenses/alphabetical) approved. -If you have more complex licensing terms, or you want to provide more detail -in your package.json file, you can use the more verbose plural form, like this: - - "licenses" : [ - { "type" : "MyLicense" - , "url" : "http://github.com/owner/project/path/to/license" - } - ] - -It's also a good idea to include a license file at the top level in your package. +It's also a good idea to include a LICENSE file at the top level in +your package. ## people fields: author, contributors @@ -575,6 +541,27 @@ Any config values can be overridden, but of course only "tag" and See `npm-config(7)` to see the list of config options that can be overridden. +## DEFAULT VALUES + +npm will default some values based on package contents. + +* `"scripts": {"start": "node server.js"}` + + If there is a `server.js` file in the root of your package, then npm + will default the `start` command to `node server.js`. + +* `"scripts":{"preinstall": "node-gyp rebuild"}` + + If there is a `binding.gyp` file in the root of your package, npm will + default the `preinstall` command to compile using node-gyp. + +* `"contributors": [...]` + + If there is an `AUTHORS` file in the root of your package, npm will + treat each line as a `Name <email> (url)` format, where email and url + are optional. Lines which start with a `#` or are blank, will be + ignored. + ## SEE ALSO * semver(7) |