diff options
author | claudiahdz <cghr1990@gmail.com> | 2019-11-18 21:01:39 +0200 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2019-11-20 19:16:47 -0500 |
commit | a7c7c703aff362f06ef5d49451a0f79fd289910f (patch) | |
tree | 48f9d01b32d55d420f229c4889a5a61178419223 /deps/npm/docs/content/using-npm | |
parent | a30a9f8193ddd61dfadc2d5d79784b682027b319 (diff) | |
download | android-node-v8-a7c7c703aff362f06ef5d49451a0f79fd289910f.tar.gz android-node-v8-a7c7c703aff362f06ef5d49451a0f79fd289910f.tar.bz2 android-node-v8-a7c7c703aff362f06ef5d49451a0f79fd289910f.zip |
deps: upgrade npm to 6.13.1
PR-URL: https://github.com/nodejs/node/pull/30533
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/npm/docs/content/using-npm')
-rwxr-xr-x | deps/npm/docs/content/using-npm/coding-style.md | 212 | ||||
-rw-r--r--[-rwxr-xr-x] | deps/npm/docs/content/using-npm/config.md | 24 | ||||
-rw-r--r--[-rwxr-xr-x] | deps/npm/docs/content/using-npm/developers.md | 12 | ||||
-rw-r--r--[-rwxr-xr-x] | deps/npm/docs/content/using-npm/disputes.md | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | deps/npm/docs/content/using-npm/orgs.md | 6 | ||||
-rw-r--r--[-rwxr-xr-x] | deps/npm/docs/content/using-npm/registry.md | 10 | ||||
-rw-r--r--[-rwxr-xr-x] | deps/npm/docs/content/using-npm/removal.md | 3 | ||||
-rw-r--r--[-rwxr-xr-x] | deps/npm/docs/content/using-npm/scope.md | 4 | ||||
-rw-r--r--[-rwxr-xr-x] | deps/npm/docs/content/using-npm/scripts.md | 12 | ||||
-rw-r--r--[-rwxr-xr-x] | deps/npm/docs/content/using-npm/semver.md | 0 |
10 files changed, 36 insertions, 249 deletions
diff --git a/deps/npm/docs/content/using-npm/coding-style.md b/deps/npm/docs/content/using-npm/coding-style.md deleted file mode 100755 index e329bda7d9..0000000000 --- a/deps/npm/docs/content/using-npm/coding-style.md +++ /dev/null @@ -1,212 +0,0 @@ ---- -section: using-npm -title: coding-style -description: npm's "funny" coding style ---- - -# coding-style -## npm's "funny" coding style - -### Description - -npm's coding style is a bit unconventional. It is not different for -difference's sake, but rather a carefully crafted style that is -designed to reduce visual clutter and make bugs more apparent. - -If you want to contribute to npm (which is very encouraged), you should -make your code conform to npm's style. - -Note: this concerns npm's code not the specific packages that you can download from the npm registry. - -### Line Length - -Keep lines shorter than 80 characters. It's better for lines to be -too short than to be too long. Break up long lists, objects, and other -statements onto multiple lines. - -### Indentation - -Two-spaces. Tabs are better, but they look like hell in web browsers -(and on GitHub), and node uses 2 spaces, so that's that. - -Configure your editor appropriately. - -### Curly braces - -Curly braces belong on the same line as the thing that necessitates them. - -Bad: - -```javascript -function () -{ -``` - -Good: -```javascript -function () { -``` - -If a block needs to wrap to the next line, use a curly brace. Don't -use it if it doesn't. - -Bad: - -```javascript -if (foo) { bar() } -while (foo) - bar() -``` -Good: - -```javascript -if (foo) bar() -while (foo) { - bar() -} -``` - -### Semicolons - -Don't use them except in four situations: - -* `for (;;)` loops. They're actually required. -* null loops like: `while (something) ;` (But you'd better have a good - reason for doing that.) -* `case 'foo': doSomething(); break` -* In front of a leading `(` or `[` at the start of the line. - This prevents the expression from being interpreted - as a function call or property access, respectively. - -Some examples of good semicolon usage: - -```javascript -;(x || y).doSomething() -;[a, b, c].forEach(doSomething) -for (var i = 0; i < 10; i ++) { - switch (state) { - case 'begin': start(); continue - case 'end': finish(); break - default: throw new Error('unknown state') - } - end() -} -``` - -Note that starting lines with `-` and `+` also should be prefixed -with a semicolon, but this is much less common. - -### Comma First - -If there is a list of things separated by commas, and it wraps -across multiple lines, put the comma at the start of the next -line, directly below the token that starts the list. Put the -final token in the list on a line by itself. For example: - -```javascript -var magicWords = [ 'abracadabra' - , 'gesundheit' - , 'ventrilo' - ] - , spells = { 'fireball' : function () { setOnFire() } - , 'water' : function () { putOut() } - } - , a = 1 - , b = 'abc' - , etc - , somethingElse - ``` - -### Quotes -Use single quotes for strings except to avoid escaping. - -Bad: - -```javascript -var notOk = "Just double quotes" -``` - -Good: - -```javascript -var ok = 'String contains "double" quotes' -var alsoOk = "String contains 'single' quotes or apostrophe" -``` - -### Whitespace - -Put a single space in front of `(` for anything other than a function call. -Also use a single space wherever it makes things more readable. - -Don't leave trailing whitespace at the end of lines. Don't indent empty -lines. Don't use more spaces than are helpful. - -### Functions - -Use named functions. They make stack traces a lot easier to read. - -### Callbacks, Sync/async Style - -Use the asynchronous/non-blocking versions of things as much as possible. -It might make more sense for npm to use the synchronous fs APIs, but this -way, the fs and http and child process stuff all uses the same callback-passing -methodology. - -The callback should always be the last argument in the list. Its first -argument is the Error or null. - -Be very careful never to ever ever throw anything. It's worse than useless. -Just send the error message back as the first argument to the callback. - -### Errors - -Always create a new Error object with your message. Don't just return a -string message to the callback. Stack traces are handy. - -### Logging - -Logging is done using the [npmlog](https://github.com/npm/npmlog) -utility. - -Please clean up logs when they are no longer helpful. In particular, -logging the same object over and over again is not helpful. Logs should -report what's happening so that it's easier to track down where a fault -occurs. - -Use appropriate log levels. See [`npm-config`](/docs/using-npm/config) and search for -"loglevel". - -### Case, naming, etc. - -Use `lowerCamelCase` for multiword identifiers when they refer to objects, -functions, methods, properties, or anything not specified in this section. - -Use `UpperCamelCase` for class names (things that you'd pass to "new"). - -Use `all-lower-hyphen-css-case` for multiword filenames and config keys. - -Use named functions. They make stack traces easier to follow. - -Use `CAPS_SNAKE_CASE` for constants, things that should never change -and are rarely used. - -Use a single uppercase letter for function names where the function -would normally be anonymous, but needs to call itself recursively. It -makes it clear that it's a "throwaway" function. - -### null, undefined, false, 0 - -Boolean variables and functions should always be either `true` or -`false`. Don't set it to 0 unless it's supposed to be a number. - -When something is intentionally missing or removed, set it to `null`. - -Don't set things to `undefined`. Reserve that value to mean "not yet -set to anything." - -Boolean objects are forbidden. - -### See Also - -* [npm developers](/using-npm/developers) -* [npm](/cli-commands/npm) diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index b5b4371002..a6947b17d5 100755..100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -4,7 +4,7 @@ title: config description: More than you probably want to know about npm configuration --- -# config +# config(7) ## More than you probably want to know about npm configuration @@ -33,7 +33,7 @@ interpreted as a configuration parameter. For example, putting configuration parameter to `bar`. Any environment configurations that are not given a value will be given the value of `true`. Config values are case-insensitive, so `NPM_CONFIG_FOO=bar` will work the -same. However, please note that inside [`npm-scripts`](/docs/using-npm/scripts) +same. However, please note that inside [`scripts`](/using-npm/scripts) npm will set its own environment variables and Node will prefer those lowercase versions over any uppercase ones that you might set. For details see [this issue](https://github.com/npm/npm/issues/14528). @@ -52,7 +52,7 @@ The four relevant files are: CLI option `--globalconfig` or environment variable `$NPM_CONFIG_GLOBALCONFIG`) * npm's built-in configuration file (`/path/to/npm/npmrc`) -See [npmrc](/docs/configuring-npm/npmrc) for more details. +See [npmrc](/configuring-npm/npmrc) for more details. #### Default Configs @@ -111,7 +111,7 @@ npm ls --global --parseable --long --loglevel info ### Per-Package Config Settings -When running scripts (see [`npm-scripts`](scripts)) the package.json "config" +When running scripts (see [`scripts`](/using-npm/scripts)) the package.json "config" keys are overwritten in the environment if there is a config param of `<name>[@<version>]:<key>`. For example, if the package.json has this: @@ -134,7 +134,7 @@ then the user could change the behavior by doing: npm config set foo:port 80 ``` -See [package.json](/docs/configuring-npm/package-json) for more information. +See [package.json](/configuring-npm/package-json) for more information. ### Config Settings @@ -179,7 +179,7 @@ When "dev" or "development" and running local `npm shrinkwrap`, When "true" submit audit reports alongside `npm install` runs to the default registry and all registries configured for scopes. See the documentation -for [`npm-audit`](/docs/cli-commands/npm-audit) for details on what is submitted. +for [`npm audit`](/cli-commands/npm-audit) for details on what is submitted. #### audit-level @@ -270,7 +270,7 @@ well as for the CA information to be stored in a file on disk. * Default: Windows: `%AppData%\npm-cache`, Posix: `~/.npm` * Type: path -The location of npm's cache directory. See [`npm-cache`](/docs/cli-commands/npm-cache) +The location of npm's cache directory. See [`npm cache`](/cli-commands/npm-cache) #### cache-lock-stale @@ -456,7 +456,7 @@ packages. When "true" displays the message at the end of each `npm install` aknowledging the number of dependencies looking for funding. -See [`npm-fund`](/docs/cli-commands/npm-fund) for details. +See [`npm fund`](/cli-commands/npm-fund) for details. #### git @@ -488,7 +488,7 @@ Run git commit hooks when using the `npm version` command. Operates in "global" mode, so that packages are installed into the `prefix` folder instead of the current working directory. See -[npm-folders](/docs/configuring-npm/folders) for more on the differences in behavior. +[folders](/configuring-npm/folders) for more on the differences in behavior. * packages are installed into the `{prefix}/lib/node_modules` folder, instead of the current working directory. @@ -571,7 +571,7 @@ If true, npm does not run scripts specified in package.json files. A module that will be loaded by the `npm init` command. See the documentation for the [init-package-json](https://github.com/isaacs/init-package-json) module -for more information, or [npm-init](/docs/cli-commands/npm-init). +for more information, or [npm init](/cli-commands/npm-init). #### init-author-name @@ -857,7 +857,7 @@ for updates immediately even for fresh package data. #### prefix -* Default: see [npm-folders](/docs/configuring-npm/folders) +* Default: see [folders](/configuring-npm/folders) * Type: path The location to install global items. If set on the command line, then @@ -1228,7 +1228,7 @@ version of npm than the latest. * Type: Boolean Set to show short usage output (like the -H output) -instead of complete help when doing [`npm-help`](/docs/cli-commands/npm-help). +instead of complete help when doing [`npm help`](/cli-commands/npm-help). #### user diff --git a/deps/npm/docs/content/using-npm/developers.md b/deps/npm/docs/content/using-npm/developers.md index ed4572d478..80b7fee6a5 100755..100644 --- a/deps/npm/docs/content/using-npm/developers.md +++ b/deps/npm/docs/content/using-npm/developers.md @@ -4,7 +4,7 @@ title: developers description: Developer Guide --- -# developers +# developers(7) ## Developer Guide @@ -58,7 +58,7 @@ an argument to `git checkout`. The default is `master`. You need to have a `package.json` file in the root of your project to do much of anything with npm. That is basically the whole interface. -See [`package.json`](/docs/configuring-npm/package-json) for details about what goes in that file. At the very +See [`package.json`](/configuring-npm/package-json) for details about what goes in that file. At the very least, you need: * name: @@ -87,7 +87,7 @@ least, you need: If you have a special compilation or installation script, then you should put it in the `scripts` object. You should definitely have at least a basic smoke-test command as the "scripts.test" field. - See [npm-scripts](/docs/using-npm/scripts). + See [scripts](/using-npm/scripts). * main: If you have a single module that serves as the entry point to your @@ -100,7 +100,7 @@ least, you need: they'll get installed just like these ones. You can use `npm init` in the root of your package in order to get you -started with a pretty basic package.json file. See [`npm-init`](/docs/cli-commands/npm-init) for +started with a pretty basic package.json file. See [`npm init`](/cli-commands/npm-init) for more info. ### Keeping files *out* of your package @@ -169,7 +169,7 @@ changes in real time without having to keep re-installing it. (You do need to either re-link or `npm rebuild -g` to update compiled packages, of course.) -More info at [`npm-link`](/docs/cli-commands/npm-link). +More info at [`npm link`](/cli-commands/npm-link). ### Before Publishing: Make Sure Your Package Installs and Works @@ -217,7 +217,7 @@ npm adduser and then follow the prompts. -This is documented better in [npm-adduser](/docs/cli-commands/npm-adduser). +This is documented better in [npm adduser](/cli-commands/npm-adduser). ### Publish your package diff --git a/deps/npm/docs/content/using-npm/disputes.md b/deps/npm/docs/content/using-npm/disputes.md index 69397164d2..65751618ca 100755..100644 --- a/deps/npm/docs/content/using-npm/disputes.md +++ b/deps/npm/docs/content/using-npm/disputes.md @@ -4,7 +4,7 @@ title: disputes description: Handling Module Name Disputes --- -# disputes +# disputes(7) ## Handling Module Name Disputes diff --git a/deps/npm/docs/content/using-npm/orgs.md b/deps/npm/docs/content/using-npm/orgs.md index 8f1935dee8..9709a12d72 100755..100644 --- a/deps/npm/docs/content/using-npm/orgs.md +++ b/deps/npm/docs/content/using-npm/orgs.md @@ -4,7 +4,7 @@ title: orgs description: Working with Teams & Orgs --- -# orgs +# orgs(7) ## Working with Teams & Orgs @@ -24,8 +24,8 @@ The developer will be able to access packages based on the teams they are on. Ac There are two main commands: -1. `npm team` see [npm-team](/docs/cli-commands/npm-team) for more details -2. `npm access` see [npm-access](/docs/cli-commands/npm-access) for more details +1. `npm team` see [npm team](/cli-commands/npm-team) for more details +2. `npm access` see [npm access](/cli-commands/npm-access) for more details ### Team Admins create teams diff --git a/deps/npm/docs/content/using-npm/registry.md b/deps/npm/docs/content/using-npm/registry.md index 8dbcba082b..cd6a2e4d71 100755..100644 --- a/deps/npm/docs/content/using-npm/registry.md +++ b/deps/npm/docs/content/using-npm/registry.md @@ -4,7 +4,7 @@ title: registry description: The JavaScript Package Registry --- -# registry +# registry(7) ## The JavaScript Package Registry @@ -32,9 +32,9 @@ of which there is a public mirror at available at <https://github.com/npm/npm-registry-couchapp>. The registry URL used is determined by the scope of the package (see -[`npm-scope`](scope). If no scope is specified, the default registry is used, which is -supplied by the `registry` config parameter. See [`npm-config`](/docs/cli-commands/npm-config), -[`npmrc`](/docs/configuring-npm/npmrc), and [`npm-config`](/docs/using-npm/config) for more on managing npm's configuration. +[`scope`](/using-npm/scope). If no scope is specified, the default registry is used, which is +supplied by the `registry` config parameter. See [`npm config`](/cli-commands/npm-config), +[`npmrc`](/configuring-npm/npmrc), and [`config`](/using-npm/config) for more on managing npm's configuration. ### Does npm send any information about me back to the registry? @@ -81,7 +81,7 @@ published at all, or `"publishConfig":{"registry":"http://my-internal-registry.local"}` to force it to be published only to your internal registry. -See [`package.json`](/docs/configuring-npm/package-json) for more info on what goes in the package.json file. +See [`package.json`](/configuring-npm/package-json) for more info on what goes in the package.json file. ### Will you replicate from my registry into the public one? diff --git a/deps/npm/docs/content/using-npm/removal.md b/deps/npm/docs/content/using-npm/removal.md index 522ac2af53..7c83684673 100755..100644 --- a/deps/npm/docs/content/using-npm/removal.md +++ b/deps/npm/docs/content/using-npm/removal.md @@ -4,7 +4,7 @@ title: removal description: Cleaning the Slate --- -# removal +# removal(7) ## Cleaning the Slate @@ -66,6 +66,5 @@ find /usr/local/{lib/node,bin} -exec grep -l npm \{\} \; ; ### See also -* README * [npm uninstall](/cli-commands/npm-uninstall) * [npm prune](/cli-commands/npm-prune) diff --git a/deps/npm/docs/content/using-npm/scope.md b/deps/npm/docs/content/using-npm/scope.md index fe5d897631..2cbc108f0d 100755..100644 --- a/deps/npm/docs/content/using-npm/scope.md +++ b/deps/npm/docs/content/using-npm/scope.md @@ -3,7 +3,7 @@ section: using-npm title: scope description: Scoped packages --- -# scope +# scope(7) ## Scoped packages @@ -55,7 +55,7 @@ Or in `package.json`: ``` Note that if the `@` symbol is omitted, in either case, npm will instead attempt to -install from GitHub; see [`npm-install`](/docs/cli-commands/npm-install). +install from GitHub; see [`npm install`](/cli-commands/npm-install). ### Requiring scoped packages diff --git a/deps/npm/docs/content/using-npm/scripts.md b/deps/npm/docs/content/using-npm/scripts.md index 6af5f7224d..6a2522fba4 100755..100644 --- a/deps/npm/docs/content/using-npm/scripts.md +++ b/deps/npm/docs/content/using-npm/scripts.md @@ -4,7 +4,7 @@ title: scripts description: How npm handles the "scripts" field --- -# scripts +# scripts(7) ## How npm handles the "scripts" field @@ -13,7 +13,7 @@ description: How npm handles the "scripts" field npm supports the "scripts" property of the package.json file, for the following scripts: -* **prepublish**: +* **prepublish** (_as of npm@5, `prepublish` is deprecated. Use `prepare` for build steps and `prepublishOnly` for upload-only._): Run BEFORE the package is packed and published, as well as on local `npm install` without any arguments. (See below) * **prepare**: @@ -59,7 +59,7 @@ following scripts: Additionally, arbitrary scripts can be executed by running `npm run-script <stage>`. *Pre* and *post* commands with matching names will be run for those as well (e.g. `premyscript`, `myscript`, -`postmyscript`). Scripts from dependencies can be run with +`postmyscript`). Scripts from dependencies can be run with `npm explore <pkg> -- npm run <stage>`. #### Prepublish and Prepare @@ -152,8 +152,8 @@ The package.json fields are tacked onto the `npm_package_` prefix. So, for instance, if you had `{"name":"foo", "version":"1.2.5"}` in your package.json file, then your package scripts would have the `npm_package_name` environment variable set to "foo", and the -`npm_package_version` set to "1.2.5". You can access these variables -in your code with `process.env.npm_package_name` and +`npm_package_version` set to "1.2.5". You can access these variables +in your code with `process.env.npm_package_name` and `process.env.npm_package_version`, and so on for other fields. #### configuration @@ -265,7 +265,7 @@ above. only will prevent some optional features, then it's better to just print a warning and exit successfully. * Try not to use scripts to do what npm can do for you. Read through - [`package.json`](/docs/configuring-npm/package-json) to see all the things that you can specify and enable + [`package.json`](/configuring-npm/package-json) to see all the things that you can specify and enable by simply describing your package appropriately. In general, this will lead to a more robust and consistent state. * Inspect the env to determine where to put things. For instance, if diff --git a/deps/npm/docs/content/using-npm/semver.md b/deps/npm/docs/content/using-npm/semver.md index 92c6381b7f..92c6381b7f 100755..100644 --- a/deps/npm/docs/content/using-npm/semver.md +++ b/deps/npm/docs/content/using-npm/semver.md |