diff --git a/.eslintrc.js b/.eslintrc.js index 7f37fc19d5a543..af1249eae6436e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -234,6 +234,8 @@ module.exports = { 'no-unreachable': 'error', 'no-unsafe-finally': 'error', 'no-unsafe-negation': 'error', + 'no-unsafe-optional-chaining': 'error', + 'no-unused-expressions': ['error', { allowShortCircuit: true }], 'no-unused-labels': 'error', 'no-unused-vars': ['error', { args: 'none', caughtErrors: 'all' }], 'no-use-before-define': ['error', { diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 66efca5cd000e7..dd3a2964c85db9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,6 +7,10 @@ Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md --> +#### Related Issues + +Fixes: https://github.com/nodejs/node/issues/ + ##### Checklist diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index 7e91c8fd007284..226dc69f0e921b 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -13,6 +13,7 @@ env: jobs: build-tarball: + if: github.event.pull_request.draft == false env: PYTHON_VERSION: 3.9 runs-on: ubuntu-latest diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 2a48e0d0fd42c0..2a021723e6f5df 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -15,6 +15,7 @@ env: jobs: build-windows-with-quic: + if: github.event.pull_request.draft == false runs-on: windows-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/close-stalled.yml b/.github/workflows/close-stalled.yml index 1834d3ac2e6815..916baf0463fa6c 100644 --- a/.github/workflows/close-stalled.yml +++ b/.github/workflows/close-stalled.yml @@ -5,6 +5,7 @@ on: jobs: stale: + if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - uses: actions/stale@v3 diff --git a/.github/workflows/comment-stalled.yml b/.github/workflows/comment-stalled.yml index 62bd26f39eb72d..1c21505c4ad317 100644 --- a/.github/workflows/comment-stalled.yml +++ b/.github/workflows/comment-stalled.yml @@ -7,6 +7,7 @@ on: jobs: staleComment: + if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - name: Post comment diff --git a/.github/workflows/coverage-linux.yml b/.github/workflows/coverage-linux.yml index 002c2189b82459..75f296230dfd37 100644 --- a/.github/workflows/coverage-linux.yml +++ b/.github/workflows/coverage-linux.yml @@ -22,6 +22,7 @@ env: jobs: coverage-linux: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index ac0ef7b6e6c018..188861883bd73d 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -22,6 +22,7 @@ env: jobs: coverage-windows: + if: github.event.pull_request.draft == false runs-on: windows-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/license-builder.yml b/.github/workflows/license-builder.yml index 714aeb1c1499d5..115bef9977d9d5 100644 --- a/.github/workflows/license-builder.yml +++ b/.github/workflows/license-builder.yml @@ -7,7 +7,8 @@ on: workflow_dispatch: jobs: - update_routes: + update_license: + if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 14aed9bfddfdc3..26be5a7cab2f98 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -14,6 +14,7 @@ env: jobs: lint-addon-docs: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -26,6 +27,7 @@ jobs: - name: Lint addon docs run: NODE=$(command -v node) make lint-addon-docs lint-cpp: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -38,6 +40,7 @@ jobs: - name: Lint C/C++ files run: make lint-cpp lint-md: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -52,6 +55,7 @@ jobs: echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json" NODE=$(command -v node) make lint-md lint-js: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -64,6 +68,7 @@ jobs: - name: Lint JavaScript files run: NODE=$(command -v node) make lint-js lint-py: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -77,8 +82,16 @@ jobs: run: | make lint-py-build || true NODE=$(command -v node) make lint-py - + lint-sh: + if: github.event.pull_request.draft == false + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - run: shellcheck -V + - name: Lint Shell scripts + run: tools/lint-sh.js . lint-codeowners: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/misc.yml b/.github/workflows/misc.yml index 1444dff7262819..2a50a2346a32a3 100644 --- a/.github/workflows/misc.yml +++ b/.github/workflows/misc.yml @@ -13,6 +13,7 @@ env: jobs: build-docs: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/test-asan.yml b/.github/workflows/test-asan.yml index 72b259a8354d8c..7df02293fb84a9 100644 --- a/.github/workflows/test-asan.yml +++ b/.github/workflows/test-asan.yml @@ -19,6 +19,7 @@ env: jobs: test-asan: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest env: CC: clang diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 967b863f25ded7..9d9b007b8f6f91 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -15,6 +15,7 @@ env: jobs: test-linux: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -30,6 +31,7 @@ jobs: run: make run-ci -j2 V=1 TEST_CI_ARGS="-p actions" test-linux-with-quic: + if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 08e6e91e8f4fbd..a476e6a08c5fc6 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -15,6 +15,7 @@ env: jobs: test-macOS-with-quic: + if: github.event.pull_request.draft == false runs-on: macos-latest steps: - uses: actions/checkout@v2 diff --git a/BUILDING.md b/BUILDING.md index 1d26ec520a8f7d..6d9b26377de83f 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -30,6 +30,7 @@ file a new issue. * [Building the documentation](#building-the-documentation) * [Building a debug build](#building-a-debug-build) * [Building an ASAN build](#building-an-asan-build) + * [Speeding up frequent rebuilds when developing](#speeding-up-frequent-rebuilds-when-developing) * [Troubleshooting Unix and macOS builds](#troubleshooting-unix-and-macos-builds) * [Windows](#windows) * [Prerequisites](#prerequisites) @@ -527,6 +528,29 @@ $ ./configure --debug --enable-asan && make -j4 $ make test-only ``` +#### Speeding up frequent rebuilds when developing + +If you plan to frequently rebuild Node.js, especially if using several branches, +installing `ccache` can help to greatly reduce build times. Set up with: +```console +$ sudo apt install ccache # for Debian/Ubuntu, included in most Linux distros +$ ccache -o cache_dir= +$ ccache -o max_size=5.0G +$ export CC="ccache gcc" # add to your .profile +$ export CXX="ccache g++" # add to your .profile +``` +This will allow for near-instantaneous rebuilds even when switching branches. + +When modifying only the JS layer in `lib`, it is possible to externally load it +without modifying the executable: +```console +$ ./configure --node-builtin-modules-path $(pwd) +``` +The resulting binary won't include any JS files and will try to load them from +the specified directory. The JS debugger of Visual Studio Code supports this +configuration since the November 2020 version and allows for setting +breakpoints. + #### Troubleshooting Unix and macOS builds Stale builds can sometimes result in `file not found` errors while building. diff --git a/CHANGELOG.md b/CHANGELOG.md index cbe9ccfd7f5019..a5da2299f7bea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,7 +32,9 @@ release. -15.3.0
+15.5.0
+15.4.0
+15.3.0
15.2.1
15.2.0
15.1.0
diff --git a/GOVERNANCE.md b/GOVERNANCE.md index aeb1d9c65e1f11..f47fb56e5b0cfb 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -151,8 +151,9 @@ The nomination passes if no Collaborators oppose it after one week. Otherwise, the nomination fails. There are steps a nominator can take in advance to make a nomination as -frictionless as possible. Use the [Collaborators discussion page][] to request -feedback from other Collaborators in private. A nominator may also work with the +frictionless as possible. To request feedback from other Collaborators in + private, use the [Collaborators discussion page][] + (which only Collaborators may view). A nominator may also work with the nominee to improve their contribution profile. Collaborators might overlook someone with valuable contributions. In that case, diff --git a/LICENSE b/LICENSE index 5f905a79a96090..2d4040e537adad 100644 --- a/LICENSE +++ b/LICENSE @@ -1248,12 +1248,12 @@ The externally maintained libraries used by Node.js are: THE SOFTWARE. """ -- babel-eslint, located at tools/node_modules/babel-eslint, is licensed as follows: +- Babel, located at tools/node_modules/@babel, is licensed as follows: """ - Copyright (c) 2014-2016 Sebastian McKenzie - MIT License + Copyright (c) 2014-present Sebastian McKenzie and other contributors + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including diff --git a/Makefile b/Makefile index 0c95b7f8904646..4a6e59536bb4d2 100644 --- a/Makefile +++ b/Makefile @@ -593,7 +593,7 @@ test-known-issues: all # Related CI job: node-test-npm test-npm: $(NODE_EXE) ## Run the npm test suite on deps/npm. - $(NODE) tools/test-npm-package --install --logfile=test-npm.tap deps/npm test-node + $(NODE) tools/test-npm-package --install --logfile=test-npm.tap deps/npm test test-npm-publish: $(NODE_EXE) npm_package_config_publishtest=true $(NODE) deps/npm/test/run.js diff --git a/README.md b/README.md index b8d5c4c09d2ec9..35db3c9d275276 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ The Node.js project uses an [open governance model](./GOVERNANCE.md). The * [TSC (Technical Steering Committee)](#tsc-technical-steering-committee) * [Collaborators](#collaborators) * [Release Keys](#release-keys) +* [License](#license) ## Support @@ -284,8 +285,6 @@ For information about the governance of the Node.js project, see **Danielle Adams** <adamzdanielle@gmail.com> (she/her) * [davisjam](https://github.com/davisjam) - **Jamie Davis** <davisjam@vt.edu> (he/him) -* [DerekNonGeneric](https://github.com/DerekNonGeneric) - -**Derek Lewis** <DerekNonGeneric@inf.is> (he/him) * [devnexen](https://github.com/devnexen) - **David Carlier** <devnexen@gmail.com> * [devsnek](https://github.com/devsnek) - @@ -372,6 +371,8 @@ For information about the governance of the Node.js project, see **Ali Ijaz Sheikh** <ofrobots@google.com> (he/him) * [oyyd](https://github.com/oyyd) - **Ouyang Yadong** <oyydoibh@gmail.com> (he/him) +* [PoojaDurgad](https://github.com/PoojaDurgad) - +**Pooja D P** <Pooja.D.P@ibm.com> (she/her) * [psmarshall](https://github.com/psmarshall) - **Peter Marshall** <petermarshall@chromium.org> (he/him) * [puzpuzpuz](https://github.com/puzpuzpuz) - @@ -459,6 +460,8 @@ For information about the governance of the Node.js project, see **Claudio Rodriguez** <cjrodr@yahoo.com> * [DavidCai1993](https://github.com/DavidCai1993) - **David Cai** <davidcai1993@yahoo.com> (he/him) +* [DerekNonGeneric](https://github.com/DerekNonGeneric) - +**Derek Lewis** <DerekNonGeneric@inf.is> (he/him) * [digitalinfinity](https://github.com/digitalinfinity) - **Hitesh Kanwathirtha** <digitalinfinity@gmail.com> (he/him) * [eljefedelrodeodeljefe](https://github.com/eljefedelrodeodeljefe) - @@ -574,6 +577,8 @@ maintaining the Node.js project. * [PoojaDurgad](https://github.com/PoojaDurgad) - **Pooja Durgad** <Pooja.D.P@ibm.com> +* [RaisinTen](https://github.com/RaisinTen) - +**Darshan Sen** <raisinten@gmail.com> ### Release Keys @@ -641,6 +646,14 @@ Other keys used to sign some previous releases: * **Timothy J Fontaine** <tjfontaine@gmail.com> `7937DFD2AB06298B2293C3187D33FF9D0246406D` +## License + +Node.js is available under the +[MIT license](https://opensource.org/licenses/MIT). Node.js also includes +external libraries that are available under a variety of licenses. See +[LICENSE](https://github.com/nodejs/node/blob/master/LICENSE) for the full +license text. + [Code of Conduct]: https://github.com/nodejs/admin/blob/master/CODE_OF_CONDUCT.md [Contributing to the project]: CONTRIBUTING.md [Node.js Website]: https://nodejs.org/ diff --git a/benchmark/_benchmark_progress.js b/benchmark/_benchmark_progress.js index 1b7ac738f6de0d..6c925f34e68202 100644 --- a/benchmark/_benchmark_progress.js +++ b/benchmark/_benchmark_progress.js @@ -39,7 +39,6 @@ class BenchmarkProgress { this.completedConfig = 0; // Total number of configurations for the current file this.scheduledConfig = 0; - this.interval; // Updates the elapsed time. } startQueue(index) { diff --git a/benchmark/child_process/child-process-params.js b/benchmark/child_process/child-process-params.js index df930395b2a015..8db8d3ace20c53 100644 --- a/benchmark/child_process/child-process-params.js +++ b/benchmark/child_process/child-process-params.js @@ -82,6 +82,7 @@ function main({ n, methodName, params }) { } break; case 'execFileSync': + case 'spawnSync': switch (params) { case 1: bench.start(); @@ -119,24 +120,5 @@ function main({ n, methodName, params }) { break; } break; - case 'spawnSync': - switch (params) { - case 1: - bench.start(); - for (let i = 0; i < n; i++) method(command); - bench.end(n); - break; - case 2: - bench.start(); - for (let i = 0; i < n; i++) method(command, args); - bench.end(n); - break; - case 3: - bench.start(); - for (let i = 0; i < n; i++) method(command, args, options); - bench.end(n); - break; - } - break; } } diff --git a/benchmark/es/destructuring-bench.js b/benchmark/es/destructuring-bench.js index c07c0383da91ac..d412b82757f083 100644 --- a/benchmark/es/destructuring-bench.js +++ b/benchmark/es/destructuring-bench.js @@ -12,7 +12,8 @@ function runSwapManual(n) { let x, y, r; bench.start(); for (let i = 0; i < n; i++) { - x = 1, y = 2; + x = 1; + y = 2; r = x; x = y; y = r; @@ -26,7 +27,8 @@ function runSwapDestructured(n) { let x, y; bench.start(); for (let i = 0; i < n; i++) { - x = 1, y = 2; + x = 1; + y = 2; [x, y] = [y, x]; assert.strictEqual(x, 2); assert.strictEqual(y, 1); diff --git a/benchmark/perf_hooks/bench-eventlooputil.js b/benchmark/perf_hooks/bench-eventlooputil.js index 984b2b66aecbcf..1fd452afa91300 100644 --- a/benchmark/perf_hooks/bench-eventlooputil.js +++ b/benchmark/perf_hooks/bench-eventlooputil.js @@ -33,7 +33,7 @@ function main({ method, n }) { function benchIdleTime(n) { bench.start(); for (let i = 0; i < n; i++) - nodeTiming.idleTime; + nodeTiming.idleTime; // eslint-disable-line no-unused-expressions bench.end(n); } diff --git a/benchmark/process/bench-env.js b/benchmark/process/bench-env.js index 5df521cc958389..e96c1d02507214 100644 --- a/benchmark/process/bench-env.js +++ b/benchmark/process/bench-env.js @@ -13,7 +13,7 @@ function main({ n, operation }) { case 'get': bench.start(); for (let i = 0; i < n; i++) { - process.env.PATH; + process.env.PATH; // eslint-disable-line no-unused-expressions } bench.end(n); break; @@ -42,7 +42,7 @@ function main({ n, operation }) { case 'query': bench.start(); for (let i = 0; i < n; i++) { - 'PATH' in process.env; + 'PATH' in process.env; // eslint-disable-line no-unused-expressions } bench.end(n); break; diff --git a/benchmark/string_decoder/string-decoder-create.js b/benchmark/string_decoder/string-decoder-create.js index f7fa5e0246b860..641e562fdeab3d 100644 --- a/benchmark/string_decoder/string-decoder-create.js +++ b/benchmark/string_decoder/string-decoder-create.js @@ -12,8 +12,7 @@ const bench = common.createBenchmark(main, { function main({ encoding, n }) { bench.start(); for (let i = 0; i < n; ++i) { - const sd = new StringDecoder(encoding); - !!sd.encoding; + new StringDecoder(encoding); } bench.end(n); } diff --git a/common.gypi b/common.gypi index fc74558f2cbffe..3b01d806407129 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.22', + 'v8_embedder_string': '-node.23', ##### V8 defaults for Node.js ##### diff --git a/configure.py b/configure.py index 50994c8c2772e2..c24d56b5d1891d 100755 --- a/configure.py +++ b/configure.py @@ -948,7 +948,7 @@ def get_gas_version(cc): # Note: Apple clang self-reports as clang 4.2.0 and gcc 4.2.1. It passes # the version check more by accident than anything else but a more rigorous -# check involves checking the build number against a whitelist. I'm not +# check involves checking the build number against an allowlist. I'm not # quite prepared to go that far yet. def check_compiler(o): if sys.platform == 'win32': @@ -1547,8 +1547,6 @@ def icu_download(path): 'variables': {} } icu_config_name = 'icu_config.gypi' - def write_config(data, name): - return # write an empty file to start with write(icu_config_name, do_not_edit + diff --git a/deps/cares/include/ares_version.h b/deps/cares/include/ares_version.h index c041d574dee09e..0bee17dfe646b4 100644 --- a/deps/cares/include/ares_version.h +++ b/deps/cares/include/ares_version.h @@ -6,12 +6,12 @@ #define ARES_COPYRIGHT "2004 - 2020 Daniel Stenberg, ." #define ARES_VERSION_MAJOR 1 -#define ARES_VERSION_MINOR 16 +#define ARES_VERSION_MINOR 17 #define ARES_VERSION_PATCH 1 #define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\ (ARES_VERSION_MINOR<<8)|\ (ARES_VERSION_PATCH)) -#define ARES_VERSION_STR "1.16.1" +#define ARES_VERSION_STR "1.17.1" #if (ARES_VERSION >= 0x010700) # define CARES_HAVE_ARES_LIBRARY_INIT 1 diff --git a/deps/cares/include/nameser.h b/deps/cares/include/nameser.h index 5de783b47171be..5c1acce215573c 100644 --- a/deps/cares/include/nameser.h +++ b/deps/cares/include/nameser.h @@ -88,7 +88,7 @@ typedef enum __ns_type { ns_t_maila = 254, /* Transfer mail agent records. */ ns_t_any = 255, /* Wildcard match. */ ns_t_zxfr = 256, /* BIND-specific, nonstandard. */ - ns_t_caa = 257, /* CA Authorization (RFC8659) */ + ns_t_caa = 257, /* Certification Authority Authorization. */ ns_t_max = 65536 } ns_type; @@ -210,4 +210,9 @@ typedef enum __ns_rcode { #endif /* HAVE_ARPA_NAMESER_COMPAT_H */ +/* Android's bionic arpa/nameser_compat.h, nor glibc versions prior to 2.25 have T_OPT defined */ +#ifndef T_OPT +# define T_OPT ns_t_opt +#endif + #endif /* ARES_NAMESER_H */ diff --git a/deps/cares/src/ares__readaddrinfo.c b/deps/cares/src/ares__readaddrinfo.c index dd3abe2e9f8778..2b5bb40c3dd017 100644 --- a/deps/cares/src/ares__readaddrinfo.c +++ b/deps/cares/src/ares__readaddrinfo.c @@ -163,6 +163,10 @@ int ares__readaddrinfo(FILE *fp, continue; } + /* Zero-out 'addr' struct, as there are members that we may not set, especially + * for ipv6. We don't want garbage data */ + memset(&addr, 0, sizeof(addr)); + /* * Convert address string to network address for the requested families. * Actual address family possible values are AF_INET and AF_INET6 only. @@ -179,7 +183,7 @@ int ares__readaddrinfo(FILE *fp, } node->ai_family = addr.sa.sa_family = AF_INET; - node->ai_addrlen = sizeof(sizeof(addr.sa4)); + node->ai_addrlen = sizeof(addr.sa4); node->ai_addr = ares_malloc(sizeof(addr.sa4)); if (!node->ai_addr) { @@ -200,7 +204,7 @@ int ares__readaddrinfo(FILE *fp, } node->ai_family = addr.sa.sa_family = AF_INET6; - node->ai_addrlen = sizeof(sizeof(addr.sa6)); + node->ai_addrlen = sizeof(addr.sa6); node->ai_addr = ares_malloc(sizeof(addr.sa6)); if (!node->ai_addr) { diff --git a/deps/cares/src/ares__sortaddrinfo.c b/deps/cares/src/ares__sortaddrinfo.c index 7a90270a2a6b92..0ad3a5bd98b9ae 100644 --- a/deps/cares/src/ares__sortaddrinfo.c +++ b/deps/cares/src/ares__sortaddrinfo.c @@ -85,11 +85,12 @@ struct addrinfo_sort_elem #define ARES_IN6_IS_ADDR_6BONE(a) \ (((a)->s6_addr[0] == 0x3f) && ((a)->s6_addr[1] == 0xfe)) + static int get_scope(const struct sockaddr *addr) { if (addr->sa_family == AF_INET6) { - const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr; + const struct sockaddr_in6 *addr6 = CARES_INADDR_CAST(const struct sockaddr_in6 *, addr); if (IN6_IS_ADDR_MULTICAST(&addr6->sin6_addr)) { return ARES_IPV6_ADDR_MC_SCOPE(&addr6->sin6_addr); @@ -114,7 +115,7 @@ static int get_scope(const struct sockaddr *addr) } else if (addr->sa_family == AF_INET) { - const struct sockaddr_in *addr4 = (const struct sockaddr_in *)addr; + const struct sockaddr_in *addr4 = CARES_INADDR_CAST(const struct sockaddr_in *, addr); unsigned long int na = ntohl(addr4->sin_addr.s_addr); if (ARES_IN_LOOPBACK(na) || /* 127.0.0.0/8 */ (na & 0xffff0000) == 0xa9fe0000) /* 169.254.0.0/16 */ @@ -149,7 +150,7 @@ static int get_label(const struct sockaddr *addr) } else if (addr->sa_family == AF_INET6) { - const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr; + const struct sockaddr_in6 *addr6 = CARES_INADDR_CAST(const struct sockaddr_in6 *, addr); if (IN6_IS_ADDR_LOOPBACK(&addr6->sin6_addr)) { return 0; @@ -210,7 +211,7 @@ static int get_precedence(const struct sockaddr *addr) } else if (addr->sa_family == AF_INET6) { - const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr; + const struct sockaddr_in6 *addr6 = CARES_INADDR_CAST(const struct sockaddr_in6 *, addr); if (IN6_IS_ADDR_LOOPBACK(&addr6->sin6_addr)) { return 50; @@ -353,10 +354,10 @@ static int rfc6724_compare(const void *ptr1, const void *ptr2) { const struct sockaddr_in6 *a1_src = &a1->src_addr.sa6; const struct sockaddr_in6 *a1_dst = - (const struct sockaddr_in6 *)a1->ai->ai_addr; + CARES_INADDR_CAST(const struct sockaddr_in6 *, a1->ai->ai_addr); const struct sockaddr_in6 *a2_src = &a2->src_addr.sa6; const struct sockaddr_in6 *a2_dst = - (const struct sockaddr_in6 *)a2->ai->ai_addr; + CARES_INADDR_CAST(const struct sockaddr_in6 *, a2->ai->ai_addr); prefixlen1 = common_prefix_len(&a1_src->sin6_addr, &a1_dst->sin6_addr); prefixlen2 = common_prefix_len(&a2_src->sin6_addr, &a2_dst->sin6_addr); if (prefixlen1 != prefixlen2) @@ -384,7 +385,7 @@ static int find_src_addr(ares_channel channel, const struct sockaddr *addr, struct sockaddr *src_addr) { - int sock; + ares_socket_t sock; int ret; ares_socklen_t len; @@ -402,7 +403,7 @@ static int find_src_addr(ares_channel channel, } sock = ares__open_socket(channel, addr->sa_family, SOCK_DGRAM, IPPROTO_UDP); - if (sock == -1) + if (sock == ARES_SOCKET_BAD) { if (errno == EAFNOSUPPORT) { @@ -426,7 +427,7 @@ static int find_src_addr(ares_channel channel, return 0; } - if (getsockname(sock, src_addr, &len) == -1) + if (getsockname(sock, src_addr, &len) != 0) { ares__close_socket(channel, sock); return -1; @@ -491,4 +492,4 @@ int ares__sortaddrinfo(ares_channel channel, struct ares_addrinfo_node *list_sen ares_free(elems); return ARES_SUCCESS; -} \ No newline at end of file +} diff --git a/deps/cares/src/ares_getaddrinfo.c b/deps/cares/src/ares_getaddrinfo.c index be168068b1d424..ecd5dd5112cb51 100644 --- a/deps/cares/src/ares_getaddrinfo.c +++ b/deps/cares/src/ares_getaddrinfo.c @@ -386,6 +386,9 @@ static int fake_addrinfo(const char *name, } } + node->ai_socktype = hints->ai_socktype; + node->ai_protocol = hints->ai_protocol; + callback(arg, ARES_SUCCESS, 0, ai); return 1; } @@ -406,6 +409,8 @@ static void end_hquery(struct host_query *hquery, int status) /* Set port into each address (resolved separately). */ while (next) { + next->ai_socktype = hquery->hints.ai_socktype; + next->ai_protocol = hquery->hints.ai_protocol; if (next->ai_family == AF_INET) { (CARES_INADDR_CAST(struct sockaddr_in *, next->ai_addr))->sin_port = htons(hquery->port); @@ -754,6 +759,7 @@ static int as_is_first(const struct host_query* hquery) { char* p; int ndots = 0; + size_t nname = strlen(hquery->name); for (p = hquery->name; *p; p++) { if (*p == '.') @@ -761,5 +767,10 @@ static int as_is_first(const struct host_query* hquery) ndots++; } } + if (nname && hquery->name[nname-1] == '.') + { + /* prevent ARES_EBADNAME for valid FQDN, where ndots < channel->ndots */ + return 1; + } return ndots >= hquery->channel->ndots; } diff --git a/deps/cares/src/ares_gethostbyaddr.c b/deps/cares/src/ares_gethostbyaddr.c index a8ca0f5744d376..54eb5997392764 100644 --- a/deps/cares/src/ares_gethostbyaddr.c +++ b/deps/cares/src/ares_gethostbyaddr.c @@ -208,7 +208,6 @@ static int file_lookup(struct ares_addr *addr, struct hostent **host) strcat(PATH_HOSTS, WIN_PATH_HOSTS); #elif defined(WATT32) - extern const char *_w32_GetHostsFile (void); const char *PATH_HOSTS = _w32_GetHostsFile(); if (!PATH_HOSTS) diff --git a/deps/cares/src/ares_gethostbyname.c b/deps/cares/src/ares_gethostbyname.c index ecd03e79310c63..4e41898496fbf9 100644 --- a/deps/cares/src/ares_gethostbyname.c +++ b/deps/cares/src/ares_gethostbyname.c @@ -258,7 +258,7 @@ static int fake_hostent(const char *name, int family, struct in_addr in; struct ares_in6_addr in6; - if (family == AF_INET || family == AF_INET6) + if (family == AF_INET || family == AF_UNSPEC) { /* It only looks like an IP address if it's all numbers and dots. */ int numdots = 0, valid = 1; @@ -276,13 +276,17 @@ static int fake_hostent(const char *name, int family, /* if we don't have 3 dots, it is illegal * (although inet_pton doesn't think so). */ - if (numdots != 3 || !valid) + if (numdots != 3 || !valid) { result = 0; - else + } else { result = (ares_inet_pton(AF_INET, name, &in) < 1 ? 0 : 1); + } - if (result) - family = AF_INET; + /* + * Set address family in case of failure, + * as we will try to convert it later afterwards + */ + family = result ? AF_INET : AF_INET6; } if (family == AF_INET6) result = (ares_inet_pton(AF_INET6, name, &in6) < 1 ? 0 : 1); @@ -383,7 +387,6 @@ static int file_lookup(const char *name, int family, struct hostent **host) strcat(PATH_HOSTS, WIN_PATH_HOSTS); #elif defined(WATT32) - extern const char *_w32_GetHostsFile (void); const char *PATH_HOSTS = _w32_GetHostsFile(); if (!PATH_HOSTS) diff --git a/deps/cares/src/ares_init.c b/deps/cares/src/ares_init.c index dffa518171b29c..92187e463e69c9 100644 --- a/deps/cares/src/ares_init.c +++ b/deps/cares/src/ares_init.c @@ -115,20 +115,6 @@ int ares_init_options(ares_channel *channelptr, struct ares_options *options, int status = ARES_SUCCESS; struct timeval now; -#ifdef CURLDEBUG - const char *env = getenv("CARES_MEMDEBUG"); - - if (env) - curl_memdebug(env); - env = getenv("CARES_MEMLIMIT"); - if (env) { - char *endptr; - long num = strtol(env, &endptr, 10); - if((endptr != env) && (endptr == env + strlen(env)) && (num > 0)) - curl_memlimit(num); - } -#endif - if (ares_library_initialized() != ARES_SUCCESS) return ARES_ENOTINITIALIZED; /* LCOV_EXCL_LINE: n/a on non-WinSock */ @@ -1611,7 +1597,8 @@ static int init_by_resolv_conf(ares_channel channel) if (channel->nservers == -1) { union res_sockaddr_union addr[MAXNS]; int nscount = res_getservers(&res, addr, MAXNS); - for (int i = 0; i < nscount; ++i) { + int i; + for (i = 0; i < nscount; ++i) { char str[INET6_ADDRSTRLEN]; int config_status; sa_family_t family = addr[i].sin.sin_family; @@ -1639,8 +1626,9 @@ static int init_by_resolv_conf(ares_channel channel) if (!channel->domains) { status = ARES_ENOMEM; } else { + int i; channel->ndomains = entries; - for (int i = 0; i < channel->ndomains; ++i) { + for (i = 0; i < channel->ndomains; ++i) { channel->domains[i] = ares_strdup(res.dnsrch[i]); if (!channel->domains[i]) status = ARES_ENOMEM; diff --git a/deps/cares/src/ares_parse_caa_reply.c b/deps/cares/src/ares_parse_caa_reply.c index 759ab8f7d123e6..620f444e007900 100644 --- a/deps/cares/src/ares_parse_caa_reply.c +++ b/deps/cares/src/ares_parse_caa_reply.c @@ -140,7 +140,7 @@ ares_parse_caa_reply (const unsigned char *abuf, int alen, status = ARES_EBADRESP; break; } - caa_curr->critical = (int)*strptr++; + caa_curr->critical = (int)*strptr++; caa_curr->plength = (int)*strptr++; if (caa_curr->plength <= 0 || (int)caa_curr->plength >= rr_len - 2) { diff --git a/deps/cares/src/ares_parse_soa_reply.c b/deps/cares/src/ares_parse_soa_reply.c index d72eeb94148e27..7cfaed2b33372a 100644 --- a/deps/cares/src/ares_parse_soa_reply.c +++ b/deps/cares/src/ares_parse_soa_reply.c @@ -62,13 +62,16 @@ ares_parse_soa_reply(const unsigned char *abuf, int alen, return ARES_EBADRESP; if (ancount == 0) return ARES_EBADRESP; - + aptr = abuf + HFIXEDSZ; /* query name */ status = ares__expand_name_for_response(aptr, abuf, alen, &qname, &len); if (status != ARES_SUCCESS) goto failed_stat; + + if (alen <= len + HFIXEDSZ + 1) + goto failed; aptr += len; qclass = DNS_QUESTION_TYPE(aptr); @@ -161,9 +164,9 @@ ares_parse_soa_reply(const unsigned char *abuf, int alen, return ARES_SUCCESS; } aptr += rr_len; - + ares_free(rr_name); - + if (aptr > abuf + alen) goto failed_stat; } diff --git a/deps/cares/src/ares_private.h b/deps/cares/src/ares_private.h index 1884c1659681c1..50b2ba06e15b38 100644 --- a/deps/cares/src/ares_private.h +++ b/deps/cares/src/ares_private.h @@ -74,6 +74,7 @@ #elif defined(WATT32) #define PATH_RESOLV_CONF "/dev/ENV/etc/resolv.conf" +W32_FUNC const char *_w32_GetHostsFile (void); #elif defined(NETWARE) @@ -415,13 +416,4 @@ int ares__connect_socket(ares_channel channel, (c)->sock_state_cb((c)->sock_state_cb_data, (s), (r), (w)); \ } WHILE_FALSE -#ifdef CURLDEBUG -/* This is low-level hard-hacking memory leak tracking and similar. Using the - libcurl lowlevel code from within library is ugly and only works when - c-ares is built and linked with a similarly curldebug-enabled libcurl, - but we do this anyway for convenience. */ -#define HEADER_CURL_SETUP_ONCE_H -#include "../lib/memdebug.h" -#endif - #endif /* __ARES_PRIVATE_H */ diff --git a/deps/cares/src/ares_process.c b/deps/cares/src/ares_process.c index ff71f66a1ecce0..65c1b7ff1a856c 100644 --- a/deps/cares/src/ares_process.c +++ b/deps/cares/src/ares_process.c @@ -34,13 +34,13 @@ #endif #ifdef HAVE_ARPA_NAMESER_H # include -#else -# include "nameser.h" #endif #ifdef HAVE_ARPA_NAMESER_COMPAT_H # include #endif +#include "nameser.h" + #ifdef HAVE_STRINGS_H # include #endif @@ -87,6 +87,7 @@ static int open_udp_socket(ares_channel channel, struct server_state *server); static int same_questions(const unsigned char *qbuf, int qlen, const unsigned char *abuf, int alen); static int same_address(struct sockaddr *sa, struct ares_addr *aa); +static int has_opt_rr(const unsigned char *abuf, int alen); static void end_query(ares_channel channel, struct query *query, int status, unsigned char *abuf, int alen); @@ -608,14 +609,14 @@ static void process_answer(ares_channel channel, unsigned char *abuf, return; packetsz = PACKETSZ; - /* If we use EDNS and server answers with one of these RCODES, the protocol + /* If we use EDNS and server answers with FORMERR without an OPT RR, the protocol * extension is not understood by the responder. We must retry the query * without EDNS enabled. */ if (channel->flags & ARES_FLAG_EDNS) { packetsz = channel->ednspsz; - if (rcode == NOTIMP || rcode == FORMERR || rcode == SERVFAIL) + if (rcode == FORMERR && has_opt_rr(abuf, alen) != 1) { int qlen = (query->tcplen - 2) - EDNSFIXEDSZ; channel->flags ^= ARES_FLAG_EDNS; @@ -1354,6 +1355,85 @@ static int same_address(struct sockaddr *sa, struct ares_addr *aa) return 0; /* different */ } +/* search for an OPT RR in the response */ +static int has_opt_rr(const unsigned char *abuf, int alen) +{ + unsigned int qdcount, ancount, nscount, arcount, i; + const unsigned char *aptr; + int status; + + if (alen < HFIXEDSZ) + return -1; + + /* Parse the answer header. */ + qdcount = DNS_HEADER_QDCOUNT(abuf); + ancount = DNS_HEADER_ANCOUNT(abuf); + nscount = DNS_HEADER_NSCOUNT(abuf); + arcount = DNS_HEADER_ARCOUNT(abuf); + + aptr = abuf + HFIXEDSZ; + + /* skip the questions */ + for (i = 0; i < qdcount; i++) + { + char* name; + long len; + status = ares_expand_name(aptr, abuf, alen, &name, &len); + if (status != ARES_SUCCESS) + return -1; + ares_free_string(name); + if (aptr + len + QFIXEDSZ > abuf + alen) + return -1; + aptr += len + QFIXEDSZ; + } + + /* skip the ancount and nscount */ + for (i = 0; i < ancount + nscount; i++) + { + char* name; + long len; + int dlen; + status = ares_expand_name(aptr, abuf, alen, &name, &len); + if (status != ARES_SUCCESS) + return -1; + ares_free_string(name); + if (aptr + len + RRFIXEDSZ > abuf + alen) + return -1; + aptr += len; + dlen = DNS_RR_LEN(aptr); + aptr += RRFIXEDSZ; + if (aptr + dlen > abuf + alen) + return -1; + aptr += dlen; + } + + /* search for rr type (41) - opt */ + for (i = 0; i < arcount; i++) + { + char* name; + long len; + int dlen; + status = ares_expand_name(aptr, abuf, alen, &name, &len); + if (status != ARES_SUCCESS) + return -1; + ares_free_string(name); + if (aptr + len + RRFIXEDSZ > abuf + alen) + return -1; + aptr += len; + + if (DNS_RR_TYPE(aptr) == T_OPT) + return 1; + + dlen = DNS_RR_LEN(aptr); + aptr += RRFIXEDSZ; + if (aptr + dlen > abuf + alen) + return -1; + aptr += dlen; + } + + return 0; +} + static void end_query (ares_channel channel, struct query *query, int status, unsigned char *abuf, int alen) { diff --git a/deps/cares/src/ares_query.c b/deps/cares/src/ares_query.c index b38b8a6c22c4db..5bbb2f5c326bdb 100644 --- a/deps/cares/src/ares_query.c +++ b/deps/cares/src/ares_query.c @@ -45,7 +45,7 @@ static void rc4(rc4_key* key, unsigned char *buffer_ptr, int buffer_len) unsigned char y; unsigned char* state; unsigned char xorIndex; - short counter; + int counter; x = key->x; y = key->y; diff --git a/deps/cares/src/ares_strsplit.h b/deps/cares/src/ares_strsplit.h index da286a9aef6b51..e00fd14dd5a131 100644 --- a/deps/cares/src/ares_strsplit.h +++ b/deps/cares/src/ares_strsplit.h @@ -40,3 +40,4 @@ void ares_strsplit_free(char **elms, size_t num_elm); #endif /* HEADER_CARES_STRSPLIT_H */ + diff --git a/deps/npm/.eslintrc.json b/deps/npm/.eslintrc.json index 139716eefd85a0..8566613e748a7e 100644 --- a/deps/npm/.eslintrc.json +++ b/deps/npm/.eslintrc.json @@ -67,6 +67,13 @@ "key-spacing": ["error", { "beforeColon": false, "afterColon": true }], "keyword-spacing": ["error", { "before": true, "after": true }], "lines-between-class-members": ["error", "always", { "exceptAfterSingleLine": true }], + "max-len": ["error", 80, { + "ignoreUrls": true, + "ignoreComments": false, + "ignoreRegExpLiterals": true, + "ignoreStrings": true, + "ignoreTemplateLiterals": true + }], "new-cap": ["error", { "newIsCap": true, "capIsNew": false, "properties": true }], "new-parens": "error", "no-array-constructor": "error", diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index 33647f09277cf2..0d3cedb68c8695 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -738,3 +738,6 @@ Hollow Man kai zhu Alex Woollam Daniel Fischer +Yash-Singh1 +Edu93Jer +Tieg Zaharia diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index a3a9984d24462f..accfdafe6643e4 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,265 @@ +## 7.3.0 (2020-12-18) + +### FEATURES + +* [`a9b8bf263`](https://github.com/npm/cli/commit/a9b8bf2634c627fbb16ca3a6bb2c2f1058c3e586) + [#2362](https://github.com/npm/cli/issues/2362) + Support multiple set/get/deletes in npm config + ([@isaacs](https://github.com/isaacs)) + +### BUG FIXES + +* [`9eef63849`](https://github.com/npm/cli/commit/9eef638499c88689acb00d812c10f0407cb95c08) + Pass full set of options to login helper functions. + This fixes `npm login --no-strict-ssl`, as well as a host of other + options that one might want to set while logging in. + Reported by: [@toddself](https://github.com/toddself) + ([@isaacs](https://github.com/isaacs)) +* [`628a554bc`](https://github.com/npm/cli/commit/628a554bc113e4e115d34778bfe8a77cfad1d933) + [#2358](https://github.com/npm/cli/issues/2358) + fix doctor test to work correctly for node pre-release versions + ([@nlf](https://github.com/nlf)) +* [`be4a0900b`](https://github.com/npm/cli/commit/be4a0900b14b2c6315bf62bed8f5affb648215ae) + [#2360](https://github.com/npm/cli/issues/2360) + raise an error early if publishing without login, registry + ([@isaacs](https://github.com/isaacs)) +* [`44d433105`](https://github.com/npm/cli/commit/44d4331058c53909ada62470b23b2185102b2128) + [#2366](https://github.com/npm/cli/issues/2366) + Include prerelease versions when deprecating + ([@tiegz](https://github.com/tiegz)) +* [`cba3341da`](https://github.com/npm/cli/commit/cba3341dae4c92541049dc976e82e2ba19566e95) + [#2373](https://github.com/npm/cli/issues/2373) + npm profile refactor + ([@ruyadorno](https://github.com/ruyadorno)) +* [`7539504e3`](https://github.com/npm/cli/commit/7539504e3abdec28039a7798e5ccb745b536cb6e) + [#2382](https://github.com/npm/cli/issues/2382) + remove the metrics sender + ([@nlf](https://github.com/nlf)) + +### DOCS + +* [`b98569a8c`](https://github.com/npm/cli/commit/b98569a8ca28dbd611fe84492aee996e2e567b55) + add note about `INIT_CWD` to run-script doc +* [`292929279`](https://github.com/npm/cli/commit/292929279854a06ca60ff737b574cbd6503ec5db) + [#2368](https://github.com/npm/cli/issues/2368) + Revert bug-reporting links to GH. + Re: + ([@tiegz](https://github.com/tiegz)) +* [`f4560626f`](https://github.com/npm/cli/commit/f4560626f09dba4889d752f7f739aa5a5f3da741) + update `ISSUE_TEMPLATE` with modern links + ([@isaacs](https://github.com/isaacs)) +* [`bc1c567ed`](https://github.com/npm/cli/commit/bc1c567ed3d853ed4f01d33a800eb453956de6ef) + update npm command doc feature request links + ([@isaacs](https://github.com/isaacs)) +* [`0ad958fe1`](https://github.com/npm/cli/commit/0ad958fe1cb811699caca235f361c8328baac8c4) + [#2381](https://github.com/npm/cli/issues/2381) + (docs,test): assorted typo fixes + ([@XhmikosR](https://github.com/XhmikosR)) + +### TESTING + +* [`a92d310b7`](https://github.com/npm/cli/commit/a92d310b7e9e4c48b08f52785c2e3a6d52a82ad7) + [#2361](https://github.com/npm/cli/issues/2361) + Add max-len to lint rules + ([@Edu93Jer](https://github.com/Edu93Jer)) + +### DEPENDENCIES + +* [`4fc2f3e05`](https://github.com/npm/cli/commit/4fc2f3e05b600aa64fe5eb6b8b77bc070e5a9403) + [#2300](https://github.com/npm/cli/issues/2300) + `@npmcli/config@1.2.8`: + * Support setting email without username/password + +## 7.2.0 (2020-12-15) + +### FEATURES + +* [`a9c4b158c`](https://github.com/npm/cli/commit/a9c4b158c46dd0d0c8d8744a97750ffd0c30cc09) + [#2342](https://github.com/npm/cli/issues/2342) + allow npm rebuild to accept a path to a module + ([@nlf](https://github.com/nlf)) + +### DEPENDENCIES + +* [`beb371800`](https://github.com/npm/cli/commit/beb371800292140bf3882253c447168a378bc154) + [#2334](https://github.com/npm/cli/issues/2334) + remove unused top level dep tough-cookie + ([@darcyclarke](https://github.com/darcyclarke)) +* [`d45e181d1`](https://github.com/npm/cli/commit/d45e181d17dd88d82b3a97f8d9cd5fa5b6230e48) + [#2335](https://github.com/npm/cli/issues/2335) + `ini@2.0.0`, `@npmcli/config@1.2.7` + ([@isaacs](https://github.com/isaacs)) +* [`ef4b18b5a`](https://github.com/npm/cli/commit/ef4b18b5a70381b264d234817cff32eeb6848a73) + [#2309](https://github.com/npm/cli/issues/2309) + `@npmcli/arborist@2.0.2` + * properly remove deps when no lockfile and package.json is present +* [`c6c013e6e`](https://github.com/npm/cli/commit/c6c013e6ebc4fe036695db1fd491eb68f3b57c68) + `readdir-scoped-modules@1.1.0` +* [`a1a2134aa`](https://github.com/npm/cli/commit/a1a2134aa9a1092493db6d6c9a729ff5203f0dd4) + remove unused sorted-object dep + ([@nlf](https://github.com/nlf)) +* [`85c2a2d31`](https://github.com/npm/cli/commit/85c2a2d318ae066fb2c161174f5aea97e18bc9c5) + [#2344](https://github.com/npm/cli/issues/2344) + remove editor dependency + ([@nlf](https://github.com/nlf)) + +### TESTING + +* [`3a6dd511c`](https://github.com/npm/cli/commit/3a6dd511c944c5f2699825a99bba1dde333a45ef) + npm edit + ([@nlf](https://github.com/nlf)) +* [`3ba5de4e7`](https://github.com/npm/cli/commit/3ba5de4e7f6c5c0f995a29844926d6ed2833addd) + [#2347](https://github.com/npm/cli/issues/2347) + npm help-search + ([@nlf](https://github.com/nlf)) +* [`6caf19f49`](https://github.com/npm/cli/commit/6caf19f491e144be3e2a1a50f492dad48b01f361) + [#2348](https://github.com/npm/cli/issues/2348) + npm help + ([@nlf](https://github.com/nlf)) +* [`cb5847e32`](https://github.com/npm/cli/commit/cb5847e3203c52062485b5de68e4f6d29b33c361) + [#2349](https://github.com/npm/cli/issues/2349) + npm hook + ([@nlf](https://github.com/nlf)) +* [`996a2f6b1`](https://github.com/npm/cli/commit/996a2f6b130d6678998a2f6a5ec97d75534d5f66) + [#2353](https://github.com/npm/cli/issues/2353) + npm org + ([@nlf](https://github.com/nlf)) +* [`8c67c38a4`](https://github.com/npm/cli/commit/8c67c38a4f476ff5be938db6b6b3ee9ac6b44db5) + [#2354](https://github.com/npm/cli/issues/2354) + npm set + ([@nlf](https://github.com/nlf)) + +## 7.1.2 (2020-12-11) + +### DEPENDENCIES + +* [`c3ba1daf7`](https://github.com/npm/cli/commit/c3ba1daf7cd335d72aeba80ae0e9f9d215ca9ea5) + [#2033](https://github.com/npm/cli/issues/2033) `@npmcli/config@1.2.6`: + * Set `INIT_CWD` to initial current working directory + * Set `NODE` to initial process.execPath +* [`8029608b9`](https://github.com/npm/cli/commit/8029608b914fe5ba35a7cd37ae95ab93b0532e2e) + `json-parse-even-better-errors@2.3.1` +* [`0233818e6`](https://github.com/npm/cli/commit/0233818e606888b80881b17a2c6aca9f10a619b2) + [#2332](https://github.com/npm/cli/issues/2332) `treeverse@1.0.4` +* [`e401d6bb3`](https://github.com/npm/cli/commit/e401d6bb37ffc767b4fefe89878dd3c3ef490b2c) + `ini@1.3.8` +* [`011bb1220`](https://github.com/npm/cli/commit/011bb122035dcd43769ec35982662cca41635068) + [#2320](https://github.com/npm/cli/issues/2320) `@npmcli/arborist@2.0.1`: + * Do not save with `^` and no version + +### BUGFIXES + +* [`244c2069f`](https://github.com/npm/cli/commit/244c2069fd093f053d3061c85575ac13e72e2454) + [#2325](https://github.com/npm/cli/issues/2325) npm search + include/exclude ([@ruyadorno](https://github.com/ruyadorno)) +* [`d825e901e`](https://github.com/npm/cli/commit/d825e901eceea4cf8d860e35238dc30008eb4da4) + [#1905](https://github.com/npm/cli/issues/1905) + [#2316](https://github.com/npm/cli/issues/2316) run install scripts for + root project +* [`315449142`](https://github.com/npm/cli/commit/31544914294948085a84097af7f0f5de2a2e8f7e) + [#2331](https://github.com/npm/cli/issues/2331) + [#2021](https://github.com/npm/cli/issues/2021) Set `NODE_ENV=production` + if 'dev' is on the omit list ([@isaacs](https://github.com/isaacs)) + +### TESTING + +* [`c243e3b9d`](https://github.com/npm/cli/commit/c243e3b9d9bda0580a0fc1b3e230b4d47412176e) + [#2313](https://github.com/npm/cli/issues/2313) tests: completion + ([@nlf](https://github.com/nlf)) +* [`7ff6efbb8`](https://github.com/npm/cli/commit/7ff6efbb866591b2330b967215cef8146dff3ebf) + [#2314](https://github.com/npm/cli/issues/2314) npm team + ([@ruyadorno](https://github.com/ruyadorno)) +* [`7a4f0c96c`](https://github.com/npm/cli/commit/7a4f0c96c2ab9f264f7bda2caf7e72c881571270) + [#2323](https://github.com/npm/cli/issues/2323) npm doctor + ([@nlf](https://github.com/nlf)) + +### DOCUMENTATION + +* [`e340cf64b`](https://github.com/npm/cli/commit/e340cf64ba31ef329a9049b60c32ffd0342cfb7d) + [#2330](https://github.com/npm/cli/issues/2330) explain through + run-script ([@isaacs](https://github.com/isaacs)) + +## 7.1.1 (2020-12-08) + +### DEPENDENCIES + +* [`bf09e719c`](https://github.com/npm/cli/commit/bf09e719c7f563a255b1e9af6b1237ebc5598db6) + `@npmcli/arborist@2.0.0` + * Much stricter tree integrity guarantees + * Fix issues where the root project is a symlink, or linked as a + workspace +* [`7ceb5b728`](https://github.com/npm/cli/commit/7ceb5b728b9f326c567f5ffe5831c9eccf013aa0) + `ini@1.3.6` +* [`77c6ced2a`](https://github.com/npm/cli/commit/77c6ced2a6daaadbff715c8f05b2e61ba76e9bab) + `make-fetch-happen@8.0.11` + * Avoid caching headers that are hazardous or unnecessary to leave + lying around (authorization, npm-session, etc.) + * [#38](https://github.com/npm/make-fetch-happen/pull/38) Include query + string in cache key ([@jpb](https://github.com/jpb)) +* [`0ef25b6cd`](https://github.com/npm/cli/commit/0ef25b6cd2921794d36f066e2b11c406342cf167) + `libnpmsearch@3.1.0`: + * Update to accept query params as options, so we can paginate. + ([@nlf](https://github.com/nlf)) +* [`518a66450`](https://github.com/npm/cli/commit/518a664500bcde30475788e8c1c3e651f23e881b) + `@npmcli/config@1.2.4`: + * Do not allow path options to be set to a boolean `false` value +* [`3d7aff9d8`](https://github.com/npm/cli/commit/3d7aff9d8dd1cf29956aa306464cd44fbc2af426) + update all dependencies using latest npm to install them + +### TESTS + +* [`2848f5940`](https://github.com/npm/cli/commit/2848f594034b87939bfc5546e3e603f123d98a01) + [npm/statusboard#173](https://github.com/npm/statusboard/issues/173) + [#2293](https://github.com/npm/cli/issues/2293) npm shrinkwrap + ([@ruyadorno](https://github.com/ruyadorno)) +* [`f6824459a`](https://github.com/npm/cli/commit/f6824459ae0c86e2fa9c84b3dcec85f572ae8e1b) + [#2302](https://github.com/npm/cli/issues/2302) npm deprecate + ([@nlf](https://github.com/nlf)) +* [`b7d74b627`](https://github.com/npm/cli/commit/b7d74b627859f08fca23209d6e0d3ec6657a4489) + [npm/statusboard#180](https://github.com/npm/statusboard/issues/180) + [#2304](https://github.com/npm/cli/issues/2304) npm unpublish + ([@ruyadorno](https://github.com/ruyadorno)) + +### FEATURES + +* [`3db90d944`](https://github.com/npm/cli/commit/3db90d94474f673591811fdab5eb6a5bfdeba261) + [#2303](https://github.com/npm/cli/issues/2303) allow for passing object + keys to searchopts to allow pagination ([@nlf](https://github.com/nlf)) + +## 7.1.0 (2020-12-04) + +### FEATURES + +* [`6b1575110`](https://github.com/npm/cli/commit/6b15751106beb99234aa4bf39ae05cf40076d42a) + [#2237](https://github.com/npm/cli/pull/2237) + add `npm set-script` command + ([@Yash-Singh1](https://github.com/Yash-Singh1)) +* [`15d7333f8`](https://github.com/npm/cli/commit/15d7333f832e3d68ae16895569f27a27ef86573e) + add interactive `npm exec` + ([@isaacs](https://github.com/isaacs)) + +### BUG FIXES + +* [`2a1192e4b`](https://github.com/npm/cli/commit/2a1192e4b03acdf6e6e24e58de68f736ab9bb35f) + [#2202](https://github.com/npm/cli/pull/2202) + Do not run interactive `npm exec` in CI when a TTY + ([@isaacs](https://github.com/isaacs)) + +### DOCUMENTATION + +* [`0599cc37d`](https://github.com/npm/cli/commit/0599cc37df453bf79d47490eb4fca3cd63f67f80) + [#2271](https://github.com/npm/cli/pull/2271) + don't wrap code block + ([@ethomson](https://github.com/ethomson)) + +### DEPENDENCIES + +* [`def85c726`](https://github.com/npm/cli/commit/def85c72640ffe2d27977c56b7aa06c6f6346ca9) + `@npmcli/arborist@1.0.14` + * fixes running `npm exec` from file system root folder +* [`4c94673ab`](https://github.com/npm/cli/commit/4c94673ab5399d27e5a48e52f7a65b038a456265) + `semver@7.3.4` + ## 7.0.15 (2020-11-27) ### DEPENDENCIES @@ -787,7 +1049,7 @@ * fix package.json dependencies order * [`49b2bf5a7`](https://github.com/npm/cli/commit/49b2bf5a798b49d52166744088a80b8a39ccaeb6) `@npmcli/config@1.1.8` - * fix unkown envs to be passed through + * fix unknown envs to be passed through * fix setting correct globalPrefix on load * [`f9aac351d`](https://github.com/npm/cli/commit/f9aac351dd36a19d14e1f951a2e8e20b41545822) `libnpmversion@1.0.5` diff --git a/deps/npm/Makefile b/deps/npm/Makefile index 83046c59aca9b2..4c96615203b026 100644 --- a/deps/npm/Makefile +++ b/deps/npm/Makefile @@ -88,13 +88,13 @@ prune: @[[ "$(shell git status -s)" != "" ]] && echo "ERR: found unpruned files" && exit 1 || echo "git status is clean" -publish: gitclean ls-ok link test docs-clean docs prune +publish: gitclean ls-ok link test docs prune @git push origin :v$(shell node bin/npm-cli.js --no-timing -v) 2>&1 || true git push origin $(BRANCH) &&\ git push origin --tags &&\ node bin/npm-cli.js publish --tag=$(PUBLISHTAG) -release: gitclean ls-ok docs-clean docs prune +release: gitclean ls-ok docs prune @bash scripts/release.sh .PHONY: all latest install dev link docs clean uninstall test man docs-clean docsclean release ls-ok dev-deps prune diff --git a/deps/npm/README.md b/deps/npm/README.md index 05da169f259619..3366c4b271f739 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -150,6 +150,8 @@ you should [read this](https://docs.npmjs.com/misc/developers). When you find issues, please report them: * web: + +* archived web: Be sure to include *all* of the output from the npm command that didn't work diff --git a/deps/npm/docs/content/commands/npm-config.md b/deps/npm/docs/content/commands/npm-config.md index ebff540eedfb98..51caa5a61b6075 100644 --- a/deps/npm/docs/content/commands/npm-config.md +++ b/deps/npm/docs/content/commands/npm-config.md @@ -7,15 +7,15 @@ description: Manage the npm configuration files ### Synopsis ```bash -npm config set [-g|--global] -npm config get -npm config delete -npm config list [-l] [--json] +npm config set = [= ...] +npm config get [ [ ...]] +npm config delete [ ...] +npm config list [--json] npm config edit -npm get -npm set [-g|--global] +npm set = [= ...] +npm get [ [ ...]] -aliases: c +alias: c ``` ### Description @@ -39,20 +39,31 @@ Config supports the following sub-commands: #### set ```bash -npm config set key value +npm config set key=value [key=value...] +npm set key=value [key=value...] ``` -Sets the config key to the value. +Sets each of the config keys to the value provided. -If value is omitted, then it sets it to "true". +If value is omitted, then it sets it to an empty string. + +Note: for backwards compatibility, `npm config set key value` is supported +as an alias for `npm config set key=value`. #### get ```bash -npm config get key +npm config get [key ...] +npm get [key ...] ``` -Echo the config value to stdout. +Echo the config value(s) to stdout. + +If multiple keys are provided, then the values will be prefixed with the +key names. + +If no keys are provided, then this command behaves the same as `npm config +list`. #### list @@ -66,10 +77,10 @@ to show the settings in json format. #### delete ```bash -npm config delete key +npm config delete key [key ...] ``` -Deletes the key from all configuration files. +Deletes the specified keys from all configuration files. #### edit diff --git a/deps/npm/docs/content/commands/npm-deprecate.md b/deps/npm/docs/content/commands/npm-deprecate.md index d0440efe890215..139441856bb068 100644 --- a/deps/npm/docs/content/commands/npm-deprecate.md +++ b/deps/npm/docs/content/commands/npm-deprecate.md @@ -7,7 +7,7 @@ description: Deprecate a version of a package ### Synopsis ```bash -npm deprecate [@] +npm deprecate [@] ``` ### Description @@ -22,8 +22,17 @@ versions, so you can do something like this: npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3" ``` -Note that you must be the package owner to deprecate something. See the -`owner` and `adduser` help topics. +SemVer ranges passed to this command are interpreted such that they *do* +include prerelease versions. For example: + +```bash +npm deprecate my-thing@1.x "1.x is no longer supported" +``` + +In this case, a version `my-thing@1.0.0-beta.0` will also be deprecated. + +You must be the package owner to deprecate something. See the `owner` and +`adduser` help topics. To un-deprecate a package, specify an empty string (`""`) for the `message` argument. Note that you must use double quotes with no space between them to diff --git a/deps/npm/docs/content/commands/npm-dist-tag.md b/deps/npm/docs/content/commands/npm-dist-tag.md index 65ce22a179fc7f..585da16ad2d2c4 100644 --- a/deps/npm/docs/content/commands/npm-dist-tag.md +++ b/deps/npm/docs/content/commands/npm-dist-tag.md @@ -78,8 +78,8 @@ This command used to be known as `npm tag`, which only created new tags, and so had a different syntax. Tags must share a namespace with version numbers, because they are -specified in the same slot: `npm install @` vs `npm install -@`. +specified in the same slot: `npm install @` vs +`npm install @`. Tags that can be interpreted as valid semver ranges will be rejected. For example, `v1.4` cannot be used as a tag, because it is interpreted by diff --git a/deps/npm/docs/content/commands/npm-exec.md b/deps/npm/docs/content/commands/npm-exec.md index c9de9933be3a55..3ae30fa0cba9a7 100644 --- a/deps/npm/docs/content/commands/npm-exec.md +++ b/deps/npm/docs/content/commands/npm-exec.md @@ -16,9 +16,11 @@ npx [@] [args...] npx -p [@] [args...] npx -c ' [args...]' npx -p [@] -c ' [args...]' +Run without --call or positional args to open interactive subshell alias: npm x, npx +common options: --package= (may be specified multiple times) -p is a shorthand for --package only when using npx executable -c --call= (may not be mixed with positional arguments) @@ -30,6 +32,11 @@ This command allows you to run an arbitrary command from an npm package (either one installed locally, or fetched remotely), in a similar context as running it via `npm run`. +Run without positional arguments or `--call`, this allows you to +interactively run commands in the same sort of shell environment that +`package.json` scripts are run. Interactive mode is not supported in CI +environments when standard input is a TTY, to prevent hangs. + Whatever packages are specified by the `--package` option will be provided in the `PATH` of the executed command, along with any locally installed package executables. The `--package` option may be diff --git a/deps/npm/docs/content/commands/npm-explain.md b/deps/npm/docs/content/commands/npm-explain.md index fe7485d61acd8b..ec63ec34f26d8a 100644 --- a/deps/npm/docs/content/commands/npm-explain.md +++ b/deps/npm/docs/content/commands/npm-explain.md @@ -8,6 +8,8 @@ description: Explain installed packages ```bash npm explain + +alias: why ``` ### Description diff --git a/deps/npm/docs/content/commands/npm-link.md b/deps/npm/docs/content/commands/npm-link.md index 7c55f18c5a431d..1a835001fc64f8 100644 --- a/deps/npm/docs/content/commands/npm-link.md +++ b/deps/npm/docs/content/commands/npm-link.md @@ -15,41 +15,44 @@ alias: npm ln ### Description +This is handy for installing your own stuff, so that you can work on it and +test iteratively without having to continually rebuild. + Package linking is a two-step process. -First, `npm link` in a package folder will create a symlink in the global folder -`{prefix}/lib/node_modules/` that links to the package where the `npm -link` command was executed. It will also link any bins in the package to `{prefix}/bin/{name}`. -Note that `npm link` uses the global prefix (see `npm prefix -g` for its value). +First, `npm link` in a package folder will create a symlink in the global +folder `{prefix}/lib/node_modules/` that links to the package +where the `npm link` command was executed. It will also link any bins in +the package to `{prefix}/bin/{name}`. Note that `npm link` uses the global +prefix (see `npm prefix -g` for its value). Next, in some other location, `npm link package-name` will create a -symbolic link from globally-installed `package-name` to `node_modules/` -of the current folder. +symbolic link from globally-installed `package-name` to `node_modules/` of +the current folder. -Note that `package-name` is taken from `package.json`, -not from directory name. +Note that `package-name` is taken from `package.json`, _not_ from the +directory name. -The package name can be optionally prefixed with a scope. See [`scope`](/using-npm/scope). -The scope must be preceded by an @-symbol and followed by a slash. +The package name can be optionally prefixed with a scope. See +[`scope`](/using-npm/scope). The scope must be preceded by an @-symbol and +followed by a slash. When creating tarballs for `npm publish`, the linked packages are -"snapshotted" to their current state by resolving the symbolic links. - -This is handy for installing your own stuff, so that you can work on it and -test it iteratively without having to continually rebuild. +"snapshotted" to their current state by resolving the symbolic links, if +they are included in `bundleDependencies`. For example: ```bash - cd ~/projects/node-redis # go into the package directory - npm link # creates global link - cd ~/projects/node-bloggy # go into some other package directory. - npm link redis # link-install the package +cd ~/projects/node-redis # go into the package directory +npm link # creates global link +cd ~/projects/node-bloggy # go into some other package directory. +npm link redis # link-install the package ``` -Now, any changes to ~/projects/node-redis will be reflected in -~/projects/node-bloggy/node_modules/node-redis/. Note that the link should -be to the package name, not the directory name for that package. +Now, any changes to `~/projects/node-redis` will be reflected in +`~/projects/node-bloggy/node_modules/node-redis/`. Note that the link +should be to the package name, not the directory name for that package. You may also shortcut the two steps in one. For example, to do the above use-case in a shorter way: @@ -69,15 +72,33 @@ npm link redis That is, it first creates a global link, and then links the global installation target into your project's `node_modules` folder. -Note that in this case, you are referring to the directory name, `node-redis`, -rather than the package name `redis`. +Note that in this case, you are referring to the directory name, +`node-redis`, rather than the package name `redis`. -If your linked package is scoped (see [`scope`](/using-npm/scope)) your link command must include that scope, e.g. +If your linked package is scoped (see [`scope`](/using-npm/scope)) your +link command must include that scope, e.g. ```bash npm link @myorg/privatepackage ``` +### Caveat + +Note that package dependencies linked in this way are _not_ saved to +`package.json` by default, on the assumption that the intention is to have +a link stand in for a regular non-link dependency. Otherwise, for example, +if you depend on `redis@^3.0.1`, and ran `npm link redis`, it would replace +the `^3.0.1` dependency with `file:../path/to/node-redis`, which you +probably don't want! Additionally, other users or developers on your +project would run into issues if they do not have their folders set up +exactly the same as yours. + +If you are adding a _new_ dependency as a link, you should add it to the +relevant metadata by running `npm install --package-lock-only`. + +If you _want_ to save the `file:` reference in your `package.json` and +`package-lock.json` files, you can use `npm link --save` to do so. + ### See Also * [npm developers](/using-npm/developers) diff --git a/deps/npm/docs/content/commands/npm-logout.md b/deps/npm/docs/content/commands/npm-logout.md index b1f344af576f34..7fa858a99993d2 100644 --- a/deps/npm/docs/content/commands/npm-logout.md +++ b/deps/npm/docs/content/commands/npm-logout.md @@ -12,13 +12,13 @@ npm logout [--registry=] [--scope=<@scope>] ### Description -When logged into a registry that supports token-based authentication, tell the -server to end this token's session. This will invalidate the token everywhere -you're using it, not just for the current environment. +When logged into a registry that supports token-based authentication, tell +the server to end this token's session. This will invalidate the token +everywhere you're using it, not just for the current environment. -When logged into a legacy registry that uses username and password authentication, this will -clear the credentials in your user configuration. In this case, it will _only_ affect -the current environment. +When logged into a legacy registry that uses username and password +authentication, this will clear the credentials in your user configuration. +In this case, it will _only_ affect the current environment. If `--scope` is provided, this will find the credentials for the registry connected to that scope, if set. diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index c6e2af3314bfbd..54787bd6389c6c 100644 --- a/deps/npm/docs/content/commands/npm-ls.md +++ b/deps/npm/docs/content/commands/npm-ls.md @@ -15,17 +15,21 @@ aliases: list, la, ll ### Description This command will print to stdout all the versions of packages that are -installed, as well as their dependencies, in a tree-structure. +installed, as well as their dependencies when `--all` is specified, in a +tree structure. -Positional arguments are `name@version-range` identifiers, which will -limit the results to only the paths to the packages named. Note that -nested packages will *also* show the paths to the specified packages. -For example, running `npm ls promzard` in npm's source tree will show: +Note: to get a "bottoms up" view of why a given package is included in the +tree at all, use [`npm explain`](/commands/npm-explain). + +Positional arguments are `name@version-range` identifiers, which will limit +the results to only the paths to the packages named. Note that nested +packages will *also* show the paths to the specified packages. For +example, running `npm ls promzard` in npm's source tree will show: ```bash - npm@@VERSION@ /path/to/npm - └─┬ init-package-json@0.0.4 - └── promzard@0.1.5 +npm@@VERSION@ /path/to/npm +└─┬ init-package-json@0.0.4 + └── promzard@0.1.5 ``` It will print out extraneous, missing, and invalid packages. @@ -35,12 +39,49 @@ in parentheses after the name@version to make it easier for users to recognize potential forks of a project. The tree shown is the logical dependency tree, based on package -dependencies, not the physical layout of your node_modules folder. +dependencies, not the physical layout of your `node_modules` folder. When run as `ll` or `la`, it shows extended information by default. +### Note: Design Changes Pending + +The `npm ls` command's output and behavior made a _ton_ of sense when npm +created a `node_modules` folder that naively nested every dependency. In +such a case, the logical dependency graph and physical tree of packages on +disk would be roughly identical. + +With the advent of automatic install-time deduplication of dependencies in +npm v3, the `ls` output was modified to display the logical dependency +graph as a tree structure, since this was more useful to most users. +However, without using `npm ls -l`, it became impossible show _where_ a +package was actually installed much of the time! + +With the advent of automatic installation of `peerDependencies` in npm v7, +this gets even more curious, as `peerDependencies` are logically +"underneath" their dependents in the dependency graph, but are always +physically at or above their location on disk. + +Also, in the years since npm got an `ls` command (in version 0.0.2!), +dependency graphs have gotten much larger as a general rule. Therefor, in +order to avoid dumping an excessive amount of content to the terminal, `npm +ls` now only shows the _top_ level dependencies, unless `--all` is +provided. + +A thorough re-examination of the use cases, intention, behavior, and output +of this command, is currently underway. Expect significant changes to at +least the default human-readable `npm ls` output in npm v8. + ### Configuration +#### all + +* Default: `false` +* Type: Boolean + +When running `npm outdated` and `npm ls`, setting `--all` will show all +outdated or installed packages, rather than only those directly depended +upon by the current project. + #### json * Default: false @@ -115,6 +156,7 @@ Set it to false in order to use all-ansi output. ### See Also +* [npm explain](/commands/npm-explain) * [npm config](/commands/npm-config) * [npmrc](/configuring-npm/npmrc) * [npm folders](/configuring-npm/folders) diff --git a/deps/npm/docs/content/commands/npm-org.md b/deps/npm/docs/content/commands/npm-org.md index 2f3c6b48088669..18047d109cc0b0 100644 --- a/deps/npm/docs/content/commands/npm-org.md +++ b/deps/npm/docs/content/commands/npm-org.md @@ -52,10 +52,11 @@ $ npm org ls my-org @mx-santos ### Description -You can use the `npm org` commands to manage and view users of an organization. -It supports adding and removing users, changing their roles, listing them, and -finding specific ones and their roles. +You can use the `npm org` commands to manage and view users of an +organization. It supports adding and removing users, changing their roles, +listing them, and finding specific ones and their roles. ### See Also +* [using orgs](/using-npm/orgs) * [Documentation on npm Orgs](https://docs.npmjs.com/orgs/) diff --git a/deps/npm/docs/content/commands/npm-outdated.md b/deps/npm/docs/content/commands/npm-outdated.md index 01ad780867d057..ee1157f332de08 100644 --- a/deps/npm/docs/content/commands/npm-outdated.md +++ b/deps/npm/docs/content/commands/npm-outdated.md @@ -15,25 +15,34 @@ npm outdated [[<@scope>/] ...] This command will check the registry to see if any (or, specific) installed packages are currently outdated. +By default, only the direct dependencies of the root project are shown. +Use `--all` to find all outdated meta-dependencies as well. + In the output: * `wanted` is the maximum version of the package that satisfies the semver - range specified in `package.json`. If there's no available semver range (i.e. - you're running `npm outdated --global`, or the package isn't included in - `package.json`), then `wanted` shows the currently-installed version. + range specified in `package.json`. If there's no available semver range + (i.e. you're running `npm outdated --global`, or the package isn't + included in `package.json`), then `wanted` shows the currently-installed + version. * `latest` is the version of the package tagged as latest in the registry. - Running `npm publish` with no special configuration will publish the package - with a dist-tag of `latest`. This may or may not be the maximum version of - the package, or the most-recently published version of the package, depending - on how the package's developer manages the latest [dist-tag](npm-dist-tag). + Running `npm publish` with no special configuration will publish the + package with a dist-tag of `latest`. This may or may not be the maximum + version of the package, or the most-recently published version of the + package, depending on how the package's developer manages the latest + [dist-tag](/commands/npm-dist-tag). * `location` is where in the physical tree the package is located. * `depended by` shows which package depends on the displayed dependency -* `package type` (when using `--long` / `-l`) tells you whether this package is - a `dependency` or a dev/peer/optional dependency. Packages not included in `package.json` - are always marked `dependencies`. -* `homepage` (when using `--long` / `-l`) is the `homepage` value contained in the package's packument -* Red means there's a newer version matching your semver requirements, so you should update now. -* Yellow indicates that there's a newer version above your semver requirements (usually new major, or new 0.x minor) so proceed with caution. +* `package type` (when using `--long` / `-l`) tells you whether this + package is a `dependency` or a dev/peer/optional dependency. Packages not + included in `package.json` are always marked `dependencies`. +* `homepage` (when using `--long` / `-l`) is the `homepage` value contained + in the package's packument +* Red means there's a newer version matching your semver requirements, so + you should update now. +* Yellow indicates that there's a newer version _above_ your semver + requirements (usually new major, or new 0.x minor) so proceed with + caution. ### An example @@ -59,19 +68,20 @@ With these `dependencies`: A few things to note: -* `glob` requires `^5`, which prevents npm from installing `glob@6`, which is - outside the semver range. -* Git dependencies will always be reinstalled, because of how they're specified. - The installed committish might satisfy the dependency specifier (if it's - something immutable, like a commit SHA), or it might not, so `npm outdated` and - `npm update` have to fetch Git repos to check. This is why currently doing a - reinstall of a Git dependency always forces a new clone and install. -* `npm@3.5.2` is marked as "wanted", but "latest" is `npm@3.5.1` because npm - uses dist-tags to manage its `latest` and `next` release channels. `npm update` - will install the _newest_ version, but `npm install npm` (with no semver range) - will install whatever's tagged as `latest`. -* `once` is just plain out of date. Reinstalling `node_modules` from scratch or - running `npm update` will bring it up to spec. +* `glob` requires `^5`, which prevents npm from installing `glob@6`, which + is outside the semver range. +* Git dependencies will always be reinstalled, because of how they're + specified. The installed committish might satisfy the dependency + specifier (if it's something immutable, like a commit SHA), or it might + not, so `npm outdated` and `npm update` have to fetch Git repos to check. + This is why currently doing a reinstall of a Git dependency always forces + a new clone and install. +* `npm@3.5.2` is marked as "wanted", but "latest" is `npm@3.5.1` because + npm uses dist-tags to manage its `latest` and `next` release channels. + `npm update` will install the _newest_ version, but `npm install npm` + (with no semver range) will install whatever's tagged as `latest`. +* `once` is just plain out of date. Reinstalling `node_modules` from + scratch or running `npm update` will bring it up to spec. ### Configuration diff --git a/deps/npm/docs/content/commands/npm-owner.md b/deps/npm/docs/content/commands/npm-owner.md index 3c984ebd856201..6479f3bdd11f42 100644 --- a/deps/npm/docs/content/commands/npm-owner.md +++ b/deps/npm/docs/content/commands/npm-owner.md @@ -18,26 +18,24 @@ aliases: author Manage ownership of published packages. -* ls: - List all the users who have access to modify a package and push new versions. - Handy when you need to know who to bug for help. -* add: - Add a new user as a maintainer of a package. This user is enabled to modify - metadata, publish new versions, and add other owners. -* rm: - Remove a user from the package owner list. This immediately revokes their - privileges. +* ls: List all the users who have access to modify a package and push new + versions. Handy when you need to know who to bug for help. +* add: Add a new user as a maintainer of a package. This user is enabled + to modify metadata, publish new versions, and add other owners. +* rm: Remove a user from the package owner list. This immediately revokes + their privileges. Note that there is only one level of access. Either you can modify a package, or you can't. Future versions may contain more fine-grained access levels, but that is not implemented at this time. -If you have two-factor authentication enabled with `auth-and-writes` then -you'll need to include an otp on the command line when changing ownership -with `--otp`. +If you have two-factor authentication enabled with `auth-and-writes` (see +[`npm-profile`](/commands/npm-profile)) then you'll need to include an otp +on the command line when changing ownership with `--otp`. ### See Also +* [npm profile](/commands/npm-profile) * [npm publish](/commands/npm-publish) * [npm registry](/using-npm/registry) * [npm adduser](/commands/npm-adduser) diff --git a/deps/npm/docs/content/commands/npm-pack.md b/deps/npm/docs/content/commands/npm-pack.md index adb5d30832cb8f..cc6b669efb1ef6 100644 --- a/deps/npm/docs/content/commands/npm-pack.md +++ b/deps/npm/docs/content/commands/npm-pack.md @@ -13,10 +13,10 @@ npm pack [[<@scope>/]...] [--dry-run] ### Description For anything that's installable (that is, a package folder, tarball, -tarball url, name@tag, name@version, name, or scoped name), this -command will fetch it to the cache, and then copy the tarball to the -current working directory as `-.tgz`, and then write -the filenames out to stdout. +tarball url, git url, name@tag, name@version, name, or scoped name), this +command will fetch it to the cache, copy the tarball to the current working +directory as `-.tgz`, and then write the filenames out to +stdout. If the same package is specified multiple times, then the file will be overwritten the second time. @@ -24,10 +24,12 @@ overwritten the second time. If no arguments are supplied, then npm packs the current package folder. The `--dry-run` argument will do everything that pack usually does without -actually packing anything. Reports on what would have gone into the tarball. +actually packing anything. That is, it reports on what would have gone +into the tarball, but nothing else. ### See Also +* [npm-packlist package](http://npm.im/npm-packlist) * [npm cache](/commands/npm-cache) * [npm publish](/commands/npm-publish) * [npm config](/commands/npm-config) diff --git a/deps/npm/docs/content/commands/npm-ping.md b/deps/npm/docs/content/commands/npm-ping.md index bc2233da74f0c2..8de06aa1848361 100644 --- a/deps/npm/docs/content/commands/npm-ping.md +++ b/deps/npm/docs/content/commands/npm-ping.md @@ -25,5 +25,6 @@ Ping error: {*Detail about error} ### See Also +* [npm doctor](/commands/npm-doctor) * [npm config](/commands/npm-config) * [npmrc](/configuring-npm/npmrc) diff --git a/deps/npm/docs/content/commands/npm-profile.md b/deps/npm/docs/content/commands/npm-profile.md index d44c994167f053..88edf26d87c410 100644 --- a/deps/npm/docs/content/commands/npm-profile.md +++ b/deps/npm/docs/content/commands/npm-profile.md @@ -16,12 +16,12 @@ npm profile disable-2fa ### Description -Change your profile information on the registry. This not be available if -you're using a non-npmjs registry. +Change your profile information on the registry. Note that this command +depends on the registry implementation, so third-party registries may not +support this interface. -* `npm profile get []`: - Display all of the properties of your profile, or one or more specific - properties. It looks like: +* `npm profile get []`: Display all of the properties of your + profile, or one or more specific properties. It looks like: ```bash +-----------------+---------------------------+ @@ -46,27 +46,26 @@ you're using a non-npmjs registry. | updated | 2017-10-02T21:29:45.922Z | +-----------------+---------------------------+ ``` - -* `npm profile set `: - Set the value of a profile property. You can set the following properties this way: - email, fullname, homepage, freenode, twitter, github -* `npm profile set password`: - Change your password. This is interactive, you'll be prompted for your - current password and a new password. You'll also be prompted for an OTP - if you have two-factor authentication enabled. +* `npm profile set `: Set the value of a profile + property. You can set the following properties this way: email, fullname, + homepage, freenode, twitter, github -* `npm profile enable-2fa [auth-and-writes|auth-only]`: - Enables two-factor authentication. Defaults to `auth-and-writes` mode. Modes are: +* `npm profile set password`: Change your password. This is interactive, + you'll be prompted for your current password and a new password. You'll + also be prompted for an OTP if you have two-factor authentication + enabled. + +* `npm profile enable-2fa [auth-and-writes|auth-only]`: Enables two-factor + authentication. Defaults to `auth-and-writes` mode. Modes are: * `auth-only`: Require an OTP when logging in or making changes to your account's authentication. The OTP will be required on both the website and the command line. - * `auth-and-writes`: Requires an OTP at all the times `auth-only` does, and also requires one when - publishing a module, setting the `latest` dist-tag, or changing access - via `npm access` and `npm owner`. + * `auth-and-writes`: Requires an OTP at all the times `auth-only` does, + and also requires one when publishing a module, setting the `latest` + dist-tag, or changing access via `npm access` and `npm owner`. -* `npm profile disable-2fa`: - Disables two-factor authentication. +* `npm profile disable-2fa`: Disables two-factor authentication. ### Details @@ -76,4 +75,6 @@ available on non npmjs.com registries. ### See Also +* [npm adduser](/commands/npm-adduser) +* [npm logout](/commands/npm-logout) * [npm config](/commands/npm-config) diff --git a/deps/npm/docs/content/commands/npm-prune.md b/deps/npm/docs/content/commands/npm-prune.md index 1a100e9d88ad75..088c1c3470fafa 100644 --- a/deps/npm/docs/content/commands/npm-prune.md +++ b/deps/npm/docs/content/commands/npm-prune.md @@ -12,29 +12,26 @@ npm prune [[<@scope>/]...] [--production] [--dry-run] [--json] ### Description -This command removes "extraneous" packages. If a package name is -provided, then only packages matching one of the supplied names are -removed. +This command removes "extraneous" packages. If a package name is provided, +then only packages matching one of the supplied names are removed. -Extraneous packages are packages that are not listed on the parent -package's dependencies list. +Extraneous packages are those present in the `node_modules` folder that are +not listed as any package's dependency list. If the `--production` flag is specified or the `NODE_ENV` environment variable is set to `production`, this command will remove the packages -specified in your `devDependencies`. Setting `--no-production` will -negate `NODE_ENV` being set to `production`. +specified in your `devDependencies`. Setting `--no-production` will negate +`NODE_ENV` being set to `production`. If the `--dry-run` flag is used then no changes will actually be made. -If the `--json` flag is used then the changes `npm prune` made (or would +If the `--json` flag is used, then the changes `npm prune` made (or would have made with `--dry-run`) are printed as a JSON object. -In normal operation with package-locks enabled, extraneous modules are -pruned automatically when modules are installed and you'll only need -this command with the `--production` flag. - -If you've disabled package-locks then extraneous modules will not be removed -and it's up to you to run `npm prune` from time-to-time to remove them. +In normal operation, extraneous modules are pruned automatically, so you'll +only need this command with the `--production` flag. However, in the real +world, operation is not always "normal". When crashes or mistakes happen, +this command can help clean up any resulting garbage. ### See Also diff --git a/deps/npm/docs/content/commands/npm-publish.md b/deps/npm/docs/content/commands/npm-publish.md index 3dcdc6f3022ed4..fc13e672223589 100644 --- a/deps/npm/docs/content/commands/npm-publish.md +++ b/deps/npm/docs/content/commands/npm-publish.md @@ -15,59 +15,91 @@ Sets tag 'latest' if no --tag specified ### Description -Publishes a package to the registry so that it can be installed by name. All -files in the package directory are included if no local `.gitignore` or -`.npmignore` file exists. If both files exist and a file is ignored by -`.gitignore` but not by `.npmignore` then it will be included. See -[`developers`](/using-npm/developers) for full details on what's included in the published package, as well as details on how the package is built. +Publishes a package to the registry so that it can be installed by name. -By default npm will publish to the public registry. This can be overridden by -specifying a different default registry or using a [`scope`](/using-npm/scope) in the name (see [`package.json`](/configuring-npm/package-json)). +By default npm will publish to the public registry. This can be overridden +by specifying a different default registry or using a +[`scope`](/using-npm/scope) in the name (see +[`package.json`](/configuring-npm/package-json)). -* ``: - A folder containing a package.json file +* ``: A folder containing a package.json file -* ``: - A url or file path to a gzipped tar archive containing a single folder - with a package.json file inside. +* ``: A url or file path to a gzipped tar archive containing a + single folder with a package.json file inside. -* `[--tag ]` - Registers the published package with the given tag, such that - `npm install @` will install this version. By default, +* `[--tag ]`: Registers the published package with the given tag, such + that `npm install @` will install this version. By default, `npm publish` updates and `npm install` installs the `latest` tag. See [`npm-dist-tag`](npm-dist-tag) for details about tags. -* `[--access ]` - Tells the registry whether this package should be published as public or - restricted. Only applies to scoped packages, which default to `restricted`. - If you don't have a paid account, you must publish with `--access public` - to publish scoped packages. +* `[--access ]`: Tells the registry whether this package + should be published as public or restricted. Only applies to scoped + packages, which default to `restricted`. If you don't have a paid + account, you must publish with `--access public` to publish scoped + packages. -* `[--otp ]` - If you have two-factor authentication enabled in `auth-and-writes` mode - then you can provide a code from your authenticator with this. If you - don't include this and you're running from a TTY then you'll be prompted. +* `[--otp ]`: If you have two-factor authentication enabled in + `auth-and-writes` mode then you can provide a code from your + authenticator with this. If you don't include this and you're running + from a TTY then you'll be prompted. -* `[--dry-run]` - As of `npm@6`, does everything publish would do except actually publishing - to the registry. Reports the details of what would have been published. +* `[--dry-run]`: As of `npm@6`, does everything publish would do except + actually publishing to the registry. Reports the details of what would + have been published. -Fails if the package name and version combination already exists in -the specified registry. +The publish will fail if the package name and version combination already +exists in the specified registry. -Once a package is published with a given name and version, that -specific name and version combination can never be used again, even if -it is removed with [`npm unpublish`](/commands/npm-unpublish). +Once a package is published with a given name and version, that specific +name and version combination can never be used again, even if it is removed +with [`npm unpublish`](/commands/npm-unpublish). As of `npm@5`, both a sha1sum and an integrity field with a sha512sum of the tarball will be submitted to the registry during publication. Subsequent installs will use the strongest supported algorithm to verify downloads. -Similar to `--dry-run` see [`npm pack`](/commands/npm-pack), which figures out the files to be -included and packs them into a tarball to be uploaded to the registry. +Similar to `--dry-run` see [`npm pack`](/commands/npm-pack), which figures +out the files to be included and packs them into a tarball to be uploaded +to the registry. + +### Files included in package + +To see what will be included in your package, run `npx npm-packlist`. All +files are included by default, with the following exceptions: + +- Certain files that are relevant to package installation and distribution + are always included. For example, `package.json`, `README.md`, + `LICENSE`, and so on. + +- If there is a "files" list in + [`package.json`](/configuring-npm/package-json), then only the files + specified will be included. (If directories are specified, then they + will be walked recursively and their contents included, subject to the + same ignore rules.) + +- If there is a `.gitignore` or `.npmignore` file, then ignored files in + that and all child directories will be excluded from the package. If + _both_ files exist, then the `.gitignore` is ignored, and only the + `.npmignore` is used. + + `.npmignore` files follow the [same pattern + rules](https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository#_ignoring) + as `.gitignore` files + +- If the file matches certain patterns, then it will _never_ be included, + unless explicitly added to the `"files"` list in `package.json`, or + un-ignored with a `!` rule in a `.npmignore` or `.gitignore` file. + +- Symbolic links are never included in npm packages. + + +See [`developers`](/using-npm/developers) for full details on what's +included in the published package, as well as details on how the package is +built. ### See Also +* [npm-packlist package](http://npm.im/npm-packlist) * [npm registry](/using-npm/registry) * [npm scope](/using-npm/scope) * [npm adduser](/commands/npm-adduser) diff --git a/deps/npm/docs/content/commands/npm-rebuild.md b/deps/npm/docs/content/commands/npm-rebuild.md index 5b6b816f68bd96..0a7ade6b165b46 100644 --- a/deps/npm/docs/content/commands/npm-rebuild.md +++ b/deps/npm/docs/content/commands/npm-rebuild.md @@ -7,16 +7,23 @@ description: Rebuild a package ### Synopsis ```bash -npm rebuild [[<@scope>/]...] +npm rebuild [[<@scope>/][@] ...] -alias: npm rb +alias: rb ``` ### Description -This command runs the `npm build` command on the matched folders. This is useful when you install a new version of node, and must recompile all your C++ addons with the new binary. +This command runs the `npm build` command on the matched folders. This is +useful when you install a new version of node, and must recompile all your +C++ addons with the new binary. It is also useful when installing with +`--ignore-scripts` and `--no-bin-links`, to explicitly choose which +packages to build and/or link bins. + +If one or more package names (and optionally version ranges) are provided, +then only packages with a name and version matching one of the specifiers +will be rebuilt. ### See Also -* [npm build](/commands/npm-build) * [npm install](/commands/npm-install) diff --git a/deps/npm/docs/content/commands/npm-repo.md b/deps/npm/docs/content/commands/npm-repo.md index c6fdf36f1d0c44..670345bece5c59 100644 --- a/deps/npm/docs/content/commands/npm-repo.md +++ b/deps/npm/docs/content/commands/npm-repo.md @@ -13,9 +13,9 @@ npm repo [ [ ...]] ### Description This command tries to guess at the likely location of a package's -repository URL, and then tries to open it using the `--browser` -config param. If no package name is provided, it will search for -a `package.json` in the current folder and use the `name` property. +repository URL, and then tries to open it using the `--browser` config +param. If no package name is provided, it will search for a `package.json` +in the current folder and use the `repository` property. ### Configuration diff --git a/deps/npm/docs/content/commands/npm-restart.md b/deps/npm/docs/content/commands/npm-restart.md index a80c54273df970..097c9fee7c9c3b 100644 --- a/deps/npm/docs/content/commands/npm-restart.md +++ b/deps/npm/docs/content/commands/npm-restart.md @@ -12,29 +12,28 @@ npm restart [-- ] ### Description -This restarts a package. +This restarts a project. It is equivalent to running `npm run-script +restart`. -This runs a package's "stop", "restart", and "start" scripts, and associated -pre- and post- scripts, in the order given below: +If the current project has a `"restart"` script specified in +`package.json`, then the following scripts will be run: + +1. prerestart +2. restart +3. postrestart + +If it does _not_ have a `"restart"` script specified, but it does have +`stop` and/or `start` scripts, then the following scripts will be run: 1. prerestart 2. prestop 3. stop 4. poststop -5. restart 6. prestart 7. start 8. poststart 9. postrestart -### Note - -Note that the "restart" script is run **in addition to** the "stop" -and "start" scripts, not instead of them. - -This is the behavior as of `npm` major version 2. A change in this -behavior will be accompanied by an increase in major version number - ### See Also * [npm run-script](/commands/npm-run-script) diff --git a/deps/npm/docs/content/commands/npm-root.md b/deps/npm/docs/content/commands/npm-root.md index 317ef9d85a5066..0d694ac876e92b 100644 --- a/deps/npm/docs/content/commands/npm-root.md +++ b/deps/npm/docs/content/commands/npm-root.md @@ -5,6 +5,7 @@ description: Display npm root --- ### Synopsis + ```bash npm root [-g] ``` @@ -13,6 +14,15 @@ npm root [-g] Print the effective `node_modules` folder to standard out. +Useful for using npm in shell scripts that do things with the +`node_modules` folder. For example: + +```bash +#!/bin/bash +global_node_modules="$(npm root --global)" +echo "Global packages installed in: ${global_node_modules}" +``` + ### See Also * [npm prefix](/commands/npm-prefix) diff --git a/deps/npm/docs/content/commands/npm-run-script.md b/deps/npm/docs/content/commands/npm-run-script.md index 06b6e9383e7fe6..b7ab20a73af473 100644 --- a/deps/npm/docs/content/commands/npm-run-script.md +++ b/deps/npm/docs/content/commands/npm-run-script.md @@ -7,23 +7,25 @@ description: Run arbitrary package scripts ### Synopsis ```bash -npm run-script [--silent] [-- ...] +npm run-script [--if-present] [--silent] [-- ] -alias: npm run +aliases: run, rum, urn ``` ### Description This runs an arbitrary command from a package's `"scripts"` object. If no -`"command"` is provided, it will list the available scripts. `run[-script]` is -used by the test, start, restart, and stop commands, but can be called -directly, as well. When the scripts in the package are printed out, they're -separated into lifecycle (test, start, restart) and directly-run scripts. +`"command"` is provided, it will list the available scripts. -As of [`npm@2.0.0`](https://blog.npmjs.org/post/98131109725/npm-2-0-0), you can -use custom arguments when executing scripts. The special option `--` is used by -[getopt](https://goo.gl/KxMmtG) to delimit the end of the options. npm will pass -all the arguments after the `--` directly to your script: +`run[-script]` is used by the test, start, restart, and stop commands, but +can be called directly, as well. When the scripts in the package are +printed out, they're separated into lifecycle (test, start, restart) and +directly-run scripts. + +Any positional arguments are passed to the specified script. Use `--` to +pass `-`-prefixed flags and options which would otherwise be parsed by npm. + +For example: ```bash npm run test -- --grep="pattern" @@ -38,41 +40,38 @@ environment variables that will be available to the script at runtime. If an built-in. In addition to the shell's pre-existing `PATH`, `npm run` adds -`node_modules/.bin` to the `PATH` provided to scripts. Any binaries provided by -locally-installed dependencies can be used without the `node_modules/.bin` -prefix. For example, if there is a `devDependency` on `tap` in your package, -you should write: +`node_modules/.bin` to the `PATH` provided to scripts. Any binaries +provided by locally-installed dependencies can be used without the +`node_modules/.bin` prefix. For example, if there is a `devDependency` on +`tap` in your package, you should write: ```bash -"scripts": {"test": "tap test/\*.js"} +"scripts": {"test": "tap test/*.js"} ``` instead of ```bash -"scripts": {"test": "node_modules/.bin/tap test/\*.js"} +"scripts": {"test": "node_modules/.bin/tap test/*.js"} ``` -to run your tests. - The actual shell your script is run within is platform dependent. By default, on Unix-like systems it is the `/bin/sh` command, on Windows it is the `cmd.exe`. The actual shell referred to by `/bin/sh` also depends on the system. -As of [`npm@5.1.0`](https://github.com/npm/npm/releases/tag/v5.1.0) you can -customize the shell with the `script-shell` configuration. - -Scripts are run from the root of the module, regardless of what your current -working directory is when you call `npm run`. If you want your script to -use different behavior based on what subdirectory you're in, you can use the -`INIT_CWD` environment variable, which holds the full path you were in when -you ran `npm run`. - -`npm run` sets the `NODE` environment variable to the `node` executable with -which `npm` is executed. Also, if the `--scripts-prepend-node-path` is passed, -the directory within which `node` resides is added to the -`PATH`. If `--scripts-prepend-node-path=auto` is passed (which has been the -default in `npm` v3), this is only performed when that `node` executable is -not found in the `PATH`. +You can customize the shell with the `script-shell` configuration. + +Scripts are run from the root of the package folder, regardless of what the +current working directory is when `npm run` is called. If you want your +script to use different behavior based on what subdirectory you're in, you +can use the `INIT_CWD` environment variable, which holds the full path you +were in when you ran `npm run`. + +`npm run` sets the `NODE` environment variable to the `node` executable +with which `npm` is executed. Also, if the `--scripts-prepend-node-path` is +passed, the directory within which `node` resides is added to the `PATH`. +If `--scripts-prepend-node-path=auto` is passed (which has been the default +in `npm` v3), this is only performed when that `node` executable is not +found in the `PATH`. If you try to run a script without having a `node_modules` directory and it fails, you will be given a warning to run `npm install`, just in case you've forgotten. diff --git a/deps/npm/docs/content/commands/npm-set-script.md b/deps/npm/docs/content/commands/npm-set-script.md new file mode 100644 index 00000000000000..7bc8f75d236537 --- /dev/null +++ b/deps/npm/docs/content/commands/npm-set-script.md @@ -0,0 +1,34 @@ +--- +title: npm-set-script +section: 1 +description: Set tasks in the scripts section of package.json +--- + +### Synopsis +An npm command that lets you create a task in the scripts section of the package.json. + +```bash +npm set-script [