| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 832cd01 commit 6f773fb
93 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -746,3 +746,4 @@ fuhao.xu <fuhao.xu@yitu-inc.com> | |||
| 746 | 746 | marsonya <16393876+marsonya@users.noreply.github.com> | |
| 747 | 747 | Jeff Griffiths <jeff@eko-recordings.ca> | |
| 748 | 748 | Michael Garvin <gar+gh@danger.computer> | |
| 749 | + Gar <gar+gh@danger.computer> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,78 @@ | |||
| 1 | + ## v7.4.2 (2021-01-15) | ||
| 2 | + | ||
| 3 | + ### DEPENDENCIES | ||
| 4 | + | ||
| 5 | + * [`e5ce6bbba`](https://github.com/npm/cli/commit/e5ce6bbbad82b85c8e74a4558503513e4f337476) | ||
| 6 | + * `@npmcli/arborist@2.0.5` | ||
| 7 | + * fix creating missing dirs when using --prefix and --global | ||
| 8 | + * fix omit types of deps in global installs | ||
| 9 | + * fix prioritizing npm-shrinkwrap.json over package-lock.json | ||
| 10 | + * better cache system for packuments | ||
| 11 | + * improves audit performance | ||
| 12 | + | ||
| 13 | + ## v7.4.1 (2021-01-14) | ||
| 14 | + | ||
| 15 | + ### BUG FIXES | ||
| 16 | + | ||
| 17 | + * [`23df96d33`](https://github.com/npm/cli/commit/23df96d3394ba0b69a37f416d7f0c26bb9354975) | ||
| 18 | + [#2486](https://github.com/npm/cli/issues/2486) | ||
| 19 | + npm link no longer deletes entire project when global prefix is a symlink | ||
| 20 | + ([@nlf](https://github.com/nlf)) | ||
| 21 | + | ||
| 22 | + ### DOCUMENTATION | ||
| 23 | + | ||
| 24 | + * [`7dd0dfc59`](https://github.com/npm/cli/commit/7dd0dfc59c861e7d3e30a86a8e6db10872fc6b44) | ||
| 25 | + [#2459](https://github.com/npm/cli/issues/2459) | ||
| 26 | + fix(docs): clean up `npm start` docs | ||
| 27 | + ([@wraithgar](https://github.com/wraithgar)) | ||
| 28 | + * [`307b3bd9f`](https://github.com/npm/cli/commit/307b3bd9f90e96fcc8805a1d5ddec80787a3d3a7) | ||
| 29 | + [#2460](https://github.com/npm/cli/issues/2460) | ||
| 30 | + fix(docs): clean up `npm stop` docs | ||
| 31 | + ([@wraithgar](https://github.com/wraithgar)) | ||
| 32 | + * [`23f01b739`](https://github.com/npm/cli/commit/23f01b739d7a01a7dc3672322e14eb76ff33d712) | ||
| 33 | + [#2462](https://github.com/npm/cli/issues/2462) | ||
| 34 | + fix(docs): clean up `npm test` docs | ||
| 35 | + ([@wraithgar](https://github.com/wraithgar)) | ||
| 36 | + * [`4b43656fc`](https://github.com/npm/cli/commit/4b43656fc608783a29ccf8495dc305459abc5cc7) | ||
| 37 | + [#2463](https://github.com/npm/cli/issues/2463) | ||
| 38 | + fix(docs): clean up `npm prefix` docs | ||
| 39 | + ([@wraithgar](https://github.com/wraithgar)) | ||
| 40 | + * [`1135539ba`](https://github.com/npm/cli/commit/1135539bac9f98bb1a5d5ed05227a8ecd19493d3) | ||
| 41 | + [`a07bb8e69`](https://github.com/npm/cli/commit/a07bb8e692a85b55d51850534c09fa58224c2285) | ||
| 42 | + [`9b55b798e`](https://github.com/npm/cli/commit/9b55b798ed8f2b9be7b3199a1bfc23b1cd89c4cd) | ||
| 43 | + [`cd5eeaaa0`](https://github.com/npm/cli/commit/cd5eeaaa08eabb505b65747a428c3c59159663dc) | ||
| 44 | + [`6df69ce10`](https://github.com/npm/cli/commit/6df69ce107912f8429665eb851825d2acebc8575) | ||
| 45 | + [`dc6b2a8b0`](https://github.com/npm/cli/commit/dc6b2a8b032d118be3566ce0fa7c67c171c8d2cb) | ||
| 46 | + [`a3c127446`](https://github.com/npm/cli/commit/a3c1274460e16d1edbdca6a0cee86ef313fdd961) | ||
| 47 | + [#2464](https://github.com/npm/cli/issues/2464) | ||
| 48 | + fix(docs): clean up `npm uninstall` docs | ||
| 49 | + ([@wraithgar](https://github.com/wraithgar)) | ||
| 50 | + * [`cfdcf32fd`](https://github.com/npm/cli/commit/cfdcf32fd7628501712b8cad4a541c6b8e7b66bc) | ||
| 51 | + [#2474](https://github.com/npm/cli/issues/2474) | ||
| 52 | + fix(docs): clean up `npm unpublish` docs | ||
| 53 | + ([@wraithgar](https://github.com/wraithgar)) | ||
| 54 | + * [`acd5b062a`](https://github.com/npm/cli/commit/acd5b062a811fcd98849df908ce26855823ca671) | ||
| 55 | + [#2475](https://github.com/npm/cli/issues/2475) | ||
| 56 | + fix(docs): update `package-lock.json` docs | ||
| 57 | + ([@isaacs](https://github.com/isaacs)) | ||
| 58 | + * [`b0b0edf6d`](https://github.com/npm/cli/commit/b0b0edf6de1678de7f4a000700c88daa5f7194ef) | ||
| 59 | + [#2482](https://github.com/npm/cli/issues/2482) | ||
| 60 | + fix(docs): clean up `npm token` docs | ||
| 61 | + ([@wraithgar](https://github.com/wraithgar)) | ||
| 62 | + * [`35559201a`](https://github.com/npm/cli/commit/35559201a4a0a5b111ce58d6824e5b4030eb4496) | ||
| 63 | + [#2487](https://github.com/npm/cli/issues/2487) | ||
| 64 | + fix(docs): clean up `npm search` docs | ||
| 65 | + ([@wraithgar](https://github.com/wraithgar)) | ||
| 66 | + | ||
| 67 | + ### DEPENDENCIES | ||
| 68 | + | ||
| 69 | + * [`ea8c02169`](https://github.com/npm/cli/commit/ea8c02169cfbf0484d67db7c0e7a6ec8aecb7210) | ||
| 70 | + `@npmcli/arborist@2.0.5` | ||
| 71 | + * [`fb6f2c313`](https://github.com/npm/cli/commit/fb6f2c313d1d9770cc7d02a3900c7945df3cb661) | ||
| 72 | + `pacote@11.2.1` | ||
| 73 | + * [`c549b7657`](https://github.com/npm/cli/commit/c549b76573b1835a63e1e5898e9c16860079d84e) | ||
| 74 | + `make-fetch-happen@8.0.13` | ||
| 75 | + | ||
| 1 | 76 | ## v7.4.0 (2021-01-07) | |
| 2 | 77 | ||
| 3 | 78 | ### FEATURES | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -190,5 +190,4 @@ $ npm audit --audit-level=moderate | |||
| 190 | 190 | ### See Also | |
| 191 | 191 | ||
| 192 | 192 | * [npm install](/commands/npm-install) | |
| 193 | - * [package-locks](/configuring-npm/package-locks) | ||
| 194 | 193 | * [config](/using-npm/config) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -68,4 +68,4 @@ cache: | |||
| 68 | 68 | ### See Also | |
| 69 | 69 | ||
| 70 | 70 | * [npm install](/commands/npm-install) | |
| 71 | - * [package-locks](/configuring-npm/package-locks) | ||
| 71 | + * [package-lock.json](/configuring-npm/package-lock-json) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,13 +12,25 @@ npm prefix [-g] | |||
| 12 | 12 | ||
| 13 | 13 | ### Description | |
| 14 | 14 | ||
| 15 | - Print the local prefix to standard out. This is the closest parent directory | ||
| 15 | + Print the local prefix to standard output. This is the closest parent directory | ||
| 16 | 16 | to contain a `package.json` file or `node_modules` directory, unless `-g` is | |
| 17 | 17 | also specified. | |
| 18 | 18 | ||
| 19 | 19 | If `-g` is specified, this will be the value of the global prefix. See | |
| 20 | 20 | [`npm config`](/commands/npm-config) for more detail. | |
| 21 | 21 | ||
| 22 | + ### Example | ||
| 23 | + | ||
| 24 | + ```bash | ||
| 25 | + npm prefix | ||
| 26 | + /usr/local/projects/foo | ||
| 27 | + ``` | ||
| 28 | + | ||
| 29 | + ```bash | ||
| 30 | + npm prefix -g | ||
| 31 | + /usr/local | ||
| 32 | + ``` | ||
| 33 | + | ||
| 22 | 34 | ### See Also | |
| 23 | 35 | ||
| 24 | 36 | * [npm root](/commands/npm-root) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,35 +16,42 @@ aliases: s, se, find | |||
| 16 | 16 | ||
| 17 | 17 | Search the registry for packages matching the search terms. `npm search` | |
| 18 | 18 | performs a linear, incremental, lexically-ordered search through package | |
| 19 | - metadata for all files in the registry. If color is enabled, it will further | ||
| 20 | - highlight the matches in the results. | ||
| 19 | + metadata for all files in the registry. If your terminal has color | ||
| 20 | + support, it will further highlight the matches in the results. This can | ||
| 21 | + be disabled with the config item `color` | ||
| 21 | 22 | ||
| 22 | - Additionally, using the `--searchopts` and `--searchexclude` options paired with | ||
| 23 | - more search terms will respectively include and exclude further patterns. The | ||
| 24 | - main difference between `--searchopts` and the standard search terms is that the | ||
| 25 | - former does not highlight results in the output and can be used for more | ||
| 26 | - fine-grained filtering. Additionally, both of these can be added to `.npmrc` for | ||
| 27 | - default search filtering behavior. | ||
| 23 | + Additionally, using the `--searchopts` and `--searchexclude` options | ||
| 24 | + paired with more search terms will include and exclude further patterns. | ||
| 25 | + The main difference between `--searchopts` and the standard search terms | ||
| 26 | + is that the former does not highlight results in the output and you can | ||
| 27 | + use them more fine-grained filtering. Additionally, you can add both of | ||
| 28 | + these to your config to change default search filtering behavior. | ||
| 28 | 29 | ||
| 29 | 30 | Search also allows targeting of maintainers in search results, by prefixing | |
| 30 | 31 | their npm username with `=`. | |
| 31 | 32 | ||
| 32 | - If a term starts with `/`, then it's interpreted as a regular expression and | ||
| 33 | - supports standard JavaScript RegExp syntax. A trailing `/` will be ignored in | ||
| 34 | - this case. (Note that many regular expression characters must be escaped or | ||
| 35 | - quoted in most shells.) | ||
| 36 | - | ||
| 37 | - ### A Note on caching | ||
| 33 | + If a term starts with `/`, then it's interpreted as a regular expression | ||
| 34 | + and supports standard JavaScript RegExp syntax. In this case search will | ||
| 35 | + ignore a trailing `/` . (Note you must escape or quote many regular | ||
| 36 | + expression characters in most shells.) | ||
| 38 | 37 | ||
| 39 | 38 | ### Configuration | |
| 40 | 39 | ||
| 40 | + All of the following can be defined in a `.npmrc` file, or passed as | ||
| 41 | + parameters to the cli prefixed with `--` (e.g. `--json`) | ||
| 42 | + | ||
| 41 | 43 | #### description | |
| 42 | 44 | ||
| 43 | 45 | * Default: true | |
| 44 | 46 | * Type: Boolean | |
| 45 | 47 | ||
| 46 | - Used as `--no-description`, disables search matching in package descriptions and | ||
| 47 | - suppresses display of that field in results. | ||
| 48 | + #### color | ||
| 49 | + | ||
| 50 | + * Default: true | ||
| 51 | + * Type: Boolean | ||
| 52 | + | ||
| 53 | + Used as `--no-color`, disables color highlighting of matches in the | ||
| 54 | + results. | ||
| 48 | 55 | ||
| 49 | 56 | #### json | |
| 50 | 57 | ||
@@ -66,9 +73,9 @@ Output search results as lines with tab-separated columns. | |||
| 66 | 73 | * Type: Boolean | |
| 67 | 74 | ||
| 68 | 75 | Display full package descriptions and other long text across multiple | |
| 69 | - lines. When disabled (default) search results are truncated to fit | ||
| 70 | - neatly on a single line. Modules with extremely long names will | ||
| 71 | - fall on multiple lines. | ||
| 76 | + lines. When disabled (which is the default) the output will | ||
| 77 | + truncate search results to fit neatly on a single line. Modules with | ||
| 78 | + extremely long names will fall on multiple lines. | ||
| 72 | 79 | ||
| 73 | 80 | #### searchopts | |
| 74 | 81 | ||
@@ -84,27 +91,43 @@ Space-separated options that are always passed to search. | |||
| 84 | 91 | ||
| 85 | 92 | Space-separated options that limit the results from search. | |
| 86 | 93 | ||
| 87 | - #### searchstaleness | ||
| 88 | - | ||
| 89 | - * Default: 900 (15 minutes) | ||
| 90 | - * Type: Number | ||
| 91 | - | ||
| 92 | - The age of the cache, in seconds, before another registry request is made. | ||
| 93 | - | ||
| 94 | 94 | #### registry | |
| 95 | 95 | ||
| 96 | 96 | * Default: https://registry.npmjs.org/ | |
| 97 | 97 | * Type: url | |
| 98 | 98 | ||
| 99 | - Search the specified registry for modules. If you have configured npm to point | ||
| 100 | - to a different default registry, such as your internal private module | ||
| 101 | - repository, `npm search` will default to that registry when searching. Pass a | ||
| 102 | - different registry url such as the default above in order to override this | ||
| 103 | - setting. | ||
| 99 | + Search the specified registry for modules. If you have configured npm to | ||
| 100 | + point to a different default registry (such as your internal private | ||
| 101 | + module repository), `npm search` will also default to that registry when | ||
| 102 | + searching. | ||
| 103 | + | ||
| 104 | + ### A note on caching | ||
| 105 | + | ||
| 106 | + The npm cli caches search results with the same terms and options | ||
| 107 | + locally in its cache. You can use the following to change how and when | ||
| 108 | + the cli uses this cache. See [`npm cache`](/commands/npm-cache) for more | ||
| 109 | + on how the cache works. | ||
| 110 | + | ||
| 111 | + #### prefer-online | ||
| 112 | + | ||
| 113 | + Forced staleness checks for cached searches, making the cli look for | ||
| 114 | + updates immediately even for fresh search results. | ||
| 115 | + | ||
| 116 | + #### prefer-offline | ||
| 117 | + | ||
| 118 | + Bypasses staleness checks for cached. Missing data will still be | ||
| 119 | + requested from the server. To force full offline mode, use `offline`. | ||
| 120 | + | ||
| 121 | + #### offline | ||
| 122 | + | ||
| 123 | + Forces full offline mode. Any searches not locally cached will result in | ||
| 124 | + an error. | ||
| 104 | 125 | ||
| 105 | 126 | ### See Also | |
| 106 | 127 | ||
| 107 | 128 | * [npm registry](/using-npm/registry) | |
| 108 | 129 | * [npm config](/commands/npm-config) | |
| 109 | 130 | * [npmrc](/configuring-npm/npmrc) | |
| 110 | 131 | * [npm view](/commands/npm-view) | |
| 132 | + * [npm cache](/commands/npm-cache) | ||
| 133 | + * https://npm.im/npm-registry-fetch | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,18 +13,18 @@ npm shrinkwrap | |||
| 13 | 13 | ### Description | |
| 14 | 14 | ||
| 15 | 15 | This command repurposes `package-lock.json` into a publishable | |
| 16 | - `npm-shrinkwrap.json` or simply creates a new one. The file created and updated | ||
| 17 | - by this command will then take precedence over any other existing or future | ||
| 18 | - `package-lock.json` files. For a detailed explanation of the design and purpose | ||
| 19 | - of package locks in npm, see [package-locks](/configuring-npm/package-locks). | ||
| 16 | + `npm-shrinkwrap.json` or simply creates a new one. The file created and | ||
| 17 | + updated by this command will then take precedence over any other existing | ||
| 18 | + or future `package-lock.json` files. For a detailed explanation of the | ||
| 19 | + design and purpose of package locks in npm, see | ||
| 20 | + [package-lock-json](/configuring-npm/package-lock-json). | ||
| 20 | 21 | ||
| 21 | 22 | ### See Also | |
| 22 | 23 | ||
| 23 | 24 | * [npm install](/commands/npm-install) | |
| 24 | 25 | * [npm run-script](/commands/npm-run-script) | |
| 25 | 26 | * [npm scripts](/using-npm/scripts) | |
| 26 | - * [package.js](/configuring-npm/package-json) | ||
| 27 | - * [package-locks](/configuring-npm/package-locks) | ||
| 27 | + * [package.json](/configuring-npm/package-json) | ||
| 28 | 28 | * [package-lock.json](/configuring-npm/package-lock-json) | |
| 29 | - * [shrinkwrap.json](/configuring-npm/shrinkwrap-json) | ||
| 29 | + * [npm-shrinkwrap.json](/configuring-npm/npm-shrinkwrap-json) | ||
| 30 | 30 | * [npm ls](/commands/npm-ls) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,13 +12,39 @@ npm start [-- <args>] | |||
| 12 | 12 | ||
| 13 | 13 | ### Description | |
| 14 | 14 | ||
| 15 | - This runs an arbitrary command specified in the package's `"start"` property of | ||
| 16 | - its `"scripts"` object. If no `"start"` property is specified on the | ||
| 17 | - `"scripts"` object, it will run `node server.js`. | ||
| 15 | + This runs a predefined command specified in the `"start"` property of | ||
| 16 | + a package's `"scripts"` object. | ||
| 17 | + | ||
| 18 | + If the `"scripts"` object does not define a `"start"` property, npm | ||
| 19 | + will run `node server.js`. | ||
| 20 | + | ||
| 21 | + Note that this is different from the default node behavior of running | ||
| 22 | + the file specified in a package's `"main"` attribute when evoking with | ||
| 23 | + `node .` | ||
| 18 | 24 | ||
| 19 | 25 | As of [`npm@2.0.0`](https://blog.npmjs.org/post/98131109725/npm-2-0-0), you can | |
| 20 | 26 | use custom arguments when executing scripts. Refer to [`npm run-script`](/commands/npm-run-script) for more details. | |
| 21 | 27 | ||
| 28 | + ### Example | ||
| 29 | + | ||
| 30 | + ```json | ||
| 31 | + { | ||
| 32 | + "scripts": { | ||
| 33 | + "start": "node foo.js" | ||
| 34 | + } | ||
| 35 | + } | ||
| 36 | + ``` | ||
| 37 | + | ||
| 38 | + ```bash | ||
| 39 | + npm start | ||
| 40 | + | ||
| 41 | + > npm@x.x.x start | ||
| 42 | + > node foo.js | ||
| 43 | + | ||
| 44 | + (foo.js output would be here) | ||
| 45 | + | ||
| 46 | + ``` | ||
| 47 | + | ||
| 22 | 48 | ### See Also | |
| 23 | 49 | ||
| 24 | 50 | * [npm run-script](/commands/npm-run-script) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,31 @@ npm stop [-- <args>] | |||
| 12 | 12 | ||
| 13 | 13 | ### Description | |
| 14 | 14 | ||
| 15 | - This runs a package's "stop" script, if one was provided. | ||
| 15 | + This runs a predefined command specified in the "stop" property of a | ||
| 16 | + package's "scripts" object. | ||
| 17 | + | ||
| 18 | + Unlike with [npm start](/commands/npm-start), there is no default script | ||
| 19 | + that will run if the `"stop"` property is not defined. | ||
| 20 | + | ||
| 21 | + ### Example | ||
| 22 | + | ||
| 23 | + ```json | ||
| 24 | + { | ||
| 25 | + "scripts": { | ||
| 26 | + "stop": "node bar.js" | ||
| 27 | + } | ||
| 28 | + } | ||
| 29 | + ``` | ||
| 30 | + | ||
| 31 | + ```bash | ||
| 32 | + npm stop | ||
| 33 | + | ||
| 34 | + > npm@x.x.x stop | ||
| 35 | + > node bar.js | ||
| 36 | + | ||
| 37 | + (bar.js output would be here) | ||
| 38 | + | ||
| 39 | + ``` | ||
| 16 | 40 | ||
| 17 | 41 | ### See Also | |
| 18 | 42 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,28 @@ aliases: t, tst | |||
| 14 | 14 | ||
| 15 | 15 | ### Description | |
| 16 | 16 | ||
| 17 | - This runs a package's "test" script, if one was provided. | ||
| 17 | + This runs a predefined command specified in the `"test"` property of | ||
| 18 | + a package's `"scripts"` object. | ||
| 19 | + | ||
| 20 | + ### Example | ||
| 21 | + | ||
| 22 | + ```json | ||
| 23 | + { | ||
| 24 | + "scripts": { | ||
| 25 | + "test": "node test.js" | ||
| 26 | + } | ||
| 27 | + } | ||
| 28 | + ``` | ||
| 29 | + | ||
| 30 | + ```bash | ||
| 31 | + npm test | ||
| 32 | + > npm@x.x.x test | ||
| 33 | + > node test.js | ||
| 34 | + | ||
| 35 | + (test.js output would be here) | ||
| 36 | + ``` | ||
| 37 | + | ||
| 38 | + | ||
| 18 | 39 | ||
| 19 | 40 | ### See Also | |
| 20 | 41 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments