21.12.16 빌드용테스트

This commit is contained in:
jinia91
2021-12-16 12:13:45 +09:00
parent e53600ad81
commit 352a9d3b4d
2750 changed files with 444550 additions and 5 deletions

6
.gitignore vendored
View File

@@ -1,9 +1,5 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
### STS ###
.apt_generated

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Binary file not shown.

View File

@@ -0,0 +1,2 @@
#Fri Nov 05 18:02:54 KST 2021
gradle.version=7.2

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,693 @@
<!--lint disable no-literal-urls-->
<p align="center">
<a href="https://nodejs.org/">
<img
alt="Node.js"
src="https://nodejs.org/static/images/logo-light.svg"
width="400"
/>
</a>
</p>
Node.js is an open-source, cross-platform, JavaScript runtime environment. It
executes JavaScript code outside of a browser. For more information on using
Node.js, see the [Node.js Website][].
The Node.js project uses an [open governance model](./GOVERNANCE.md). The
[OpenJS Foundation][] provides support for the project.
**This project is bound by a [Code of Conduct][].**
# Table of contents
* [Support](#support)
* [Release types](#release-types)
* [Download](#download)
* [Current and LTS releases](#current-and-lts-releases)
* [Nightly releases](#nightly-releases)
* [API documentation](#api-documentation)
* [Verifying binaries](#verifying-binaries)
* [Building Node.js](#building-nodejs)
* [Security](#security)
* [Contributing to Node.js](#contributing-to-nodejs)
* [Current project team members](#current-project-team-members)
* [TSC (Technical Steering Committee)](#tsc-technical-steering-committee)
* [Collaborators](#collaborators)
* [Release keys](#release-keys)
* [License](#license)
## Support
Looking for help? Check out the
[instructions for getting support](.github/SUPPORT.md).
## Release types
* **Current**: Under active development. Code for the Current release is in the
branch for its major version number (for example,
[v15.x](https://github.com/nodejs/node/tree/v15.x)). Node.js releases a new
major version every 6 months, allowing for breaking changes. This happens in
April and October every year. Releases appearing each October have a support
life of 8 months. Releases appearing each April convert to LTS (see below)
each October.
* **LTS**: Releases that receive Long Term Support, with a focus on stability
and security. Every even-numbered major version will become an LTS release.
LTS releases receive 12 months of _Active LTS_ support and a further 18 months
of _Maintenance_. LTS release lines have alphabetically-ordered code names,
beginning with v4 Argon. There are no breaking changes or feature additions,
except in some special circumstances.
* **Nightly**: Code from the Current branch built every 24-hours when there are
changes. Use with caution.
Current and LTS releases follow [Semantic Versioning](https://semver.org). A
member of the Release Team [signs](#release-keys) each Current and LTS release.
For more information, see the
[Release README](https://github.com/nodejs/Release#readme).
### Download
Binaries, installers, and source tarballs are available at
<https://nodejs.org/en/download/>.
#### Current and LTS releases
<https://nodejs.org/download/release/>
The [latest](https://nodejs.org/download/release/latest/) directory is an
alias for the latest Current release. The latest-_codename_ directory is an
alias for the latest release from an LTS line. For example, the
[latest-fermium](https://nodejs.org/download/release/latest-fermium/) directory
contains the latest Fermium (Node.js 14) release.
#### Nightly releases
<https://nodejs.org/download/nightly/>
Each directory name and filename contains a date (in UTC) and the commit
SHA at the HEAD of the release.
#### API documentation
Documentation for the latest Current release is at <https://nodejs.org/api/>.
Version-specific documentation is available in each release directory in the
_docs_ subdirectory. Version-specific documentation is also at
<https://nodejs.org/download/docs/>.
### Verifying binaries
Download directories contain a `SHASUMS256.txt` file with SHA checksums for the
files.
To download `SHASUMS256.txt` using `curl`:
```console
$ curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt
```
To check that a downloaded file matches the checksum, run
it through `sha256sum` with a command such as:
```console
$ grep node-vx.y.z.tar.gz SHASUMS256.txt | sha256sum -c -
```
For Current and LTS, the GPG detached signature of `SHASUMS256.txt` is in
`SHASUMS256.txt.sig`. You can use it with `gpg` to verify the integrity of
`SHASUMS256.txt`. You will first need to import
[the GPG keys of individuals authorized to create releases](#release-keys). To
import the keys:
```console
$ gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D
```
See the bottom of this README for a full script to import active release keys.
Next, download the `SHASUMS256.txt.sig` for the release:
```console
$ curl -O https://nodejs.org/dist/vx.y.z/SHASUMS256.txt.sig
```
Then use `gpg --verify SHASUMS256.txt.sig SHASUMS256.txt` to verify
the file's signature.
## Building Node.js
See [BUILDING.md](BUILDING.md) for instructions on how to build Node.js from
source and a list of supported platforms.
## Security
For information on reporting security vulnerabilities in Node.js, see
[SECURITY.md](./SECURITY.md).
## Contributing to Node.js
* [Contributing to the project][]
* [Working Groups][]
* [Strategic Initiatives][]
* [Technical values and prioritization][]
## Current project team members
For information about the governance of the Node.js project, see
[GOVERNANCE.md](./GOVERNANCE.md).
### TSC (Technical Steering Committee)
<!--lint disable prohibited-strings-->
* [aduh95](https://github.com/aduh95) -
**Antoine du Hamel** &lt;duhamelantoine1995@gmail.com&gt; (he/him)
* [apapirovski](https://github.com/apapirovski) -
**Anatoli Papirovski** &lt;apapirovski@mac.com&gt; (he/him)
* [BethGriggs](https://github.com/BethGriggs) -
**Beth Griggs** &lt;bgriggs@redhat.com&gt; (she/her)
* [BridgeAR](https://github.com/BridgeAR) -
**Ruben Bridgewater** &lt;ruben@bridgewater.de&gt; (he/him)
* [ChALkeR](https://github.com/ChALkeR) -
**Сковорода Никита Андреевич** &lt;chalkerx@gmail.com&gt; (he/him)
* [cjihrig](https://github.com/cjihrig) -
**Colin Ihrig** &lt;cjihrig@gmail.com&gt; (he/him)
* [codebytere](https://github.com/codebytere) -
**Shelley Vohr** &lt;codebytere@gmail.com&gt; (she/her)
* [danbev](https://github.com/danbev) -
**Daniel Bevenius** &lt;daniel.bevenius@gmail.com&gt; (he/him)
* [danielleadams](https://github.com/danielleadams) -
**Danielle Adams** &lt;adamzdanielle@gmail.com&gt; (she/her)
* [fhinkel](https://github.com/fhinkel) -
**Franziska Hinkelmann** &lt;franziska.hinkelmann@gmail.com&gt; (she/her)
* [gabrielschulhof](https://github.com/gabrielschulhof) -
**Gabriel Schulhof** &lt;gabrielschulhof@gmail.com&gt;
* [gireeshpunathil](https://github.com/gireeshpunathil) -
**Gireesh Punathil** &lt;gpunathi@in.ibm.com&gt; (he/him)
* [jasnell](https://github.com/jasnell) -
**James M Snell** &lt;jasnell@gmail.com&gt; (he/him)
* [joyeecheung](https://github.com/joyeecheung) -
**Joyee Cheung** &lt;joyeec9h3@gmail.com&gt; (she/her)
* [mcollina](https://github.com/mcollina) -
**Matteo Collina** &lt;matteo.collina@gmail.com&gt; (he/him)
* [mhdawson](https://github.com/mhdawson) -
**Michael Dawson** &lt;midawson@redhat.com&gt; (he/him)
* [mmarchini](https://github.com/mmarchini) -
**Mary Marchini** &lt;oss@mmarchini.me&gt; (she/her)
* [MylesBorins](https://github.com/MylesBorins) -
**Myles Borins** &lt;myles.borins@gmail.com&gt; (he/him)
* [ronag](https://github.com/ronag) -
**Robert Nagy** &lt;ronagy@icloud.com&gt;
* [targos](https://github.com/targos) -
**Michaël Zasso** &lt;targos@protonmail.com&gt; (he/him)
* [tniessen](https://github.com/tniessen) -
**Tobias Nießen** &lt;tniessen@tnie.de&gt;
* [Trott](https://github.com/Trott) -
**Rich Trott** &lt;rtrott@gmail.com&gt; (he/him)
### TSC emeriti
* [addaleax](https://github.com/addaleax) -
**Anna Henningsen** &lt;anna@addaleax.net&gt; (she/her)
* [bnoordhuis](https://github.com/bnoordhuis) -
**Ben Noordhuis** &lt;info@bnoordhuis.nl&gt;
* [chrisdickinson](https://github.com/chrisdickinson) -
**Chris Dickinson** &lt;christopher.s.dickinson@gmail.com&gt;
* [evanlucas](https://github.com/evanlucas) -
**Evan Lucas** &lt;evanlucas@me.com&gt; (he/him)
* [Fishrock123](https://github.com/Fishrock123) -
**Jeremiah Senkpiel** &lt;fishrock123@rocketmail.com&gt; (he/they)
* [gibfahn](https://github.com/gibfahn) -
**Gibson Fahnestock** &lt;gibfahn@gmail.com&gt; (he/him)
* [indutny](https://github.com/indutny) -
**Fedor Indutny** &lt;fedor.indutny@gmail.com&gt;
* [isaacs](https://github.com/isaacs) -
**Isaac Z. Schlueter** &lt;i@izs.me&gt;
* [joshgav](https://github.com/joshgav) -
**Josh Gavant** &lt;josh.gavant@outlook.com&gt;
* [mscdex](https://github.com/mscdex) -
**Brian White** &lt;mscdex@mscdex.net&gt;
* [nebrius](https://github.com/nebrius) -
**Bryan Hughes** &lt;bryan@nebri.us&gt;
* [ofrobots](https://github.com/ofrobots) -
**Ali Ijaz Sheikh** &lt;ofrobots@google.com&gt; (he/him)
* [orangemocha](https://github.com/orangemocha) -
**Alexis Campailla** &lt;orangemocha@nodejs.org&gt;
* [piscisaureus](https://github.com/piscisaureus) -
**Bert Belder** &lt;bertbelder@gmail.com&gt;
* [rvagg](https://github.com/rvagg) -
**Rod Vagg** &lt;r@va.gg&gt;
* [sam-github](https://github.com/sam-github) -
**Sam Roberts** &lt;vieuxtech@gmail.com&gt;
* [shigeki](https://github.com/shigeki) -
**Shigeki Ohtsu** &lt;ohtsu@ohtsu.org&gt; (he/him)
* [thefourtheye](https://github.com/thefourtheye) -
**Sakthipriyan Vairamani** &lt;thechargingvolcano@gmail.com&gt; (he/him)
* [TimothyGu](https://github.com/TimothyGu) -
**Tiancheng "Timothy" Gu** &lt;timothygu99@gmail.com&gt; (he/him)
* [trevnorris](https://github.com/trevnorris) -
**Trevor Norris** &lt;trev.norris@gmail.com&gt;
### Collaborators
* [addaleax](https://github.com/addaleax) -
**Anna Henningsen** &lt;anna@addaleax.net&gt; (she/her)
* [aduh95](https://github.com/aduh95) -
**Antoine du Hamel** &lt;duhamelantoine1995@gmail.com&gt; (he/him)
* [ak239](https://github.com/ak239) -
**Aleksei Koziatinskii** &lt;ak239spb@gmail.com&gt;
* [AndreasMadsen](https://github.com/AndreasMadsen) -
**Andreas Madsen** &lt;amwebdk@gmail.com&gt; (he/him)
* [antsmartian](https://github.com/antsmartian) -
**Anto Aravinth** &lt;anto.aravinth.cse@gmail.com&gt; (he/him)
* [apapirovski](https://github.com/apapirovski) -
**Anatoli Papirovski** &lt;apapirovski@mac.com&gt; (he/him)
* [AshCripps](https://github.com/AshCripps) -
**Ash Cripps** &lt;acripps@redhat.com&gt;
* [bcoe](https://github.com/bcoe) -
**Ben Coe** &lt;bencoe@gmail.com&gt; (he/him)
* [bengl](https://github.com/bengl) -
**Bryan English** &lt;bryan@bryanenglish.com&gt; (he/him)
* [benjamingr](https://github.com/benjamingr) -
**Benjamin Gruenbaum** &lt;benjamingr@gmail.com&gt;
* [BethGriggs](https://github.com/BethGriggs) -
**Beth Griggs** &lt;bgriggs@redhat.com&gt; (she/her)
* [bmeck](https://github.com/bmeck) -
**Bradley Farias** &lt;bradley.meck@gmail.com&gt;
* [bmeurer](https://github.com/bmeurer) -
**Benedikt Meurer** &lt;benedikt.meurer@gmail.com&gt;
* [boneskull](https://github.com/boneskull) -
**Christopher Hiller** &lt;boneskull@boneskull.com&gt; (he/him)
* [BridgeAR](https://github.com/BridgeAR) -
**Ruben Bridgewater** &lt;ruben@bridgewater.de&gt; (he/him)
* [bzoz](https://github.com/bzoz) -
**Bartosz Sosnowski** &lt;bartosz@janeasystems.com&gt;
* [cclauss](https://github.com/cclauss) -
**Christian Clauss** &lt;cclauss@me.com&gt; (he/him)
* [ChALkeR](https://github.com/ChALkeR) -
**Сковорода Никита Андреевич** &lt;chalkerx@gmail.com&gt; (he/him)
* [cjihrig](https://github.com/cjihrig) -
**Colin Ihrig** &lt;cjihrig@gmail.com&gt; (he/him)
* [codebytere](https://github.com/codebytere) -
**Shelley Vohr** &lt;codebytere@gmail.com&gt; (she/her)
* [danbev](https://github.com/danbev) -
**Daniel Bevenius** &lt;daniel.bevenius@gmail.com&gt; (he/him)
* [danielleadams](https://github.com/danielleadams) -
**Danielle Adams** &lt;adamzdanielle@gmail.com&gt; (she/her)
* [davisjam](https://github.com/davisjam) -
**Jamie Davis** &lt;davisjam@vt.edu&gt; (he/him)
* [DerekNonGeneric](https://github.com/DerekNonGeneric) -
**Derek Lewis** &lt;DerekNonGeneric@inf.is&gt; (he/him)
* [devnexen](https://github.com/devnexen) -
**David Carlier** &lt;devnexen@gmail.com&gt;
* [devsnek](https://github.com/devsnek) -
**Gus Caplan** &lt;me@gus.host&gt; (they/them)
* [dmabupt](https://github.com/dmabupt) -
**Xu Meng** &lt;dmabupt@gmail.com&gt; (he/him)
* [dnlup](https://github.com/dnlup)
**Daniele Belardi** &lt;dwon.dnl@gmail.com&gt; (he/him)
* [edsadr](https://github.com/edsadr) -
**Adrian Estrada** &lt;edsadr@gmail.com&gt; (he/him)
* [eugeneo](https://github.com/eugeneo) -
**Eugene Ostroukhov** &lt;eostroukhov@google.com&gt;
* [evanlucas](https://github.com/evanlucas) -
**Evan Lucas** &lt;evanlucas@me.com&gt; (he/him)
* [fhinkel](https://github.com/fhinkel) -
**Franziska Hinkelmann** &lt;franziska.hinkelmann@gmail.com&gt; (she/her)
* [Fishrock123](https://github.com/Fishrock123) -
**Jeremiah Senkpiel** &lt;fishrock123@rocketmail.com&gt; (he/they)
* [Flarna](https://github.com/Flarna) -
**Gerhard Stöbich** &lt;deb2001-github@yahoo.de&gt; (he/they)
* [gabrielschulhof](https://github.com/gabrielschulhof) -
**Gabriel Schulhof** &lt;gabrielschulhof@gmail.com&gt;
* [gdams](https://github.com/gdams) -
**George Adams** &lt;george.adams@uk.ibm.com&gt; (he/him)
* [geek](https://github.com/geek) -
**Wyatt Preul** &lt;wpreul@gmail.com&gt;
* [gengjiawen](https://github.com/gengjiawen) -
**Jiawen Geng** &lt;technicalcute@gmail.com&gt;
* [GeoffreyBooth](https://github.com/geoffreybooth) -
**Geoffrey Booth** &lt;webmaster@geoffreybooth.com&gt; (he/him)
* [gireeshpunathil](https://github.com/gireeshpunathil) -
**Gireesh Punathil** &lt;gpunathi@in.ibm.com&gt; (he/him)
* [guybedford](https://github.com/guybedford) -
**Guy Bedford** &lt;guybedford@gmail.com&gt; (he/him)
* [HarshithaKP](https://github.com/HarshithaKP) -
**Harshitha K P** &lt;harshitha014@gmail.com&gt; (she/her)
* [hashseed](https://github.com/hashseed) -
**Yang Guo** &lt;yangguo@chromium.org&gt; (he/him)
* [himself65](https://github.com/himself65) -
**Zeyu Yang** &lt;himself65@outlook.com&gt; (he/him)
* [hiroppy](https://github.com/hiroppy) -
**Yuta Hiroto** &lt;hello@hiroppy.me&gt; (he/him)
* [iansu](https://github.com/iansu) -
**Ian Sutherland** &lt;ian@iansutherland.ca&gt;
* [indutny](https://github.com/indutny) -
**Fedor Indutny** &lt;fedor.indutny@gmail.com&gt;
* [JacksonTian](https://github.com/JacksonTian) -
**Jackson Tian** &lt;shyvo1987@gmail.com&gt;
* [jasnell](https://github.com/jasnell) -
**James M Snell** &lt;jasnell@gmail.com&gt; (he/him)
* [jdalton](https://github.com/jdalton) -
**John-David Dalton** &lt;john.david.dalton@gmail.com&gt;
* [jkrems](https://github.com/jkrems) -
**Jan Krems** &lt;jan.krems@gmail.com&gt; (he/him)
* [joaocgreis](https://github.com/joaocgreis) -
**João Reis** &lt;reis@janeasystems.com&gt;
* [joyeecheung](https://github.com/joyeecheung) -
**Joyee Cheung** &lt;joyeec9h3@gmail.com&gt; (she/her)
* [juanarbol](https://github.com/juanarbol) -
**Juan José Arboleda** &lt;soyjuanarbol@gmail.com&gt; (he/him)
* [JungMinu](https://github.com/JungMinu) -
**Minwoo Jung** &lt;nodecorelab@gmail.com&gt; (he/him)
* [lance](https://github.com/lance) -
**Lance Ball** &lt;lball@redhat.com&gt; (he/him)
* [legendecas](https://github.com/legendecas) -
**Chengzhong Wu** &lt;legendecas@gmail.com&gt; (he/him)
* [Leko](https://github.com/Leko) -
**Shingo Inoue** &lt;leko.noor@gmail.com&gt; (he/him)
* [linkgoron](https://github.com/linkgoron) -
**Nitzan Uziely** &lt;linkgoron@gmail.com&gt;
* [lpinca](https://github.com/lpinca) -
**Luigi Pinca** &lt;luigipinca@gmail.com&gt; (he/him)
* [lundibundi](https://github.com/lundibundi) -
**Denys Otrishko** &lt;shishugi@gmail.com&gt; (he/him)
* [Lxxyx](https://github.com/Lxxyx) -
**Zijian Liu** &lt;lxxyxzj@gmail.com&gt; (he/him)
* [mafintosh](https://github.com/mafintosh) -
**Mathias Buus** &lt;mathiasbuus@gmail.com&gt; (he/him)
* [mcollina](https://github.com/mcollina) -
**Matteo Collina** &lt;matteo.collina@gmail.com&gt; (he/him)
* [mhdawson](https://github.com/mhdawson) -
**Michael Dawson** &lt;midawson@redhat.com&gt; (he/him)
* [miladfarca](https://github.com/miladfarca) -
**Milad Fa** &lt;mfarazma@redhat.com&gt; (he/him)
* [mildsunrise](https://github.com/mildsunrise) -
**Alba Mendez** &lt;me@alba.sh&gt; (she/her)
* [misterdjules](https://github.com/misterdjules) -
**Julien Gilli** &lt;jgilli@nodejs.org&gt;
* [mmarchini](https://github.com/mmarchini) -
**Mary Marchini** &lt;oss@mmarchini.me&gt; (she/her)
* [mscdex](https://github.com/mscdex) -
**Brian White** &lt;mscdex@mscdex.net&gt;
* [MylesBorins](https://github.com/MylesBorins) -
**Myles Borins** &lt;myles.borins@gmail.com&gt; (he/him)
* [ofrobots](https://github.com/ofrobots) -
**Ali Ijaz Sheikh** &lt;ofrobots@google.com&gt; (he/him)
* [oyyd](https://github.com/oyyd) -
**Ouyang Yadong** &lt;oyydoibh@gmail.com&gt; (he/him)
* [panva](https://github.com/panva) -
**Filip Skokan** &lt;panva.ip@gmail.com&gt;
* [PoojaDurgad](https://github.com/PoojaDurgad) -
**Pooja D P** &lt;Pooja.D.P@ibm.com&gt; (she/her)
* [puzpuzpuz](https://github.com/puzpuzpuz) -
**Andrey Pechkurov** &lt;apechkurov@gmail.com&gt; (he/him)
* [Qard](https://github.com/Qard) -
**Stephen Belanger** &lt;admin@stephenbelanger.com&gt; (he/him)
* [RaisinTen](https://github.com/RaisinTen) -
**Darshan Sen** &lt;raisinten@gmail.com&gt; (he/him)
* [refack](https://github.com/refack) -
**Refael Ackermann (רפאל פלחי)** &lt;refack@gmail.com&gt; (he/him/הוא/אתה)
* [rexagod](https://github.com/rexagod) -
**Pranshu Srivastava** &lt;rexagod@gmail.com&gt; (he/him)
* [richardlau](https://github.com/richardlau) -
**Richard Lau** &lt;rlau@redhat.com&gt;
* [rickyes](https://github.com/rickyes) -
**Ricky Zhou** &lt;0x19951125@gmail.com&gt; (he/him)
* [ronag](https://github.com/ronag) -
**Robert Nagy** &lt;ronagy@icloud.com&gt;
* [rubys](https://github.com/rubys) -
**Sam Ruby** &lt;rubys@intertwingly.net&gt;
* [ruyadorno](https://github.com/ruyadorno) -
**Ruy Adorno** &lt;ruyadorno@github.com&gt; (he/him)
* [rvagg](https://github.com/rvagg) -
**Rod Vagg** &lt;rod@vagg.org&gt;
* [ryzokuken](https://github.com/ryzokuken) -
**Ujjwal Sharma** &lt;ryzokuken@disroot.org&gt; (he/him)
* [saghul](https://github.com/saghul) -
**Saúl Ibarra Corretgé** &lt;saghul@gmail.com&gt;
* [santigimeno](https://github.com/santigimeno) -
**Santiago Gimeno** &lt;santiago.gimeno@gmail.com&gt;
* [seishun](https://github.com/seishun) -
**Nikolai Vavilov** &lt;vvnicholas@gmail.com&gt;
* [shisama](https://github.com/shisama) -
**Masashi Hirano** &lt;shisama07@gmail.com&gt; (he/him)
* [silverwind](https://github.com/silverwind) -
**Roman Reiss** &lt;me@silverwind.io&gt;
* [srl295](https://github.com/srl295) -
**Steven R Loomis** &lt;srloomis@us.ibm.com&gt;
* [starkwang](https://github.com/starkwang) -
**Weijia Wang** &lt;starkwang@126.com&gt;
* [sxa](https://github.com/sxa) -
**Stewart X Addison** &lt;sxa@redhat.com&gt; (he/him)
* [targos](https://github.com/targos) -
**Michaël Zasso** &lt;targos@protonmail.com&gt; (he/him)
* [TimothyGu](https://github.com/TimothyGu) -
**Tiancheng "Timothy" Gu** &lt;timothygu99@gmail.com&gt; (he/him)
* [tniessen](https://github.com/tniessen) -
**Tobias Nießen** &lt;tniessen@tnie.de&gt;
* [trivikr](https://github.com/trivikr) -
**Trivikram Kamat** &lt;trivikr.dev@gmail.com&gt;
* [Trott](https://github.com/Trott) -
**Rich Trott** &lt;rtrott@gmail.com&gt; (he/him)
* [vdeturckheim](https://github.com/vdeturckheim) -
**Vladimir de Turckheim** &lt;vlad2t@hotmail.com&gt; (he/him)
* [watilde](https://github.com/watilde) -
**Daijiro Wachi** &lt;daijiro.wachi@gmail.com&gt; (he/him)
* [watson](https://github.com/watson) -
**Thomas Watson** &lt;w@tson.dk&gt;
* [XadillaX](https://github.com/XadillaX) -
**Khaidi Chu** &lt;i@2333.moe&gt; (he/him)
* [yashLadha](https://github.com/yashLadha) -
**Yash Ladha** &lt;yash@yashladha.in&gt; (he/him)
* [yhwang](https://github.com/yhwang) -
**Yihong Wang** &lt;yh.wang@ibm.com&gt;
* [yorkie](https://github.com/yorkie) -
**Yorkie Liu** &lt;yorkiefixer@gmail.com&gt;
* [yosuke-furukawa](https://github.com/yosuke-furukawa) -
**Yosuke Furukawa** &lt;yosuke.furukawa@gmail.com&gt;
* [ZYSzys](https://github.com/ZYSzys) -
**Yongsheng Zhang** &lt;zyszys98@gmail.com&gt; (he/him)
### Collaborator emeriti
* [andrasq](https://github.com/andrasq) -
**Andras** &lt;andras@kinvey.com&gt;
* [AnnaMag](https://github.com/AnnaMag) -
**Anna M. Kedzierska** &lt;anna.m.kedzierska@gmail.com&gt;
* [aqrln](https://github.com/aqrln) -
**Alexey Orlenko** &lt;eaglexrlnk@gmail.com&gt; (he/him)
* [bnoordhuis](https://github.com/bnoordhuis) -
**Ben Noordhuis** &lt;info@bnoordhuis.nl&gt;
* [brendanashworth](https://github.com/brendanashworth) -
**Brendan Ashworth** &lt;brendan.ashworth@me.com&gt;
* [calvinmetcalf](https://github.com/calvinmetcalf) -
**Calvin Metcalf** &lt;calvin.metcalf@gmail.com&gt;
* [chrisdickinson](https://github.com/chrisdickinson) -
**Chris Dickinson** &lt;christopher.s.dickinson@gmail.com&gt;
* [claudiorodriguez](https://github.com/claudiorodriguez) -
**Claudio Rodriguez** &lt;cjrodr@yahoo.com&gt;
* [DavidCai1993](https://github.com/DavidCai1993) -
**David Cai** &lt;davidcai1993@yahoo.com&gt; (he/him)
* [digitalinfinity](https://github.com/digitalinfinity) -
**Hitesh Kanwathirtha** &lt;digitalinfinity@gmail.com&gt; (he/him)
* [eljefedelrodeodeljefe](https://github.com/eljefedelrodeodeljefe) -
**Robert Jefe Lindstaedt** &lt;robert.lindstaedt@gmail.com&gt;
* [estliberitas](https://github.com/estliberitas) -
**Alexander Makarenko** &lt;estliberitas@gmail.com&gt;
* [firedfox](https://github.com/firedfox) -
**Daniel Wang** &lt;wangyang0123@gmail.com&gt;
* [gibfahn](https://github.com/gibfahn) -
**Gibson Fahnestock** &lt;gibfahn@gmail.com&gt; (he/him)
* [glentiki](https://github.com/glentiki) -
**Glen Keane** &lt;glenkeane.94@gmail.com&gt; (he/him)
* [iarna](https://github.com/iarna) -
**Rebecca Turner** &lt;me@re-becca.org&gt;
* [imran-iq](https://github.com/imran-iq) -
**Imran Iqbal** &lt;imran@imraniqbal.org&gt;
* [imyller](https://github.com/imyller) -
**Ilkka Myller** &lt;ilkka.myller@nodefield.com&gt;
* [isaacs](https://github.com/isaacs) -
**Isaac Z. Schlueter** &lt;i@izs.me&gt;
* [italoacasas](https://github.com/italoacasas) -
**Italo A. Casas** &lt;me@italoacasas.com&gt; (he/him)
* [jasongin](https://github.com/jasongin) -
**Jason Ginchereau** &lt;jasongin@microsoft.com&gt;
* [jbergstroem](https://github.com/jbergstroem) -
**Johan Bergström** &lt;bugs@bergstroem.nu&gt;
* [jhamhader](https://github.com/jhamhader) -
**Yuval Brik** &lt;yuval@brik.org.il&gt;
* [joshgav](https://github.com/joshgav) -
**Josh Gavant** &lt;josh.gavant@outlook.com&gt;
* [julianduque](https://github.com/julianduque) -
**Julian Duque** &lt;julianduquej@gmail.com&gt; (he/him)
* [kfarnung](https://github.com/kfarnung) -
**Kyle Farnung** &lt;kfarnung@microsoft.com&gt; (he/him)
* [kunalspathak](https://github.com/kunalspathak) -
**Kunal Pathak** &lt;kunal.pathak@microsoft.com&gt;
* [lucamaraschi](https://github.com/lucamaraschi) -
**Luca Maraschi** &lt;luca.maraschi@gmail.com&gt; (he/him)
* [lxe](https://github.com/lxe) -
**Aleksey Smolenchuk** &lt;lxe@lxe.co&gt;
* [maclover7](https://github.com/maclover7) -
**Jon Moss** &lt;me@jonathanmoss.me&gt; (he/him)
* [matthewloring](https://github.com/matthewloring) -
**Matthew Loring** &lt;mattloring@google.com&gt;
* [micnic](https://github.com/micnic) -
**Nicu Micleușanu** &lt;micnic90@gmail.com&gt; (he/him)
* [mikeal](https://github.com/mikeal) -
**Mikeal Rogers** &lt;mikeal.rogers@gmail.com&gt;
* [monsanto](https://github.com/monsanto) -
**Christopher Monsanto** &lt;chris@monsan.to&gt;
* [MoonBall](https://github.com/MoonBall) -
**Chen Gang** &lt;gangc.cxy@foxmail.com&gt;
* [not-an-aardvark](https://github.com/not-an-aardvark) -
**Teddy Katz** &lt;teddy.katz@gmail.com&gt; (he/him)
* [Olegas](https://github.com/Olegas) -
**Oleg Elifantiev** &lt;oleg@elifantiev.ru&gt;
* [orangemocha](https://github.com/orangemocha) -
**Alexis Campailla** &lt;orangemocha@nodejs.org&gt;
* [othiym23](https://github.com/othiym23) -
**Forrest L Norvell** &lt;ogd@aoaioxxysz.net&gt; (he/him)
* [petkaantonov](https://github.com/petkaantonov) -
**Petka Antonov** &lt;petka_antonov@hotmail.com&gt;
* [phillipj](https://github.com/phillipj) -
**Phillip Johnsen** &lt;johphi@gmail.com&gt;
* [piscisaureus](https://github.com/piscisaureus) -
**Bert Belder** &lt;bertbelder@gmail.com&gt;
* [pmq20](https://github.com/pmq20) -
**Minqi Pan** &lt;pmq2001@gmail.com&gt;
* [princejwesley](https://github.com/princejwesley) -
**Prince John Wesley** &lt;princejohnwesley@gmail.com&gt;
* [psmarshall](https://github.com/psmarshall) -
**Peter Marshall** &lt;petermarshall@chromium.org&gt; (he/him)
* [rlidwka](https://github.com/rlidwka) -
**Alex Kocharin** &lt;alex@kocharin.ru&gt;
* [rmg](https://github.com/rmg) -
**Ryan Graham** &lt;r.m.graham@gmail.com&gt;
* [robertkowalski](https://github.com/robertkowalski) -
**Robert Kowalski** &lt;rok@kowalski.gd&gt;
* [romankl](https://github.com/romankl) -
**Roman Klauke** &lt;romaaan.git@gmail.com&gt;
* [ronkorving](https://github.com/ronkorving) -
**Ron Korving** &lt;ron@ronkorving.nl&gt;
* [RReverser](https://github.com/RReverser) -
**Ingvar Stepanyan** &lt;me@rreverser.com&gt;
* [sam-github](https://github.com/sam-github) -
**Sam Roberts** &lt;vieuxtech@gmail.com&gt;
* [sebdeckers](https://github.com/sebdeckers) -
**Sebastiaan Deckers** &lt;sebdeckers83@gmail.com&gt;
* [shigeki](https://github.com/shigeki) -
**Shigeki Ohtsu** &lt;ohtsu@ohtsu.org&gt; (he/him)
* [stefanmb](https://github.com/stefanmb) -
**Stefan Budeanu** &lt;stefan@budeanu.com&gt;
* [tellnes](https://github.com/tellnes) -
**Christian Tellnes** &lt;christian@tellnes.no&gt;
* [thefourtheye](https://github.com/thefourtheye) -
**Sakthipriyan Vairamani** &lt;thechargingvolcano@gmail.com&gt; (he/him)
* [thlorenz](https://github.com/thlorenz) -
**Thorsten Lorenz** &lt;thlorenz@gmx.de&gt;
* [trevnorris](https://github.com/trevnorris) -
**Trevor Norris** &lt;trev.norris@gmail.com&gt;
* [tunniclm](https://github.com/tunniclm) -
**Mike Tunnicliffe** &lt;m.j.tunnicliffe@gmail.com&gt;
* [vkurchatkin](https://github.com/vkurchatkin) -
**Vladimir Kurchatkin** &lt;vladimir.kurchatkin@gmail.com&gt;
* [vsemozhetbyt](https://github.com/vsemozhetbyt) -
**Vse Mozhet Byt** &lt;vsemozhetbyt@gmail.com&gt; (he/him)
* [whitlockjc](https://github.com/whitlockjc) -
**Jeremy Whitlock** &lt;jwhitlock@apache.org&gt;
<!--lint enable prohibited-strings-->
Collaborators follow the [Collaborator Guide](./doc/guides/collaborator-guide.md) in
maintaining the Node.js project.
### Triagers
* [Ayase-252](https://github.com/Ayase-252) -
**Qingyu Deng** &lt;i@ayase-lab.com&gt;
* [marsonya](https://github.com/marsonya) -
**Akhil Marsonya** &lt;akhil.marsonya27@gmail.com&gt; (he/him)
* [PoojaDurgad](https://github.com/PoojaDurgad) -
**Pooja Durgad** &lt;Pooja.D.P@ibm.com&gt;
* [RaisinTen](https://github.com/RaisinTen) -
**Darshan Sen** &lt;raisinten@gmail.com&gt;
### Release keys
Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys):
* **Beth Griggs** &lt;bgriggs@redhat.com&gt;
`4ED778F539E3634C779C87C6D7062848A1AB005C`
* **Colin Ihrig** &lt;cjihrig@gmail.com&gt;
`94AE36675C464D64BAFA68DD7434390BDBE9B9C5`
* **Danielle Adams** &lt;adamzdanielle@gmail.com&gt;
`74F12602B6F1C4E913FAA37AD3A89613643B6201`
* **James M Snell** &lt;jasnell@keybase.io&gt;
`71DCFD284A79C3B38668286BC97EC7A07EDE3FC1`
* **Michaël Zasso** &lt;targos@protonmail.com&gt;
`8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600`
* **Myles Borins** &lt;myles.borins@gmail.com&gt;
`C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8`
* **Richard Lau** &lt;rlau@redhat.com&gt;
`C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C`
* **Rod Vagg** &lt;rod@vagg.org&gt;
`DD8F2338BAE7501E3DD5AC78C273792F7D83545D`
* **Ruben Bridgewater** &lt;ruben@bridgewater.de&gt;
`A48C2BEE680E841632CD4E44F07496B3EB3C1762`
* **Ruy Adorno** &lt;ruyadorno@hotmail.com&gt;
`108F52B48DB57BB0CC439B2997B01419BD92F80A`
* **Shelley Vohr** &lt;shelley.vohr@gmail.com&gt;
`B9E2F5981AA6E0CD28160D9FF13993A75599653C`
To import the full set of trusted release keys (including subkeys possibly used
to sign releases):
```bash
gpg --keyserver pool.sks-keyservers.net --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C
gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5
gpg --keyserver pool.sks-keyservers.net --recv-keys 74F12602B6F1C4E913FAA37AD3A89613643B6201
gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1
gpg --keyserver pool.sks-keyservers.net --recv-keys 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600
gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8
gpg --keyserver pool.sks-keyservers.net --recv-keys C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C
gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D
gpg --keyserver pool.sks-keyservers.net --recv-keys A48C2BEE680E841632CD4E44F07496B3EB3C1762
gpg --keyserver pool.sks-keyservers.net --recv-keys 108F52B48DB57BB0CC439B2997B01419BD92F80A
gpg --keyserver pool.sks-keyservers.net --recv-keys B9E2F5981AA6E0CD28160D9FF13993A75599653C
```
See the section above on [Verifying Binaries](#verifying-binaries) for how to
use these keys to verify a downloaded file.
Other keys used to sign some previous releases:
* **Chris Dickinson** &lt;christopher.s.dickinson@gmail.com&gt;
`9554F04D7259F04124DE6B476D5A82AC7E37093B`
* **Danielle Adams** &lt;adamzdanielle@gmail.com&gt;
`1C050899334244A8AF75E53792EF661D867B9DFA`
* **Evan Lucas** &lt;evanlucas@me.com&gt;
`B9AE9905FFD7803F25714661B63B535A4C206CA9`
* **Gibson Fahnestock** &lt;gibfahn@gmail.com&gt;
`77984A986EBC2AA786BC0F66B01FBB92821C587A`
* **Isaac Z. Schlueter** &lt;i@izs.me&gt;
`93C7E9E91B49E432C2F75674B0A78B0A6C481CF6`
* **Italo A. Casas** &lt;me@italoacasas.com&gt;
`56730D5401028683275BD23C23EFEFE93C4CFFFE`
* **Jeremiah Senkpiel** &lt;fishrock@keybase.io&gt;
`FD3A5288F042B6850C66B31F09FE44734EB7990E`
* **Julien Gilli** &lt;jgilli@fastmail.fm&gt;
`114F43EE0176B71C7BC219DD50A3051F888C628D`
* **Timothy J Fontaine** &lt;tjfontaine@gmail.com&gt;
`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/HEAD/LICENSE) for the full
license text.
[Code of Conduct]: https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md
[Contributing to the project]: CONTRIBUTING.md
[Node.js Website]: https://nodejs.org/
[OpenJS Foundation]: https://openjsf.org/
[Strategic Initiatives]: https://github.com/nodejs/TSC/blob/HEAD/Strategic-Initiatives.md
[Technical values and prioritization]: doc/guides/technical-values.md
[Working Groups]: https://github.com/nodejs/TSC/blob/HEAD/WORKING_GROUPS.md

View File

@@ -0,0 +1,55 @@
@echo off
setlocal
title Install Additional Tools for Node.js
cls
echo ====================================================
echo Tools for Node.js Native Modules Installation Script
echo ====================================================
echo.
echo This script will install Python and the Visual Studio Build Tools, necessary
echo to compile Node.js native modules. Note that Chocolatey and required Windows
echo updates will also be installed.
echo.
echo This will require about 3 Gb of free disk space, plus any space necessary to
echo install Windows updates. This will take a while to run.
echo.
echo Please close all open programs for the duration of the installation. If the
echo installation fails, please ensure Windows is fully updated, reboot your
echo computer and try to run this again. This script can be found in the
echo Start menu under Node.js.
echo.
echo You can close this window to stop now. Detailed instructions to install these
echo tools manually are available at https://github.com/nodejs/node-gyp#on-windows
echo.
pause
cls
REM Adapted from https://github.com/Microsoft/windows-dev-box-setup-scripts/blob/79bbe5bdc4867088b3e074f9610932f8e4e192c2/README.md#legal
echo Using this script downloads third party software
echo ------------------------------------------------
echo This script will direct to Chocolatey to install packages. By using
echo Chocolatey to install a package, you are accepting the license for the
echo application, executable(s), or other artifacts delivered to your machine as a
echo result of a Chocolatey install. This acceptance occurs whether you know the
echo license terms or not. Read and understand the license terms of the packages
echo being installed and their dependencies prior to installation:
echo - https://chocolatey.org/packages/chocolatey
echo - https://chocolatey.org/packages/python
echo - https://chocolatey.org/packages/visualstudio2019-workload-vctools
echo.
echo This script is provided AS-IS without any warranties of any kind
echo ----------------------------------------------------------------
echo Chocolatey has implemented security safeguards in their process to help
echo protect the community from malicious or pirated software, but any use of this
echo script is at your own risk. Please read the Chocolatey's legal terms of use
echo as well as how the community repository for Chocolatey.org is maintained.
echo.
pause
cls
"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command Start-Process '%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe' -ArgumentList '-NoProfile -InputFormat None -ExecutionPolicy Bypass -Command [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; iex ((New-Object System.Net.WebClient).DownloadString(''https://chocolatey.org/install.ps1'')); choco upgrade -y python visualstudio2019-workload-vctools; Read-Host ''Type ENTER to exit'' ' -Verb RunAs

View File

@@ -0,0 +1,185 @@
<instrumentationManifest
xmlns="http://schemas.microsoft.com/win/2004/08/events"
xmlns:win="http://manifests.microsoft.com/win/2004/08/windows/events"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<instrumentation>
<events>
<provider name="NodeJS-ETW-provider"
guid="{77754E9B-264B-4D8D-B981-E4135C1ECB0C}"
symbol="NODE_ETW_PROVIDER"
message="$(string.NodeJS-ETW-provider.name)"
resourceFileName="node.exe"
messageFileName="node.exe">
<tasks>
<task name="MethodRuntime" value="1"
symbol="JSCRIPT_METHOD_RUNTIME_TASK">
<opcodes>
<opcode name="MethodLoad" value="10"
symbol="JSCRIPT_METHOD_METHODLOAD_OPCODE"/>
</opcodes>
</task>
</tasks>
<opcodes>
<opcode name="NODE_HTTP_SERVER_REQUEST" value="10"/>
<opcode name="NODE_HTTP_SERVER_RESPONSE" value="11"/>
<opcode name="NODE_HTTP_CLIENT_REQUEST" value="12"/>
<opcode name="NODE_HTTP_CLIENT_RESPONSE" value="13"/>
<opcode name="NODE_NET_SERVER_CONNECTION" value="14"/>
<opcode name="NODE_NET_STREAM_END" value="15"/>
<opcode name="NODE_GC_START" value="16"/>
<opcode name="NODE_GC_DONE" value="17"/>
<opcode name="NODE_V8SYMBOL_REMOVE" value="21"/>
<opcode name="NODE_V8SYMBOL_MOVE" value="22"/>
<opcode name="NODE_V8SYMBOL_RESET" value="23"/>
</opcodes>
<templates>
<template tid="node_connection">
<data name="fd" inType="win:UInt32" />
<data name="port" inType="win:UInt32" />
<data name="remote" inType="win:AnsiString" />
<data name="buffered" inType="win:UInt32" />
</template>
<template tid="node_http_client_request">
<data name="url" inType="win:AnsiString" />
<data name="method" inType="win:AnsiString" />
<data name="fd" inType="win:UInt32" />
<data name="port" inType="win:UInt32" />
<data name="remote" inType="win:AnsiString" />
<data name="buffered" inType="win:UInt32" />
</template>
<template tid="node_http_server_request">
<data name="url" inType="win:AnsiString" />
<data name="method" inType="win:AnsiString" />
<data name="forwardedFor" inType="win:AnsiString" />
<data name="fd" inType="win:UInt32" />
<data name="port" inType="win:UInt32" />
<data name="remote" inType="win:AnsiString" />
<data name="buffered" inType="win:UInt32" />
</template>
<template tid="node_gc">
<data name="gctype" inType="win:UInt32" />
<data name="gccallbackflags" inType="win:UInt32" />
</template>
<template tid="V8AddressChange">
<data name="addr1" inType="win:Pointer" outType="win:HexInt64"/>
<data name="addr2" inType="win:Pointer" outType="win:HexInt64"/>
</template>
<template tid="MethodLoadUnload">
<data name="ScriptContextID" inType="win:Pointer" outType="win:HexInt64"/>
<data name="MethodStartAddress" inType="win:Pointer" outType="win:HexInt64" />
<data name="MethodSize" inType="win:UInt64" />
<data name="MethodID" inType="win:UInt32" />
<data name="MethodFlags" inType="win:UInt16" />
<data name="MethodAddressRangeID" inType="win:UInt16" />
<data name="SourceID" inType="win:UInt64" />
<data name="Line" inType="win:UInt32" outType="xs:unsignedInt" />
<data name="Column" inType="win:UInt32" outType="xs:unsignedInt" />
<data name="MethodName" inType="win:UnicodeString" outType="xs:string" />
</template>
</templates>
<events>
<event value="1"
opcode="NODE_HTTP_SERVER_REQUEST"
template="node_http_server_request"
symbol="NODE_HTTP_SERVER_REQUEST_EVENT"
message="$(string.NodeJS-ETW-provider.event.1.message)"
level="win:Informational"/>
<event value="2"
opcode="NODE_HTTP_SERVER_RESPONSE"
template="node_connection"
symbol="NODE_HTTP_SERVER_RESPONSE_EVENT"
message="$(string.NodeJS-ETW-provider.event.2.message)"
level="win:Informational"/>
<event value="3"
opcode="NODE_HTTP_CLIENT_REQUEST"
template="node_http_client_request"
symbol="NODE_HTTP_CLIENT_REQUEST_EVENT"
message="$(string.NodeJS-ETW-provider.event.3.message)"
level="win:Informational"/>
<event value="4"
opcode="NODE_HTTP_CLIENT_RESPONSE"
template="node_connection"
symbol="NODE_HTTP_CLIENT_RESPONSE_EVENT"
message="$(string.NodeJS-ETW-provider.event.4.message)"
level="win:Informational"/>
<event value="5"
opcode="NODE_NET_SERVER_CONNECTION"
template="node_connection"
symbol="NODE_NET_SERVER_CONNECTION_EVENT"
message="$(string.NodeJS-ETW-provider.event.5.message)"
level="win:Informational"/>
<event value="6"
opcode="NODE_NET_STREAM_END"
template="node_connection"
symbol="NODE_NET_STREAM_END_EVENT"
message="$(string.NodeJS-ETW-provider.event.6.message)"
level="win:Informational"/>
<event value="7"
opcode="NODE_GC_START"
template="node_gc"
symbol="NODE_GC_START_EVENT"
message="$(string.NodeJS-ETW-provider.event.7.message)"
level="win:Informational"/>
<event value="8"
opcode="NODE_GC_DONE"
template="node_gc"
symbol="NODE_GC_DONE_EVENT"
message="$(string.NodeJS-ETW-provider.event.8.message)"
level="win:Informational"/>
<event value="9"
level="win:Informational"
opcode="MethodLoad"
symbol="MethodLoad"
message="$(string.NodeJS-ETW-provider.event.9.message)"
task="MethodRuntime"
template="MethodLoadUnload"/>
<event value="21"
opcode="NODE_V8SYMBOL_REMOVE"
template="V8AddressChange"
symbol="NODE_V8SYMBOL_REMOVE_EVENT"
message="$(string.NodeJS-ETW-provider.event.21.message)"
level="win:Informational" />
<event value="22"
opcode="NODE_V8SYMBOL_MOVE"
template="V8AddressChange"
symbol="NODE_V8SYMBOL_MOVE_EVENT"
message="$(string.NodeJS-ETW-provider.event.22.message)"
level="win:Informational" />
<event value="23"
opcode="NODE_V8SYMBOL_RESET"
symbol="NODE_V8SYMBOL_RESET_EVENT"
message="$(string.NodeJS-ETW-provider.event.23.message)"
level="win:Informational" />
</events>
</provider>
</events>
</instrumentation>
<localization>
<resources culture="en-US">
<stringTable>
<string id="NodeJS-ETW-provider.name" value="Node.js ETW Provider"/>
<string id="NodeJS-ETW-provider.event.1.message" value="Node.js HTTP Server Request%nMethod: %2%nRemote: %6%nPort: %5%nURL: %1"/>
<string id="NodeJS-ETW-provider.event.2.message" value="Node.js HTTP Server Response%nRemote: %3%nPort: %2"/>
<string id="NodeJS-ETW-provider.event.3.message" value="Node.js HTTP Client Request%nMethod: %2%nRemote: %5%nPort: %4%nURL: %1"/>
<string id="NodeJS-ETW-provider.event.4.message" value="Node.js HTTP Client Response%nRemote: %3%nPort: %2"/>
<string id="NodeJS-ETW-provider.event.5.message" value="Node.js Net Server Connection%nRemote: %3%nPort: %2"/>
<string id="NodeJS-ETW-provider.event.6.message" value="Node.js Net Stream End%nRemote: %3%nPort: %2"/>
<string id="NodeJS-ETW-provider.event.7.message" value="Node.js Garbage Collection Start"/>
<string id="NodeJS-ETW-provider.event.8.message" value="Node.js Garbage Collection Done"/>
<string id="NodeJS-ETW-provider.event.9.message" value="Node.js Function Compiled: %10"/>
<string id="NodeJS-ETW-provider.event.21.message" value="Node.js V8 Symbol Remove"/>
<string id="NodeJS-ETW-provider.event.22.message" value="Node.js V8 Symbol Move"/>
<string id="NodeJS-ETW-provider.event.23.message" value="Node.js V8 Symbol Reset"/>
</stringTable>
</resources>
</localization>
</instrumentationManifest>

View File

@@ -0,0 +1,214 @@
{
"parserOptions": {
"ecmaVersion": 2018,
"ecmaFeatures": {},
"sourceType": "script"
},
"env": {
"es6": true,
"node": true
},
"plugins": [
"import",
"node",
"promise",
"standard"
],
"globals": {
"document": "readonly",
"navigator": "readonly",
"window": "readonly"
},
"rules": {
"accessor-pairs": "error",
"array-bracket-spacing": ["error", "never"],
"arrow-spacing": ["error", { "before": true, "after": true }],
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", { "allowSingleLine": false }],
"camelcase": ["error", { "properties": "never" }],
"comma-dangle": ["error", {
"arrays": "always-multiline",
"objects": "always-multiline",
"imports": "always-multiline",
"exports": "always-multiline",
"functions": "never"
}],
"comma-spacing": ["error", { "before": false, "after": true }],
"comma-style": ["error", "last"],
"computed-property-spacing": ["error", "never"],
"constructor-super": "error",
"curly": ["error", "multi-or-nest"],
"dot-location": ["error", "property"],
"dot-notation": ["error", { "allowKeywords": true }],
"eol-last": "error",
"eqeqeq": ["error", "always", { "null": "ignore" }],
"func-call-spacing": ["error", "never"],
"generator-star-spacing": ["error", { "before": true, "after": true }],
"handle-callback-err": ["error", "^(err|error)$" ],
"indent": ["error", 2, {
"SwitchCase": 1,
"VariableDeclarator": 1,
"outerIIFEBody": 1,
"MemberExpression": 1,
"FunctionDeclaration": { "parameters": 1, "body": 1 },
"FunctionExpression": { "parameters": 1, "body": 1 },
"CallExpression": { "arguments": 1 },
"ArrayExpression": 1,
"ObjectExpression": 1,
"ImportDeclaration": 1,
"flatTernaryExpressions": true,
"ignoreComments": false,
"ignoredNodes": ["TemplateLiteral *"]
}],
"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",
"no-async-promise-executor": "error",
"no-caller": "error",
"no-case-declarations": "error",
"no-class-assign": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "off",
"no-const-assign": "error",
"no-constant-condition": ["error", { "checkLoops": false }],
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-dupe-args": "error",
"no-dupe-class-members": "error",
"no-dupe-keys": "error",
"no-duplicate-case": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-eval": "error",
"no-ex-assign": "error",
"no-extend-native": "error",
"no-extra-bind": "error",
"no-extra-boolean-cast": "error",
"no-extra-parens": ["error", "functions"],
"no-fallthrough": "error",
"no-floating-decimal": "error",
"no-func-assign": "error",
"no-global-assign": "error",
"no-implied-eval": "error",
"no-inner-declarations": ["error", "functions"],
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-iterator": "error",
"no-labels": ["error", { "allowLoop": true, "allowSwitch": false }],
"no-lone-blocks": "error",
"no-misleading-character-class": "error",
"no-prototype-builtins": "error",
"no-useless-catch": "error",
"no-mixed-operators": "off",
"no-mixed-spaces-and-tabs": "error",
"no-multi-spaces": "error",
"no-multi-str": "error",
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
"no-negated-in-lhs": "error",
"no-new": "off",
"no-new-func": "error",
"no-new-object": "error",
"no-new-require": "error",
"no-new-symbol": "error",
"no-new-wrappers": "error",
"no-obj-calls": "error",
"no-octal": "error",
"no-octal-escape": "error",
"no-path-concat": "error",
"no-proto": "error",
"no-redeclare": ["error", { "builtinGlobals": false }],
"no-regex-spaces": "error",
"no-return-assign": "off",
"no-self-assign": "off",
"no-self-compare": "error",
"no-sequences": "error",
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-tabs": "error",
"no-template-curly-in-string": "off",
"no-this-before-super": "error",
"no-throw-literal": "off",
"no-trailing-spaces": "error",
"no-undef": "error",
"no-undef-init": "error",
"no-unexpected-multiline": "error",
"no-unmodified-loop-condition": "error",
"no-unneeded-ternary": ["error", { "defaultAssignment": false }],
"no-unreachable": "error",
"no-unsafe-finally": 0,
"no-unsafe-negation": "error",
"no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true, "allowTaggedTemplates": true }],
"no-unused-vars": ["error", { "vars": "all", "args": "none", "ignoreRestSiblings": true }],
"no-use-before-define": ["error", { "functions": false, "classes": false, "variables": false }],
"no-useless-call": "error",
"no-useless-computed-key": "error",
"no-useless-constructor": "error",
"no-useless-escape": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-void": "error",
"no-whitespace-before-property": "error",
"no-with": "error",
"nonblock-statement-body-position": [2, "below"],
"object-curly-newline": "off",
"object-curly-spacing": "off",
"object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }],
"one-var": ["error", { "initialized": "never" }],
"operator-linebreak": "off",
"padded-blocks": ["error", { "blocks": "never", "switches": "never", "classes": "never" }],
"prefer-const": ["error", {"destructuring": "all"}],
"prefer-promise-reject-errors": "error",
"quote-props": ["error", "as-needed"],
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"rest-spread-spacing": ["error", "never"],
"semi": ["error", "never"],
"semi-spacing": ["error", { "before": false, "after": true }],
"space-before-blocks": ["error", "always"],
"space-before-function-paren": ["error", "always"],
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
"space-unary-ops": ["error", { "words": true, "nonwords": false }],
"spaced-comment": ["error", "always", {
"line": { "markers": ["*package", "!", "/", ",", "="] },
"block": { "balanced": true, "markers": ["*package", "!", ",", ":", "::", "flow-include"], "exceptions": ["*"] }
}],
"symbol-description": "error",
"template-curly-spacing": ["error", "never"],
"template-tag-spacing": ["error", "never"],
"unicode-bom": ["error", "never"],
"use-isnan": "error",
"valid-typeof": ["error", { "requireStringLiterals": true }],
"wrap-iife": ["error", "any", { "functionPrototypeMethods": true }],
"yield-star-spacing": ["error", "both"],
"yoda": ["error", "never"],
"import/export": "error",
"import/first": "error",
"import/no-absolute-path": ["error", { "esmodule": true, "commonjs": true, "amd": false }],
"import/no-duplicates": "error",
"import/no-named-default": "error",
"import/no-webpack-loader-syntax": "error",
"node/no-deprecated-api": "error",
"node/process-exit-as-throw": "error",
"promise/param-names": "off",
"standard/no-callback-literal": "error"
}
}

View File

@@ -0,0 +1,45 @@
*.swp
.*.swp
netlify.toml
npm-debug.log
/.github
/test
node_modules/marked
node_modules/marked-man
node_modules/tap
tap-snapshots
node_modules/.bin
node_modules/npm-registry-mock
/npmrc
/release/
/coverage/
# don't need these in the npm package.
Makefile
.licensee.json
.mailmap
changelogs/*
configure
make.bat
scripts
html/*.png
docs/nav.yml
docs/config.json
docs/dockhand.js
docs/template.html
# don't ignore .npmignore files
# these are used in some tests.
!.npmignore
/npm-*.tgz
*.pyc
Session.vim
.nyc_output
/.editorconfig
# don't ship smoke tests
smoke-tests/
tap-snapshots/smoke-tests-index.js-TAP.test.js

View File

View File

@@ -0,0 +1,785 @@
# Authors sorted by whether or not they're me
isaacs <i@izs.me>
Steve Steiner <ssteinerX@gmail.com>
Mikeal Rogers <mikeal.rogers@gmail.com>
Aaron Blohowiak <aaron.blohowiak@gmail.com>
Martyn Smith <martyn@dollyfish.net.nz>
Charlie Robbins <charlie.robbins@gmail.com>
Francisco Treacy <francisco.treacy@gmail.com>
Cliffano Subagio <cliffano@gmail.com>
Christian Eager <christian.eager@nokia.com>
Dav Glass <davglass@gmail.com>
Alex K. Wolfe <alexkwolfe@gmail.com>
James Sanders <jimmyjazz14@gmail.com>
Reid Burke <me@reidburke.com>
Arlo Breault <arlolra@gmail.com>
Timo Derstappen <teemow@gmail.com>
Bart Teeuwisse <bart.teeuwisse@thecodemill.biz>
Ben Noordhuis <info@bnoordhuis.nl>
Tor Valamo <tor.valamo@gmail.com>
Whyme.Lyu <5longluna@gmail.com>
Olivier Melcher <olivier.melcher@gmail.com>
Tomaž Muraus <kami@k5-storitve.net>
Evan Meagher <evan.meagher@gmail.com>
Orlando Vazquez <ovazquez@gmail.com>
Kai Chen <kaichenxyz@gmail.com>
George Miroshnykov <gmiroshnykov@lohika.com>
Geoff Flarity <geoff.flarity@gmail.com>
Max Goodman <c@chromakode.com>
Pete Kruckenberg <pete@kruckenberg.com>
Laurie Harper <laurie@holoweb.net>
Chris Wong <chris@chriswongstudio.com>
Scott Bronson <brons_github@rinspin.com>
Federico Romero <federomero@gmail.com>
Visnu Pitiyanuvath <visnupx@gmail.com>
Irakli Gozalishvili <rfobic@gmail.com>
Mark Cahill <mark@tiemonster.info>
Tony <zearin@gonk.net>
Iain Sproat <iainsproat@gmail.com>
Trent Mick <trentm@gmail.com>
Felix Geisendörfer <felix@debuggable.com>
Jameson Little <t.jameson.little@gmail.com>
Conny Brunnkvist <conny@fuchsia.se>
Will Elwood <w.elwood08@gmail.com>
Dean Landolt <dean@deanlandolt.com>
Oleg Efimov <efimovov@gmail.com>
Martin Cooper <mfncooper@gmail.com>
Jann Horn <jannhorn@googlemail.com>
Andrew Bradley <cspotcode@gmail.com>
Maciej Małecki <me@mmalecki.com>
Stephen Sugden <glurgle@gmail.com>
Michael Budde <mbudde@gmail.com>
Jason Smith <jhs@iriscouch.com>
Gautham Pai <buzypi@gmail.com>
David Trejo <david.daniel.trejo@gmail.com>
Paul Vorbach <paul@vorb.de>
George Ornbo <george@shapeshed.com>
Tim Oxley <secoif@gmail.com>
Tyler Green <tyler.green2@gmail.com>
Dave Pacheco <dap@joyent.com>
Danila Gerasimov <danila.gerasimov@gmail.com>
Rod Vagg <rod@vagg.org>
Christian Howe <coderarity@gmail.com>
Andrew Lunny <alunny@gmail.com>
Henrik Hodne <dvyjones@binaryhex.com>
Adam Blackburn <regality@gmail.com>
Kris Windham <kriswindham@gmail.com>
Jens Grunert <jens.grunert@gmail.com>
Joost-Wim Boekesteijn <joost-wim@boekesteijn.nl>
Dalmais Maxence <root@ip-10-195-202-5.ec2.internal>
Marcus Ekwall <marcus.ekwall@gmail.com>
Aaron Stacy <aaron.r.stacy@gmail.com>
Phillip Howell <phowell@cothm.org>
Domenic Denicola <domenic@domenicdenicola.com>
James Halliday <mail@substack.net>
Jeremy Cantrell <jmcantrell@gmail.com>
Ribettes <patlogan29@gmail.com>
Don Park <donpark@docuverse.com>
Einar Otto Stangvik <einaros@gmail.com>
Kei Son <heyacct@gmail.com>
Nicolas Morel <marsup@gmail.com>
Mark Dube <markisdee@gmail.com>
Nathan Rajlich <nathan@tootallnate.net>
Maxim Bogushevich <boga1@mail.ru>
Meaglin <Meaglin.wasabi@gmail.com>
Ben Evans <ben@bensbit.co.uk>
Nathan Zadoks <nathan@nathan7.eu>
Brian White <mscdex@mscdex.net>
Jed Schmidt <tr@nslator.jp>
Ian Livingstone <ianl@cs.dal.ca>
Patrick Pfeiffer <patrick@buzzle.at>
Paul Miller <paul@paulmillr.com>
Ryan Emery <seebees@gmail.com>
Carl Lange <carl@flax.ie>
Jan Lehnardt <jan@apache.org>
Stuart P. Bentley <stuart@testtrack4.com>
Johan Sköld <johan@skold.cc>
Stuart Knightley <stuart@stuartk.com>
Niggler <nirk.niggler@gmail.com>
Paolo Fragomeni <paolo@async.ly>
Jaakko Manninen <jaakko@rocketpack.fi>
Luke Arduini <luke.arduini@gmail.com>
Larz Conwell <larz@larz-laptop.(none)>
Marcel Klehr <mklehr@gmx.net>
Robert Kowalski <rok@kowalski.gd>
Forbes Lindesay <forbes@lindesay.co.uk>
Vaz Allen <vaz@tryptid.com>
Jake Verbaten <raynos2@gmail.com>
Schabse Laks <Dev@SLaks.net>
Florian Margaine <florian@margaine.com>
Johan Nordberg <its@johan-nordberg.com>
Ian Babrou <ibobrik@gmail.com>
Di Wu <dwu@palantir.com>
Mathias Bynens <mathias@qiwi.be>
Matt McClure <matt.mcclure@mapmyfitness.com>
Matt Lunn <matt@mattlunn.me.uk>
Alexey Kreschuk <akrsch@gmail.com>
elisee <elisee@sparklin.org>
Robert Gieseke <robert.gieseke@gmail.com>
François Frisch <francoisfrisch@gmail.com>
Trevor Burnham <tburnham@hubspot.com>
Alan Shaw <alan@freestyle-developments.co.uk>
TJ Holowaychuk <tj@vision-media.ca>
Nicholas Kinsey <pyro@feisty.io>
Paulo Cesar <pauloc062@gmail.com>
Elan Shanker <elan.shanker@gmail.com>
Jon Spencer <jon@jonspencer.ca>
Jason Diamond <jason@diamond.name>
Maximilian Antoni <mail@maxantoni.de>
Thom Blake <tblake@brightroll.com>
Jess Martin <jessmartin@gmail.com>
Spain Train <michael.spainhower@opower.com>
Alex Rodionov <p0deje@gmail.com>
Matt Colyer <matt@colyer.name>
Evan You <yyx990803@gmail.com>
bitspill <bitspill+github@bitspill.net>
Gabriel Falkenberg <gabriel.falkenberg@gmail.com>
Alexej Yaroshevich <alex@qfox.ru>
Quim Calpe <quim@kalpe.com>
Steve Mason <stevem@brandwatch.com>
Wil Moore III <wil.moore@wilmoore.com>
Sergey Belov <peimei@ya.ru>
Tom Huang <hzlhu.dargon@gmail.com>
CamilleM <camille.moulin@alterway.fr>
Sébastien Santoro <dereckson@espace-win.org>
Evan Lucas <evan@btc.com>
Quinn Slack <qslack@qslack.com>
Alex Kocharin <alex@kocharin.ru>
Daniel Santiago <daniel.santiago@highlevelwebs.com>
Denis Gladkikh <outcoldman@gmail.com>
Andrew Horton <andrew.j.horton@gmail.com>
Zeke Sikelianos <zeke@sikelianos.com>
Dylan Greene <dylang@gmail.com>
Franck Cuny <franck.cuny@gmail.com>
Yeonghoon Park <sola92@gmail.com>
Rafael de Oleza <rafa@spotify.com>
Mikola Lysenko <mikolalysenko@gmail.com>
Yazhong Liu <yorkiefixer@gmail.com>
Neil Gentleman <ngentleman@gmail.com>
Kris Kowal <kris.kowal@cixar.com>
Alex Gorbatchev <alex.gorbatchev@gmail.com>
Shawn Wildermuth <shawn@wildermuth.com>
Wesley de Souza <wesleywex@gmail.com>
yoyoyogi <yogesh.k@gmail.com>
J. Tangelder <j.tangelder@gmail.com>
Jean Lauliac <jean@lauliac.com>
Andrey Kislyuk <kislyuk@gmail.com>
Thorsten Lorenz <thlorenz@gmx.de>
Julian Gruber <julian@juliangruber.com>
Benjamin Coe <bencoe@gmail.com>
Alex Ford <Alex.Ford@CodeTunnel.com>
Matt Hickford <matt.hickford@gmail.com>
Sean McGivern <sean.mcgivern@rightscale.com>
C J Silverio <ceejceej@gmail.com>
Robin Tweedie <robin@songkick.com>
Miroslav Bajtoš <miroslav@strongloop.com>
David Glasser <glasser@davidglasser.net>
Gianluca Casati <casati_gianluca@yahoo.it>
Forrest L Norvell <ogd@aoaioxxysz.net>
Karsten Tinnefeld <k.tinnefeld@googlemail.com>
Bryan Burgers <bryan@burgers.io>
David Beitey <david@davidjb.com>
Evan You <yyou@google.com>
Zach Pomerantz <zmp@umich.edu>
Chris Williams <cwilliams88@gmail.com>
sudodoki <smd.deluzion@gmail.com>
Mick Thompson <dthompson@gmail.com>
Felix Rabe <felix@rabe.io>
Michael Hayes <michael@hayes.io>
Chris Dickinson <christopher.s.dickinson@gmail.com>
Bradley Meck <bradley.meck@gmail.com>
GeJ <geraud@gcu.info>
Andrew Terris <atterris@gmail.com>
Michael Nisi <michael.nisi@gmail.com>
fengmk2 <fengmk2@gmail.com>
Adam Meadows <adam.meadows@gmail.com>
Chulki Lee <chulki.lee@gmail.com>
不四 <busi.hyy@taobao.com>
dead_horse <dead_horse@qq.com>
Kenan Yildirim <kenan@kenany.me>
Laurie Voss <git@seldo.com>
Rebecca Turner <me@re-becca.org>
Hunter Loftis <hunter@hunterloftis.com>
Peter Richardson <github@zoomy.net>
Jussi Kalliokoski <jussi.kalliokoski@gmail.com>
Filip Weiss <me@fiws.net>
Timo Weiß <timoweiss@Timo-MBP.local>
Christopher Hiller <chiller@badwing.com>
Jérémy Lal <kapouer@melix.org>
Anders Janmyr <anders@janmyr.com>
Chris Meyers <chris.meyers.fsu@gmail.com>
Ludwig Magnusson <ludwig@mediatool.com>
Wout Mertens <Wout.Mertens@gmail.com>
Nick Santos <nick@medium.com>
Terin Stock <terinjokes@gmail.com>
Faiq Raza <faiqrazarizvi@gmail.com>
Thomas Torp <thomas@erupt.no>
Sam Mikes <smikes@cubane.com>
Mat Tyndall <mat.tyndall@gmail.com>
Tauren Mills <tauren@sportzing.com>
Ron Martinez <ramartin.net@gmail.com>
Kazuhito Hokamura <k.hokamura@gmail.com>
Tristan Davies <github@tristan.io>
David Volm <david@volminator.com>
Lin Clark <lin.w.clark@gmail.com>
Ben Page <bpage@dewalch.com>
Jeff Jo <jeffjo@squareup.com>
martinvd <martinvdpub@gmail.com>
Mark J. Titorenko <nospam-github.com@titorenko.net>
Oddur Sigurdsson <oddurs@gmail.com>
Eric Mill <eric@konklone.com>
Gabriel Barros <descartavel1@gmail.com>
KevinSheedy <kevinsheedy@gmail.com>
Aleksey Smolenchuk <aleksey@uber.com>
Ed Morley <emorley@mozilla.com>
Blaine Bublitz <blaine@iceddev.com>
Andrey Fedorov <anfedorov@gmail.com>
Daijiro Wachi <daijiro.wachi@gmail.com>
Luc Thevenard <lucthevenard@gmail.com>
Aria Stewart <aredridel@nbtsc.org>
Charlie Rudolph <charles.w.rudolph@gmail.com>
Vladimir Rutsky <rutsky@users.noreply.github.com>
Isaac Murchie <isaac@saucelabs.com>
Marcin Wosinek <marcin.wosinek@gmail.com>
David Marr <davemarr@gmail.com>
Bryan English <bryan@bryanenglish.com>
Anthony Zotti <amZotti@users.noreply.github.com>
Karl Horky <karl.horky@gmail.com>
Jordan Harband <ljharb@gmail.com>
Guðlaugur Stefán Egilsson <gulli@kolibri.is>
Helge Skogly Holm <helge.holm@gmail.com>
Peter A. Shevtsov <petr.shevtsov@gmail.com>
Alain Kalker <a.c.kalker@gmail.com>
Bryant Williams <b.n.williams@gmail.com>
Jonas Weber <github@jonasw.de>
Tim Whidden <twhid@twhid.com>
Andreas <functino@users.noreply.github.com>
Karolis Narkevicius <karolis.n@gmail.com>
Adrian Lynch <adi_ady_ade@hotmail.com>
Richard Littauer <richard.littauer@gmail.com>
Oli Evans <oli@zilla.org.uk>
Matt Brennan <mattyb1000@gmail.com>
Jeff Barczewski <jeff.barczewski@gmail.com>
Danny Fritz <dannyfritz@gmail.com>
Takaya Kobayashi <jigsaw@live.jp>
Ra'Shaun Stovall <rashaunstovall@gmail.com>
Julien Meddah <julien.meddah@deveryware.com>
Michiel Sikma <michiel@wedemandhtml.com>
Jakob Krigovsky <jakob.krigovsky@gmail.com>
Charmander <~@charmander.me>
Erik Wienhold <git@ewie.name>
James Butler <james.butler@sandfox.co.uk>
Kevin Kragenbrink <kevin@gaikai.com>
Arnaud Rinquin <rinquin.arnaud@gmail.com>
Mike MacCana <mike.maccana@gmail.com>
Antti Mattila <anttti@fastmail.fm>
laiso <laiso@lai.so>
Matt Zorn <zornme@gmail.com>
Kyle Mitchell <kyle@kemitchell.com>
Jeremiah Senkpiel <fishrock123@rocketmail.com>
Michael Klein <mischkl@users.noreply.github.com>
Simen Bekkhus <sbekkhus91@gmail.com>
Victor <victor.shih@gmail.com>
thefourtheye <thechargingvolcano@gmail.com>
Clay Carpenter <claycarpenter@gmail.com>
bangbang93 <bangbang93@163.com>
Nick Malaguti <nmalaguti@palantir.com>
Cedric Nelson <cedric.nelson@gmail.com>
Kat Marchán <kzm@zkat.tech>
Andrew <talktome@aboutandrew.co.uk>
Eduardo Pinho <enet4mikeenet@gmail.com>
Rachel Hutchison <rhutchix@intel.com>
Ryan Temple <ryantemple145@gmail.com>
Eugene Sharygin <eush77@gmail.com>
James Talmage <james@talmage.io>
jane arc <jane@uber.com>
Joseph Dykstra <josephdykstra@gmail.com>
Andrew Crites <ajcrites@gmail.com>
Joshua Egan <josh-egan@users.noreply.github.com>
Carlos Alberto <euprogramador@gmail.com>
Thomas Cort <thomasc@ssimicro.com>
Thaddee Tyl <thaddee.tyl@gmail.com>
Steve Klabnik <steve@steveklabnik.com>
Andrew Murray <radarhere@gmail.com>
Stephan Bönnemann <stephan@excellenteasy.com>
Kyle M. Tarplee <kyle.tarplee@numerica.us>
Derek Peterson <derekpetey@gmail.com>
Greg Whiteley <greg.whiteley@atomos.com>
murgatroid99 <mlumish@google.com>
Marcin Cieslak <saper@saper.info>
João Reis <reis@janeasystems.com>
Matthew Hasbach <hasbach.git@gmail.com>
Jon Hall <jon_hall@outlook.com>
Anna Henningsen <sqrt@entless.org>
James Treworgy <jamietre@gmail.com>
James Hartig <james@levenlabs.com>
Stephanie Snopek <stephaniesnopek@gmail.com>
Kent C. Dodds <kent@doddsfamily.us>
Aaron Krause <aaronjkrause@gmail.com>
Daniel K O'Leary <daniel@dko.io>
fscherwi <fscherwi@users.noreply.github.com>
Thomas Reggi <thomas@reggi.com>
Thomas Michael McTiernan <thomasmctiernan@gmail.com>
Jason Kurian <JaKXz@users.noreply.github.com>
Sebastiaan Deckers <seb@ninja.sg>
lady3bean <lady3bean@users.noreply.github.com>
Tomi Carr <TaMe3971@users.noreply.github.com>
Juan Caicedo <retiredcanadianpoet@gmail.com>
Ashley Williams <ashley@npmjs.com>
Andrew Marcinkevičius <andrew.web@ifdattic.com>
Jorrit Schippers <jorrit@ncode.nl>
Alex Lukin <alex.lukin@softgrad.com>
Aria Stewart <aredridel@dinhe.net>
Tiago Rodrigues <tmcrodrigues@gmail.com>
Tim <tim-github@baverstock.org.uk>
Nick Williams <WickyNilliams@users.noreply.github.com>
Louis Larry <louis.larry@gmail.com>
Ben Gotow <bengotow@gmail.com>
Jakub Gieryluk <jakub.g.opensource@gmail.com>
Kevin Lorenz <mail@kevinlorenz.com>
Martin von Gagern <Martin.vGagern@gmx.net>
Eymen Gunay <eymen@egunay.com>
Martin Ek <mail@ekmartin.com>
Rafał Pocztarski <r.pocztarski@gmail.com>
Mark Reeder <mreeder@uber.com>
Chris Rebert <github@chrisrebert.com>
Scott Addie <tobias.addie@gmail.com>
Jeff McMahan <jeffrey.lee.mcmahan@gmail.com>
Tim Krins <timkrins@gmail.com>
Hal Henke <halhenke@gmail.com>
Julian Simioni <julian@simioni.org>
Jimb Esser <jimb@yahoo-inc.com>
Alexis Campailla <alexis@janeasystems.com>
Chris Chua <chris.sirhc@gmail.com>
Beau Gunderson <beau@beaugunderson.com>
Dave Galbraith <dave@jut.io>
s100 <shughes1@uk.ibm.com>
Sergey Simonchik <sergey.simonchik@jetbrains.com>
Vanja Radovanović <elvanja@gmail.com>
Jonathan Persson <persson.jonathan@gmail.com>
Vedat Mahir YILMAZ <mahir@vedatmahir.com>
Samuel Reed <samuel.trace.reed@gmail.com>
Rafał Legiędź <rafal.legiedz@gmail.com>
Jan Schär <jscissr@gmail.com>
Xcat Liu <xcatliu@gmail.com>
harryh <Aourin@users.noreply.github.com>
Prayag Verma <prayag.verma@gmail.com>
Neil Kistner <neil.kistner@gmail.com>
Zoujie Wzj <zoujie.wzj@alibaba-inc.com>
Ryan Hendrickson <ryan.hendrickson@alum.mit.edu>
Arturo Coronel <aoitsu3@gmail.com>
Hutson Betts <hbetts@factset.com>
Lewis Cowper <lewis.cowper@googlemail.com>
Adam Byrne <misterbyrne@gmail.com>
Ifeanyi Oraelosi <ifeanyioraelosi@gmail.com>
Robert Ludwig <rob.ludwig@rideamigos.com>
Chris Warren <chris@ixalon.net>
Scott Plumlee <scott@plumlee.org>
Daniel Pedersen <daniel@scandinav.se>
rhgb <kaiserdaemon@gmail.com>
doug.wade <doug.wade@redfin.com>
Zac <zdoege@gm.slc.edu>
GriffinSchneider <griffinschneider@gmail.com>
Andres Kalle <mjomble@gmail.com>
thefourtheye <thefourtheye@users.noreply.github.com>
Yael <yaelz@users.noreply.github.com>
Yann Odeyer <yann@odeyer.com>
James Monger <jameskmonger@hotmail.co.uk>
Thomas Hallock <thomas@1stdibs.com>
Paul Irish <paul.irish@gmail.com>
Paul O'Leary McCann <polm@dampfkraft.com>
Francis Gulotta <wizard@roborooter.com>
Felix Rieseberg <felix@felixrieseberg.com>
Glen Mailer <glenjamin@gmail.com>
Federico Brigante <bfred-it@users.noreply.github.com>
Steve Mao <maochenyan@gmail.com>
Anna Henningsen <anna@addaleax.net>
Rachel Evans <git@rve.org.uk>
Sam Minnee <sam@silverstripe.com>
Zirak <zirakertan@gmail.com>
Daniel Lupu <lupu.daniel.f@gmail.com>
Gianluca Casati <fibo@users.noreply.github.com>
André Herculano <andresilveirah@gmail.com>
Wyatt Preul <wpreul@gmail.com>
Myles Borins <mborins@us.ibm.com>
Elliot Lee <github.public@intelliot.com>
Dmitry Kirilyuk <gk.joker@gmail.com>
Aaron Tribou <aaron.tribou@gmail.com>
Tapani Moilanen <moilanen.tapani@gmail.com>
Han Seoul-Oh <laughinghan@gmail.com>
Aleksey Shvayka <shvaikalesh@gmail.com>
Emma Ramirez <ramirez.emma.g@gmail.com>
Julian Duque <julianduquej@gmail.com>
Simon MacDonald <simon.macdonald@gmail.com>
Adam Stankiewicz <sheerun@sher.pl>
Gregers Gram Rygg <gregers.gram.rygg@finn.no>
Peter Dave Hello <hsu@peterdavehello.org>
Jordan Klassen <forivall@gmail.com>
Jason Palmer <jason@jason-palmer.com>
Michael Hart <michael.hart.au@gmail.com>
Sasha Koss <koss@nocorp.me>
David Emmerson <david.emmerson@gmail.com>
Christophe Hurpeau <christophe@hurpeau.com>
Daniel Paz-Soldan <daniel.pazsoldan@gmail.com>
Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Zach Renner <zarenner@microsoft.com>
Christopher Hiller <boneskull@boneskull.com>
Joshua Bennett <legodudejb@gmail.com>
Andrew Meyer <andrewm.bpi@gmail.com>
Michael Jasper <mdjasper@gmail.com>
Max <contact@mstoiber.com>
Szymon Nowak <szimek@gmail.com>
Jason Karns <jason.karns@gmail.com>
Lucas Holmquist <lholmqui@redhat.com>
Ionică Bizău <bizauionica@gmail.com>
Alex Chesters <AlexChesters@users.noreply.github.com>
Robert Gay <robert.gay@redfin.com>
Steven <stevokk@hotmail.com>
Tim Caswell <tim@creationix.com>
Anna Henningsen <github@addaleax.net>
Kim Røen <kim@kimroen.com>
Douglas Wilson <dougwilson@live.com>
Mike Engel <mike@mike-engel.com>
baderbuddy <baderbuddy@gmail.com>
Alex Jordan <alex@strugee.net>
Ville Lahdenvuo <tuhoojabotti@gmail.com>
Natalie Wolfe <nwolfe@newrelic.com>
Andrew Schmadel <aschmadel@learningobjects.com>
Jonah Moses <jonahkmoses@gmail.com>
Daijirō Wachi <daijiro.wachi@gmail.com>
Dmitry Litvinchenko <karaliti@gmail.com>
chocolateboy <chocolate@cpan.org>
Henry Zhu <hi@henryzoo.com>
Nate Goldman <ungoldman@gmail.com>
Ted Yavuzkurt <hello@TedY.io>
Arseniy Maximov <localhost@kern0.ru>
Evgeny Kulikov <beyondcompute@users.noreply.github.com>
Сковорода Никита Андреевич <chalkerx@gmail.com>
Carol (Nichols || Goulding) <carol.nichols@gmail.com>
Jarid Margolin <jaridmargolin@gmail.com>
David Cook <divergentdave@gmail.com>
Brian Dukes <bdukes@engagesoftware.com>
Jed Fox <git@twopointzero.us>
Pavlo Liulia <pavloblack@hotmail.com>
Ján Dzurek <famousgarkin@outlook.com>
Lucas Theisen <ltheisen@mitre.org>
Mike Sherov <mike.sherov@gmail.com>
薛定谔的猫 <hh_2013@foxmail.com>
Paweł Lula <pavloblack@hotmail.com>
Jakob Krigovsky <jakob@krigovsky.com>
George Rawlinson <george@rawlinson.net.nz>
Jack Nagel <jacknagel@users.noreply.github.com>
Andreas Kohn <andreas.kohn@gmail.com>
Jason Wohlgemuth <jhwohlgemuth@users.noreply.github.com>
Ryan Graham <r.m.graham@gmail.com>
Hirse <jan.pilzer@gmx.de>
Colin Rotherham <work@colinr.com>
Aki <hi@akiro.se>
Emily Marigold Klassen <forivall@gmail.com>
Ramana Venkata <idlike2dream@gmail.com>
kierendixon <knitesoulja@hotmail.com>
Rácz Tibor Zoltán <racztiborzoltan@gmail.com>
Guangcong Luo <guangcongluo@gmail.com>
Steven <steven@ceriously.com>
Jan Pilzer <jan.pilzer@gmx.de>
Leonard Martin <leonard.martin@gmail.com>
Teddy Katz <teddy.katz@gmail.com>
Simon Legg <leggsimon@gmail.com>
Kin Lum <kenneth.kin.lum@gmail.com>
David Rousselie <guido.dassori@gmail.com>
Jože Mlakar <JozeM@ixtlan-team.si>
happylynx <happylynx@users.noreply.github.com>
Dominic Watson <intellix@users.noreply.github.com>
Enrico Weigelt, metux IT consult <enrico.weigelt@gr13.net>
Brian Beck <exogen@gmail.com>
Ramana Venkata <vramana@users.noreply.github.com>
Misha Kaletsky <misha.kaletsky@gmail.com>
Andrew Schmadel <schmod@users.noreply.github.com>
AJ Jordan <alex@strugee.net>
Mark Banner <standard8@mozilla.com>
Richard Simko <richardsimko@users.noreply.github.com>
Sanketh Katta <sankethkatta@gmail.com>
Tim Needham <tim.needham@wmfs.net>
Leonardo Rojas <leonardo.rojas@shopify.com>
Mark Peter Fejes <fejes.mark@gmail.com>
Ryan Florence <rpflorence@gmail.com>
MichaelQQ <mingsian.tu@vpon.com>
Anders D. Johnson <anders.d.johnson.developer@gmail.com>
Benjamin Fernandes <lotharsee@gmail.com>
Simon Kurtz <simonkurtz@gmail.com>
David Goss <david@davidgoss.co.uk>
Luis Gustavo Pereira <lgp1985@yahoo.com.br>
Amos Wenger <fasterthanlime@users.noreply.github.com>
Samuel Marks <samuelmarks@gmail.com>
Victor Travieso <victor@grabcad.com>
Joshua Chaitin-Pollak <jbcpollak@users.noreply.github.com>
Brendan Warkentin <faazshift@gmail.com>
Scott Santucci <ScottFreeCode@users.noreply.github.com>
Xavier Cambar <xcambar@gmail.com>
Vikram <nrvikram19@gmail.com>
Igor Nadj <igor.nadj@shinesolutions.com>
Tong Li <supertong@users.noreply.github.com>
tripu <t@tripu.info>
Carsten Brandt <mail@cebe.cc>
Marcin Szczepanski <marcin@imagichine.com.au>
Josh Clow <josh@textio.com>
Jakub Holy <jakubholy@jakubholy.net>
Alexandra Ulsh <alexandra.ulsh@gmail.com>
Tom MacWright <tmcw@users.noreply.github.com>
Felicio Mununga <felicio@users.noreply.github.com>
Gabor Szabo <gszabo@users.noreply.github.com>
Andreas Müller <mail@devmount.de>
Andrew Pitman <apitman@users.noreply.github.com>
Jacob Wejendorp <jacob@wejendorp.dk>
Alejandro López <a.lopez.sanchez@outlook.es>
Victor Belozyorov <hi@vbelozyorov.com>
Bradley Farias <bfarias@godaddy.com>
Kyle E. Mitchell <kyle@kemitchell.com>
Tuan Anh Tran <me@tuananh.org>
Nathan Woltman <nwoltman@outlook.com>
Kyra <kyranet@users.noreply.github.com>
Leаh Neukirchen <chneukirchen@gmail.com>
Kyle Spier-Swenson <kyleshome@gmail.com>
Joe Bowbeer <joe.bowbeer@gmail.com>
Nalin Bhardwaj <6984346+nalinbhardwaj@users.noreply.github.com>
Nicolas Garnier <ngarnier@users.noreply.github.com>
Vladislav Rassokhin <vladrassokhin@gmail.com>
Josh Goldberg <joshuakgoldberg@outlook.com>
laggingreflex <laggingreflex@gmail.com>
Kristofer Selbekk <selbekk@users.noreply.github.com>
Sreenivas Alapati <sreenivas9alapati@gmail.com>
Ben Creasy <ben@bencreasy.com>
Allan Kimmer Jensen <allankimmerjensen@gmail.com>
rinfan <rinfan@users.noreply.github.com>
Matt Hoyle <code@deployable.co>
Mason Pawsey <mpawsey@csub.edu>
Johannes Bader <olydis@users.noreply.github.com>
Michael Zabka <zabka.michael@gmail.com>
Bruce MacNaughton <bmacnaughton@gmail.com>
Christopher Patty <christopher.patty@aggiemail.usu.edu>
Max Stoiber <contact@mxstbr.com>
Enrico Weigelt <enrico.weigelt@gr13.net>
David Hu <davidjhu@gmail.com>
Steven R. Loomis <srl295@gmail.com>
Julien Deniau <julien.deniau@gmail.com>
Prasanna Venkatesh T S <vipranarayan14@gmail.com>
Alec Larson <aleclarson@users.noreply.github.com>
John-David Dalton <john.david.dalton@gmail.com>
Raymond Feng <enjoyjava@gmail.com>
Tieme van Veen <tiemevanveen@hotmail.com>
Finn Pauls <derfinn@gmail.com>
Jeremy Kahn <jeremyckahn@gmail.com>
Mertcan Mermerkaya <mertcan@mermerkaya.net>
Will Yardley <wyardley@users.noreply.github.com>
Matt Travi <github@travi.org>
Solomon Victorino <solomonvictorino@gmail.com>
Rich Trott <rtrott@gmail.com>
Maksym Kobieliev <maximaximums@gmail.com>
Thomas Reggi <socialtr@gmail.com>
David Gilbertson <gilbertson.david@gmail.com>
Rob Lourens <roblourens@gmail.com>
Karan Thakkar <karanjthakkar@gmail.com>
Howard T. Chiam <hchiam@users.noreply.github.com>
Geoffrey Mattie <info@geoffreymattie.com>
Luis Lobo Borobia <luislobo@gmail.com>
Aaron Tribou <tribou@users.noreply.github.com>
刘祺 <gucong@gmail.com>
Brad Johnson <bradsk88@gmail.com>
Artem Varaksa <aymfst@gmail.com>
Mary <Ipadlover8322@gmail.com>
Darryl Pogue <dvpdiner2@gmail.com>
Rick Schubert <rickschubert@gmx.de>
Daniel W <dwilches@gmail.com>
XhmikosR <xhmikosr@gmail.com>
Martin Kühl <mkhl@users.noreply.github.com>
Valentin Ouvrard <valentin210594@gmail.com>
Noah Benham <noahbenham@users.noreply.github.com>
Brian Olore <brian@olore.net>
Mat Warger <mwarger@gmail.com>
Federico Rampazzo <frampone@gmail.com>
SneakyFish5 <32284796+SneakyFish5@users.noreply.github.com>
Nikki Everett <neverett@users.noreply.github.com>
Erik Price <github@erikprice.net>
Lars Willighagen <lars.willighagen@gmail.com>
Kevin Gibbons <bakkot@gmail.com>
Maarten Balliauw <maarten@balliauw.be>
Mehdy Dara <mdara@eleven-labs.com>
Robert Kielty <rob.kielty@gmail.com>
Scott Trinh <scottyparade@gmail.com>
Hugo <hugovk@users.noreply.github.com>
Jacob <jakeincanada@icloud.com>
Joe Bottigliero <joe@bottigliero.com>
Nikolai Vavilov <vvnicholas@gmail.com>
Kelvin Jin <kelvinjin@google.com>
乱序 <midare@utakana.de>
Audrey Eschright <audrey@npmjs.com>
Xu Meng <dmabupt@gmail.com>
George <george.taveras1231@gmail.com>
Beni von Cheni <benjaminlchen@gmail.com>
Frédéric Harper <fharper@npmjs.com>
Johannes Würbach <johannes.wuerbach@googlemail.com>
ƇʘƁ̆ąƇ́ <anchnk@users.noreply.github.com>
Eli Doran <eli@elidoran.com>
Tobias Koppers <tobias.koppers@googlemail.com>
Grey Baker <greysteil@gmail.com>
JT Turner <jtwebman@gmail.com>
Audrey Eschright <audrey@lifeofaudrey.com>
Alexander Gudulin <alexandr.gudulin@gmail.com>
Philipp Hagemeister <phihag@phihag.de>
Amadou Sall <ahasall.dev@gmail.com>
Chris Manson <mansona@users.noreply.github.com>
vlasy <vlasy@users.noreply.github.com>
Emilis Dambauskas (Tokenmill) <emilis.dambauskas@tokenmill.lt>
George Czabania <george@mish.guru>
Jonathan Underwood <junderwood@bitcoinbank.co.jp>
Nick Graef <nicholas.a.graef@gmail.com>
James George <jamesgeorge998001@gmail.com>
John O'Sullivan <j.osullivan42@gmail.com>
ossdev <ossdev@puresoftware.com>
Raphael Goulais <raphael.goulais@f5c.fr>
COURIER, CALEB [AG/1000] <caleb.courier@monsanto.com>
CalebCourier <caleb.courier@monsanto.com>
Florian Keller <florian.keller@wire.com>
Sreeram Jayan <sreeram.jayan@cerner.com>
--get <lars.willighagen@gmail.com>
raywu0123 <b05901189@ntu.edu.tw>
Iván Reinoso García <ireinoso@plainconcepts.com>
Roy Marples <roy@marples.name>
Robert James Gabriel <robert_gabriel@outlook.com>
John Firebaugh <john.firebaugh@gmail.com>
Kitten King <hi@kittenking.me>
Claudia Hernández <cghr1990@gmail.com>
Artem Sapegin <artem@sapegin.ru>
Márton Salomváry <salomvary@gmail.com>
gall0ws <g4ll0ws@gmail.com>
Olivier Chevet <olivr70@outlook.fr>
Maël Nison <nison.mael@gmail.com>
Sara Ahbabou <ahbabousara@gmail.com>
Gareth Jones <Jones258@Gmail.com>
Ruy Adorno <ruyadorno@hotmail.com>
Michael Perrotte <mike@npmjs.com>
Ben Blank <ben.blank+github@gmail.com>
Christian Clauss <cclauss@me.com>
Nikita Lebedev <bloomber111@gmail.com>
Henrik Gemal <henrik@gemal.dk>
Philip Harrison <philip@mailharrison.com>
Jason Etcovitch <jasonetco@github.com>
Darcy Clarke <darcy@darcyclarke.me>
orion <oletizi@mac.com>
NoDocCat <nodoccat@outlook.com>
joan xie <w4ergf@qq.com>
Amal Hussein <amal@npmjs.com>
Brett Zamir <brettz9@yahoo.com>
Menelaos Kotsollaris <mkotsollaris@users.noreply.github.com>
Mehdi Hasan Khan <mhasan@omicronlab.com>
Craig Loewen <crloewen@microsoft.com>
Fighting-Jack <574637316@qq.com>
Bakel, Roel van <roel.vanbakel@oce.com>
Charlie West-Toebe <38671683+Hoidberg@users.noreply.github.com>
Richard Lau <riclau@uk.ibm.com>
Felix Yan <felixonmars@archlinux.org>
Zhenya Vinogradov <zhenyavinogradov@gmail.com>
Rafael Hengles <rhengles@gmail.com>
Jan-Philip Gehrcke <jp@opstrace.com>
Caleb Sacks <16855387+clabe45@users.noreply.github.com>
Kyle Getz <kgetz@arista.com>
Sean Healy <s@xib.ca>
Netanel Gilad <netanelg@wix.com>
Dave Nicolson <david.nicolson@gmail.com>
Ajay Narain Mathur <ajaynarainmathur@gmail.com>
Vitaliy Markitanov <9357021+vit100@users.noreply.github.com>
simon_s <simon_s@afimilk.co.il>
John Kennedy <john.kennedy.9147@gmail.com>
Bernard Kitchens <bernard@npmjs.com>
Jarda Snajdr <jsnajdr@gmail.com>
Naix Geng <1308363651@qq.com>
Dylan Treisman <dylanzt@gmail.com>
mum-never-proud <abhuz@hotmail.com>
Pablo Cúbico <pablocuadrado@gmail.com>
Peter Fich <peterfich@users.noreply.github.com>
Maxwell Gerber <mgerber@berkeley.edu>
Sean Poulter <sean.poulter@gmail.com>
vanishcode <vanishcode@outlook.com>
Timo Sand <timo.sand@iki.fi>
Jean-Charles Sisk <jasisk@gmail.com>
Martin Packman <martin@zegami.com>
Danielle Adams <danielle.adams@heroku.com>
Edward Thomson <ethomson@edwardthomson.com>
Masafumi Koba <ybiquitous@gmail.com>
Gianfranco Costamagna <costamagnagianfranco@yahoo.it>
Antonio <antonio.olmo@devo.com>
Sandra Tatarevićová <sandra@tatarevicova.cz>
Antoine du Hamel <duhamelantoine1995@gmail.com>
Assaf Sapir <assapir@github.com>
jamesgeorge007 <jamesgeorge998001@gmail.com>
Lukas Spieß <lumaxis@github.com>
Mickael Jeanroy <mickael.jeanroy@gmail.com>
Myles Borins <mylesborins@github.com>
Nathan LaFreniere <quitlahok@gmail.com>
Lucio Martinez <lucio.martinez@sixt.com>
Brian Jenkins <brian@npmjs.com>
nlf <quitlahok@gmail.com>
zhaoxuxu <zhaoxuxujc@gmail.com>
liuye.adam <liuye.adam@bytedance.com>
Michaël Zasso <targos@protonmail.com>
Gareth Jones <jones258@gmail.com>
Jake Champion <me@jakechampion.name>
takenspc <taken.spc@gmail.com>
iraj <irajtaghlidi@gmail.com>
Michele Azzolari <michele@azzolari.it>
foxxyz <foxxyz@gmail.com>
Dr <dr@dr.run>
Jan Tojnar <jtojnar@gmail.com>
Jason Attwood <jason_attwood@hotmail.co.uk>
Vlad GURDIGA <gurdiga@gmail.com>
Sébastien Puech <s.puech@tricentis.com>
Jannis Hell <Primajin@users.noreply.github.com>
Hollow Man <hollowman@hollowman.ml>
kai zhu <kaizhu256@gmail.com>
Alex Woollam <alexjhwoollam@gmail.com>
Daniel Fischer <daniel@d-fischer.dev>
Yash-Singh1 <saiansh2525@gmail.com>
Edu93Jer <mailing_93@hotmail.com>
Tieg Zaharia <tieg@tidelift.com>
Aki <71239005+AkiaCode@users.noreply.github.com>
fuhao.xu <fuhao.xu@yitu-inc.com>
marsonya <16393876+marsonya@users.noreply.github.com>
Jeff Griffiths <jeff@eko-recordings.ca>
Michael Garvin <gar+gh@danger.computer>
Gar <gar+gh@danger.computer>
dr-js <dr@dr.run>
Pavan Bellamkonda <31280326+pavanbellamkonda@users.noreply.github.com>
Alexander Riccio <test35965@gmail.com>
RA80533 <32469082+RA80533@users.noreply.github.com>
Ikko Ashimine <eltociear@gmail.com>
MrBrain295 <66077254+MrBrain295@users.noreply.github.com>
kumavis <aaron@kumavis.me>
Christof Lemke <christoflemke@github.com>
Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
Bjørn Johansen <bjjohans@microsoft.com>
Fraqe <f@fraqe.ca>
Edward Grech <dwardu@gmail.com>
Kenrick <kenrick95@gmail.com>
Karthik Sundari <karthik_sundari@comcast.com>
Jan Sepke <625043+jansepke@users.noreply.github.com>
Augusto Moura <augusto.borgesm@gmail.com>
Eric Chow <eric.zjp.chow@gmail.com>
kbayrhammer <klaus.bayrhammer@redbull.com>
James Chen-Smith <jameschensmith@gmail.com>
Yash Singh <saiansh2525@gmail.com>
Danielle Church <dani.church@gmail.com>
Seth Thomas <seth@emailseth.com>
Andreas <andreas@bielk.se>
Felipe Santos <felipecassiors@gmail.com>
Luigi Pinca <luigipinca@gmail.com>
Marco Sirabella <marco@sirabella.org>
wangsai <wangsai@bootcss.com>
Luke Hefson <luke@github.com>
mrmlnc <mrmlnc@yandex-team.ru>
Juan Picado <juanpicado19@gmail.com>
Kevin Cormier <kcormier@redhat.com>
Nariyasu Heseri <heserisiyookang@gmail.com>
rethab <rethab@protonmail.ch>
Spencer Wilson <5624115+spencerwilson@users.noreply.github.com>
Daniel Park <gimli01@github.com>
Daniel Park <daniel.park@endevors.io>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,60 @@
# Contributing
## Code of Conduct
All interactions in the **npm** organization on GitHub are considered to be covered by our standard [Code of Conduct](https://www.npmjs.com/policies/conduct).
## Development
**1. Clone this repository...**
```bash
$ git clone git@github.com:npm/cli.git npm
```
**2. Navigate into project & install development-specific dependencies...**
```bash
$ cd ./npm && npm install
```
**3. Write some code &/or add some tests...**
```bash
...
```
**4. Run tests & ensure they pass...**
```
$ npm run test
```
**5. Open a [Pull Request](https://github.com/npm/cli/pulls) for your work & become the newest contributor to `npm`! 🎉**
## Test Coverage
We expect that every new feature or bug fix comes with corresponding tests that validate the solutions. We strive to have as close to, if not exactly, 100% code coverage.
**You can find out what the current test coverage percentage is by running...**
```bash
$ npm run check-coverage
```
## Performance & Benchmarks
We've set up an automated [benchmark](https://github.com/npm/benchmarks) integration that will run against all Pull Requests; Posting back a comment with the results of the run.
**Example:**
![image](https://user-images.githubusercontent.com/2818462/72312698-e2e57f80-3656-11ea-9fcf-4a8f6b97b0d1.png)
You can learn more about this tool, including how to run & configure it manually, [here](https://github.com/npm/benchmarks)
## Dependency Updates
It should be noted that our team does not accept third-party dependency updates/PRs. We have a [release process](https://github.com/npm/cli/wiki/Release-Process) that includes checks to ensure dependencies are staying up-to-date & will ship security patches for CVEs as they occur. If you submit a PR trying to update our dependencies we will close it with or without a reference to these contribution guidelines.
## Reporting Bugs
When submitting a new bug report, please first [search](https://github.com/npm/cli/issues) for an existing or similar report & then use one of our existing [issue templates](https://github.com/npm/cli/issues/new/choose) if you believe you've come across a unique problem. Duplicate issues, or issues that don't use one of our templates may get closed without a response.

View File

@@ -0,0 +1,235 @@
The npm application
Copyright (c) npm, Inc. and Contributors
Licensed on the terms of The Artistic License 2.0
Node package dependencies of the npm application
Copyright (c) their respective copyright owners
Licensed on their respective license terms
The npm public registry at https://registry.npmjs.org
and the npm website at https://www.npmjs.com
Operated by npm, Inc.
Use governed by terms published on https://www.npmjs.com
"Node.js"
Trademark Joyent, Inc., https://joyent.com
Neither npm nor npm, Inc. are affiliated with Joyent, Inc.
The Node.js application
Project of Node Foundation, https://nodejs.org
The npm Logo
Copyright (c) Mathias Pettersson and Brian Hammond
"Gubblebum Blocky" typeface
Copyright (c) Tjarda Koster, https://jelloween.deviantart.com
Used with permission
--------
The Artistic License 2.0
Copyright (c) 2000-2006, The Perl Foundation.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
This license establishes the terms under which a given free software
Package may be copied, modified, distributed, and/or redistributed.
The intent is that the Copyright Holder maintains some artistic
control over the development of that Package while still keeping the
Package available as open source and free software.
You are always permitted to make arrangements wholly outside of this
license directly with the Copyright Holder of a given Package. If the
terms of this license do not permit the full use that you propose to
make of the Package, you should contact the Copyright Holder and seek
a different licensing arrangement.
Definitions
"Copyright Holder" means the individual(s) or organization(s)
named in the copyright notice for the entire Package.
"Contributor" means any party that has contributed code or other
material to the Package, in accordance with the Copyright Holder's
procedures.
"You" and "your" means any person who would like to copy,
distribute, or modify the Package.
"Package" means the collection of files distributed by the
Copyright Holder, and derivatives of that collection and/or of
those files. A given Package may consist of either the Standard
Version, or a Modified Version.
"Distribute" means providing a copy of the Package or making it
accessible to anyone else, or in the case of a company or
organization, to others outside of your company or organization.
"Distributor Fee" means any fee that you charge for Distributing
this Package or providing support for this Package to another
party. It does not mean licensing fees.
"Standard Version" refers to the Package if it has not been
modified, or has been modified only in ways explicitly requested
by the Copyright Holder.
"Modified Version" means the Package, if it has been changed, and
such changes were not explicitly requested by the Copyright
Holder.
"Original License" means this Artistic License as Distributed with
the Standard Version of the Package, in its current version or as
it may be modified by The Perl Foundation in the future.
"Source" form means the source code, documentation source, and
configuration files for the Package.
"Compiled" form means the compiled bytecode, object code, binary,
or any other form resulting from mechanical transformation or
translation of the Source form.
Permission for Use and Modification Without Distribution
(1) You are permitted to use the Standard Version and create and use
Modified Versions for any purpose without restriction, provided that
you do not Distribute the Modified Version.
Permissions for Redistribution of the Standard Version
(2) You may Distribute verbatim copies of the Source form of the
Standard Version of this Package in any medium without restriction,
either gratis or for a Distributor Fee, provided that you duplicate
all of the original copyright notices and associated disclaimers. At
your discretion, such verbatim copies may or may not include a
Compiled form of the Package.
(3) You may apply any bug fixes, portability changes, and other
modifications made available from the Copyright Holder. The resulting
Package will still be considered the Standard Version, and as such
will be subject to the Original License.
Distribution of Modified Versions of the Package as Source
(4) You may Distribute your Modified Version as Source (either gratis
or for a Distributor Fee, and with or without a Compiled form of the
Modified Version) provided that you clearly document how it differs
from the Standard Version, including, but not limited to, documenting
any non-standard features, executables, or modules, and provided that
you do at least ONE of the following:
(a) make the Modified Version available to the Copyright Holder
of the Standard Version, under the Original License, so that the
Copyright Holder may include your modifications in the Standard
Version.
(b) ensure that installation of your Modified Version does not
prevent the user installing or running the Standard Version. In
addition, the Modified Version must bear a name that is different
from the name of the Standard Version.
(c) allow anyone who receives a copy of the Modified Version to
make the Source form of the Modified Version available to others
under
(i) the Original License or
(ii) a license that permits the licensee to freely copy,
modify and redistribute the Modified Version using the same
licensing terms that apply to the copy that the licensee
received, and requires that the Source form of the Modified
Version, and of any works derived from it, be made freely
available in that license fees are prohibited but Distributor
Fees are allowed.
Distribution of Compiled Forms of the Standard Version
or Modified Versions without the Source
(5) You may Distribute Compiled forms of the Standard Version without
the Source, provided that you include complete instructions on how to
get the Source of the Standard Version. Such instructions must be
valid at the time of your distribution. If these instructions, at any
time while you are carrying out such distribution, become invalid, you
must provide new instructions on demand or cease further distribution.
If you provide valid instructions or cease distribution within thirty
days after you become aware that the instructions are invalid, then
you do not forfeit any of your rights under this license.
(6) You may Distribute a Modified Version in Compiled form without
the Source, provided that you comply with Section 4 with respect to
the Source of the Modified Version.
Aggregating or Linking the Package
(7) You may aggregate the Package (either the Standard Version or
Modified Version) with other packages and Distribute the resulting
aggregation provided that you do not charge a licensing fee for the
Package. Distributor Fees are permitted, and licensing fees for other
components in the aggregation are permitted. The terms of this license
apply to the use and Distribution of the Standard or Modified Versions
as included in the aggregation.
(8) You are permitted to link Modified and Standard Versions with
other works, to embed the Package in a larger work of your own, or to
build stand-alone binary or bytecode versions of applications that
include the Package, and Distribute the result without restriction,
provided the result does not expose a direct interface to the Package.
Items That are Not Considered Part of a Modified Version
(9) Works (including, but not limited to, modules and scripts) that
merely extend or make use of the Package, do not, by themselves, cause
the Package to be a Modified Version. In addition, such works are not
considered parts of the Package itself, and are not subject to the
terms of this license.
General Provisions
(10) Any use, modification, and distribution of the Standard or
Modified Versions is governed by this Artistic License. By using,
modifying or distributing the Package, you accept this license. Do not
use, modify, or distribute the Package, if you do not accept this
license.
(11) If your Modified Version has been derived from a Modified
Version made by someone other than you, you are nevertheless required
to ensure that your Modified Version complies with the requirements of
this license.
(12) This license does not grant you the right to use any trademark,
service mark, tradename, or logo of the Copyright Holder.
(13) This license includes the non-exclusive, worldwide,
free-of-charge patent license to make, have made, use, offer to sell,
sell, import and otherwise transfer the Package with respect to any
patent claims licensable by the Copyright Holder that are necessarily
infringed by the Package. If you institute patent litigation
(including a cross-claim or counterclaim) against any party alleging
that the Package constitutes direct or contributory patent
infringement, then this Artistic License to you shall terminate on the
date that such litigation is filed.
(14) Disclaimer of Warranty:
THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL
LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------

View File

@@ -0,0 +1,65 @@
[![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/npm/cli/Node%20CI/latest)](https://github.com/npm/cli/actions?query=workflow%3A%22Node+CI%22+branch%3Alatest) [![Coveralls github branch](https://img.shields.io/coveralls/github/npm/cli/latest)](https://coveralls.io/github/npm/cli?branch=latest)
# npm - a JavaScript package manager
### Requirements
* [**Node.js** `v10`](https://nodejs.org/en/download/) or higher must be installed to run this program
### Installation
**`npm`** comes bundled with [**`node`**](https://nodejs.org/), & most third-party distributions, by default. Officially supported downloads/distributions can be found at: [nodejs.org/en/download](https://nodejs.org/en/download)
#### Direct Download
You can download & install **`npm`** directly from [**npmjs**.com](https://npmjs.com/) using our custom `install.sh` script:
```bash
curl -qL https://www.npmjs.com/install.sh | sh
```
#### Node Version Managers
If you're looking to manage multiple versions of **`node`** &/or **`npm`**, consider using a "Node Version Manager" such as:
* [**`nvm`**](https://github.com/nvm-sh/nvm)
* [**`nvs`**](https://github.com/jasongin/nvs)
* [**`nave`**](https://github.com/isaacs/nave)
* [**`n`**](https://github.com/tj/n)
* [**`volta`**](https://github.com/volta-cli/volta)
* [**`nodenv`**](https://github.com/nodenv/nodenv)
* [**`asdf-nodejs`**](https://github.com/asdf-vm/asdf-nodejs)
### Usage
```bash
npm <command>
```
### Links & Resources
* [**Documentation**](https://docs.npmjs.com/) - Official docs & how-tos for all things **npm**
* Note: you can also search docs locally with `npm help-search <query>`
* [**Bug Tracker**](https://github.com/npm/cli/issues) - Search or submit bugs against the CLI
* [**Roadmap**](https://github.com/npm/roadmap) - Track & follow along with our public roadmap
* [**Feedback**](https://github.com/npm/feedback) - Contribute ideas & discussion around the npm registry, website & CLI
* [**RFCs**](https://github.com/npm/rfcs) - Contribute ideas & specifications for the API/design of the npm CLI
* [**Service Status**](https://status.npmjs.org/) - Monitor the current status & see incident reports for the website & registry
* [**Project Status**](https://npm.github.io/statusboard/) - See the health of all our maintained OSS projects in one view
* [**Events Calendar**](https://calendar.google.com/calendar/u/0/embed?src=npmjs.com_oonluqt8oftrt0vmgrfbg6q6go@group.calendar.google.com) - Keep track of our Open RFC calls, releases, meetups, conferences & more
* [**Support**](https://www.npmjs.com/support) - Experiencing problems with the **npm** [website](https://npmjs.com) or [registry](https://registry.npmjs.org)? File a ticket [here](https://www.npmjs.com/support)
### Acknowledgments
* `npm` is configured to use the **npm Public Registry** at [https://registry.npmjs.org](https://registry.npmjs.org) by default; Usage of this registry is subject to **Terms of Use** available at [https://npmjs.com/policies/terms](https://npmjs.com/policies/terms)
* You can configure `npm` to use any other compatible registry you prefer. You can read more about configuring third-party registries [here](https://docs.npmjs.com/cli/v7/using-npm/registry)
### FAQ on Branding
#### Is it "npm" or "NPM" or "Npm"?
**`npm`** should never be capitalized unless it is being displayed in a location that is customarily all-capitals (ex. titles on `man` pages).
#### Is "npm" an acronym for "Node Package Manager"?
Contrary to popular belief, **`npm`** **is not** in fact an acronym for "Node Package Manager"; It is a recursive bacronymic abbreviation for **"npm is not an acronym"** (if the project was named "ninaa", then it would be an acronym). The precursor to **`npm`** was actually a bash utility named **"pm"**, which was the shortform name of **"pkgmakeinst"** - a bash function that installed various things on various platforms. If **`npm`** were to ever have been considered an acronym, it would be as "node pm" or, potentially "new pm".

View File

@@ -0,0 +1,114 @@
---
title: npm-access
section: 1
description: Set access level on published packages
---
### Synopsis
```bash
npm access public [<package>]
npm access restricted [<package>]
npm access grant <read-only|read-write> <scope:team> [<package>]
npm access revoke <scope:team> [<package>]
npm access 2fa-required [<package>]
npm access 2fa-not-required [<package>]
npm access ls-packages [<user>|<scope>|<scope:team>]
npm access ls-collaborators [<package> [<user>]]
npm access edit [<package>]
```
### Description
Used to set access controls on private packages.
For all of the subcommands, `npm access` will perform actions on the packages
in the current working directory if no package name is passed to the
subcommand.
* public / restricted:
Set a package to be either publicly accessible or restricted.
* grant / revoke:
Add or remove the ability of users and teams to have read-only or read-write
access to a package.
* 2fa-required / 2fa-not-required:
Configure whether a package requires that anyone publishing it have two-factor
authentication enabled on their account.
* ls-packages:
Show all of the packages a user or a team is able to access, along with the
access level, except for read-only public packages (it won't print the whole
registry listing)
* ls-collaborators:
Show all of the access privileges for a package. Will only show permissions
for packages to which you have at least read access. If `<user>` is passed in,
the list is filtered only to teams _that_ user happens to belong to.
* edit:
Set the access privileges for a package at once using `$EDITOR`.
### Details
`npm access` always operates directly on the current registry, configurable
from the command line using `--registry=<registry url>`.
Unscoped packages are *always public*.
Scoped packages *default to restricted*, but you can either publish them as
public using `npm publish --access=public`, or set their access as public using
`npm access public` after the initial publish.
You must have privileges to set the access of a package:
* You are an owner of an unscoped or scoped package.
* You are a member of the team that owns a scope.
* You have been given read-write privileges for a package, either as a member
of a team or directly as an owner.
If you have two-factor authentication enabled then you'll be prompted to
provide an otp token, or may use the `--otp=...` option to specify it on
the command line.
If your account is not paid, then attempts to publish scoped packages will
fail with an HTTP 402 status code (logically enough), unless you use
`--access=public`.
Management of teams and team memberships is done with the `npm team` command.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `otp`
* Default: null
* Type: null or String
This is a one-time password from a two-factor authenticator. It's needed
when publishing or changing package permissions with `npm access`.
If not set, and a registry response fails with a challenge for a one-time
password, npm will prompt on the command line for one.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [`libnpmaccess`](https://npm.im/libnpmaccess)
* [npm team](/commands/npm-team)
* [npm publish](/commands/npm-publish)
* [npm config](/commands/npm-config)
* [npm registry](/using-npm/registry)

View File

@@ -0,0 +1,87 @@
---
title: npm-adduser
section: 1
description: Add a registry user account
---
### Synopsis
```bash
npm adduser [--registry=url] [--scope=@orgname] [--auth-type=legacy]
aliases: login, add-user
```
Note: This command is unaware of workspaces.
### Description
Create or verify a user named `<username>` in the specified registry, and
save the credentials to the `.npmrc` file. If no registry is specified,
the default registry will be used (see [`config`](/using-npm/config)).
The username, password, and email are read in from prompts.
To reset your password, go to <https://www.npmjs.com/forgot>
To change your email address, go to <https://www.npmjs.com/email-edit>
You may use this command multiple times with the same user account to
authorize on a new machine. When authenticating on a new machine,
the username, password and email address must all match with
your existing record.
`npm login` is an alias to `adduser` and behaves exactly the same way.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `scope`
* Default: the scope of the current project, if any, or ""
* Type: String
Associate an operation with a scope for a scoped registry.
Useful when logging in to or out of a private registry:
```
# log in, linking the scope to the custom registry
npm login --scope=@mycorp --registry=https://registry.mycorp.com
# log out, removing the link and the auth token
npm logout --scope=@mycorp
```
This will cause `@mycorp` to be mapped to the registry for future
installation of packages specified according to the pattern
`@mycorp/package`.
This will also cause `npm init` to create a scoped package.
```
# accept all defaults, and create a package named "@foo/whatever",
# instead of just named "whatever"
npm init --scope=@foo --yes
```
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm registry](/using-npm/registry)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm owner](/commands/npm-owner)
* [npm whoami](/commands/npm-whoami)
* [npm token](/commands/npm-token)
* [npm profile](/commands/npm-profile)

View File

@@ -0,0 +1,311 @@
---
title: npm-audit
section: 1
description: Run a security audit
---
### Synopsis
```bash
npm audit [--json] [--production] [--audit-level=(low|moderate|high|critical)]
npm audit fix [--force|--package-lock-only|--dry-run|--production|--only=(dev|prod)]
common options: [--production] [--only=(dev|prod)]
```
### Description
The audit command submits a description of the dependencies configured in
your project to your default registry and asks for a report of known
vulnerabilities. If any vulnerabilities are found, then the impact and
appropriate remediation will be calculated. If the `fix` argument is
provided, then remediations will be applied to the package tree.
The command will exit with a 0 exit code if no vulnerabilities were found.
Note that some vulnerabilities cannot be fixed automatically and will
require manual intervention or review. Also note that since `npm audit
fix` runs a full-fledged `npm install` under the hood, all configs that
apply to the installer will also apply to `npm install` -- so things like
`npm audit fix --package-lock-only` will work as expected.
By default, the audit command will exit with a non-zero code if any
vulnerability is found. It may be useful in CI environments to include the
`--audit-level` parameter to specify the minimum vulnerability level that
will cause the command to fail. This option does not filter the report
output, it simply changes the command's failure threshold.
### Audit Endpoints
There are two audit endpoints that npm may use to fetch vulnerability
information: the `Bulk Advisory` endpoint and the `Quick Audit` endpoint.
#### Bulk Advisory Endpoint
As of version 7, npm uses the much faster `Bulk Advisory` endpoint to
optimize the speed of calculating audit results.
npm will generate a JSON payload with the name and list of versions of each
package in the tree, and POST it to the default configured registry at
the path `/-/npm/v1/security/advisories/bulk`.
Any packages in the tree that do not have a `version` field in their
package.json file will be ignored. If any `--omit` options are specified
(either via the `--omit` config, or one of the shorthands such as
`--production`, `--only=dev`, and so on), then packages will be omitted
from the submitted payload as appropriate.
If the registry responds with an error, or with an invalid response, then
npm will attempt to load advisory data from the `Quick Audit` endpoint.
The expected result will contain a set of advisory objects for each
dependency that matches the advisory range. Each advisory object contains
a `name`, `url`, `id`, `severity`, `vulnerable_versions`, and `title`.
npm then uses these advisory objects to calculate vulnerabilities and
meta-vulnerabilities of the dependencies within the tree.
#### Quick Audit Endpoint
If the `Bulk Advisory` endpoint returns an error, or invalid data, npm will
attempt to load advisory data from the `Quick Audit` endpoint, which is
considerably slower in most cases.
The full package tree as found in `package-lock.json` is submitted, along
with the following pieces of additional metadata:
* `npm_version`
* `node_version`
* `platform`
* `arch`
* `node_env`
All packages in the tree are submitted to the Quick Audit endpoint.
Omitted dependency types are skipped when generating the report.
#### Scrubbing
Out of an abundance of caution, npm versions 5 and 6 would "scrub" any
packages from the submitted report if their name contained a `/` character,
so as to avoid leaking the names of potentially private packages or git
URLs.
However, in practice, this resulted in audits often failing to properly
detect meta-vulnerabilities, because the tree would appear to be invalid
due to missing dependencies, and prevented the detection of vulnerabilities
in package trees that used git dependencies or private modules.
This scrubbing has been removed from npm as of version 7.
#### Calculating Meta-Vulnerabilities and Remediations
npm uses the
[`@npmcli/metavuln-calculator`](http://npm.im/@npmcli/metavuln-calculator)
module to turn a set of security advisories into a set of "vulnerability"
objects. A "meta-vulnerability" is a dependency that is vulnerable by
virtue of dependence on vulnerable versions of a vulnerable package.
For example, if the package `foo` is vulnerable in the range `>=1.0.2
<2.0.0`, and the package `bar` depends on `foo@^1.1.0`, then that version
of `bar` can only be installed by installing a vulnerable version of `foo`.
In this case, `bar` is a "metavulnerability".
Once metavulnerabilities for a given package are calculated, they are
cached in the `~/.npm` folder and only re-evaluated if the advisory range
changes, or a new version of the package is published (in which case, the
new version is checked for metavulnerable status as well).
If the chain of metavulnerabilities extends all the way to the root
project, and it cannot be updated without changing its dependency ranges,
then `npm audit fix` will require the `--force` option to apply the
remediation. If remediations do not require changes to the dependency
ranges, then all vulnerable packages will be updated to a version that does
not have an advisory or metavulnerability posted against it.
### Exit Code
The `npm audit` command will exit with a 0 exit code if no vulnerabilities
were found. The `npm audit fix` command will exit with 0 exit code if no
vulnerabilities are found _or_ if the remediation is able to successfully
fix all vulnerabilities.
If vulnerabilities were found the exit code will depend on the
`audit-level` configuration setting.
### Examples
Scan your project for vulnerabilities and automatically install any compatible
updates to vulnerable dependencies:
```bash
$ npm audit fix
```
Run `audit fix` without modifying `node_modules`, but still updating the
pkglock:
```bash
$ npm audit fix --package-lock-only
```
Skip updating `devDependencies`:
```bash
$ npm audit fix --only=prod
```
Have `audit fix` install SemVer-major updates to toplevel dependencies, not
just SemVer-compatible ones:
```bash
$ npm audit fix --force
```
Do a dry run to get an idea of what `audit fix` will do, and _also_ output
install information in JSON format:
```bash
$ npm audit fix --dry-run --json
```
Scan your project for vulnerabilities and just show the details, without
fixing anything:
```bash
$ npm audit
```
Get the detailed audit report in JSON format:
```bash
$ npm audit --json
```
Fail an audit only if the results include a vulnerability with a level of moderate or higher:
```bash
$ npm audit --audit-level=moderate
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `audit-level`
* Default: null
* Type: null, "info", "low", "moderate", "high", "critical", or "none"
The minimum level of vulnerability for `npm audit` to exit with a non-zero
exit code.
#### `dry-run`
* Default: false
* Type: Boolean
Indicates that you don't want npm to make any changes and that it should
only report what it would have done. This can be passed into any of the
commands that modify your local installation, eg, `install`, `update`,
`dedupe`, `uninstall`, as well as `pack` and `publish`.
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.
#### `force`
* Default: false
* Type: Boolean
Removes various protections against unfortunate side effects, common
mistakes, unnecessary performance degradation, and malicious input.
* Allow clobbering non-npm files in global installs.
* Allow the `npm version` command to work on an unclean git repository.
* Allow deleting the cache folder with `npm cache clean`.
* Allow installing packages that have an `engines` declaration requiring a
different version of npm.
* Allow installing packages that have an `engines` declaration requiring a
different version of `node`, even if `--engine-strict` is enabled.
* Allow `npm audit fix` to install modules outside your stated dependency
range (including SemVer-major changes).
* Allow unpublishing all versions of a published package.
* Allow conflicting peerDependencies to be installed in the root project.
* Implicitly set `--yes` during `npm init`.
If you don't have a clear idea of what you want to do, it is strongly
recommended that you do not use this option!
#### `json`
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
#### `package-lock-only`
* Default: false
* Type: Boolean
If set to true, it will update only the `package-lock.json`, instead of
checking `node_modules` and downloading dependencies.
#### `omit`
* Default: 'dev' if the `NODE_ENV` environment variable is set to
'production', otherwise empty.
* Type: "dev", "optional", or "peer" (can be set multiple times)
Dependency types to omit from the installation tree on disk.
Note that these dependencies _are_ still resolved and added to the
`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
physically installed on disk.
If a package type appears in both the `--include` and `--omit` lists, then
it will be included.
If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
variable will be set to `'production'` for all lifecycle scripts.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm install](/commands/npm-install)
* [config](/using-npm/config)

View File

@@ -0,0 +1,45 @@
---
title: npm-bin
section: 1
description: Display npm bin folder
---
### Synopsis
```bash
npm bin [-g|--global]
```
Note: This command is unaware of workspaces.
### Description
Print the folder where npm will install executables.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `global`
* Default: false
* Type: Boolean
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
[folders](/configuring-npm/folders) for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead
of the current working directory.
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm prefix](/commands/npm-prefix)
* [npm root](/commands/npm-root)
* [npm folders](/configuring-npm/folders)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)

View File

@@ -0,0 +1,55 @@
---
title: npm-bugs
section: 1
description: Report bugs for a package in a web browser
---
### Synopsis
```bash
npm bugs [<pkgname> [<pkgname> ...]]
aliases: issues
```
### Description
This command tries to guess at the likely location of a package's bug
tracker URL or the `mailto` URL of the support email, 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.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `browser`
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
* Type: null, Boolean, or String
The browser that is called by npm commands to open websites.
Set to `false` to suppress browser behavior and instead print urls to
terminal.
Set to `true` to use default system URL opener.
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm docs](/commands/npm-docs)
* [npm view](/commands/npm-view)
* [npm publish](/commands/npm-publish)
* [npm registry](/using-npm/registry)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [package.json](/configuring-npm/package-json)

View File

@@ -0,0 +1,101 @@
---
title: npm-cache
section: 1
description: Manipulates packages cache
---
### Synopsis
```bash
npm cache add <tarball file>...
npm cache add <folder>...
npm cache add <tarball url>...
npm cache add <name>@<version>...
npm cache clean
aliases: npm cache clear, npm cache rm
npm cache verify
```
Note: This command is unaware of workspaces.
### Description
Used to add, list, or clean the npm cache folder.
* add:
Add the specified packages to the local cache. This command is primarily
intended to be used internally by npm, but it can provide a way to
add data to the local installation cache explicitly.
* clean:
Delete all data out of the cache folder. Note that this is typically
unnecessary, as npm's cache is self-healing and resistant to data
corruption issues.
* verify:
Verify the contents of the cache folder, garbage collecting any unneeded
data, and verifying the integrity of the cache index and all cached data.
### Details
npm stores cache data in an opaque directory within the configured `cache`,
named `_cacache`. This directory is a
[`cacache`](http://npm.im/cacache)-based content-addressable cache that
stores all http request data as well as other package-related data. This
directory is primarily accessed through `pacote`, the library responsible
for all package fetching as of npm@5.
All data that passes through the cache is fully verified for integrity on
both insertion and extraction. Cache corruption will either trigger an
error, or signal to `pacote` that the data must be refetched, which it will
do automatically. For this reason, it should never be necessary to clear
the cache for any reason other than reclaiming disk space, thus why `clean`
now requires `--force` to run.
There is currently no method exposed through npm to inspect or directly
manage the contents of this cache. In order to access it, `cacache` must be
used directly.
npm will not remove data by itself: the cache will grow as new packages are
installed.
### A note about the cache's design
The npm cache is strictly a cache: it should not be relied upon as a
persistent and reliable data store for package data. npm makes no guarantee
that a previously-cached piece of data will be available later, and will
automatically delete corrupted contents. The primary guarantee that the
cache makes is that, if it does return data, that data will be exactly the
data that was inserted.
To run an offline verification of existing cache contents, use `npm cache
verify`.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `cache`
* Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm`
* Type: Path
The location of npm's cache directory. See [`npm
cache`](/commands/npm-cache)
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm folders](/configuring-npm/folders)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm install](/commands/npm-install)
* [npm publish](/commands/npm-publish)
* [npm pack](/commands/npm-pack)
* https://npm.im/cacache
* https://npm.im/pacote
* https://npm.im/@npmcli/arborist
* https://npm.im/make-fetch-happen

View File

@@ -0,0 +1,97 @@
---
title: npm-ci
section: 1
description: Install a project with a clean slate
---
### Synopsis
```bash
npm ci
```
### Description
This command is similar to [`npm install`](/commands/npm-install), except
it's meant to be used in automated environments such as test platforms,
continuous integration, and deployment -- or any situation where you want
to make sure you're doing a clean install of your dependencies.
`npm ci` will be significantly faster when:
- There is a `package-lock.json` or `npm-shrinkwrap.json` file.
- The `node_modules` folder is missing or empty.
In short, the main differences between using `npm install` and `npm ci` are:
* The project **must** have an existing `package-lock.json` or
`npm-shrinkwrap.json`.
* If dependencies in the package lock do not match those in `package.json`,
`npm ci` will exit with an error, instead of updating the package lock.
* `npm ci` can only install entire projects at a time: individual
dependencies cannot be added with this command.
* If a `node_modules` is already present, it will be automatically removed
before `npm ci` begins its install.
* It will never write to `package.json` or any of the package-locks:
installs are essentially frozen.
### Example
Make sure you have a package-lock and an up-to-date install:
```bash
$ cd ./my/npm/project
$ npm install
added 154 packages in 10s
$ ls | grep package-lock
```
Run `npm ci` in that project
```bash
$ npm ci
added 154 packages in 5s
```
Configure Travis to build using `npm ci` instead of `npm install`:
```bash
# .travis.yml
install:
- npm ci
# keep the npm cache around to speed up installs
cache:
directories:
- "$HOME/.npm"
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `script-shell`
* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
init <pkg>` commands.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm install](/commands/npm-install)
* [package-lock.json](/configuring-npm/package-lock-json)

View File

@@ -0,0 +1,41 @@
---
title: npm-completion
section: 1
description: Tab Completion for npm
---
### Synopsis
```bash
source <(npm completion)
```
Note: This command is unaware of workspaces.
### Description
Enables tab-completion in all npm commands.
The synopsis above
loads the completions into your current shell. Adding it to
your ~/.bashrc or ~/.zshrc will make the completions available
everywhere:
```bash
npm completion >> ~/.bashrc
npm completion >> ~/.zshrc
```
You may of course also pipe the output of `npm completion` to a file
such as `/usr/local/etc/bash_completion.d/npm` or
`/etc/bash_completion.d/npm` if you have a system that will read
that file for you.
When `COMP_CWORD`, `COMP_LINE`, and `COMP_POINT` are defined in the
environment, `npm completion` acts in "plumbing mode", and outputs
completions based on the arguments.
### See Also
* [npm developers](/using-npm/developers)
* [npm](/commands/npm)

View File

@@ -0,0 +1,146 @@
---
title: npm-config
section: 1
description: Manage the npm configuration files
---
### Synopsis
```bash
npm config set <key>=<value> [<key>=<value> ...]
npm config get [<key> [<key> ...]]
npm config delete <key> [<key> ...]
npm config list [--json]
npm config edit
npm set <key>=<value> [<key>=<value> ...]
npm get [<key> [<key> ...]]
alias: c
```
Note: This command is unaware of workspaces.
### Description
npm gets its config settings from the command line, environment
variables, `npmrc` files, and in some cases, the `package.json` file.
See [npmrc](/configuring-npm/npmrc) for more information about the npmrc
files.
See [config(7)](/using-npm/config) for a more thorough explanation of the
mechanisms involved, and a full list of config options available.
The `npm config` command can be used to update and edit the contents
of the user and global npmrc files.
### Sub-commands
Config supports the following sub-commands:
#### set
```bash
npm config set key=value [key=value...]
npm set key=value [key=value...]
```
Sets each of the config keys to the value provided.
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 get [key ...]
```
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
```bash
npm config list
```
Show all the config settings. Use `-l` to also show defaults. Use `--json`
to show the settings in json format.
#### delete
```bash
npm config delete key [key ...]
```
Deletes the specified keys from all configuration files.
#### edit
```bash
npm config edit
```
Opens the config file in an editor. Use the `--global` flag to edit the
global config.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `json`
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
#### `global`
* Default: false
* Type: Boolean
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
[folders](/configuring-npm/folders) for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead
of the current working directory.
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`
#### `editor`
* Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on
Windows, or 'vim' on Unix systems
* Type: String
The command to run for `npm edit` and `npm config edit`.
#### `long`
* Default: false
* Type: Boolean
Show extended information in `ls`, `search`, and `help-search`.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm folders](/configuring-npm/folders)
* [npm config](/commands/npm-config)
* [package.json](/configuring-npm/package-json)
* [npmrc](/configuring-npm/npmrc)
* [npm](/commands/npm)

View File

@@ -0,0 +1,244 @@
---
title: npm-dedupe
section: 1
description: Reduce duplication in the package tree
---
### Synopsis
```bash
npm dedupe
npm ddp
aliases: ddp
```
### Description
Searches the local package tree and attempts to simplify the overall
structure by moving dependencies further up the tree, where they can
be more effectively shared by multiple dependent packages.
For example, consider this dependency graph:
```
a
+-- b <-- depends on c@1.0.x
| `-- c@1.0.3
`-- d <-- depends on c@~1.0.9
`-- c@1.0.10
```
In this case, `npm dedupe` will transform the tree to:
```bash
a
+-- b
+-- d
`-- c@1.0.10
```
Because of the hierarchical nature of node's module lookup, b and d
will both get their dependency met by the single c package at the root
level of the tree.
In some cases, you may have a dependency graph like this:
```
a
+-- b <-- depends on c@1.0.x
+-- c@1.0.3
`-- d <-- depends on c@1.x
`-- c@1.9.9
```
During the installation process, the `c@1.0.3` dependency for `b` was
placed in the root of the tree. Though `d`'s dependency on `c@1.x` could
have been satisfied by `c@1.0.3`, the newer `c@1.9.0` dependency was used,
because npm favors updates by default, even when doing so causes
duplication.
Running `npm dedupe` will cause npm to note the duplication and
re-evaluate, deleting the nested `c` module, because the one in the root is
sufficient.
To prefer deduplication over novelty during the installation process, run
`npm install --prefer-dedupe` or `npm config set prefer-dedupe true`.
Arguments are ignored. Dedupe always acts on the entire tree.
Note that this operation transforms the dependency tree, but will never
result in new modules being installed.
Using `npm find-dupes` will run the command in `--dry-run` mode.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `global-style`
* Default: false
* Type: Boolean
Causes npm to install the package into your local `node_modules` folder with
the same layout it uses with the global `node_modules` folder. Only your
direct dependencies will show in `node_modules` and everything they depend
on will be flattened in their `node_modules` folders. This obviously will
eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling`
will be preferred.
#### `legacy-bundling`
* Default: false
* Type: Boolean
Causes npm to install the package such that versions of npm prior to 1.4,
such as the one included with node 0.8, can install the package. This
eliminates all automatic deduping. If used with `global-style` this option
will be preferred.
#### `strict-peer-deps`
* Default: false
* Type: Boolean
If set to `true`, and `--legacy-peer-deps` is not set, then _any_
conflicting `peerDependencies` will be treated as an install failure, even
if npm could reasonably guess the appropriate resolution based on non-peer
dependency relationships.
By default, conflicting `peerDependencies` deep in the dependency graph will
be resolved using the nearest non-peer dependency specification, even if
doing so will result in some packages receiving a peer dependency outside
the range set in their package's `peerDependencies` object.
When such and override is performed, a warning is printed, explaining the
conflict and the packages involved. If `--strict-peer-deps` is set, then
this warning is treated as a failure.
#### `package-lock`
* Default: true
* Type: Boolean
If set to false, then ignore `package-lock.json` files when installing. This
will also prevent _writing_ `package-lock.json` if `save` is true.
When package package-locks are disabled, automatic pruning of extraneous
modules will also be disabled. To remove extraneous modules with
package-locks disabled use `npm prune`.
#### `omit`
* Default: 'dev' if the `NODE_ENV` environment variable is set to
'production', otherwise empty.
* Type: "dev", "optional", or "peer" (can be set multiple times)
Dependency types to omit from the installation tree on disk.
Note that these dependencies _are_ still resolved and added to the
`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
physically installed on disk.
If a package type appears in both the `--include` and `--omit` lists, then
it will be included.
If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
variable will be set to `'production'` for all lifecycle scripts.
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `audit`
* Default: true
* Type: Boolean
When "true" submit audit reports alongside `npm install` runs to the default
registry and all registries configured for scopes. See the documentation for
[`npm audit`](/commands/npm-audit) for details on what is submitted.
#### `bin-links`
* Default: true
* Type: Boolean
Tells npm to create symlinks (or `.cmd` shims on Windows) for package
executables.
Set to false to have it not do this. This can be used to work around the
fact that some file systems don't support symlinks, even on ostensibly Unix
systems.
#### `fund`
* Default: true
* Type: Boolean
When "true" displays the message at the end of each `npm install`
acknowledging the number of dependencies looking for funding. See [`npm
fund`](/commands/npm-fund) for details.
#### `dry-run`
* Default: false
* Type: Boolean
Indicates that you don't want npm to make any changes and that it should
only report what it would have done. This can be passed into any of the
commands that modify your local installation, eg, `install`, `update`,
`dedupe`, `uninstall`, as well as `pack` and `publish`.
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm find-dupes](/commands/npm-find-dupes)
* [npm ls](/commands/npm-ls)
* [npm update](/commands/npm-update)
* [npm install](/commands/npm-install)

View File

@@ -0,0 +1,72 @@
---
title: npm-deprecate
section: 1
description: Deprecate a version of a package
---
### Synopsis
```bash
npm deprecate <pkg>[@<version range>] <message>
```
Note: This command is unaware of workspaces.
### Description
This command will update the npm registry entry for a package, providing a
deprecation warning to all who attempt to install it.
It works on [version ranges](https://semver.npmjs.com/) as well as specific
versions, so you can do something like this:
```bash
npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3"
```
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
format an empty string.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `otp`
* Default: null
* Type: null or String
This is a one-time password from a two-factor authenticator. It's needed
when publishing or changing package permissions with `npm access`.
If not set, and a registry response fails with a challenge for a one-time
password, npm will prompt on the command line for one.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm publish](/commands/npm-publish)
* [npm registry](/using-npm/registry)
* [npm owner](/commands/npm-owner)
* [npm owner](/commands/npm-adduser)

View File

@@ -0,0 +1,251 @@
---
title: npm-diff
section: 1
description: The registry diff command
---
### Synopsis
```bash
npm diff [...<paths>]
npm diff --diff=<pkg-name> [...<paths>]
npm diff --diff=<version-a> [--diff=<version-b>] [...<paths>]
npm diff --diff=<spec-a> [--diff=<spec-b>] [...<paths>]
npm diff [--diff-ignore-all-space] [--diff-name-only] [...<paths>]
```
### Description
Similar to its `git diff` counterpart, this command will print diff patches
of files for packages published to the npm registry.
* `npm diff --diff=<spec-a> --diff=<spec-b>`
Compares two package versions using their registry specifiers, e.g:
`npm diff --diff=pkg@1.0.0 --diff=pkg@^2.0.0`. It's also possible to
compare across forks of any package,
e.g: `npm diff --diff=pkg@1.0.0 --diff=pkg-fork@1.0.0`.
Any valid spec can be used, so that it's also possible to compare
directories or git repositories,
e.g: `npm diff --diff=pkg@latest --diff=./packages/pkg`
Here's an example comparing two different versions of a package named
`abbrev` from the registry:
```bash
npm diff --diff=abbrev@1.1.0 --diff=abbrev@1.1.1
```
On success, output looks like:
```bash
diff --git a/package.json b/package.json
index v1.1.0..v1.1.1 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "abbrev",
- "version": "1.1.0",
+ "version": "1.1.1",
"description": "Like ruby's abbrev module, but in js",
"author": "Isaac Z. Schlueter <i@izs.me>",
"main": "abbrev.js",
```
Given the flexible nature of npm specs, you can also target local
directories or git repos just like when using `npm install`:
```bash
npm diff --diff=https://github.com/npm/libnpmdiff --diff=./local-path
```
In the example above we can compare the contents from the package installed
from the git repo at `github.com/npm/libnpmdiff` with the contents of the
`./local-path` that contains a valid package, such as a modified copy of
the original.
* `npm diff` (in a package directory, no arguments):
If the package is published to the registry, `npm diff` will fetch the
tarball version tagged as `latest` (this value can be configured using the
`tag` option) and proceed to compare the contents of files present in that
tarball, with the current files in your local file system.
This workflow provides a handy way for package authors to see what
package-tracked files have been changed in comparison with the latest
published version of that package.
* `npm diff --diff=<pkg-name>` (in a package directory):
When using a single package name (with no version or tag specifier) as an
argument, `npm diff` will work in a similar way to
[`npm-outdated`](npm-outdated) and reach for the registry to figure out
what current published version of the package named `<pkg-name>`
will satisfy its dependent declared semver-range. Once that specific
version is known `npm diff` will print diff patches comparing the
current version of `<pkg-name>` found in the local file system with
that specific version returned by the registry.
Given a package named `abbrev` that is currently installed:
```bash
npm diff --diff=abbrev
```
That will request from the registry its most up to date version and
will print a diff output comparing the currently installed version to this
newer one if the version numbers are not the same.
* `npm diff --diff=<spec-a>` (in a package directory):
Similar to using only a single package name, it's also possible to declare
a full registry specifier version if you wish to compare the local version
of an installed package with the specific version/tag/semver-range provided
in `<spec-a>`.
An example: assuming `pkg@1.0.0` is installed in the current `node_modules`
folder, running:
```bash
npm diff --diff=pkg@2.0.0
```
It will effectively be an alias to
`npm diff --diff=pkg@1.0.0 --diff=pkg@2.0.0`.
* `npm diff --diff=<semver-a> [--diff=<semver-b>]` (in a package directory):
Using `npm diff` along with semver-valid version numbers is a shorthand
to compare different versions of the current package.
It needs to be run from a package directory, such that for a package named
`pkg` running `npm diff --diff=1.0.0 --diff=1.0.1` is the same as running
`npm diff --diff=pkg@1.0.0 --diff=pkg@1.0.1`.
If only a single argument `<version-a>` is provided, then the current local
file system is going to be compared against that version.
Here's an example comparing two specific versions (published to the
configured registry) of the current project directory:
```bash
npm diff --diff=1.0.0 --diff=1.1.0
```
Note that tag names are not valid `--diff` argument values, if you wish to
compare to a published tag, you must use the `pkg@tagname` syntax.
#### Filtering files
It's possible to also specify positional arguments using file names or globs
pattern matching in order to limit the result of diff patches to only a subset
of files for a given package, e.g:
```bash
npm diff --diff=pkg@2 ./lib/ CHANGELOG.md
```
In the example above the diff output is only going to print contents of files
located within the folder `./lib/` and changed lines of code within the
`CHANGELOG.md` file.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `diff`
* Default:
* Type: String (can be set multiple times)
Define arguments to compare in `npm diff`.
#### `diff-name-only`
* Default: false
* Type: Boolean
Prints only filenames when using `npm diff`.
#### `diff-unified`
* Default: 3
* Type: Number
The number of lines of context to print in `npm diff`.
#### `diff-ignore-all-space`
* Default: false
* Type: Boolean
Ignore whitespace when comparing lines in `npm diff`.
#### `diff-no-prefix`
* Default: false
* Type: Boolean
Do not show any source or destination prefix in `npm diff` output.
Note: this causes `npm diff` to ignore the `--diff-src-prefix` and
`--diff-dst-prefix` configs.
#### `diff-src-prefix`
* Default: "a/"
* Type: String
Source prefix to be used in `npm diff` output.
#### `diff-dst-prefix`
* Default: "b/"
* Type: String
Destination prefix to be used in `npm diff` output.
#### `diff-text`
* Default: false
* Type: Boolean
Treat all files as text in `npm diff`.
#### `global`
* Default: false
* Type: Boolean
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
[folders](/configuring-npm/folders) for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead
of the current working directory.
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`
#### `tag`
* Default: "latest"
* Type: String
If you ask npm to install a package and don't tell it a specific version,
then it will install the specified tag.
Also the tag that is added to the package@version specified by the `npm tag`
command, if no explicit tag is given.
When used by the `npm diff` command, this is the tag used to fetch the
tarball that will be compared with the local files by default.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
## See Also
* [npm outdated](/commands/npm-outdated)
* [npm install](/commands/npm-install)
* [npm config](/commands/npm-config)
* [npm registry](/using-npm/registry)

View File

@@ -0,0 +1,136 @@
---
title: npm-dist-tag
section: 1
description: Modify package distribution tags
---
### Synopsis
```bash
npm dist-tag add <pkg>@<version> [<tag>]
npm dist-tag rm <pkg> <tag>
npm dist-tag ls [<pkg>]
aliases: dist-tags
```
### Description
Add, remove, and enumerate distribution tags on a package:
* add: Tags the specified version of the package with the specified tag, or
the `--tag` config if not specified. If you have two-factor
authentication on auth-and-writes then youll need to include a one-time
password on the command line with `--otp <one-time password>`, or at the
OTP prompt.
* rm: Clear a tag that is no longer in use from the package. If you have
two-factor authentication on auth-and-writes then youll need to include
a one-time password on the command line with `--otp <one-time password>`,
or at the OTP prompt.
* ls: Show all of the dist-tags for a package, defaulting to the package in
the current prefix. This is the default action if none is specified.
A tag can be used when installing packages as a reference to a version instead
of using a specific version number:
```bash
npm install <name>@<tag>
```
When installing dependencies, a preferred tagged version may be specified:
```bash
npm install --tag <tag>
```
(This also applies to any other commands that resolve and install
dependencies, such as `npm dedupe`, `npm update`, and `npm audit fix`.)
Publishing a package sets the `latest` tag to the published version unless the
`--tag` option is used. For example, `npm publish --tag=beta`.
By default, `npm install <pkg>` (without any `@<version>` or `@<tag>`
specifier) installs the `latest` tag.
### Purpose
Tags can be used to provide an alias instead of version numbers.
For example, a project might choose to have multiple streams of development
and use a different tag for each stream, e.g., `stable`, `beta`, `dev`,
`canary`.
By default, the `latest` tag is used by npm to identify the current version
of a package, and `npm install <pkg>` (without any `@<version>` or `@<tag>`
specifier) installs the `latest` tag. Typically, projects only use the
`latest` tag for stable release versions, and use other tags for unstable
versions such as prereleases.
The `next` tag is used by some projects to identify the upcoming version.
Other than `latest`, no tag has any special significance to npm itself.
### Caveats
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 <pkg>@<version>` vs
`npm install <pkg>@<tag>`.
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
semver as `>=1.4.0 <1.5.0`. See <https://github.com/npm/npm/issues/6082>.
The simplest way to avoid semver problems with tags is to use tags that do
not begin with a number or the letter `v`.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm publish](/commands/npm-publish)
* [npm install](/commands/npm-install)
* [npm dedupe](/commands/npm-dedupe)
* [npm registry](/using-npm/registry)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)

View File

@@ -0,0 +1,87 @@
---
title: npm-docs
section: 1
description: Open documentation for a package in a web browser
---
### Synopsis
```bash
npm docs [<pkgname> [<pkgname> ...]]
aliases: home
```
### Description
This command tries to guess at the likely location of a package's
documentation URL, and then tries to open it using the `--browser` config
param. You can pass multiple package names at once. If no package name is
provided, it will search for a `package.json` in the current folder and use
the `name` property.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `browser`
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
* Type: null, Boolean, or String
The browser that is called by npm commands to open websites.
Set to `false` to suppress browser behavior and instead print urls to
terminal.
Set to `true` to use default system URL opener.
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm view](/commands/npm-view)
* [npm publish](/commands/npm-publish)
* [npm registry](/using-npm/registry)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [package.json](/configuring-npm/package-json)

View File

@@ -0,0 +1,122 @@
---
title: npm-doctor
section: 1
description: Check your npm environment
---
### Synopsis
```bash
npm doctor
```
Note: This command is unaware of workspaces.
### Description
`npm doctor` runs a set of checks to ensure that your npm installation has
what it needs to manage your JavaScript packages. npm is mostly a
standalone tool, but it does have some basic requirements that must be met:
+ Node.js and git must be executable by npm.
+ The primary npm registry, `registry.npmjs.com`, or another service that
uses the registry API, is available.
+ The directories that npm uses, `node_modules` (both locally and
globally), exist and can be written by the current user.
+ The npm cache exists, and the package tarballs within it aren't corrupt.
Without all of these working properly, npm may not work properly. Many
issues are often attributable to things that are outside npm's code base,
so `npm doctor` confirms that the npm installation is in a good state.
Also, in addition to this, there are also very many issue reports due to
using old versions of npm. Since npm is constantly improving, running
`npm@latest` is better than an old version.
`npm doctor` verifies the following items in your environment, and if there
are any recommended changes, it will display them.
#### `npm ping`
By default, npm installs from the primary npm registry,
`registry.npmjs.org`. `npm doctor` hits a special ping endpoint within the
registry. This can also be checked with `npm ping`. If this check fails,
you may be using a proxy that needs to be configured, or may need to talk
to your IT staff to get access over HTTPS to `registry.npmjs.org`.
This check is done against whichever registry you've configured (you can
see what that is by running `npm config get registry`), and if you're using
a private registry that doesn't support the `/whoami` endpoint supported by
the primary registry, this check may fail.
#### `npm -v`
While Node.js may come bundled with a particular version of npm, it's the
policy of the CLI team that we recommend all users run `npm@latest` if they
can. As the CLI is maintained by a small team of contributors, there are
only resources for a single line of development, so npm's own long-term
support releases typically only receive critical security and regression
fixes. The team believes that the latest tested version of npm is almost
always likely to be the most functional and defect-free version of npm.
#### `node -v`
For most users, in most circumstances, the best version of Node will be the
latest long-term support (LTS) release. Those of you who want access to new
ECMAscript features or bleeding-edge changes to Node's standard library may
be running a newer version, and some may be required to run an older
version of Node because of enterprise change control policies. That's OK!
But in general, the npm team recommends that most users run Node.js LTS.
#### `npm config get registry`
You may be installing from private package registries for your project or
company. That's great! Others may be following tutorials or StackOverflow
questions in an effort to troubleshoot problems you may be having.
Sometimes, this may entail changing the registry you're pointing at. This
part of `npm doctor` just lets you, and maybe whoever's helping you with
support, know that you're not using the default registry.
#### `which git`
While it's documented in the README, it may not be obvious that npm needs
Git installed to do many of the things that it does. Also, in some cases
 especially on Windows  you may have Git set up in such a way that it's
not accessible via your `PATH` so that npm can find it. This check ensures
that Git is available.
#### Permissions checks
* Your cache must be readable and writable by the user running npm.
* Global package binaries must be writable by the user running npm.
* Your local `node_modules` path, if you're running `npm doctor` with a
project directory, must be readable and writable by the user running npm.
#### Validate the checksums of cached packages
When an npm package is published, the publishing process generates a
checksum that npm uses at install time to verify that the package didn't
get corrupted in transit. `npm doctor` uses these checksums to validate the
package tarballs in your local cache (you can see where that cache is
located with `npm config get cache`). In the event that there are corrupt
packages in your cache, you should probably run `npm cache clean -f` and
reset the cache.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm bugs](/commands/npm-bugs)
* [npm help](/commands/npm-help)
* [npm ping](/commands/npm-ping)

View File

@@ -0,0 +1,48 @@
---
title: npm-edit
section: 1
description: Edit an installed package
---
### Synopsis
```bash
npm edit <pkg>
```
Note: This command is unaware of workspaces.
### Description
Selects a dependency in the current project and opens the package folder in
the default editor (or whatever you've configured as the npm `editor`
config -- see [`npm-config`](npm-config).)
After it has been edited, the package is rebuilt so as to pick up any
changes in compiled packages.
For instance, you can do `npm install connect` to install connect
into your package, and then `npm edit connect` to make a few
changes to your locally installed copy.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `editor`
* Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on
Windows, or 'vim' on Unix systems
* Type: String
The command to run for `npm edit` and `npm config edit`.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm folders](/configuring-npm/folders)
* [npm explore](/commands/npm-explore)
* [npm install](/commands/npm-install)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)

View File

@@ -0,0 +1,355 @@
---
title: npm-exec
section: 1
description: Run a command from a local or remote npm package
---
### Synopsis
```bash
npm exec -- <pkg>[@<version>] [args...]
npm exec --package=<pkg>[@<version>] -- <cmd> [args...]
npm exec -c '<cmd> [args...]'
npm exec --package=foo -c '<cmd> [args...]'
npm exec [--ws] [-w <workspace-name] [args...]
npx <pkg>[@<specifier>] [args...]
npx -p <pkg>[@<specifier>] <cmd> [args...]
npx -c '<cmd> [args...]'
npx -p <pkg>[@<specifier>] -c '<cmd> [args...]'
Run without --call or positional args to open interactive subshell
alias: npm x, npx
common options:
--package=<pkg> (may be specified multiple times)
-p is a shorthand for --package only when using npx executable
-c <cmd> --call=<cmd> (may not be mixed with positional arguments)
```
### Description
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
specified multiple times, to execute the supplied command in an environment
where all specified packages are available.
If any requested packages are not present in the local project
dependencies, then they are installed to a folder in the npm cache, which
is added to the `PATH` environment variable in the executed process. A
prompt is printed (which can be suppressed by providing either `--yes` or
`--no`).
Package names provided without a specifier will be matched with whatever
version exists in the local project. Package names with a specifier will
only be considered a match if they have the exact same name and version as
the local dependency.
If no `-c` or `--call` option is provided, then the positional arguments
are used to generate the command string. If no `--package` options
are provided, then npm will attempt to determine the executable name from
the package specifier provided as the first positional argument according
to the following heuristic:
- If the package has a single entry in its `bin` field in `package.json`,
or if all entries are aliases of the same command, then that command
will be used.
- If the package has multiple `bin` entries, and one of them matches the
unscoped portion of the `name` field, then that command will be used.
- If this does not result in exactly one option (either because there are
no bin entries, or none of them match the `name` of the package), then
`npm exec` exits with an error.
To run a binary _other than_ the named binary, specify one or more
`--package` options, which will prevent npm from inferring the package from
the first command argument.
### `npx` vs `npm exec`
When run via the `npx` binary, all flags and options *must* be set prior to
any positional arguments. When run via `npm exec`, a double-hyphen `--`
flag can be used to suppress npm's parsing of switches and options that
should be sent to the executed command.
For example:
```
$ npx foo@latest bar --package=@npmcli/foo
```
In this case, npm will resolve the `foo` package name, and run the
following command:
```
$ foo bar --package=@npmcli/foo
```
Since the `--package` option comes _after_ the positional arguments, it is
treated as an argument to the executed command.
In contrast, due to npm's argument parsing logic, running this command is
different:
```
$ npm exec foo@latest bar --package=@npmcli/foo
```
In this case, npm will parse the `--package` option first, resolving the
`@npmcli/foo` package. Then, it will execute the following command in that
context:
```
$ foo@latest bar
```
The double-hyphen character is recommended to explicitly tell npm to stop
parsing command line options and switches. The following command would
thus be equivalent to the `npx` command above:
```
$ npm exec -- foo@latest bar --package=@npmcli/foo
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `package`
* Default:
* Type: String (can be set multiple times)
The package to install for [`npm exec`](/commands/npm-exec)
#### `call`
* Default: ""
* Type: String
Optional companion option for `npm exec`, `npx` that allows for specifying a
custom command to be run along with the installed packages.
```bash
npm exec --package yo --package generator-node --call "yo node"
```
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### Examples
Run the version of `tap` in the local dependencies, with the provided
arguments:
```
$ npm exec -- tap --bail test/foo.js
$ npx tap --bail test/foo.js
```
Run a command _other than_ the command whose name matches the package name
by specifying a `--package` option:
```
$ npm exec --package=foo -- bar --bar-argument
# ~ or ~
$ npx --package=foo bar --bar-argument
```
Run an arbitrary shell script, in the context of the current project:
```
$ npm x -c 'eslint && say "hooray, lint passed"'
$ npx -c 'eslint && say "hooray, lint passed"'
```
### Workspaces support
You may use the `workspace` or `workspaces` configs in order to run an
arbitrary command from an npm package (either one installed locally, or fetched
remotely) in the context of the specified workspaces.
If no positional argument or `--call` option is provided, it will open an
interactive subshell in the context of each of these configured workspaces one
at a time.
Given a project with configured workspaces, e.g:
```
.
+-- package.json
`-- packages
+-- a
| `-- package.json
+-- b
| `-- package.json
`-- c
`-- package.json
```
Assuming the workspace configuration is properly set up at the root level
`package.json` file. e.g:
```
{
"workspaces": [ "./packages/*" ]
}
```
You can execute an arbitrary command from a package in the context of each of
the configured workspaces when using the `workspaces` configuration options,
in this example we're using **eslint** to lint any js file found within each
workspace folder:
```
npm exec --ws -- eslint ./*.js
```
#### Filtering workspaces
It's also possible to execute a command in a single workspace using the
`workspace` config along with a name or directory path:
```
npm exec --workspace=a -- eslint ./*.js
```
The `workspace` config can also be specified multiple times in order to run a
specific script in the context of multiple workspaces. When defining values for
the `workspace` config in the command line, it also possible to use `-w` as a
shorthand, e.g:
```
npm exec -w a -w b -- eslint ./*.js
```
This last command will run the `eslint` command in both `./packages/a` and
`./packages/b` folders.
### Compatibility with Older npx Versions
The `npx` binary was rewritten in npm v7.0.0, and the standalone `npx`
package deprecated at that time. `npx` uses the `npm exec`
command instead of a separate argument parser and install process, with
some affordances to maintain backwards compatibility with the arguments it
accepted in previous versions.
This resulted in some shifts in its functionality:
- Any `npm` config value may be provided.
- To prevent security and user-experience problems from mistyping package
names, `npx` prompts before installing anything. Suppress this
prompt with the `-y` or `--yes` option.
- The `--no-install` option is deprecated, and will be converted to `--no`.
- Shell fallback functionality is removed, as it is not advisable.
- The `-p` argument is a shorthand for `--parseable` in npm, but shorthand
for `--package` in npx. This is maintained, but only for the `npx`
executable.
- The `--ignore-existing` option is removed. Locally installed bins are
always present in the executed process `PATH`.
- The `--npm` option is removed. `npx` will always use the `npm` it ships
with.
- The `--node-arg` and `-n` options are removed.
- The `--always-spawn` option is redundant, and thus removed.
- The `--shell` option is replaced with `--script-shell`, but maintained
in the `npx` executable for backwards compatibility.
### A note on caching
The npm cli utilizes its internal package cache when using the package
name specified. You can use the following to change how and when the
cli uses this cache. See [`npm cache`](/commands/npm-cache) for more on
how the cache works.
#### prefer-online
Forces staleness checks for packages, making the cli look for updates
immediately even if the package is already in the cache.
#### prefer-offline
Bypasses staleness checks for packages. Missing data will still be
requested from the server. To force full offline mode, use `offline`.
#### offline
Forces full offline mode. Any packages not locally cached will result in
an error.
#### workspace
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
This value is not exported to the environment for child processes.
#### workspaces
* Alias: `--ws`
* Type: Boolean
* Default: `false`
Run scripts in the context of all configured workspaces for the current
project.
### See Also
* [npm run-script](/commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [npm test](/commands/npm-test)
* [npm start](/commands/npm-start)
* [npm restart](/commands/npm-restart)
* [npm stop](/commands/npm-stop)
* [npm config](/commands/npm-config)
* [npm workspaces](/using-npm/workspaces)

View File

@@ -0,0 +1,102 @@
---
title: npm-explain
section: 1
description: Explain installed packages
---
### Synopsis
```bash
npm explain <folder | specifier>
alias: why
```
### Description
This command will print the chain of dependencies causing a given package
to be installed in the current project.
Positional arguments can be either folders within `node_modules`, or
`name@version-range` specifiers, which will select the dependency
relationships to explain.
For example, running `npm explain glob` within npm's source tree will show:
```bash
glob@7.1.6
node_modules/glob
glob@"^7.1.4" from the root project
glob@7.1.1 dev
node_modules/tacks/node_modules/glob
glob@"^7.0.5" from rimraf@2.6.2
node_modules/tacks/node_modules/rimraf
rimraf@"^2.6.2" from tacks@1.3.0
node_modules/tacks
dev tacks@"^1.3.0" from the root project
```
To explain just the package residing at a specific folder, pass that as the
argument to the command. This can be useful when trying to figure out
exactly why a given dependency is being duplicated to satisfy conflicting
version requirements within the project.
```bash
$ npm explain node_modules/nyc/node_modules/find-up
find-up@3.0.0 dev
node_modules/nyc/node_modules/find-up
find-up@"^3.0.0" from nyc@14.1.1
node_modules/nyc
nyc@"^14.1.1" from tap@14.10.8
node_modules/tap
dev tap@"^14.10.8" from the root project
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `json`
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm folders](/configuring-npm/folders)
* [npm ls](/commands/npm-ls)
* [npm install](/commands/npm-install)
* [npm link](/commands/npm-link)
* [npm prune](/commands/npm-prune)
* [npm outdated](/commands/npm-outdated)
* [npm update](/commands/npm-update)

View File

@@ -0,0 +1,51 @@
---
title: npm-explore
section: 1
description: Browse an installed package
---
### Synopsis
```bash
npm explore <pkg> [ -- <command>]
```
Note: This command is unaware of workspaces.
### Description
Spawn a subshell in the directory of the installed package specified.
If a command is specified, then it is run in the subshell, which then
immediately terminates.
This is particularly handy in the case of git submodules in the
`node_modules` folder:
```bash
npm explore some-dependency -- git pull origin master
```
Note that the package is *not* automatically rebuilt afterwards, so be
sure to use `npm rebuild <pkg>` if you make any changes.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `shell`
* Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on
Windows
* Type: String
The shell to run for the `npm explore` command.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm folders](/configuring-npm/folders)
* [npm edit](/commands/npm-edit)
* [npm rebuild](/commands/npm-rebuild)
* [npm install](/commands/npm-install)

View File

@@ -0,0 +1,175 @@
---
title: npm-find-dupes
section: 1
description: Find duplication in the package tree
---
### Synopsis
```bash
npm find-dupes
```
### Description
Runs `npm dedupe` in `--dry-run` mode, making npm only output the
duplications, without actually changing the package tree.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `global-style`
* Default: false
* Type: Boolean
Causes npm to install the package into your local `node_modules` folder with
the same layout it uses with the global `node_modules` folder. Only your
direct dependencies will show in `node_modules` and everything they depend
on will be flattened in their `node_modules` folders. This obviously will
eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling`
will be preferred.
#### `legacy-bundling`
* Default: false
* Type: Boolean
Causes npm to install the package such that versions of npm prior to 1.4,
such as the one included with node 0.8, can install the package. This
eliminates all automatic deduping. If used with `global-style` this option
will be preferred.
#### `strict-peer-deps`
* Default: false
* Type: Boolean
If set to `true`, and `--legacy-peer-deps` is not set, then _any_
conflicting `peerDependencies` will be treated as an install failure, even
if npm could reasonably guess the appropriate resolution based on non-peer
dependency relationships.
By default, conflicting `peerDependencies` deep in the dependency graph will
be resolved using the nearest non-peer dependency specification, even if
doing so will result in some packages receiving a peer dependency outside
the range set in their package's `peerDependencies` object.
When such and override is performed, a warning is printed, explaining the
conflict and the packages involved. If `--strict-peer-deps` is set, then
this warning is treated as a failure.
#### `package-lock`
* Default: true
* Type: Boolean
If set to false, then ignore `package-lock.json` files when installing. This
will also prevent _writing_ `package-lock.json` if `save` is true.
When package package-locks are disabled, automatic pruning of extraneous
modules will also be disabled. To remove extraneous modules with
package-locks disabled use `npm prune`.
#### `omit`
* Default: 'dev' if the `NODE_ENV` environment variable is set to
'production', otherwise empty.
* Type: "dev", "optional", or "peer" (can be set multiple times)
Dependency types to omit from the installation tree on disk.
Note that these dependencies _are_ still resolved and added to the
`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
physically installed on disk.
If a package type appears in both the `--include` and `--omit` lists, then
it will be included.
If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
variable will be set to `'production'` for all lifecycle scripts.
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `audit`
* Default: true
* Type: Boolean
When "true" submit audit reports alongside `npm install` runs to the default
registry and all registries configured for scopes. See the documentation for
[`npm audit`](/commands/npm-audit) for details on what is submitted.
#### `bin-links`
* Default: true
* Type: Boolean
Tells npm to create symlinks (or `.cmd` shims on Windows) for package
executables.
Set to false to have it not do this. This can be used to work around the
fact that some file systems don't support symlinks, even on ostensibly Unix
systems.
#### `fund`
* Default: true
* Type: Boolean
When "true" displays the message at the end of each `npm install`
acknowledging the number of dependencies looking for funding. See [`npm
fund`](/commands/npm-fund) for details.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm dedupe](/commands/npm-dedupe)
* [npm ls](/commands/npm-ls)
* [npm update](/commands/npm-update)
* [npm install](/commands/npm-install)

View File

@@ -0,0 +1,136 @@
---
title: npm-fund
section: 1
description: Retrieve funding information
---
### Synopsis
```bash
npm fund [<pkg>]
npm fund [-w <workspace-name>]
```
### Description
This command retrieves information on how to fund the dependencies of a
given project. If no package name is provided, it will list all
dependencies that are looking for funding in a tree structure, listing the
type of funding and the url to visit. If a package name is provided then it
tries to open its funding url using the `--browser` config param; if there
are multiple funding sources for the package, the user will be instructed
to pass the `--which` option to disambiguate.
The list will avoid duplicated entries and will stack all packages that
share the same url as a single entry. Thus, the list does not have the same
shape of the output from `npm ls`.
#### Example
### Workspaces support
It's possible to filter the results to only include a single workspace and its
dependencies using the `workspace` config option.
#### Example:
Here's an example running `npm fund` in a project with a configured
workspace `a`:
```bash
$ npm fund
test-workspaces-fund@1.0.0
+-- https://example.com/a
| | `-- a@1.0.0
| `-- https://example.com/maintainer
| `-- foo@1.0.0
+-- https://example.com/npmcli-funding
| `-- @npmcli/test-funding
`-- https://example.com/org
`-- bar@2.0.0
```
And here is an example of the expected result when filtering only by
a specific workspace `a` in the same project:
```bash
$ npm fund -w a
test-workspaces-fund@1.0.0
`-- https://example.com/a
| `-- a@1.0.0
`-- https://example.com/maintainer
`-- foo@2.0.0
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `json`
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
#### `browser`
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
* Type: null, Boolean, or String
The browser that is called by npm commands to open websites.
Set to `false` to suppress browser behavior and instead print urls to
terminal.
Set to `true` to use default system URL opener.
#### `unicode`
* Default: false on windows, true on mac/unix systems with a unicode locale,
as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
* Type: Boolean
When set to true, npm uses unicode characters in the tree output. When
false, it uses ascii characters instead of unicode glyphs.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `which`
* Default: null
* Type: null or Number
If there are multiple funding sources, which 1-indexed source URL to open.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
## See Also
* [npm install](/commands/npm-install)
* [npm docs](/commands/npm-docs)
* [npm ls](/commands/npm-ls)
* [npm config](/commands/npm-config)
* [npm workspaces](/using-npm/workspaces)

View File

@@ -0,0 +1,42 @@
---
title: npm-help-search
section: 1
description: Search npm help documentation
---
### Synopsis
```bash
npm help-search <text>
```
Note: This command is unaware of workspaces.
### Description
This command will search the npm markdown documentation files for the terms
provided, and then list the results, sorted by relevance.
If only one result is found, then it will show that help topic.
If the argument to `npm help` is not a known help topic, then it will call
`help-search`. It is rarely if ever necessary to call this command
directly.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `long`
* Default: false
* Type: Boolean
Show extended information in `ls`, `search`, and `help-search`.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm](/commands/npm)
* [npm help](/commands/npm-help)

View File

@@ -0,0 +1,46 @@
---
title: npm-help
section: 1
description: Get help on npm
---
### Synopsis
```bash
npm help <term> [<terms..>]
```
Note: This command is unaware of workspaces.
### Description
If supplied a topic, then show the appropriate documentation page.
If the topic does not exist, or if multiple terms are provided, then npm
will run the `help-search` command to find a match. Note that, if
`help-search` finds a single subject, then it will run `help` on that
topic, so unique matches are equivalent to specifying a topic name.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `viewer`
* Default: "man" on Posix, "browser" on Windows
* Type: String
The program to use to view help content.
Set to `"browser"` to view html help content in the default web browser.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm](/commands/npm)
* [npm folders](/configuring-npm/folders)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [package.json](/configuring-npm/package-json)
* [npm help-search](/commands/npm-help-search)

View File

@@ -0,0 +1,112 @@
---
title: npm-hook
section: 1
description: Manage registry hooks
---
### Synopsis
```bash
npm hook ls [pkg]
npm hook add <entity> <url> <secret>
npm hook update <id> <url> [secret]
npm hook rm <id>
```
Note: This command is unaware of workspaces.
### Description
Allows you to manage [npm
hooks](https://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifications-of-npm),
including adding, removing, listing, and updating.
Hooks allow you to configure URL endpoints that will be notified whenever a
change happens to any of the supported entity types. Three different types
of entities can be watched by hooks: packages, owners, and scopes.
To create a package hook, simply reference the package name.
To create an owner hook, prefix the owner name with `~` (as in,
`~youruser`).
To create a scope hook, prefix the scope name with `@` (as in,
`@yourscope`).
The hook `id` used by `update` and `rm` are the IDs listed in `npm hook ls`
for that particular hook.
The shared secret will be sent along to the URL endpoint so you can verify
the request came from your own configured hook.
### Example
Add a hook to watch a package for changes:
```bash
$ npm hook add lodash https://example.com/ my-shared-secret
```
Add a hook to watch packages belonging to the user `substack`:
```bash
$ npm hook add ~substack https://example.com/ my-shared-secret
```
Add a hook to watch packages in the scope `@npm`
```bash
$ npm hook add @npm https://example.com/ my-shared-secret
```
List all your active hooks:
```bash
$ npm hook ls
```
List your active hooks for the `lodash` package:
```bash
$ npm hook ls lodash
```
Update an existing hook's url:
```bash
$ npm hook update id-deadbeef https://my-new-website.here/
```
Remove a hook:
```bash
$ npm hook rm id-deadbeef
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `otp`
* Default: null
* Type: null or String
This is a one-time password from a two-factor authenticator. It's needed
when publishing or changing package permissions with `npm access`.
If not set, and a registry response fails with a challenge for a one-time
password, npm will prompt on the command line for one.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* ["Introducing Hooks" blog post](https://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifications-of-npm)

View File

@@ -0,0 +1,223 @@
---
title: npm-init
section: 1
description: Create a package.json file
---
### Synopsis
```bash
npm init [--yes|-y|--scope]
npm init <@scope> (same as `npm exec <@scope>/create`)
npm init [<@scope>/]<name> (same as `npm exec [<@scope>/]create-<name>`)
npm init [-w <dir>] [args...]
```
### Description
`npm init <initializer>` can be used to set up a new or existing npm
package.
`initializer` in this case is an npm package named `create-<initializer>`,
which will be installed by [`npm-exec`](/commands/npm-exec), and then have its
main bin executed -- presumably creating or updating `package.json` and
running any other initialization-related operations.
The init command is transformed to a corresponding `npm exec` operation as
follows:
* `npm init foo` -> `npm exec create-foo`
* `npm init @usr/foo` -> `npm exec @usr/create-foo`
* `npm init @usr` -> `npm exec @usr/create`
If the initializer is omitted (by just calling `npm init`), init will fall
back to legacy init behavior. It will ask you a bunch of questions, and
then write a package.json for you. It will attempt to make reasonable
guesses based on existing fields, dependencies, and options selected. It is
strictly additive, so it will keep any fields and values that were already
set. You can also use `-y`/`--yes` to skip the questionnaire altogether. If
you pass `--scope`, it will create a scoped package.
#### Forwarding additional options
Any additional options will be passed directly to the command, so `npm init
foo -- --hello` will map to `npm exec -- create-foo --hello`.
To better illustrate how options are forwarded, here's a more evolved
example showing options passed to both the **npm cli** and a create package,
both following commands are equivalent:
- `npm init foo -y --registry=<url> -- --hello -a`
- `npm exec -y --registry=<url> -- create-foo --hello -a`
### Examples
Create a new React-based project using
[`create-react-app`](https://npm.im/create-react-app):
```bash
$ npm init react-app ./my-react-app
```
Create a new `esm`-compatible package using
[`create-esm`](https://npm.im/create-esm):
```bash
$ mkdir my-esm-lib && cd my-esm-lib
$ npm init esm --yes
```
Generate a plain old package.json using legacy init:
```bash
$ mkdir my-npm-pkg && cd my-npm-pkg
$ git init
$ npm init
```
Generate it without having it ask any questions:
```bash
$ npm init -y
```
### Workspaces support
It's possible to create a new workspace within your project by using the
`workspace` config option. When using `npm init -w <dir>` the cli will
create the folders and boilerplate expected while also adding a reference
to your project `package.json` `"workspaces": []` property in order to make
sure that new generated **workspace** is properly set up as such.
Given a project with no workspaces, e.g:
```
.
+-- package.json
```
You may generate a new workspace using the legacy init:
```bash
$ npm init -w packages/a
```
That will generate a new folder and `package.json` file, while also updating
your top-level `package.json` to add the reference to this new workspace:
```
.
+-- package.json
`-- packages
`-- a
`-- package.json
```
The workspaces init also supports the `npm init <initializer> -w <dir>`
syntax, following the same set of rules explained earlier in the initial
**Description** section of this page. Similar to the previous example of
creating a new React-based project using
[`create-react-app`](https://npm.im/create-react-app), the following syntax
will make sure to create the new react app as a nested **workspace** within your
project and configure your `package.json` to recognize it as such:
```bash
npm init -w packages/my-react-app react-app .
```
This will make sure to generate your react app as expected, one important
consideration to have in mind is that `npm exec` is going to be run in the
context of the newly created folder for that workspace, and that's the reason
why in this example the initializer uses the initializer name followed with a
dot to represent the current directory in that context, e.g: `react-app .`:
```
.
+-- package.json
`-- packages
+-- a
| `-- package.json
`-- my-react-app
+-- README
+-- package.json
`-- ...
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `yes`
* Default: null
* Type: null or Boolean
Automatically answer "yes" to any prompts that npm might print on the
command line.
#### `force`
* Default: false
* Type: Boolean
Removes various protections against unfortunate side effects, common
mistakes, unnecessary performance degradation, and malicious input.
* Allow clobbering non-npm files in global installs.
* Allow the `npm version` command to work on an unclean git repository.
* Allow deleting the cache folder with `npm cache clean`.
* Allow installing packages that have an `engines` declaration requiring a
different version of npm.
* Allow installing packages that have an `engines` declaration requiring a
different version of `node`, even if `--engine-strict` is enabled.
* Allow `npm audit fix` to install modules outside your stated dependency
range (including SemVer-major changes).
* Allow unpublishing all versions of a published package.
* Allow conflicting peerDependencies to be installed in the root project.
* Implicitly set `--yes` during `npm init`.
If you don't have a clear idea of what you want to do, it is strongly
recommended that you do not use this option!
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [init-package-json module](http://npm.im/init-package-json)
* [package.json](/configuring-npm/package-json)
* [npm version](/commands/npm-version)
* [npm scope](/using-npm/scope)
* [npm exec](/commands/npm-exec)
* [npm workspaces](/using-npm/workspaces)

View File

@@ -0,0 +1,49 @@
---
title: npm-install-ci-test
section: 1
description: Install a project with a clean slate and run tests
---
### Synopsis
```bash
npm install-ci-test
alias: npm cit
```
### Description
This command runs `npm ci` followed immediately by `npm test`.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `script-shell`
* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
init <pkg>` commands.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm install-test](/commands/npm-install-test)
* [npm ci](/commands/npm-ci)
* [npm test](/commands/npm-test)

View File

@@ -0,0 +1,228 @@
---
title: npm-install-test
section: 1
description: Install package(s) and run tests
---
### Synopsis
```bash
npm install-test (with no args, in package dir)
npm install-test [<@scope>/]<name>
npm install-test [<@scope>/]<name>@<tag>
npm install-test [<@scope>/]<name>@<version>
npm install-test [<@scope>/]<name>@<version range>
npm install-test <tarball file>
npm install-test <tarball url>
npm install-test <folder>
alias: npm it
common options: [--save|--save-dev|--save-optional] [--save-exact] [--dry-run]
```
### Description
This command runs an `npm install` followed immediately by an `npm test`. It
takes exactly the same arguments as `npm install`.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `save`
* Default: true
* Type: Boolean
Save installed packages to a package.json file as dependencies.
When used with the `npm rm` command, removes the dependency from
package.json.
#### `save-exact`
* Default: false
* Type: Boolean
Dependencies saved to package.json will be configured with an exact version
rather than using npm's default semver range operator.
#### `global`
* Default: false
* Type: Boolean
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
[folders](/configuring-npm/folders) for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead
of the current working directory.
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`
#### `global-style`
* Default: false
* Type: Boolean
Causes npm to install the package into your local `node_modules` folder with
the same layout it uses with the global `node_modules` folder. Only your
direct dependencies will show in `node_modules` and everything they depend
on will be flattened in their `node_modules` folders. This obviously will
eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling`
will be preferred.
#### `legacy-bundling`
* Default: false
* Type: Boolean
Causes npm to install the package such that versions of npm prior to 1.4,
such as the one included with node 0.8, can install the package. This
eliminates all automatic deduping. If used with `global-style` this option
will be preferred.
#### `strict-peer-deps`
* Default: false
* Type: Boolean
If set to `true`, and `--legacy-peer-deps` is not set, then _any_
conflicting `peerDependencies` will be treated as an install failure, even
if npm could reasonably guess the appropriate resolution based on non-peer
dependency relationships.
By default, conflicting `peerDependencies` deep in the dependency graph will
be resolved using the nearest non-peer dependency specification, even if
doing so will result in some packages receiving a peer dependency outside
the range set in their package's `peerDependencies` object.
When such and override is performed, a warning is printed, explaining the
conflict and the packages involved. If `--strict-peer-deps` is set, then
this warning is treated as a failure.
#### `package-lock`
* Default: true
* Type: Boolean
If set to false, then ignore `package-lock.json` files when installing. This
will also prevent _writing_ `package-lock.json` if `save` is true.
When package package-locks are disabled, automatic pruning of extraneous
modules will also be disabled. To remove extraneous modules with
package-locks disabled use `npm prune`.
#### `omit`
* Default: 'dev' if the `NODE_ENV` environment variable is set to
'production', otherwise empty.
* Type: "dev", "optional", or "peer" (can be set multiple times)
Dependency types to omit from the installation tree on disk.
Note that these dependencies _are_ still resolved and added to the
`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
physically installed on disk.
If a package type appears in both the `--include` and `--omit` lists, then
it will be included.
If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
variable will be set to `'production'` for all lifecycle scripts.
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `audit`
* Default: true
* Type: Boolean
When "true" submit audit reports alongside `npm install` runs to the default
registry and all registries configured for scopes. See the documentation for
[`npm audit`](/commands/npm-audit) for details on what is submitted.
#### `bin-links`
* Default: true
* Type: Boolean
Tells npm to create symlinks (or `.cmd` shims on Windows) for package
executables.
Set to false to have it not do this. This can be used to work around the
fact that some file systems don't support symlinks, even on ostensibly Unix
systems.
#### `fund`
* Default: true
* Type: Boolean
When "true" displays the message at the end of each `npm install`
acknowledging the number of dependencies looking for funding. See [`npm
fund`](/commands/npm-fund) for details.
#### `dry-run`
* Default: false
* Type: Boolean
Indicates that you don't want npm to make any changes and that it should
only report what it would have done. This can be passed into any of the
commands that modify your local installation, eg, `install`, `update`,
`dedupe`, `uninstall`, as well as `pack` and `publish`.
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm install](/commands/npm-install)
* [npm install-ci-test](/commands/npm-install-ci-test)
* [npm test](/commands/npm-test)

View File

@@ -0,0 +1,658 @@
---
title: npm-install
section: 1
description: Install a package
---
### Synopsis
```bash
npm install (with no args, in package dir)
npm install [<@scope>/]<name>
npm install [<@scope>/]<name>@<tag>
npm install [<@scope>/]<name>@<version>
npm install [<@scope>/]<name>@<version range>
npm install <alias>@npm:<name>
npm install <git-host>:<git-user>/<repo-name>
npm install <git repo url>
npm install <tarball file>
npm install <tarball url>
npm install <folder>
aliases: npm i, npm add
common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional|--save-peer] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run]
```
### Description
This command installs a package and any packages that it depends on. If the
package has a package-lock, or an npm shrinkwrap file, or a yarn lock file,
the installation of dependencies will be driven by that, respecting the
following order of precedence:
* `npm-shrinkwrap.json`
* `package-lock.json`
* `yarn.lock`
See [package-lock.json](/configuring-npm/package-lock-json) and
[`npm shrinkwrap`](/commands/npm-shrinkwrap).
A `package` is:
* a) a folder containing a program described by a
[`package.json`](/configuring-npm/package-json) file
* b) a gzipped tarball containing (a)
* c) a url that resolves to (b)
* d) a `<name>@<version>` that is published on the registry (see
[`registry`](/using-npm/registry)) with (c)
* e) a `<name>@<tag>` (see [`npm dist-tag`](/commands/npm-dist-tag)) that
points to (d)
* f) a `<name>` that has a "latest" tag satisfying (e)
* g) a `<git remote url>` that resolves to (a)
Even if you never publish your package, you can still get a lot of benefits
of using npm if you just want to write a node program (a), and perhaps if
you also want to be able to easily install it elsewhere after packing it up
into a tarball (b).
* `npm install` (in a package directory, no arguments):
Install the dependencies in the local `node_modules` folder.
In global mode (ie, with `-g` or `--global` appended to the command),
it installs the current package context (ie, the current working
directory) as a global package.
By default, `npm install` will install all modules listed as
dependencies in [`package.json`](/configuring-npm/package-json).
With the `--production` flag (or when the `NODE_ENV` environment
variable is set to `production`), npm will not install modules listed
in `devDependencies`. To install all modules listed in both
`dependencies` and `devDependencies` when `NODE_ENV` environment
variable is set to `production`, you can use `--production=false`.
> NOTE: The `--production` flag has no particular meaning when adding a
dependency to a project.
* `npm install <folder>`:
Install the package in the directory as a symlink in the current
project. Its dependencies will be installed before it's linked. If
`<folder>` sits inside the root of your project, its dependencies may
be hoisted to the top-level `node_modules` as they would for other
types of dependencies.
* `npm install <tarball file>`:
Install a package that is sitting on the filesystem. Note: if you just
want to link a dev directory into your npm root, you can do this more
easily by using [`npm link`](/commands/npm-link).
Tarball requirements:
* The filename *must* use `.tar`, `.tar.gz`, or `.tgz` as the
extension.
* The package contents should reside in a subfolder inside the tarball
(usually it is called `package/`). npm strips one directory layer
when installing the package (an equivalent of `tar x
--strip-components=1` is run).
* The package must contain a `package.json` file with `name` and
`version` properties.
Example:
```bash
npm install ./package.tgz
```
* `npm install <tarball url>`:
Fetch the tarball url, and then install it. In order to distinguish between
this and other options, the argument must start with "http://" or "https://"
Example:
```bash
npm install https://github.com/indexzero/forever/tarball/v0.5.6
```
* `npm install [<@scope>/]<name>`:
Do a `<name>@<tag>` install, where `<tag>` is the "tag" config. (See
[`config`](/using-npm/config). The config's default value is `latest`.)
In most cases, this will install the version of the modules tagged as
`latest` on the npm registry.
Example:
```bash
npm install sax
```
`npm install` saves any specified packages into `dependencies` by default.
Additionally, you can control where and how they get saved with some
additional flags:
* `-P, --save-prod`: Package will appear in your `dependencies`. This
is the default unless `-D` or `-O` are present.
* `-D, --save-dev`: Package will appear in your `devDependencies`.
* `-O, --save-optional`: Package will appear in your
`optionalDependencies`.
* `--no-save`: Prevents saving to `dependencies`.
When using any of the above options to save dependencies to your
package.json, there are two additional, optional flags:
* `-E, --save-exact`: Saved dependencies will be configured with an
exact version rather than using npm's default semver range operator.
* `-B, --save-bundle`: Saved dependencies will also be added to your
`bundleDependencies` list.
Further, if you have an `npm-shrinkwrap.json` or `package-lock.json`
then it will be updated as well.
`<scope>` is optional. The package will be downloaded from the registry
associated with the specified scope. If no registry is associated with
the given scope the default registry is assumed. See
[`scope`](/using-npm/scope).
Note: if you do not include the @-symbol on your scope name, npm will
interpret this as a GitHub repository instead, see below. Scopes names
must also be followed by a slash.
Examples:
```bash
npm install sax
npm install githubname/reponame
npm install @myorg/privatepackage
npm install node-tap --save-dev
npm install dtrace-provider --save-optional
npm install readable-stream --save-exact
npm install ansi-regex --save-bundle
```
**Note**: If there is a file or folder named `<name>` in the current
working directory, then it will try to install that, and only try to
fetch the package by name if it is not valid.
* `npm install <alias>@npm:<name>`:
Install a package under a custom alias. Allows multiple versions of
a same-name package side-by-side, more convenient import names for
packages with otherwise long ones, and using git forks replacements
or forked npm packages as replacements. Aliasing works only on your
project and does not rename packages in transitive dependencies.
Aliases should follow the naming conventions stated in
[`validate-npm-package-name`](https://www.npmjs.com/package/validate-npm-package-name#naming-rules).
Examples:
```bash
npm install my-react@npm:react
npm install jquery2@npm:jquery@2
npm install jquery3@npm:jquery@3
npm install npa@npm:npm-package-arg
```
* `npm install [<@scope>/]<name>@<tag>`:
Install the version of the package that is referenced by the specified tag.
If the tag does not exist in the registry data for that package, then this
will fail.
Example:
```bash
npm install sax@latest
npm install @myorg/mypackage@latest
```
* `npm install [<@scope>/]<name>@<version>`:
Install the specified version of the package. This will fail if the
version has not been published to the registry.
Example:
```bash
npm install sax@0.1.1
npm install @myorg/privatepackage@1.5.0
```
* `npm install [<@scope>/]<name>@<version range>`:
Install a version of the package matching the specified version range.
This will follow the same rules for resolving dependencies described in
[`package.json`](/configuring-npm/package-json).
Note that most version ranges must be put in quotes so that your shell
will treat it as a single argument.
Example:
```bash
npm install sax@">=0.1.0 <0.2.0"
npm install @myorg/privatepackage@"16 - 17"
```
* `npm install <git remote url>`:
Installs the package from the hosted git provider, cloning it with
`git`. For a full git remote url, only that URL will be attempted.
```bash
<protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish> | #semver:<semver>]
```
`<protocol>` is one of `git`, `git+ssh`, `git+http`, `git+https`, or
`git+file`.
If `#<commit-ish>` is provided, it will be used to clone exactly that
commit. If the commit-ish has the format `#semver:<semver>`, `<semver>`
can be any valid semver range or exact version, and npm will look for
any tags or refs matching that range in the remote repository, much as
it would for a registry dependency. If neither `#<commit-ish>` or
`#semver:<semver>` is specified, then the default branch of the
repository is used.
If the repository makes use of submodules, those submodules will be
cloned as well.
If the package being installed contains a `prepare` script, its
`dependencies` and `devDependencies` will be installed, and the prepare
script will be run, before the package is packaged and installed.
The following git environment variables are recognized by npm and will
be added to the environment when running git:
* `GIT_ASKPASS`
* `GIT_EXEC_PATH`
* `GIT_PROXY_COMMAND`
* `GIT_SSH`
* `GIT_SSH_COMMAND`
* `GIT_SSL_CAINFO`
* `GIT_SSL_NO_VERIFY`
See the git man page for details.
Examples:
```bash
npm install git+ssh://git@github.com:npm/cli.git#v1.0.27
npm install git+ssh://git@github.com:npm/cli#pull/273
npm install git+ssh://git@github.com:npm/cli#semver:^5.0
npm install git+https://isaacs@github.com/npm/cli.git
npm install git://github.com/npm/cli.git#v1.0.27
GIT_SSH_COMMAND='ssh -i ~/.ssh/custom_ident' npm install git+ssh://git@github.com:npm/cli.git
```
* `npm install <githubname>/<githubrepo>[#<commit-ish>]`:
* `npm install github:<githubname>/<githubrepo>[#<commit-ish>]`:
Install the package at `https://github.com/githubname/githubrepo` by
attempting to clone it using `git`.
If `#<commit-ish>` is provided, it will be used to clone exactly that
commit. If the commit-ish has the format `#semver:<semver>`, `<semver>`
can be any valid semver range or exact version, and npm will look for
any tags or refs matching that range in the remote repository, much as
it would for a registry dependency. If neither `#<commit-ish>` or
`#semver:<semver>` is specified, then `master` is used.
As with regular git dependencies, `dependencies` and `devDependencies`
will be installed if the package has a `prepare` script before the
package is done installing.
Examples:
```bash
npm install mygithubuser/myproject
npm install github:mygithubuser/myproject
```
* `npm install gist:[<githubname>/]<gistID>[#<commit-ish>|#semver:<semver>]`:
Install the package at `https://gist.github.com/gistID` by attempting to
clone it using `git`. The GitHub username associated with the gist is
optional and will not be saved in `package.json`.
As with regular git dependencies, `dependencies` and `devDependencies` will
be installed if the package has a `prepare` script before the package is
done installing.
Example:
```bash
npm install gist:101a11beef
```
* `npm install bitbucket:<bitbucketname>/<bitbucketrepo>[#<commit-ish>]`:
Install the package at `https://bitbucket.org/bitbucketname/bitbucketrepo`
by attempting to clone it using `git`.
If `#<commit-ish>` is provided, it will be used to clone exactly that
commit. If the commit-ish has the format `#semver:<semver>`, `<semver>` can
be any valid semver range or exact version, and npm will look for any tags
or refs matching that range in the remote repository, much as it would for a
registry dependency. If neither `#<commit-ish>` or `#semver:<semver>` is
specified, then `master` is used.
As with regular git dependencies, `dependencies` and `devDependencies` will
be installed if the package has a `prepare` script before the package is
done installing.
Example:
```bash
npm install bitbucket:mybitbucketuser/myproject
```
* `npm install gitlab:<gitlabname>/<gitlabrepo>[#<commit-ish>]`:
Install the package at `https://gitlab.com/gitlabname/gitlabrepo`
by attempting to clone it using `git`.
If `#<commit-ish>` is provided, it will be used to clone exactly that
commit. If the commit-ish has the format `#semver:<semver>`, `<semver>` can
be any valid semver range or exact version, and npm will look for any tags
or refs matching that range in the remote repository, much as it would for a
registry dependency. If neither `#<commit-ish>` or `#semver:<semver>` is
specified, then `master` is used.
As with regular git dependencies, `dependencies` and `devDependencies` will
be installed if the package has a `prepare` script before the package is
done installing.
Example:
```bash
npm install gitlab:mygitlabuser/myproject
npm install gitlab:myusr/myproj#semver:^5.0
```
You may combine multiple arguments and even multiple types of arguments.
For example:
```bash
npm install sax@">=0.1.0 <0.2.0" bench supervisor
```
The `--tag` argument will apply to all of the specified install targets. If
a tag with the given name exists, the tagged version is preferred over
newer versions.
The `--dry-run` argument will report in the usual way what the install
would have done without actually installing anything.
The `--package-lock-only` argument will only update the
`package-lock.json`, instead of checking `node_modules` and downloading
dependencies.
The `-f` or `--force` argument will force npm to fetch remote resources
even if a local copy exists on disk.
```bash
npm install sax --force
```
### Configuration
See the [`config`](/using-npm/config) help doc. Many of the configuration
params have some effect on installation, since that's most of what npm
does.
These are some of the most common options related to installation.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `save`
* Default: true
* Type: Boolean
Save installed packages to a package.json file as dependencies.
When used with the `npm rm` command, removes the dependency from
package.json.
#### `save-exact`
* Default: false
* Type: Boolean
Dependencies saved to package.json will be configured with an exact version
rather than using npm's default semver range operator.
#### `global`
* Default: false
* Type: Boolean
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
[folders](/configuring-npm/folders) for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead
of the current working directory.
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`
#### `global-style`
* Default: false
* Type: Boolean
Causes npm to install the package into your local `node_modules` folder with
the same layout it uses with the global `node_modules` folder. Only your
direct dependencies will show in `node_modules` and everything they depend
on will be flattened in their `node_modules` folders. This obviously will
eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling`
will be preferred.
#### `legacy-bundling`
* Default: false
* Type: Boolean
Causes npm to install the package such that versions of npm prior to 1.4,
such as the one included with node 0.8, can install the package. This
eliminates all automatic deduping. If used with `global-style` this option
will be preferred.
#### `strict-peer-deps`
* Default: false
* Type: Boolean
If set to `true`, and `--legacy-peer-deps` is not set, then _any_
conflicting `peerDependencies` will be treated as an install failure, even
if npm could reasonably guess the appropriate resolution based on non-peer
dependency relationships.
By default, conflicting `peerDependencies` deep in the dependency graph will
be resolved using the nearest non-peer dependency specification, even if
doing so will result in some packages receiving a peer dependency outside
the range set in their package's `peerDependencies` object.
When such and override is performed, a warning is printed, explaining the
conflict and the packages involved. If `--strict-peer-deps` is set, then
this warning is treated as a failure.
#### `package-lock`
* Default: true
* Type: Boolean
If set to false, then ignore `package-lock.json` files when installing. This
will also prevent _writing_ `package-lock.json` if `save` is true.
When package package-locks are disabled, automatic pruning of extraneous
modules will also be disabled. To remove extraneous modules with
package-locks disabled use `npm prune`.
#### `omit`
* Default: 'dev' if the `NODE_ENV` environment variable is set to
'production', otherwise empty.
* Type: "dev", "optional", or "peer" (can be set multiple times)
Dependency types to omit from the installation tree on disk.
Note that these dependencies _are_ still resolved and added to the
`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
physically installed on disk.
If a package type appears in both the `--include` and `--omit` lists, then
it will be included.
If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
variable will be set to `'production'` for all lifecycle scripts.
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `audit`
* Default: true
* Type: Boolean
When "true" submit audit reports alongside `npm install` runs to the default
registry and all registries configured for scopes. See the documentation for
[`npm audit`](/commands/npm-audit) for details on what is submitted.
#### `bin-links`
* Default: true
* Type: Boolean
Tells npm to create symlinks (or `.cmd` shims on Windows) for package
executables.
Set to false to have it not do this. This can be used to work around the
fact that some file systems don't support symlinks, even on ostensibly Unix
systems.
#### `fund`
* Default: true
* Type: Boolean
When "true" displays the message at the end of each `npm install`
acknowledging the number of dependencies looking for funding. See [`npm
fund`](/commands/npm-fund) for details.
#### `dry-run`
* Default: false
* Type: Boolean
Indicates that you don't want npm to make any changes and that it should
only report what it would have done. This can be passed into any of the
commands that modify your local installation, eg, `install`, `update`,
`dedupe`, `uninstall`, as well as `pack` and `publish`.
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### Algorithm
Given a `package{dep}` structure: `A{B,C}, B{C}, C{D}`,
the npm install algorithm produces:
```bash
A
+-- B
+-- C
+-- D
```
That is, the dependency from B to C is satisfied by the fact that A already
caused C to be installed at a higher level. D is still installed at the top
level because nothing conflicts with it.
For `A{B,C}, B{C,D@1}, C{D@2}`, this algorithm produces:
```bash
A
+-- B
+-- C
`-- D@2
+-- D@1
```
Because B's D@1 will be installed in the top-level, C now has to install
D@2 privately for itself. This algorithm is deterministic, but different
trees may be produced if two dependencies are requested for installation in
a different order.
See [folders](/configuring-npm/folders) for a more detailed description of
the specific folder structures that npm creates.
### See Also
* [npm folders](/configuring-npm/folders)
* [npm update](/commands/npm-update)
* [npm audit](/commands/npm-audit)
* [npm fund](/commands/npm-fund)
* [npm link](/commands/npm-link)
* [npm rebuild](/commands/npm-rebuild)
* [npm scripts](/using-npm/scripts)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm registry](/using-npm/registry)
* [npm dist-tag](/commands/npm-dist-tag)
* [npm uninstall](/commands/npm-uninstall)
* [npm shrinkwrap](/commands/npm-shrinkwrap)
* [package.json](/configuring-npm/package-json)
* [workspaces](/using-npm/workspaces)

View File

@@ -0,0 +1,315 @@
---
title: npm-link
section: 1
description: Symlink a package folder
---
### Synopsis
```bash
npm link (in package dir)
npm link [<@scope>/]<pkg>[@<version>]
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/<package>` 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.
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.
When creating tarballs for `npm publish`, the linked packages are
"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
```
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:
```bash
cd ~/projects/node-bloggy # go into the dir of your main project
npm link ../node-redis # link the dir of your dependency
```
The second line is the equivalent of doing:
```bash
(cd ../node-redis; npm link)
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`.
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 <dep> --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 <dep> --save` to do so.
### Workspace Usage
`npm link <pkg> --workspace <name>` will link the relevant package as a
dependency of the specified workspace(s). Note that It may actually be
linked into the parent project's `node_modules` folder, if there are no
conflicting dependencies.
`npm link --workspace <name>` will create a global link to the specified
workspace(s).
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `save`
* Default: true
* Type: Boolean
Save installed packages to a package.json file as dependencies.
When used with the `npm rm` command, removes the dependency from
package.json.
#### `save-exact`
* Default: false
* Type: Boolean
Dependencies saved to package.json will be configured with an exact version
rather than using npm's default semver range operator.
#### `global`
* Default: false
* Type: Boolean
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
[folders](/configuring-npm/folders) for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead
of the current working directory.
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`
#### `global-style`
* Default: false
* Type: Boolean
Causes npm to install the package into your local `node_modules` folder with
the same layout it uses with the global `node_modules` folder. Only your
direct dependencies will show in `node_modules` and everything they depend
on will be flattened in their `node_modules` folders. This obviously will
eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling`
will be preferred.
#### `legacy-bundling`
* Default: false
* Type: Boolean
Causes npm to install the package such that versions of npm prior to 1.4,
such as the one included with node 0.8, can install the package. This
eliminates all automatic deduping. If used with `global-style` this option
will be preferred.
#### `strict-peer-deps`
* Default: false
* Type: Boolean
If set to `true`, and `--legacy-peer-deps` is not set, then _any_
conflicting `peerDependencies` will be treated as an install failure, even
if npm could reasonably guess the appropriate resolution based on non-peer
dependency relationships.
By default, conflicting `peerDependencies` deep in the dependency graph will
be resolved using the nearest non-peer dependency specification, even if
doing so will result in some packages receiving a peer dependency outside
the range set in their package's `peerDependencies` object.
When such and override is performed, a warning is printed, explaining the
conflict and the packages involved. If `--strict-peer-deps` is set, then
this warning is treated as a failure.
#### `package-lock`
* Default: true
* Type: Boolean
If set to false, then ignore `package-lock.json` files when installing. This
will also prevent _writing_ `package-lock.json` if `save` is true.
When package package-locks are disabled, automatic pruning of extraneous
modules will also be disabled. To remove extraneous modules with
package-locks disabled use `npm prune`.
#### `omit`
* Default: 'dev' if the `NODE_ENV` environment variable is set to
'production', otherwise empty.
* Type: "dev", "optional", or "peer" (can be set multiple times)
Dependency types to omit from the installation tree on disk.
Note that these dependencies _are_ still resolved and added to the
`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
physically installed on disk.
If a package type appears in both the `--include` and `--omit` lists, then
it will be included.
If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
variable will be set to `'production'` for all lifecycle scripts.
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `audit`
* Default: true
* Type: Boolean
When "true" submit audit reports alongside `npm install` runs to the default
registry and all registries configured for scopes. See the documentation for
[`npm audit`](/commands/npm-audit) for details on what is submitted.
#### `bin-links`
* Default: true
* Type: Boolean
Tells npm to create symlinks (or `.cmd` shims on Windows) for package
executables.
Set to false to have it not do this. This can be used to work around the
fact that some file systems don't support symlinks, even on ostensibly Unix
systems.
#### `fund`
* Default: true
* Type: Boolean
When "true" displays the message at the end of each `npm install`
acknowledging the number of dependencies looking for funding. See [`npm
fund`](/commands/npm-fund) for details.
#### `dry-run`
* Default: false
* Type: Boolean
Indicates that you don't want npm to make any changes and that it should
only report what it would have done. This can be passed into any of the
commands that modify your local installation, eg, `install`, `update`,
`dedupe`, `uninstall`, as well as `pack` and `publish`.
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm developers](/using-npm/developers)
* [package.json](/configuring-npm/package-json)
* [npm install](/commands/npm-install)
* [npm folders](/configuring-npm/folders)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)

View File

@@ -0,0 +1,76 @@
---
title: npm-logout
section: 1
description: Log out of the registry
---
### Synopsis
```bash
npm logout [--registry=<url>] [--scope=<@scope>]
```
Note: This command is unaware of workspaces.
### 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 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.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `scope`
* Default: the scope of the current project, if any, or ""
* Type: String
Associate an operation with a scope for a scoped registry.
Useful when logging in to or out of a private registry:
```
# log in, linking the scope to the custom registry
npm login --scope=@mycorp --registry=https://registry.mycorp.com
# log out, removing the link and the auth token
npm logout --scope=@mycorp
```
This will cause `@mycorp` to be mapped to the registry for future
installation of packages specified according to the pattern
`@mycorp/package`.
This will also cause `npm init` to create a scoped package.
```
# accept all defaults, and create a package named "@foo/whatever",
# instead of just named "whatever"
npm init --scope=@foo --yes
```
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm adduser](/commands/npm-adduser)
* [npm registry](/using-npm/registry)
* [npm config](/commands/npm-config)
* [npm whoami](/commands/npm-whoami)

View File

@@ -0,0 +1,225 @@
---
title: npm-ls
section: 1
description: List installed packages
---
### Synopsis
```bash
npm ls [[<@scope>/]<pkg> ...]
aliases: list, la, ll
```
### Description
This command will print to stdout all the versions of packages that are
installed, as well as their dependencies when `--all` is specified, in a
tree structure.
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
```
It will print out extraneous, missing, and invalid packages.
If a project specifies git urls for dependencies these are shown
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.
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. Therefore, 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
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `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
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
#### `long`
* Default: false
* Type: Boolean
Show extended information in `ls`, `search`, and `help-search`.
#### `parseable`
* Default: false
* Type: Boolean
Output parseable results from commands that write to standard output. For
`npm search`, this will be tab-separated table format.
#### `global`
* Default: false
* Type: Boolean
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
[folders](/configuring-npm/folders) for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead
of the current working directory.
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`
#### `depth`
* Default: `Infinity` if `--all` is set, otherwise `1`
* Type: null or Number
The depth to go when recursing packages for `npm ls`.
If not set, `npm ls` will show only the immediate dependencies of the root
project. If `--all` is set, then npm will show all dependencies by default.
#### `omit`
* Default: 'dev' if the `NODE_ENV` environment variable is set to
'production', otherwise empty.
* Type: "dev", "optional", or "peer" (can be set multiple times)
Dependency types to omit from the installation tree on disk.
Note that these dependencies _are_ still resolved and added to the
`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
physically installed on disk.
If a package type appears in both the `--include` and `--omit` lists, then
it will be included.
If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
variable will be set to `'production'` for all lifecycle scripts.
#### `link`
* Default: false
* Type: Boolean
If true, then local installs will link if there is a suitable globally
installed package.
Note that this means that local installs can cause things to be installed
into the global space at the same time. The link is only done if one of the
two conditions are met:
* The package is not already installed globally, or
* the globally installed version is identical to the version that is being
installed locally.
When used with `npm ls`, only show packages that are linked.
#### `unicode`
* Default: false on windows, true on mac/unix systems with a unicode locale,
as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
* Type: Boolean
When set to true, npm uses unicode characters in the tree output. When
false, it uses ascii characters instead of unicode glyphs.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm explain](/commands/npm-explain)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm folders](/configuring-npm/folders)
* [npm explain](/commands/npm-explain)
* [npm install](/commands/npm-install)
* [npm link](/commands/npm-link)
* [npm prune](/commands/npm-prune)
* [npm outdated](/commands/npm-outdated)
* [npm update](/commands/npm-update)

View File

@@ -0,0 +1,105 @@
---
title: npm-org
section: 1
description: Manage orgs
---
### Synopsis
```bash
npm org set <orgname> <username> [developer | admin | owner]
npm org rm <orgname> <username>
npm org ls <orgname> [<username>]
```
Note: This command is unaware of workspaces.
### Example
Add a new developer to an org:
```bash
$ npm org set my-org @mx-smith
```
Add a new admin to an org (or change a developer to an admin):
```bash
$ npm org set my-org @mx-santos admin
```
Remove a user from an org:
```bash
$ npm org rm my-org mx-santos
```
List all users in an org:
```bash
$ npm org ls my-org
```
List all users in JSON format:
```bash
$ npm org ls my-org --json
```
See what role a user has in an org:
```bash
$ 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.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `otp`
* Default: null
* Type: null or String
This is a one-time password from a two-factor authenticator. It's needed
when publishing or changing package permissions with `npm access`.
If not set, and a registry response fails with a challenge for a one-time
password, npm will prompt on the command line for one.
#### `json`
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
#### `parseable`
* Default: false
* Type: Boolean
Output parseable results from commands that write to standard output. For
`npm search`, this will be tab-separated table format.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [using orgs](/using-npm/orgs)
* [Documentation on npm Orgs](https://docs.npmjs.com/orgs/)

View File

@@ -0,0 +1,168 @@
---
title: npm-outdated
section: 1
description: Check for outdated packages
---
### Synopsis
```bash
npm outdated [[<@scope>/]<pkg> ...]
```
### Description
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 and direct
dependencies of your configured *workspaces* 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.
* `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](/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.
### An example
```bash
$ npm outdated
Package Current Wanted Latest Location Depended by
glob 5.0.15 5.0.15 6.0.1 node_modules/glob dependent-package-name
nothingness 0.0.3 git git node_modules/nothingness dependent-package-name
npm 3.5.1 3.5.2 3.5.1 node_modules/npm dependent-package-name
local-dev 0.0.3 linked linked local-dev dependent-package-name
once 1.3.2 1.3.3 1.3.3 node_modules/once dependent-package-name
```
With these `dependencies`:
```json
{
"glob": "^5.0.15",
"nothingness": "github:othiym23/nothingness#master",
"npm": "^3.5.1",
"once": "^1.3.1"
}
```
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.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `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
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
#### `long`
* Default: false
* Type: Boolean
Show extended information in `ls`, `search`, and `help-search`.
#### `parseable`
* Default: false
* Type: Boolean
Output parseable results from commands that write to standard output. For
`npm search`, this will be tab-separated table format.
#### `global`
* Default: false
* Type: Boolean
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
[folders](/configuring-npm/folders) for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead
of the current working directory.
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm update](/commands/npm-update)
* [npm dist-tag](/commands/npm-dist-tag)
* [npm registry](/using-npm/registry)
* [npm folders](/configuring-npm/folders)
* [npm workspaces](/using-npm/workspaces)

View File

@@ -0,0 +1,67 @@
---
title: npm-owner
section: 1
description: Manage package owners
---
### Synopsis
```bash
npm owner add <user> [<@scope>/]<pkg>
npm owner rm <user> [<@scope>/]<pkg>
npm owner ls [<@scope>/]<pkg>
aliases: author
```
Note: This command is unaware of workspaces.
### Description
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.
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` (see
[`npm-profile`](/commands/npm-profile)) then you'll need to include an otp
on the command line when changing ownership with `--otp`.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `otp`
* Default: null
* Type: null or String
This is a one-time password from a two-factor authenticator. It's needed
when publishing or changing package permissions with `npm access`.
If not set, and a registry response fails with a challenge for a one-time
password, npm will prompt on the command line for one.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm profile](/commands/npm-profile)
* [npm publish](/commands/npm-publish)
* [npm registry](/using-npm/registry)
* [npm adduser](/commands/npm-adduser)

View File

@@ -0,0 +1,92 @@
---
title: npm-pack
section: 1
description: Create a tarball from a package
---
### Synopsis
```bash
npm pack [[<@scope>/]<pkg>...] [--dry-run] [--json]
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `dry-run`
* Default: false
* Type: Boolean
Indicates that you don't want npm to make any changes and that it should
only report what it would have done. This can be passed into any of the
commands that modify your local installation, eg, `install`, `update`,
`dedupe`, `uninstall`, as well as `pack` and `publish`.
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.
#### `json`
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### Description
For anything that's installable (that is, a package folder, tarball,
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 `<name>-<version>.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.
If no arguments are supplied, then npm packs the current package folder.
### 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)
* [npmrc](/configuring-npm/npmrc)

View File

@@ -0,0 +1,45 @@
---
title: npm-ping
section: 1
description: Ping npm registry
---
### Synopsis
```bash
npm ping [--registry <registry>]
```
Note: This command is unaware of workspaces.
### Description
Ping the configured or given npm registry and verify authentication.
If it works it will output something like:
```bash
Ping success: {*Details about registry*}
```
otherwise you will get:
```bash
Ping error: {*Detail about error}
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm doctor](/commands/npm-doctor)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)

View File

@@ -0,0 +1,62 @@
---
title: npm-prefix
section: 1
description: Display prefix
---
### Synopsis
```bash
npm prefix [-g]
```
Note: This command is unaware of workspaces.
### Description
Print the local prefix to standard output. This is the closest parent directory
to contain a `package.json` file or `node_modules` directory, unless `-g` is
also specified.
If `-g` is specified, this will be the value of the global prefix. See
[`npm config`](/commands/npm-config) for more detail.
### Example
```bash
npm prefix
/usr/local/projects/foo
```
```bash
npm prefix -g
/usr/local
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `global`
* Default: false
* Type: Boolean
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
[folders](/configuring-npm/folders) for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead
of the current working directory.
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm root](/commands/npm-root)
* [npm bin](/commands/npm-bin)
* [npm folders](/configuring-npm/folders)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)

View File

@@ -0,0 +1,125 @@
---
title: npm-profile
section: 1
description: Change settings on your registry profile
---
### Synopsis
```bash
npm profile get [--json|--parseable] [<property>]
npm profile set [--json|--parseable] <property> <value>
npm profile set password
npm profile enable-2fa [auth-and-writes|auth-only]
npm profile disable-2fa
```
Note: This command is unaware of workspaces.
### Description
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 [<property>]`: Display all of the properties of your
profile, or one or more specific properties. It looks like:
```bash
+-----------------+---------------------------+
| name | example |
+-----------------+---------------------------+
| email | me@example.com (verified) |
+-----------------+---------------------------+
| two factor auth | auth-and-writes |
+-----------------+---------------------------+
| fullname | Example User |
+-----------------+---------------------------+
| homepage | |
+-----------------+---------------------------+
| freenode | |
+-----------------+---------------------------+
| twitter | |
+-----------------+---------------------------+
| github | |
+-----------------+---------------------------+
| created | 2015-02-26T01:38:35.892Z |
+-----------------+---------------------------+
| updated | 2017-10-02T21:29:45.922Z |
+-----------------+---------------------------+
```
* `npm profile set <property> <value>`: 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 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`.
* `npm profile disable-2fa`: Disables two-factor authentication.
### Details
Some of these commands may not be available on non npmjs.com registries.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `json`
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
#### `parseable`
* Default: false
* Type: Boolean
Output parseable results from commands that write to standard output. For
`npm search`, this will be tab-separated table format.
#### `otp`
* Default: null
* Type: null or String
This is a one-time password from a two-factor authenticator. It's needed
when publishing or changing package permissions with `npm access`.
If not set, and a registry response fails with a challenge for a one-time
password, npm will prompt on the command line for one.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm adduser](/commands/npm-adduser)
* [npm registry](/using-npm/registry)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm owner](/commands/npm-owner)
* [npm whoami](/commands/npm-whoami)
* [npm token](/commands/npm-token)

View File

@@ -0,0 +1,118 @@
---
title: npm-prune
section: 1
description: Remove extraneous packages
---
### Synopsis
```bash
npm prune [[<@scope>/]<pkg>...] [--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.
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`.
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
have made with `--dry-run`) are printed as a JSON object.
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.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `omit`
* Default: 'dev' if the `NODE_ENV` environment variable is set to
'production', otherwise empty.
* Type: "dev", "optional", or "peer" (can be set multiple times)
Dependency types to omit from the installation tree on disk.
Note that these dependencies _are_ still resolved and added to the
`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
physically installed on disk.
If a package type appears in both the `--include` and `--omit` lists, then
it will be included.
If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
variable will be set to `'production'` for all lifecycle scripts.
#### `dry-run`
* Default: false
* Type: Boolean
Indicates that you don't want npm to make any changes and that it should
only report what it would have done. This can be passed into any of the
commands that modify your local installation, eg, `install`, `update`,
`dedupe`, `uninstall`, as well as `pack` and `publish`.
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.
#### `json`
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm uninstall](/commands/npm-uninstall)
* [npm folders](/configuring-npm/folders)
* [npm ls](/commands/npm-ls)

View File

@@ -0,0 +1,203 @@
---
title: npm-publish
section: 1
description: Publish a package
---
### Synopsis
```bash
npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>] [--otp otpcode] [--dry-run]
Publishes '.' if no argument supplied
Sets tag 'latest' if no --tag specified
```
### Description
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)).
* `<folder>`: A folder containing a package.json file
* `<tarball>`: A url or file path to a gzipped tar archive containing a
single folder with a package.json file inside.
* `[--tag <tag>]`: Registers the published package with the given tag, such
that `npm install <name>@<tag>` 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 <public|restricted>]`: 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 <otpcode>]`: 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.
* `[--workspaces]`: Enables workspace context while publishing. All
workspace packages will be published.
* `[--workspace]`: Enables workspaces context and limits results to only
those specified by this config item. Only the packages in the
workspaces given will be published.
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).
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.
### 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.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `tag`
* Default: "latest"
* Type: String
If you ask npm to install a package and don't tell it a specific version,
then it will install the specified tag.
Also the tag that is added to the package@version specified by the `npm tag`
command, if no explicit tag is given.
When used by the `npm diff` command, this is the tag used to fetch the
tarball that will be compared with the local files by default.
#### `access`
* Default: 'restricted' for scoped packages, 'public' for unscoped packages
* Type: null, "restricted", or "public"
When publishing scoped packages, the access level defaults to `restricted`.
If you want your scoped package to be publicly viewable (and installable)
set `--access=public`. The only valid values for `access` are `public` and
`restricted`. Unscoped packages _always_ have an access level of `public`.
#### `dry-run`
* Default: false
* Type: Boolean
Indicates that you don't want npm to make any changes and that it should
only report what it would have done. This can be passed into any of the
commands that modify your local installation, eg, `install`, `update`,
`dedupe`, `uninstall`, as well as `pack` and `publish`.
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.
#### `otp`
* Default: null
* Type: null or String
This is a one-time password from a two-factor authenticator. It's needed
when publishing or changing package permissions with `npm access`.
If not set, and a registry response fails with a challenge for a one-time
password, npm will prompt on the command line for one.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### 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)
* [npm owner](/commands/npm-owner)
* [npm deprecate](/commands/npm-deprecate)
* [npm dist-tag](/commands/npm-dist-tag)
* [npm pack](/commands/npm-pack)
* [npm profile](/commands/npm-profile)

View File

@@ -0,0 +1,105 @@
---
title: npm-rebuild
section: 1
description: Rebuild a package
---
### Synopsis
```bash
npm rebuild [[<@scope>/]<name>[@<version>] ...]
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. 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.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `global`
* Default: false
* Type: Boolean
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
[folders](/configuring-npm/folders) for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead
of the current working directory.
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`
#### `bin-links`
* Default: true
* Type: Boolean
Tells npm to create symlinks (or `.cmd` shims on Windows) for package
executables.
Set to false to have it not do this. This can be used to work around the
fact that some file systems don't support symlinks, even on ostensibly Unix
systems.
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm install](/commands/npm-install)

View File

@@ -0,0 +1,73 @@
---
title: npm-repo
section: 1
description: Open package repository page in the browser
---
### Synopsis
```bash
npm repo [<pkgname> [<pkgname> ...]]
```
### 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 `repository` property.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `browser`
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
* Type: null, Boolean, or String
The browser that is called by npm commands to open websites.
Set to `false` to suppress browser behavior and instead print urls to
terminal.
Set to `true` to use default system URL opener.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm docs](/commands/npm-docs)
* [npm config](/commands/npm-config)

View File

@@ -0,0 +1,70 @@
---
title: npm-restart
section: 1
description: Restart a package
---
### Synopsis
```bash
npm restart [-- <args>]
```
### Description
This restarts a project. It is equivalent to running `npm run-script
restart`.
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
6. prestart
7. start
8. poststart
9. postrestart
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `script-shell`
* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
init <pkg>` commands.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm run-script](/commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [npm test](/commands/npm-test)
* [npm start](/commands/npm-start)
* [npm stop](/commands/npm-stop)
* [npm restart](/commands/npm-restart)

View File

@@ -0,0 +1,52 @@
---
title: npm-root
section: 1
description: Display npm root
---
### Synopsis
```bash
npm root [-g]
```
### Description
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}"
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `global`
* Default: false
* Type: Boolean
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
[folders](/configuring-npm/folders) for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead
of the current working directory.
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm prefix](/commands/npm-prefix)
* [npm bin](/commands/npm-bin)
* [npm folders](/configuring-npm/folders)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)

View File

@@ -0,0 +1,220 @@
---
title: npm-run-script
section: 1
description: Run arbitrary package scripts
---
### Synopsis
```bash
npm run-script <command> [--if-present] [--silent] [-- <args>]
npm run-script <command> [--workspace=<workspace-name>]
npm run-script <command> [--workspaces]
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.
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"
```
The arguments will only be passed to the script specified after `npm run`
and not to any `pre` or `post` script.
The `env` script is a special built-in command that can be used to list
environment variables that will be available to the script at runtime. If an
"env" command is defined in your package, it will take precedence over the
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:
```bash
"scripts": {"test": "tap test/*.js"}
```
instead of
```bash
"scripts": {"test": "node_modules/.bin/tap test/*.js"}
```
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
`cmd.exe`.
The actual shell referred to by `/bin/sh` also depends on the system.
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.
### Workspaces support
You may use the `workspace` or `workspaces` configs in order to run an
arbitrary command from a package's `"scripts"` object in the context of the
specified workspaces. If no `"command"` is provided, it will list the available
scripts for each of these configured workspaces.
Given a project with configured workspaces, e.g:
```
.
+-- package.json
`-- packages
+-- a
| `-- package.json
+-- b
| `-- package.json
`-- c
`-- package.json
```
Assuming the workspace configuration is properly set up at the root level
`package.json` file. e.g:
```
{
"workspaces": [ "./packages/*" ]
}
```
And that each of the configured workspaces has a configured `test` script,
we can run tests in all of them using the `workspaces` config:
```
npm test --workspaces
```
#### Filtering workspaces
It's also possible to run a script in a single workspace using the `workspace`
config along with a name or directory path:
```
npm test --workspace=a
```
The `workspace` config can also be specified multiple times in order to run a
specific script in the context of multiple workspaces. When defining values for
the `workspace` config in the command line, it also possible to use `-w` as a
shorthand, e.g:
```
npm test -w a -w b
```
This last command will run `test` in both `./packages/a` and `./packages/b`
packages.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
#### `if-present`
* Default: false
* Type: Boolean
If true, npm will not exit with an error code when `run-script` is invoked
for a script that isn't defined in the `scripts` section of `package.json`.
This option can be used when it's desirable to optionally run a script when
it's present and fail if the script fails. This is useful, for example, when
running scripts that may only apply for some builds in an otherwise generic
CI setup.
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `script-shell`
* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
init <pkg>` commands.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm scripts](/using-npm/scripts)
* [npm test](/commands/npm-test)
* [npm start](/commands/npm-start)
* [npm restart](/commands/npm-restart)
* [npm stop](/commands/npm-stop)
* [npm config](/commands/npm-config)
* [npm workspaces](/using-npm/workspaces)

View File

@@ -0,0 +1,138 @@
---
title: npm-search
section: 1
description: Search for packages
---
### Synopsis
```bash
npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...]
aliases: s, se, find
```
Note: This command is unaware of workspaces.
### Description
Search the registry for packages matching the search terms. `npm search`
performs a linear, incremental, lexically-ordered search through package
metadata for all files in the registry. If your terminal has color
support, it will further highlight the matches in the results. This can
be disabled with the config item `color`
Additionally, using the `--searchopts` and `--searchexclude` options
paired with more search terms will include and exclude further patterns.
The main difference between `--searchopts` and the standard search terms
is that the former does not highlight results in the output and you can
use them more fine-grained filtering. Additionally, you can add both of
these to your config to change default search filtering behavior.
Search also allows targeting of maintainers in search results, by prefixing
their npm username with `=`.
If a term starts with `/`, then it's interpreted as a regular expression
and supports standard JavaScript RegExp syntax. In this case search will
ignore a trailing `/` . (Note you must escape or quote many regular
expression characters in most shells.)
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `long`
* Default: false
* Type: Boolean
Show extended information in `ls`, `search`, and `help-search`.
#### `json`
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
#### `color`
* Default: true unless the NO_COLOR environ is set to something other than '0'
* Type: "always" or Boolean
If false, never shows colors. If `"always"` then always shows colors. If
true, then only prints color codes for tty file descriptors.
#### `parseable`
* Default: false
* Type: Boolean
Output parseable results from commands that write to standard output. For
`npm search`, this will be tab-separated table format.
#### `description`
* Default: true
* Type: Boolean
Show the description in `npm search`
#### `searchopts`
* Default: ""
* Type: String
Space-separated options that are always passed to search.
#### `searchexclude`
* Default: ""
* Type: String
Space-separated options that limit the results from search.
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `prefer-online`
* Default: false
* Type: Boolean
If true, staleness checks for cached data will be forced, making the CLI
look for updates immediately even for fresh package data.
#### `prefer-offline`
* Default: false
* Type: Boolean
If true, staleness checks for cached data will be bypassed, but missing data
will be requested from the server. To force full offline mode, use
`--offline`.
#### `offline`
* Default: false
* Type: Boolean
Force offline mode: no network requests will be done during install. To
allow the CLI to fill in missing cache data, see `--prefer-offline`.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm registry](/using-npm/registry)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm view](/commands/npm-view)
* [npm cache](/commands/npm-cache)
* https://npm.im/npm-registry-fetch

View File

@@ -0,0 +1,72 @@
---
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 [<script>] [<command>]
```
**Example:**
* `npm set-script start "http-server ."`
```json
{
"name": "my-project",
"scripts": {
"start": "http-server .",
"test": "some existing value"
}
}
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm run-script](/commands/npm-run-script)
* [npm install](/commands/npm-install)
* [npm test](/commands/npm-test)
* [npm start](/commands/npm-start)

View File

@@ -0,0 +1,32 @@
---
title: npm-shrinkwrap
section: 1
description: Lock down dependency versions for publication
---
### Synopsis
```bash
npm shrinkwrap
```
Note: This command is unaware of workspaces.
### Description
This command repurposes `package-lock.json` into a publishable
`npm-shrinkwrap.json` or simply creates a new one. The file created and
updated by this command will then take precedence over any other existing
or future `package-lock.json` files. For a detailed explanation of the
design and purpose of package locks in npm, see
[package-lock-json](/configuring-npm/package-lock-json).
### See Also
* [npm install](/commands/npm-install)
* [npm run-script](/commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [package.json](/configuring-npm/package-json)
* [package-lock.json](/configuring-npm/package-lock-json)
* [npm-shrinkwrap.json](/configuring-npm/npm-shrinkwrap-json)
* [npm ls](/commands/npm-ls)

View File

@@ -0,0 +1,64 @@
---
title: npm-star
section: 1
description: Mark your favorite packages
---
### Synopsis
```bash
npm star [<pkg>...]
```
Note: This command is unaware of workspaces.
### Description
"Starring" a package means that you have some interest in it. It's
a vaguely positive way to show that you care.
It's a boolean thing. Starring repeatedly has no additional effect.
### More
There's also these extra commands to help you manage your favorite packages:
#### Unstar
You can also "unstar" a package using [`npm unstar`](/commands/npm-unstar)
"Unstarring" is the same thing, but in reverse.
#### Listing stars
You can see all your starred packages using [`npm stars`](/commands/npm-stars)
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `unicode`
* Default: false on windows, true on mac/unix systems with a unicode locale,
as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
* Type: Boolean
When set to true, npm uses unicode characters in the tree output. When
false, it uses ascii characters instead of unicode glyphs.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm unstar](/commands/npm-unstar)
* [npm stars](/commands/npm-stars)
* [npm view](/commands/npm-view)
* [npm whoami](/commands/npm-whoami)
* [npm adduser](/commands/npm-adduser)

View File

@@ -0,0 +1,41 @@
---
title: npm-stars
section: 1
description: View packages marked as favorites
---
### Synopsis
```bash
npm stars [<user>]
```
Note: This command is unaware of workspaces.
### Description
If you have starred a lot of neat things and want to find them again
quickly this command lets you do just that.
You may also want to see your friend's favorite packages, in this case
you will most certainly enjoy this command.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm star](/commands/npm-star)
* [npm unstar](/commands/npm-unstar)
* [npm view](/commands/npm-view)
* [npm whoami](/commands/npm-whoami)
* [npm adduser](/commands/npm-adduser)

View File

@@ -0,0 +1,80 @@
---
title: npm-start
section: 1
description: Start a package
---
### Synopsis
```bash
npm start [-- <args>]
```
### Description
This runs a predefined command specified in the `"start"` property of
a package's `"scripts"` object.
If the `"scripts"` object does not define a `"start"` property, npm
will run `node server.js`.
Note that this is different from the default node behavior of running
the file specified in a package's `"main"` attribute when evoking with
`node .`
As of [`npm@2.0.0`](https://blog.npmjs.org/post/98131109725/npm-2-0-0), you can
use custom arguments when executing scripts. Refer to [`npm run-script`](/commands/npm-run-script) for more details.
### Example
```json
{
"scripts": {
"start": "node foo.js"
}
}
```
```bash
npm start
> npm@x.x.x start
> node foo.js
(foo.js output would be here)
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `script-shell`
* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
init <pkg>` commands.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm run-script](/commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [npm test](/commands/npm-test)
* [npm restart](/commands/npm-restart)
* [npm stop](/commands/npm-stop)

View File

@@ -0,0 +1,73 @@
---
title: npm-stop
section: 1
description: Stop a package
---
### Synopsis
```bash
npm stop [-- <args>]
```
### Description
This runs a predefined command specified in the "stop" property of a
package's "scripts" object.
Unlike with [npm start](/commands/npm-start), there is no default script
that will run if the `"stop"` property is not defined.
### Example
```json
{
"scripts": {
"stop": "node bar.js"
}
}
```
```bash
npm stop
> npm@x.x.x stop
> node bar.js
(bar.js output would be here)
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `script-shell`
* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
init <pkg>` commands.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm run-script](/commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [npm test](/commands/npm-test)
* [npm start](/commands/npm-start)
* [npm restart](/commands/npm-restart)

View File

@@ -0,0 +1,149 @@
---
title: npm-team
section: 1
description: Manage organization teams and team memberships
---
### Synopsis
```bash
npm team create <scope:team>
npm team destroy <scope:team>
npm team add <scope:team> <user>
npm team rm <scope:team> <user>
npm team ls <scope>|<scope:team>
```
Note: This command is unaware of workspaces.
### Description
Used to manage teams in organizations, and change team memberships. Does not
handle permissions for packages.
Teams must always be fully qualified with the organization/scope they belong to
when operating on them, separated by a colon (`:`). That is, if you have a
`newteam` team in an `org` organization, you must always refer to that team
as `@org:newteam` in these commands.
If you have two-factor authentication enabled in `auth-and-writes` mode, then
you can provide a code from your authenticator with `[--otp <otpcode>]`.
If you don't include this then you will be prompted.
* create / destroy:
Create a new team, or destroy an existing one. Note: You cannot remove the
`developers` team, <a href="https://docs.npmjs.com/about-developers-team" target="_blank">learn more.</a>
Here's how to create a new team `newteam` under the `org` org:
```bash
npm team create @org:newteam
```
You should see a confirming message such as: `+@org:newteam` once the new
team has been created.
* add:
Add a user to an existing team.
Adding a new user `username` to a team named `newteam` under the `org` org:
```bash
npm team add @org:newteam username
```
On success, you should see a message: `username added to @org:newteam`
* rm:
Using `npm team rm` you can also remove users from a team they belong to.
Here's an example removing user `username` from `newteam` team
in `org` organization:
```bash
npm team rm @org:newteam username
```
Once the user is removed a confirmation message is displayed:
`username removed from @org:newteam`
* ls:
If performed on an organization name, will return a list of existing teams
under that organization. If performed on a team, it will instead return a list
of all users belonging to that particular team.
Here's an example of how to list all teams from an org named `org`:
```bash
npm team ls @org
```
Example listing all members of a team named `newteam`:
```bash
npm team ls @org:newteam
```
### Details
`npm team` always operates directly on the current registry, configurable from
the command line using `--registry=<registry url>`.
You must be a *team admin* to create teams and manage team membership, under
the given organization. Listing teams and team memberships may be done by
any member of the organization.
Organization creation and management of team admins and *organization* members
is done through the website, not the npm CLI.
To use teams to manage permissions on packages belonging to your organization,
use the `npm access` command to grant or revoke the appropriate permissions.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `otp`
* Default: null
* Type: null or String
This is a one-time password from a two-factor authenticator. It's needed
when publishing or changing package permissions with `npm access`.
If not set, and a registry response fails with a challenge for a one-time
password, npm will prompt on the command line for one.
#### `parseable`
* Default: false
* Type: Boolean
Output parseable results from commands that write to standard output. For
`npm search`, this will be tab-separated table format.
#### `json`
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm access](/commands/npm-access)
* [npm config](/commands/npm-config)
* [npm registry](/using-npm/registry)

View File

@@ -0,0 +1,70 @@
---
title: npm-test
section: 1
description: Test a package
---
### Synopsis
```bash
npm test [-- <args>]
aliases: t, tst
```
### Description
This runs a predefined command specified in the `"test"` property of
a package's `"scripts"` object.
### Example
```json
{
"scripts": {
"test": "node test.js"
}
}
```
```bash
npm test
> npm@x.x.x test
> node test.js
(test.js output would be here)
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `script-shell`
* Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows
* Type: null or String
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
init <pkg>` commands.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm run-script](/commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [npm start](/commands/npm-start)
* [npm restart](/commands/npm-restart)
* [npm stop](/commands/npm-stop)

View File

@@ -0,0 +1,125 @@
---
title: npm-token
section: 1
description: Manage your authentication tokens
---
### Synopsis
```bash
npm token list [--json|--parseable]
npm token create [--read-only] [--cidr=1.1.1.1/24,2.2.2.2/16]
npm token revoke <id|token>
```
Note: This command is unaware of workspaces.
### Description
This lets you list, create and revoke authentication tokens.
* `npm token list`:
Shows a table of all active authentication tokens. You can request
this as JSON with `--json` or tab-separated values with `--parseable`.
```bash
+--------+---------+------------+----------+----------------+
| id | token | created | read-only | CIDR whitelist |
+--------+---------+------------+----------+----------------+
| 7f3134 | 1fa9ba… | 2017-10-02 | yes | |
+--------+---------+------------+----------+----------------+
| c03241 | af7aef… | 2017-10-02 | no | 192.168.0.1/24 |
+--------+---------+------------+----------+----------------+
| e0cf92 | 3a436a… | 2017-10-02 | no | |
+--------+---------+------------+----------+----------------+
| 63eb9d | 74ef35… | 2017-09-28 | no | |
+--------+---------+------------+----------+----------------+
| 2daaa8 | cbad5f… | 2017-09-26 | no | |
+--------+---------+------------+----------+----------------+
| 68c2fe | 127e51… | 2017-09-23 | no | |
+--------+---------+------------+----------+----------------+
| 6334e1 | 1dadd1… | 2017-09-23 | no | |
+--------+---------+------------+----------+----------------+
```
* `npm token create [--read-only] [--cidr=<cidr-ranges>]`:
Create a new authentication token. It can be `--read-only`, or accept
a list of
[CIDR](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)
ranges with which to limit use of this token. This will prompt you for
your password, and, if you have two-factor authentication enabled, an
otp.
Currently, the cli can not generate automation tokens. Please refer to
the [docs
website](https://docs.npmjs.com/creating-and-viewing-access-tokens)
for more information on generating automation tokens.
```bash
+----------------+--------------------------------------+
| token | a73c9572-f1b9-8983-983d-ba3ac3cc913d |
+----------------+--------------------------------------+
| cidr_whitelist | |
+----------------+--------------------------------------+
| readonly | false |
+----------------+--------------------------------------+
| created | 2017-10-02T07:52:24.838Z |
+----------------+--------------------------------------+
```
* `npm token revoke <token|id>`:
Immediately removes an authentication token from the registry. You
will no longer be able to use it. This can accept both complete
tokens (such as those you get back from `npm token create`, and those
found in your `.npmrc`), and ids as seen in the parseable or json
output of `npm token list`. This will NOT accept the truncated token
found in the normal `npm token list` output.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `read-only`
* Default: false
* Type: Boolean
This is used to mark a token as unable to publish when configuring limited
access tokens with the `npm token create` command.
#### `cidr`
* Default: null
* Type: null or String (can be set multiple times)
This is a list of CIDR address to be used when configuring limited access
tokens with the `npm token create` command.
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `otp`
* Default: null
* Type: null or String
This is a one-time password from a two-factor authenticator. It's needed
when publishing or changing package permissions with `npm access`.
If not set, and a registry response fails with a challenge for a one-time
password, npm will prompt on the command line for one.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm adduser](/commands/npm-adduser)
* [npm registry](/using-npm/registry)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm owner](/commands/npm-owner)
* [npm whoami](/commands/npm-whoami)
* [npm profile](/commands/npm-profile)

View File

@@ -0,0 +1,111 @@
---
title: npm-uninstall
section: 1
description: Remove a package
---
### Synopsis
```bash
npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|--no-save]
aliases: remove, rm, r, un, unlink
```
### Description
This uninstalls a package, completely removing everything npm installed
on its behalf.
It also removes the package from the `dependencies`, `devDependencies`,
`optionalDependencies`, and `peerDependencies` objects in your
`package.json`.
Futher, if you have an `npm-shrinkwrap.json` or `package-lock.json`, npm
will update those files as well.
`--no-save` will tell npm not to remove the package from your
`package.json`, `npm-shrinkwrap.json`, or `package-lock.json` files.
`--save` or `-S` will tell npm to remove the package from your
`package.json`, `npm-shrinkwrap.json`, and `package-lock.json` files.
This is the default, but you may need to use this if you have for
instance `save=false` in your `npmrc` file
In global mode (ie, with `-g` or `--global` appended to the command),
it uninstalls the current package context as a global package.
`--no-save` is ignored in this case.
Scope is optional and follows the usual rules for [`scope`](/using-npm/scope).
### Examples
```bash
npm uninstall sax
```
`sax` will no longer be in your `package.json`, `npm-shrinkwrap.json`, or
`package-lock.json` files.
```bash
npm uninstall lodash --no-save
```
`lodash` will not be removed from your `package.json`,
`npm-shrinkwrap.json`, or `package-lock.json` files.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `save`
* Default: true
* Type: Boolean
Save installed packages to a package.json file as dependencies.
When used with the `npm rm` command, removes the dependency from
package.json.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm prune](/commands/npm-prune)
* [npm install](/commands/npm-install)
* [npm folders](/configuring-npm/folders)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)

View File

@@ -0,0 +1,130 @@
---
title: npm-unpublish
section: 1
description: Remove a package from the registry
---
### Synopsis
To learn more about how the npm registry treats unpublish, see our <a
href="https://www.npmjs.com/policies/unpublish" target="_blank"
rel="noopener noreferrer"> unpublish policies</a>
#### Unpublishing a single version of a package
```bash
npm unpublish [<@scope>/]<pkg>@<version>
```
#### Unpublishing an entire package
```bash
npm unpublish [<@scope>/]<pkg> --force
```
### Warning
Consider using the [`deprecate`](/commands/npm-deprecate) command instead,
if your intent is to encourage users to upgrade, or if you no longer
want to maintain a package.
### Description
This removes a package version from the registry, deleting its entry and
removing the tarball.
The npm registry will return an error if you are not [logged
in](/commands/npm-adduser).
If you do not specify a version or if you remove all of a package's
versions then the registry will remove the root package entry entirely.
Even if you unpublish a package version, that specific name and version
combination can never be reused. In order to publish the package again,
you must use a new version number. If you unpublish the entire package,
you may not publish any new versions of that package until 24 hours have
passed.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `dry-run`
* Default: false
* Type: Boolean
Indicates that you don't want npm to make any changes and that it should
only report what it would have done. This can be passed into any of the
commands that modify your local installation, eg, `install`, `update`,
`dedupe`, `uninstall`, as well as `pack` and `publish`.
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.
#### `force`
* Default: false
* Type: Boolean
Removes various protections against unfortunate side effects, common
mistakes, unnecessary performance degradation, and malicious input.
* Allow clobbering non-npm files in global installs.
* Allow the `npm version` command to work on an unclean git repository.
* Allow deleting the cache folder with `npm cache clean`.
* Allow installing packages that have an `engines` declaration requiring a
different version of npm.
* Allow installing packages that have an `engines` declaration requiring a
different version of `node`, even if `--engine-strict` is enabled.
* Allow `npm audit fix` to install modules outside your stated dependency
range (including SemVer-major changes).
* Allow unpublishing all versions of a published package.
* Allow conflicting peerDependencies to be installed in the root project.
* Implicitly set `--yes` during `npm init`.
If you don't have a clear idea of what you want to do, it is strongly
recommended that you do not use this option!
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm deprecate](/commands/npm-deprecate)
* [npm publish](/commands/npm-publish)
* [npm registry](/using-npm/registry)
* [npm adduser](/commands/npm-adduser)
* [npm owner](/commands/npm-owner)
* [npm login](/commands/npm-adduser)

View File

@@ -0,0 +1,72 @@
---
title: npm-unstar
section: 1
description: Remove an item from your favorite packages
---
### Synopsis
```bash
npm unstar [<pkg>...]
```
Note: This command is unaware of workspaces.
### Description
"Unstarring" a package is the opposite of [`npm star`](/commands/npm-star),
it removes an item from your list of favorite packages.
### More
There's also these extra commands to help you manage your favorite packages:
#### Star
You can "star" a package using [`npm star`](/commands/npm-star)
#### Listing stars
You can see all your starred packages using [`npm stars`](/commands/npm-stars)
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
#### `unicode`
* Default: false on windows, true on mac/unix systems with a unicode locale,
as defined by the `LC_ALL`, `LC_CTYPE`, or `LANG` environment variables.
* Type: Boolean
When set to true, npm uses unicode characters in the tree output. When
false, it uses ascii characters instead of unicode glyphs.
#### `otp`
* Default: null
* Type: null or String
This is a one-time password from a two-factor authenticator. It's needed
when publishing or changing package permissions with `npm access`.
If not set, and a registry response fails with a challenge for a one-time
password, npm will prompt on the command line for one.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm star](/commands/npm-star)
* [npm stars](/commands/npm-stars)
* [npm view](/commands/npm-view)
* [npm whoami](/commands/npm-whoami)
* [npm adduser](/commands/npm-adduser)

View File

@@ -0,0 +1,302 @@
---
title: npm-update
section: 1
description: Update packages
---
### Synopsis
```bash
npm update [-g] [<pkg>...]
aliases: up, upgrade
```
### Description
This command will update all the packages listed to the latest version
(specified by the `tag` config), respecting semver.
It will also install missing packages.
If the `-g` flag is specified, this command will update globally installed
packages.
If no package name is specified, all packages in the specified location (global
or local) will be updated.
### Example
For the examples below, assume that the current package is `app` and it depends
on dependencies, `dep1` (`dep2`, .. etc.). The published versions of `dep1`
are:
```json
{
"dist-tags": { "latest": "1.2.2" },
"versions": [
"1.2.2",
"1.2.1",
"1.2.0",
"1.1.2",
"1.1.1",
"1.0.0",
"0.4.1",
"0.4.0",
"0.2.0"
]
}
```
#### Caret Dependencies
If `app`'s `package.json` contains:
```json
"dependencies": {
"dep1": "^1.1.1"
}
```
Then `npm update` will install `dep1@1.2.2`, because `1.2.2` is `latest` and
`1.2.2` satisfies `^1.1.1`.
#### Tilde Dependencies
However, if `app`'s `package.json` contains:
```json
"dependencies": {
"dep1": "~1.1.1"
}
```
In this case, running `npm update` will install `dep1@1.1.2`. Even though the
`latest` tag points to `1.2.2`, this version do not satisfy `~1.1.1`, which is
equivalent to `>=1.1.1 <1.2.0`. So the highest-sorting version that satisfies
`~1.1.1` is used, which is `1.1.2`.
#### Caret Dependencies below 1.0.0
Suppose `app` has a caret dependency on a version below `1.0.0`, for example:
```json
"dependencies": {
"dep1": "^0.2.0"
}
```
`npm update` will install `dep1@0.2.0`, because there are no other
versions which satisfy `^0.2.0`.
If the dependence were on `^0.4.0`:
```json
"dependencies": {
"dep1": "^0.4.0"
}
```
Then `npm update` will install `dep1@0.4.1`, because that is the highest-sorting
version that satisfies `^0.4.0` (`>= 0.4.0 <0.5.0`)
#### Updating Globally-Installed Packages
`npm update -g` will apply the `update` action to each globally installed
package that is `outdated` -- that is, has a version that is different from
`wanted`.
Note: Globally installed packages are treated as if they are installed with a
caret semver range specified. So if you require to update to `latest` you may
need to run `npm install -g [<pkg>...]`
NOTE: If a package has been upgraded to a version newer than `latest`, it will
be _downgraded_.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `global`
* Default: false
* Type: Boolean
Operates in "global" mode, so that packages are installed into the `prefix`
folder instead of the current working directory. See
[folders](/configuring-npm/folders) for more on the differences in behavior.
* packages are installed into the `{prefix}/lib/node_modules` folder, instead
of the current working directory.
* bin files are linked to `{prefix}/bin`
* man pages are linked to `{prefix}/share/man`
#### `global-style`
* Default: false
* Type: Boolean
Causes npm to install the package into your local `node_modules` folder with
the same layout it uses with the global `node_modules` folder. Only your
direct dependencies will show in `node_modules` and everything they depend
on will be flattened in their `node_modules` folders. This obviously will
eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling`
will be preferred.
#### `legacy-bundling`
* Default: false
* Type: Boolean
Causes npm to install the package such that versions of npm prior to 1.4,
such as the one included with node 0.8, can install the package. This
eliminates all automatic deduping. If used with `global-style` this option
will be preferred.
#### `strict-peer-deps`
* Default: false
* Type: Boolean
If set to `true`, and `--legacy-peer-deps` is not set, then _any_
conflicting `peerDependencies` will be treated as an install failure, even
if npm could reasonably guess the appropriate resolution based on non-peer
dependency relationships.
By default, conflicting `peerDependencies` deep in the dependency graph will
be resolved using the nearest non-peer dependency specification, even if
doing so will result in some packages receiving a peer dependency outside
the range set in their package's `peerDependencies` object.
When such and override is performed, a warning is printed, explaining the
conflict and the packages involved. If `--strict-peer-deps` is set, then
this warning is treated as a failure.
#### `package-lock`
* Default: true
* Type: Boolean
If set to false, then ignore `package-lock.json` files when installing. This
will also prevent _writing_ `package-lock.json` if `save` is true.
When package package-locks are disabled, automatic pruning of extraneous
modules will also be disabled. To remove extraneous modules with
package-locks disabled use `npm prune`.
#### `omit`
* Default: 'dev' if the `NODE_ENV` environment variable is set to
'production', otherwise empty.
* Type: "dev", "optional", or "peer" (can be set multiple times)
Dependency types to omit from the installation tree on disk.
Note that these dependencies _are_ still resolved and added to the
`package-lock.json` or `npm-shrinkwrap.json` file. They are just not
physically installed on disk.
If a package type appears in both the `--include` and `--omit` lists, then
it will be included.
If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment
variable will be set to `'production'` for all lifecycle scripts.
#### `ignore-scripts`
* Default: false
* Type: Boolean
If true, npm does not run scripts specified in package.json files.
Note that commands explicitly intended to run a particular script, such as
`npm start`, `npm stop`, `npm restart`, `npm test`, and `npm run-script`
will still run their intended script if `ignore-scripts` is set, but they
will *not* run any pre- or post-scripts.
#### `audit`
* Default: true
* Type: Boolean
When "true" submit audit reports alongside `npm install` runs to the default
registry and all registries configured for scopes. See the documentation for
[`npm audit`](/commands/npm-audit) for details on what is submitted.
#### `bin-links`
* Default: true
* Type: Boolean
Tells npm to create symlinks (or `.cmd` shims on Windows) for package
executables.
Set to false to have it not do this. This can be used to work around the
fact that some file systems don't support symlinks, even on ostensibly Unix
systems.
#### `fund`
* Default: true
* Type: Boolean
When "true" displays the message at the end of each `npm install`
acknowledging the number of dependencies looking for funding. See [`npm
fund`](/commands/npm-fund) for details.
#### `dry-run`
* Default: false
* Type: Boolean
Indicates that you don't want npm to make any changes and that it should
only report what it would have done. This can be passed into any of the
commands that modify your local installation, eg, `install`, `update`,
`dedupe`, `uninstall`, as well as `pack` and `publish`.
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm install](/commands/npm-install)
* [npm outdated](/commands/npm-outdated)
* [npm shrinkwrap](/commands/npm-shrinkwrap)
* [npm registry](/using-npm/registry)
* [npm folders](/configuring-npm/folders)
* [npm ls](/commands/npm-ls)

View File

@@ -0,0 +1,194 @@
---
title: npm-version
section: 1
description: Bump a package version
---
### Synopsis
```bash
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
'npm [-v | --version]' to print npm version
'npm view <pkg> version' to view a package's published version
'npm ls' to inspect current package/dependency versions
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `allow-same-version`
* Default: false
* Type: Boolean
Prevents throwing an error when `npm version` is used to set the new version
to the same value as the current version.
#### `commit-hooks`
* Default: true
* Type: Boolean
Run git commit hooks when using the `npm version` command.
#### `git-tag-version`
* Default: true
* Type: Boolean
Tag the commit when using the `npm version` command.
#### `json`
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
#### `preid`
* Default: ""
* Type: String
The "prerelease identifier" to use as a prefix for the "prerelease" part of
a semver. Like the `rc` in `1.2.0-rc.8`.
#### `sign-git-tag`
* Default: false
* Type: Boolean
If set to true, then the `npm version` command will tag the version using
`-s` to add a signature.
Note that git requires you to have set up GPG keys in your git configs for
this to work properly.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### Description
Run this in a package directory to bump the version and write the new data
back to `package.json`, `package-lock.json`, and, if present,
`npm-shrinkwrap.json`.
The `newversion` argument should be a valid semver string, a valid second
argument to [semver.inc](https://github.com/npm/node-semver#functions) (one
of `patch`, `minor`, `major`, `prepatch`, `preminor`, `premajor`,
`prerelease`), or `from-git`. In the second case, the existing version will
be incremented by 1 in the specified field. `from-git` will try to read
the latest git tag, and use that as the new npm version.
If run in a git repo, it will also create a version commit and tag. This
behavior is controlled by `git-tag-version` (see below), and can be
disabled on the command line by running `npm --no-git-tag-version version`.
It will fail if the working directory is not clean, unless the `-f` or
`--force` flag is set.
If supplied with `-m` or `--message` config option, npm will use it as a
commit message when creating a version commit. If the `message` config
contains `%s` then that will be replaced with the resulting version number.
For example:
```bash
npm version patch -m "Upgrade to %s for reasons"
```
If the `sign-git-tag` config is set, then the tag will be signed using the
`-s` flag to git. Note that you must have a default GPG key set up in your
git config for this to work properly. For example:
```bash
$ npm config set sign-git-tag true
$ npm version patch
You need a passphrase to unlock the secret key for
user: "isaacs (http://blog.izs.me/) <i@izs.me>"
2048-bit RSA key, ID 6C481CF6, created 2010-08-31
Enter passphrase:
```
If `preversion`, `version`, or `postversion` are in the `scripts` property
of the package.json, they will be executed as part of running `npm
version`.
The exact order of execution is as follows:
1. Check to make sure the git working directory is clean before we get
started. Your scripts may add files to the commit in future steps.
This step is skipped if the `--force` flag is set.
2. Run the `preversion` script. These scripts have access to the old
`version` in package.json. A typical use would be running your full
test suite before deploying. Any files you want added to the commit
should be explicitly added using `git add`.
3. Bump `version` in `package.json` as requested (`patch`, `minor`,
`major`, etc).
4. Run the `version` script. These scripts have access to the new `version`
in package.json (so they can incorporate it into file headers in
generated files for example). Again, scripts should explicitly add
generated files to the commit using `git add`.
5. Commit and tag.
6. Run the `postversion` script. Use it to clean up the file system or
automatically push the commit and/or tag.
Take the following example:
```json
{
"scripts": {
"preversion": "npm test",
"version": "npm run build && git add -A dist",
"postversion": "git push && git push --tags && rm -rf build/temp"
}
}
```
This runs all your tests and proceeds only if they pass. Then runs your
`build` script, and adds everything in the `dist` directory to the commit.
After the commit, it pushes the new commit and tag up to the server, and
deletes the `build/temp` directory.
### See Also
* [npm init](/commands/npm-init)
* [npm run-script](/commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [package.json](/configuring-npm/package-json)
* [config](/using-npm/config)

View File

@@ -0,0 +1,164 @@
---
title: npm-view
section: 1
description: View registry info
---
### Synopsis
```bash
npm view [<@scope>/]<name>[@<version>] [<field>[.<subfield>]...]
aliases: info, show, v
```
### Description
This command shows data about a package and prints it to stdout.
As an example, to view information about the `connect` package from the registry, you would run:
```bash
npm view connect
```
The default version is `"latest"` if unspecified.
Field names can be specified after the package descriptor.
For example, to show the dependencies of the `ronn` package at version
`0.3.5`, you could do the following:
```bash
npm view ronn@0.3.5 dependencies
```
You can view child fields by separating them with a period.
To view the git repository URL for the latest version of `npm`, you would run the following command:
```bash
npm view npm repository.url
```
This makes it easy to view information about a dependency with a bit of
shell scripting. For example, to view all the data about the version of
`opts` that `ronn` depends on, you could write the following:
```bash
npm view opts@$(npm view ronn dependencies.opts)
```
For fields that are arrays, requesting a non-numeric field will return
all of the values from the objects in the list. For example, to get all
the contributor names for the `express` package, you would run:
```bash
npm view express contributors.email
```
You may also use numeric indices in square braces to specifically select
an item in an array field. To just get the email address of the first
contributor in the list, you can run:
```bash
npm view express contributors[0].email
```
Multiple fields may be specified, and will be printed one after another.
For example, to get all the contributor names and email addresses, you
can do this:
```bash
npm view express contributors.name contributors.email
```
"Person" fields are shown as a string if they would be shown as an
object. So, for example, this will show the list of `npm` contributors in
the shortened string format. (See [`package.json`](/configuring-npm/package-json) for more on this.)
```bash
npm view npm contributors
```
If a version range is provided, then data will be printed for every
matching version of the package. This will show which version of `jsdom`
was required by each matching version of `yui3`:
```bash
npm view yui3@'>0.5.4' dependencies.jsdom
```
To show the `connect` package version history, you can do
this:
```bash
npm view connect versions
```
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `json`
* Default: false
* Type: Boolean
Whether or not to output JSON data, rather than the normal output.
Not supported by all npm commands.
#### `workspace`
* Default:
* Type: String (can be set multiple times)
Enable running a command in the context of the configured workspaces of the
current project while filtering by running only the workspaces defined by
this configuration option.
Valid values for the `workspace` config are either:
* Workspace names
* Path to a workspace directory
* Path to a parent workspace directory (will result to selecting all of the
nested workspaces)
When set for the `npm init` command, this may be set to the folder of a
workspace which does not yet exist, to create the folder and set it up as a
brand new workspace within the project.
This value is not exported to the environment for child processes.
#### `workspaces`
* Default: false
* Type: Boolean
Enable running a command in the context of **all** the configured
workspaces.
This value is not exported to the environment for child processes.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### Output
If only a single string field for a single version is output, then it
will not be colorized or quoted, to enable piping the output to
another command. If the field is an object, it will be output as a JavaScript object literal.
If the `--json` flag is given, the outputted fields will be JSON.
If the version range matches multiple versions then each printed value
will be prefixed with the version it applies to.
If multiple fields are requested, then each of them is prefixed with
the field name.
### See Also
* [npm search](/commands/npm-search)
* [npm registry](/using-npm/registry)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm docs](/commands/npm-docs)

View File

@@ -0,0 +1,43 @@
---
title: npm-whoami
section: 1
description: Display npm username
---
### Synopsis
```bash
npm whoami [--registry <registry>]
```
Note: This command is unaware of workspaces.
### Description
Display the npm username of the currently logged-in user.
If logged into a registry that provides token-based authentication, then
connect to the `/-/whoami` registry endpoint to find the username
associated with the token, and print to standard output.
If logged into a registry that uses Basic Auth, then simply print the
`username` portion of the authentication string.
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
<!-- automatically generated, do not edit manually -->
#### `registry`
* Default: "https://registry.npmjs.org/"
* Type: URL
The base URL of the npm registry.
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm adduser](/commands/npm-adduser)

View File

@@ -0,0 +1,173 @@
---
title: npm
section: 1
description: javascript package manager
---
### Synopsis
```bash
npm <command> [args]
```
### Version
@VERSION@
### Description
npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
conflicts intelligently.
It is extremely configurable to support a variety of use cases. Most
commonly, you use it to publish, discover, install, and develop node
programs.
Run `npm help` to get a list of available commands.
### Important
npm comes preconfigured to use npm's public registry at
https://registry.npmjs.org by default. Use of the npm public registry is
subject to terms of use available at
https://www.npmjs.com/policies/terms.
You can configure npm to use any compatible registry you like, and even
run your own registry. Use of someone else's registry is governed by
their terms of use.
### Introduction
You probably got npm because you want to install stuff.
The very first thing you will most likely want to run in any node
program is `npm install` to install its dependencies.
You can also run `npm install blerg` to install the latest version of
"blerg". Check out [`npm install`](/commands/npm-install) for more
info. It can do a lot of stuff.
Use the `npm search` command to show everything that's available in the
public registry. Use `npm ls` to show everything you've installed.
### Dependencies
If a package lists a dependency using a git URL, npm will install that
dependency using the [`git`](https://github.com/git-guides/install-git)
command and will generate an error if it is not installed.
If one of the packages npm tries to install is a native node module and
requires compiling of C++ Code, npm will use
[node-gyp](https://github.com/nodejs/node-gyp) for that task.
For a Unix system, [node-gyp](https://github.com/nodejs/node-gyp)
needs Python, make and a buildchain like GCC. On Windows,
Python and Microsoft Visual Studio C++ are needed. For more information
visit [the node-gyp repository](https://github.com/nodejs/node-gyp) and
the [node-gyp Wiki](https://github.com/nodejs/node-gyp/wiki).
### Directories
See [`folders`](/configuring-npm/folders) to learn about where npm puts
stuff.
In particular, npm has two modes of operation:
* local mode:
npm installs packages into the current project directory, which
defaults to the current working directory. Packages install to
`./node_modules`, and bins to `./node_modules/.bin`.
* global mode:
npm installs packages into the install prefix at
`$npm_config_prefix/lib/node_modules` and bins to
`$npm_config_prefix/bin`.
Local mode is the default. Use `-g` or `--global` on any command to
run in global mode instead.
### Developer Usage
If you're using npm to develop and publish your code, check out the
following help topics:
* json:
Make a package.json file. See
[`package.json`](/configuring-npm/package-json).
* link:
Links your current working code into Node's path, so that you don't
have to reinstall every time you make a change. Use [`npm
link`](/commands/npm-link) to do this.
* install:
It's a good idea to install things if you don't need the symbolic
link. Especially, installing other peoples code from the registry is
done via [`npm install`](/commands/npm-install)
* adduser:
Create an account or log in. When you do this, npm will store
credentials in the user config file config file.
* publish:
Use the [`npm publish`](/commands/npm-publish) command to upload your
code to the registry.
#### Configuration
npm is extremely configurable. It reads its configuration options from
5 places.
* Command line switches:
Set a config with `--key val`. All keys take a value, even if they
are booleans (the config parser doesn't know what the options are at
the time of parsing). If you do not provide a value (`--key`) then
the option is set to boolean `true`.
* Environment Variables:
Set any config by prefixing the name in an environment variable with
`npm_config_`. For example, `export npm_config_key=val`.
* User Configs:
The file at `$HOME/.npmrc` is an ini-formatted list of configs. If
present, it is parsed. If the `userconfig` option is set in the cli
or env, that file will be used instead.
* Global Configs:
The file found at `./etc/npmrc` (relative to the global prefix will be
parsed if it is found. See [`npm prefix`](/commands/npm-prefix) for
more info on the global prefix. If the `globalconfig` option is set
in the cli, env, or user config, then that file is parsed instead.
* Defaults:
npm's default configuration options are defined in
lib/utils/config-defs.js. These must not be changed.
See [`config`](/using-npm/config) for much much more information.
### Contributions
Patches welcome!
If you would like to help, but don't know what to work on, read the
[contributing
guidelines](https://github.com/npm/cli/blob/latest/CONTRIBUTING.md) and
check the issues list.
### Bugs
When you find issues, please report them:
<https://github.com/npm/cli/issues>
Please be sure to follow the template and bug reporting guidelines.
### Feature Requests
Discuss new feature ideas on our discussion forum:
* <https://github.com/npm/feedback>
Or suggest formal RFC proposals:
* <https://github.com/npm/rfcs>
### See Also
* [npm help](/commands/npm-help)
* [package.json](/configuring-npm/package-json)
* [npmrc](/configuring-npm/npmrc)
* [npm config](/commands/npm-config)
* [npm install](/commands/npm-install)
* [npm prefix](/commands/npm-prefix)
* [npm publish](/commands/npm-publish)

View File

@@ -0,0 +1,177 @@
---
title: npx
section: 1
description: Run a command from a local or remote npm package
---
### Synopsis
```bash
npm exec -- <pkg>[@<version>] [args...]
npm exec --package=<pkg>[@<version>] -- <cmd> [args...]
npm exec -c '<cmd> [args...]'
npm exec --package=foo -c '<cmd> [args...]'
npx <pkg>[@<specifier>] [args...]
npx -p <pkg>[@<specifier>] <cmd> [args...]
npx -c '<cmd> [args...]'
npx -p <pkg>[@<specifier>] -c '<cmd> [args...]'
alias: npm x, npx
--package=<pkg> (may be specified multiple times)
-p is a shorthand for --package only when using npx executable
-c <cmd> --call=<cmd> (may not be mixed with positional arguments)
```
### Description
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`.
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
specified multiple times, to execute the supplied command in an environment
where all specified packages are available.
If any requested packages are not present in the local project
dependencies, then they are installed to a folder in the npm cache, which
is added to the `PATH` environment variable in the executed process. A
prompt is printed (which can be suppressed by providing either `--yes` or
`--no`).
Package names provided without a specifier will be matched with whatever
version exists in the local project. Package names with a specifier will
only be considered a match if they have the exact same name and version as
the local dependency.
If no `-c` or `--call` option is provided, then the positional arguments
are used to generate the command string. If no `--package` options
are provided, then npm will attempt to determine the executable name from
the package specifier provided as the first positional argument according
to the following heuristic:
- If the package has a single entry in its `bin` field in `package.json`,
or if all entries are aliases of the same command, then that command
will be used.
- If the package has multiple `bin` entries, and one of them matches the
unscoped portion of the `name` field, then that command will be used.
- If this does not result in exactly one option (either because there are
no bin entries, or none of them match the `name` of the package), then
`npm exec` exits with an error.
To run a binary _other than_ the named binary, specify one or more
`--package` options, which will prevent npm from inferring the package from
the first command argument.
### `npx` vs `npm exec`
When run via the `npx` binary, all flags and options *must* be set prior to
any positional arguments. When run via `npm exec`, a double-hyphen `--`
flag can be used to suppress npm's parsing of switches and options that
should be sent to the executed command.
For example:
```
$ npx foo@latest bar --package=@npmcli/foo
```
In this case, npm will resolve the `foo` package name, and run the
following command:
```
$ foo bar --package=@npmcli/foo
```
Since the `--package` option comes _after_ the positional arguments, it is
treated as an argument to the executed command.
In contrast, due to npm's argument parsing logic, running this command is
different:
```
$ npm exec foo@latest bar --package=@npmcli/foo
```
In this case, npm will parse the `--package` option first, resolving the
`@npmcli/foo` package. Then, it will execute the following command in that
context:
```
$ foo@latest bar
```
The double-hyphen character is recommended to explicitly tell npm to stop
parsing command line options and switches. The following command would
thus be equivalent to the `npx` command above:
```
$ npm exec -- foo@latest bar --package=@npmcli/foo
```
### Examples
Run the version of `tap` in the local dependencies, with the provided
arguments:
```
$ npm exec -- tap --bail test/foo.js
$ npx tap --bail test/foo.js
```
Run a command _other than_ the command whose name matches the package name
by specifying a `--package` option:
```
$ npm exec --package=foo -- bar --bar-argument
# ~ or ~
$ npx --package=foo bar --bar-argument
```
Run an arbitrary shell script, in the context of the current project:
```
$ npm x -c 'eslint && say "hooray, lint passed"'
$ npx -c 'eslint && say "hooray, lint passed"'
```
### Compatibility with Older npx Versions
The `npx` binary was rewritten in npm v7.0.0, and the standalone `npx`
package deprecated at that time. `npx` uses the `npm exec`
command instead of a separate argument parser and install process, with
some affordances to maintain backwards compatibility with the arguments it
accepted in previous versions.
This resulted in some shifts in its functionality:
- Any `npm` config value may be provided.
- To prevent security and user-experience problems from mistyping package
names, `npx` prompts before installing anything. Suppress this
prompt with the `-y` or `--yes` option.
- The `--no-install` option is deprecated, and will be converted to `--no`.
- Shell fallback functionality is removed, as it is not advisable.
- The `-p` argument is a shorthand for `--parseable` in npm, but shorthand
for `--package` in npx. This is maintained, but only for the `npx`
executable.
- The `--ignore-existing` option is removed. Locally installed bins are
always present in the executed process `PATH`.
- The `--npm` option is removed. `npx` will always use the `npm` it ships
with.
- The `--node-arg` and `-n` options are removed.
- The `--always-spawn` option is redundant, and thus removed.
- The `--shell` option is replaced with `--script-shell`, but maintained
in the `npx` executable for backwards compatibility.
### See Also
* [npm run-script](/commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [npm test](/commands/npm-test)
* [npm start](/commands/npm-start)
* [npm restart](/commands/npm-restart)
* [npm stop](/commands/npm-stop)
* [npm config](/commands/npm-config)

View File

@@ -0,0 +1,219 @@
---
title: folders
section: 5
description: Folder Structures Used by npm
---
### Description
npm puts various things on your computer. That's its job.
This document will tell you what it puts where.
#### tl;dr
* Local install (default): puts stuff in `./node_modules` of the current
package root.
* Global install (with `-g`): puts stuff in /usr/local or wherever node
is installed.
* Install it **locally** if you're going to `require()` it.
* Install it **globally** if you're going to run it on the command line.
* If you need both, then install it in both places, or use `npm link`.
#### prefix Configuration
The `prefix` config defaults to the location where node is installed.
On most systems, this is `/usr/local`. On Windows, it's `%AppData%\npm`.
On Unix systems, it's one level up, since node is typically installed at
`{prefix}/bin/node` rather than `{prefix}/node.exe`.
When the `global` flag is set, npm installs things into this prefix.
When it is not set, it uses the root of the current package, or the
current working directory if not in a package already.
#### Node Modules
Packages are dropped into the `node_modules` folder under the `prefix`.
When installing locally, this means that you can
`require("packagename")` to load its main module, or
`require("packagename/lib/path/to/sub/module")` to load other modules.
Global installs on Unix systems go to `{prefix}/lib/node_modules`.
Global installs on Windows go to `{prefix}/node_modules` (that is, no
`lib` folder.)
Scoped packages are installed the same way, except they are grouped together
in a sub-folder of the relevant `node_modules` folder with the name of that
scope prefix by the @ symbol, e.g. `npm install @myorg/package` would place
the package in `{prefix}/node_modules/@myorg/package`. See [`scope`](/using-npm/scope) for more details.
If you wish to `require()` a package, then install it locally.
#### Executables
When in global mode, executables are linked into `{prefix}/bin` on Unix,
or directly into `{prefix}` on Windows.
When in local mode, executables are linked into
`./node_modules/.bin` so that they can be made available to scripts run
through npm. (For example, so that a test runner will be in the path
when you run `npm test`.)
#### Man Pages
When in global mode, man pages are linked into `{prefix}/share/man`.
When in local mode, man pages are not installed.
Man pages are not installed on Windows systems.
#### Cache
See [`npm cache`](/commands/npm-cache). Cache files are stored in `~/.npm` on Posix, or
`%AppData%/npm-cache` on Windows.
This is controlled by the `cache` configuration param.
#### Temp Files
Temporary files are stored by default in the folder specified by the
`tmp` config, which defaults to the TMPDIR, TMP, or TEMP environment
variables, or `/tmp` on Unix and `c:\windows\temp` on Windows.
Temp files are given a unique folder under this root for each run of the
program, and are deleted upon successful exit.
### More Information
When installing locally, npm first tries to find an appropriate
`prefix` folder. This is so that `npm install foo@1.2.3` will install
to the sensible root of your package, even if you happen to have `cd`ed
into some other folder.
Starting at the $PWD, npm will walk up the folder tree checking for a
folder that contains either a `package.json` file, or a `node_modules`
folder. If such a thing is found, then that is treated as the effective
"current directory" for the purpose of running npm commands. (This
behavior is inspired by and similar to git's .git-folder seeking
logic when running git commands in a working dir.)
If no package root is found, then the current folder is used.
When you run `npm install foo@1.2.3`, then the package is loaded into
the cache, and then unpacked into `./node_modules/foo`. Then, any of
foo's dependencies are similarly unpacked into
`./node_modules/foo/node_modules/...`.
Any bin files are symlinked to `./node_modules/.bin/`, so that they may
be found by npm scripts when necessary.
#### Global Installation
If the `global` configuration is set to true, then npm will
install packages "globally".
For global installation, packages are installed roughly the same way,
but using the folders described above.
#### Cycles, Conflicts, and Folder Parsimony
Cycles are handled using the property of node's module system that it
walks up the directories looking for `node_modules` folders. So, at every
stage, if a package is already installed in an ancestor `node_modules`
folder, then it is not installed at the current location.
Consider the case above, where `foo -> bar -> baz`. Imagine if, in
addition to that, baz depended on bar, so you'd have:
`foo -> bar -> baz -> bar -> baz ...`. However, since the folder
structure is: `foo/node_modules/bar/node_modules/baz`, there's no need to
put another copy of bar into `.../baz/node_modules`, since when it calls
require("bar"), it will get the copy that is installed in
`foo/node_modules/bar`.
This shortcut is only used if the exact same
version would be installed in multiple nested `node_modules` folders. It
is still possible to have `a/node_modules/b/node_modules/a` if the two
"a" packages are different versions. However, without repeating the
exact same package multiple times, an infinite regress will always be
prevented.
Another optimization can be made by installing dependencies at the
highest level possible, below the localized "target" folder.
#### Example
Consider this dependency graph:
```bash
foo
+-- blerg@1.2.5
+-- bar@1.2.3
| +-- blerg@1.x (latest=1.3.7)
| +-- baz@2.x
| | `-- quux@3.x
| | `-- bar@1.2.3 (cycle)
| `-- asdf@*
`-- baz@1.2.3
`-- quux@3.x
`-- bar
```
In this case, we might expect a folder structure like this:
```bash
foo
+-- node_modules
+-- blerg (1.2.5) <---[A]
+-- bar (1.2.3) <---[B]
| `-- node_modules
| +-- baz (2.0.2) <---[C]
| | `-- node_modules
| | `-- quux (3.2.0)
| `-- asdf (2.3.4)
`-- baz (1.2.3) <---[D]
`-- node_modules
`-- quux (3.2.0) <---[E]
```
Since foo depends directly on `bar@1.2.3` and `baz@1.2.3`, those are
installed in foo's `node_modules` folder.
Even though the latest copy of blerg is 1.3.7, foo has a specific
dependency on version 1.2.5. So, that gets installed at [A]. Since the
parent installation of blerg satisfies bar's dependency on `blerg@1.x`,
it does not install another copy under [B].
Bar [B] also has dependencies on baz and asdf, so those are installed in
bar's `node_modules` folder. Because it depends on `baz@2.x`, it cannot
re-use the `baz@1.2.3` installed in the parent `node_modules` folder [D],
and must install its own copy [C].
Underneath bar, the `baz -> quux -> bar` dependency creates a cycle.
However, because bar is already in quux's ancestry [B], it does not
unpack another copy of bar into that folder.
Underneath `foo -> baz` [D], quux's [E] folder tree is empty, because its
dependency on bar is satisfied by the parent folder copy installed at [B].
For a graphical breakdown of what is installed where, use `npm ls`.
#### Publishing
Upon publishing, npm will look in the `node_modules` folder. If any of
the items there are not in the `bundledDependencies` array, then they will
not be included in the package tarball.
This allows a package maintainer to install all of their dependencies
(and dev dependencies) locally, but only re-publish those items that
cannot be found elsewhere. See [`package.json`](/configuring-npm/package-json) for more information.
### See also
* [package.json](/configuring-npm/package-json)
* [npm install](/commands/npm-install)
* [npm pack](/commands/npm-pack)
* [npm cache](/commands/npm-cache)
* [npm config](/commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [config](/using-npm/config)
* [npm publish](/commands/npm-publish)

View File

@@ -0,0 +1,87 @@
---
title: install
section: 5
description: Download and install node and npm
---
### Description
To publish and install packages to and from the public npm registry, you
must install Node.js and the npm command line interface using either a Node
version manager or a Node installer. **We strongly recommend using a Node
version manager to install Node.js and npm.** We do not recommend using a
Node installer, since the Node installation process installs npm in a
directory with local permissions and can cause permissions errors when you
run npm packages globally.
### Overview
- [Checking your version of npm and
Node.js](#checking-your-version-of-npm-and-node-js)
- [Using a Node version manager to install Node.js and
npm](#using-a-node-version-manager-to-install-node-js-and-npm)
- [Using a Node installer to install Node.js and
npm](#using-a-node-installer-to-install-node-js-and-npm)
### Checking your version of npm and Node.js
To see if you already have Node.js and npm installed and check the
installed version, run the following commands:
```
node -v
npm -v
```
### Using a Node version manager to install Node.js and npm
Node version managers allow you to install and switch between multiple
versions of Node.js and npm on your system so you can test your
applications on multiple versions of npm to ensure they work for users on
different versions.
#### OSX or Linux Node version managers
* [nvm](https://github.com/creationix/nvm)
* [n](https://github.com/tj/n)
#### Windows Node version managers
* [nodist](https://github.com/marcelklehr/nodist)
* [nvm-windows](https://github.com/coreybutler/nvm-windows)
### Using a Node installer to install Node.js and npm
If you are unable to use a Node version manager, you can use a Node
installer to install both Node.js and npm on your system.
* [Node.js installer](https://nodejs.org/en/download/)
* [NodeSource installer](https://github.com/nodesource/distributions). If
you use Linux, we recommend that you use a NodeSource installer.
#### OS X or Windows Node installers
If you're using OS X or Windows, use one of the installers from the
[Node.js download page](https://nodejs.org/en/download/). Be sure to
install the version labeled **LTS**. Other versions have not yet been
tested with npm.
#### Linux or other operating systems Node installers
If you're using Linux or another operating system, use one of the following
installers:
- [NodeSource installer](https://github.com/nodesource/distributions)
(recommended)
- One of the installers on the [Node.js download
page](https://nodejs.org/en/download/)
Or see [this page](https://nodejs.org/en/download/package-manager/) to
install npm for Linux in the way many Linux developers prefer.
#### Less-common operating systems
For more information on installing Node.js on a variety of operating
systems, see [this page][pkg-mgr].
[pkg-mgr]: https://nodejs.org/en/download/package-manager/

View File

@@ -0,0 +1,34 @@
---
title: npm-shrinkwrap.json
section: 5
description: A publishable lockfile
---
### Description
`npm-shrinkwrap.json` is a file created by [`npm
shrinkwrap`](/commands/npm-shrinkwrap). It is identical to
`package-lock.json`, with one major caveat: Unlike `package-lock.json`,
`npm-shrinkwrap.json` may be included when publishing a package.
The recommended use-case for `npm-shrinkwrap.json` is applications deployed
through the publishing process on the registry: for example, daemons and
command-line tools intended as global installs or `devDependencies`. It's
strongly discouraged for library authors to publish this file, since that
would prevent end users from having control over transitive dependency
updates.
If both `package-lock.json` and `npm-shrinkwrap.json` are present in a
package root, `npm-shrinkwrap.json` will be preferred over the
`package-lock.json` file.
For full details and description of the `npm-shrinkwrap.json` file format,
refer to the manual page for
[package-lock.json](/configuring-npm/package-lock-json).
### See also
* [npm shrinkwrap](/commands/npm-shrinkwrap)
* [package-lock.json](/configuring-npm/package-lock-json)
* [package.json](/configuring-npm/package-json)
* [npm install](/commands/npm-install)

View File

@@ -0,0 +1,100 @@
---
title: npmrc
section: 5
description: The npm config files
---
### Description
npm gets its config settings from the command line, environment variables,
and `npmrc` files.
The `npm config` command can be used to update and edit the contents of the
user and global npmrc files.
For a list of available configuration options, see
[config](/using-npm/config).
### Files
The four relevant files are:
* per-project config file (/path/to/my/project/.npmrc)
* per-user config file (~/.npmrc)
* global config file ($PREFIX/etc/npmrc)
* npm builtin config file (/path/to/npm/npmrc)
All npm config files are an ini-formatted list of `key = value` parameters.
Environment variables can be replaced using `${VARIABLE_NAME}`. For
example:
```bash
prefix = ${HOME}/.npm-packages
```
Each of these files is loaded, and config options are resolved in priority
order. For example, a setting in the userconfig file would override the
setting in the globalconfig file.
Array values are specified by adding "[]" after the key name. For example:
```bash
key[] = "first value"
key[] = "second value"
```
#### Comments
Lines in `.npmrc` files are interpreted as comments when they begin with a
`;` or `#` character. `.npmrc` files are parsed by
[npm/ini](https://github.com/npm/ini), which specifies this comment syntax.
For example:
```bash
# last modified: 01 Jan 2016
; Set a new registry for a scoped package
@myscope:registry=https://mycustomregistry.example.org
```
#### Per-project config file
When working locally in a project, a `.npmrc` file in the root of the
project (ie, a sibling of `node_modules` and `package.json`) will set
config values specific to this project.
Note that this only applies to the root of the project that you're running
npm in. It has no effect when your module is published. For example, you
can't publish a module that forces itself to install globally, or in a
different location.
Additionally, this file is not read in global mode, such as when running
`npm install -g`.
#### Per-user config file
`$HOME/.npmrc` (or the `userconfig` param, if set in the environment or on
the command line)
#### Global config file
`$PREFIX/etc/npmrc` (or the `globalconfig` param, if set above): This file
is an ini-file formatted list of `key = value` parameters. Environment
variables can be replaced as above.
#### Built-in config file
`path/to/npm/itself/npmrc`
This is an unchangeable "builtin" configuration file that npm keeps
consistent across updates. Set fields in here using the `./configure`
script that comes with npm. This is primarily for distribution maintainers
to override default configs in a standard and consistent manner.
### See also
* [npm folders](/configuring-npm/folders)
* [npm config](/commands/npm-config)
* [config](/using-npm/config)
* [package.json](/configuring-npm/package-json)
* [npm](/commands/npm)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,236 @@
---
title: package-lock.json
section: 5
description: A manifestation of the manifest
---
### Description
`package-lock.json` is automatically generated for any operations where npm
modifies either the `node_modules` tree, or `package.json`. It describes the
exact tree that was generated, such that subsequent installs are able to
generate identical trees, regardless of intermediate dependency updates.
This file is intended to be committed into source repositories, and serves
various purposes:
* Describe a single representation of a dependency tree such that
teammates, deployments, and continuous integration are guaranteed to
install exactly the same dependencies.
* Provide a facility for users to "time-travel" to previous states of
`node_modules` without having to commit the directory itself.
* Facilitate greater visibility of tree changes through readable source
control diffs.
* Optimize the installation process by allowing npm to skip repeated
metadata resolutions for previously-installed packages.
* As of npm v7, lockfiles include enough information to gain a complete
picture of the package tree, reducing the need to read `package.json`
files, and allowing for significant performance improvements.
### `package-lock.json` vs `npm-shrinkwrap.json`
Both of these files have the same format, and perform similar functions in
the root of a project.
The difference is that `package-lock.json` cannot be published, and it will
be ignored if found in any place other than the root project.
In contrast, [npm-shrinkwrap.json](/configuring-npm/npm-shrinkwrap-json) allows
publication, and defines the dependency tree from the point encountered.
This is not recommended unless deploying a CLI tool or otherwise using the
publication process for producing production packages.
If both `package-lock.json` and `npm-shrinkwrap.json` are present in the
root of a project, `npm-shrinkwrap.json` will take precedence and
`package-lock.json` will be ignored.
### Hidden Lockfiles
In order to avoid processing the `node_modules` folder repeatedly, npm as
of v7 uses a "hidden" lockfile present in
`node_modules/.package-lock.json`. This contains information about the
tree, and is used in lieu of reading the entire `node_modules` hierarchy
provided that the following conditions are met:
- All package folders it references exist in the `node_modules` hierarchy.
- No package folders exist in the `node_modules` hierarchy that are not
listed in the lockfile.
- The modified time of the file is at least as recent as all of the package
folders it references.
That is, the hidden lockfile will only be relevant if it was created as
part of the most recent update to the package tree. If another CLI mutates
the tree in any way, this will be detected, and the hidden lockfile will be
ignored.
Note that it _is_ possible to manually change the _contents_ of a package
in such a way that the modified time of the package folder is unaffected.
For example, if you add a file to `node_modules/foo/lib/bar.js`, then the
modified time on `node_modules/foo` will not reflect this change. If you
are manually editing files in `node_modules`, it is generally best to
delete the file at `node_modules/.package-lock.json`.
As the hidden lockfile is ignored by older npm versions, it does not
contain the backwards compatibility affordances present in "normal"
lockfiles. That is, it is `lockfileVersion: 3`, rather than
`lockfileVersion: 2`.
### Handling Old Lockfiles
When npm detects a lockfile from npm v6 or before during the package
installation process, it is automatically updated to fetch missing
information from either the `node_modules` tree or (in the case of empty
`node_modules` trees or very old lockfile formats) the npm registry.
### File Format
#### `name`
The name of the package this is a package-lock for. This will match what's
in `package.json`.
#### `version`
The version of the package this is a package-lock for. This will match
what's in `package.json`.
#### `lockfileVersion`
An integer version, starting at `1` with the version number of this
document whose semantics were used when generating this
`package-lock.json`.
Note that the file format changed significantly in npm v7 to track
information that would have otherwise required looking in `node_modules` or
the npm registry. Lockfiles generated by npm v7 will contain
`lockfileVersion: 2`.
* No version provided: an "ancient" shrinkwrap file from a version of npm
prior to npm v5.
* `1`: The lockfile version used by npm v5 and v6.
* `2`: The lockfile version used by npm v7, which is backwards compatible
to v1 lockfiles.
* `3`: The lockfile version used by npm v7, _without_ backwards
compatibility affordances. This is used for the hidden lockfile at
`node_modules/.package-lock.json`, and will likely be used in a future
version of npm, once support for npm v6 is no longer relevant.
npm will always attempt to get whatever data it can out of a lockfile, even
if it is not a version that it was designed to support.
#### `packages`
This is an object that maps package locations to an object containing the
information about that package.
The root project is typically listed with a key of `""`, and all other
packages are listed with their relative paths from the root project folder.
Package descriptors have the following fields:
* version: The version found in `package.json`
* resolved: The place where the package was actually resolved from. In
the case of packages fetched from the registry, this will be a url to a
tarball. In the case of git dependencies, this will be the full git url
with commit sha. In the case of link dependencies, this will be the
location of the link target.
* integrity: A `sha512` or `sha1` [Standard Subresource
Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/)
string for the artifact that was unpacked in this location.
* link: A flag to indicate that this is a symbolic link. If this is
present, no other fields are specified, since the link target will also
be included in the lockfile.
* dev, optional, devOptional: If the package is strictly part of the
`devDependencies` tree, then `dev` will be true. If it is strictly part
of the `optionalDependencies` tree, then `optional` will be set. If it
is both a `dev` dependency _and_ an `optional` dependency of a non-dev
dependency, then `devOptional` will be set. (An `optional` dependency of
a `dev` dependency will have both `dev` and `optional` set.)
* inBundle: A flag to indicate that the package is a bundled dependency.
* hasInstallScript: A flag to indicate that the package has a `preinstall`,
`install`, or `postinstall` script.
* hasShrinkwrap: A flag to indicate that the package has an
`npm-shrinkwrap.json` file.
* bin, license, engines, dependencies, optionalDependencies: fields from
`package.json`
#### dependencies
Legacy data for supporting versions of npm that use `lockfileVersion: 1`.
This is a mapping of package names to dependency objects. Because the
object structure is strictly hierarchical, symbolic link dependencies are
somewhat challenging to represent in some cases.
npm v7 ignores this section entirely if a `packages` section is present,
but does keep it up to date in order to support switching between npm v6
and npm v7.
Dependency objects have the following fields:
* version: a specifier that varies depending on the nature of the package,
and is usable in fetching a new copy of it.
* bundled dependencies: Regardless of source, this is a version number
that is purely for informational purposes.
* registry sources: This is a version number. (eg, `1.2.3`)
* git sources: This is a git specifier with resolved committish. (eg,
`git+https://example.com/foo/bar#115311855adb0789a0466714ed48a1499ffea97e`)
* http tarball sources: This is the URL of the tarball. (eg,
`https://example.com/example-1.3.0.tgz`)
* local tarball sources: This is the file URL of the tarball. (eg
`file:///opt/storage/example-1.3.0.tgz`)
* local link sources: This is the file URL of the link. (eg
`file:libs/our-module`)
* integrity: A `sha512` or `sha1` [Standard Subresource
Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/)
string for the artifact that was unpacked in this location. For git
dependencies, this is the commit sha.
* resolved: For registry sources this is path of the tarball relative to
the registry URL. If the tarball URL isn't on the same server as the
registry URL then this is a complete URL.
* bundled: If true, this is the bundled dependency and will be installed
by the parent module. When installing, this module will be extracted
from the parent module during the extract phase, not installed as a
separate dependency.
* dev: If true then this dependency is either a development dependency ONLY
of the top level module or a transitive dependency of one. This is false
for dependencies that are both a development dependency of the top level
and a transitive dependency of a non-development dependency of the top
level.
* optional: If true then this dependency is either an optional dependency
ONLY of the top level module or a transitive dependency of one. This is
false for dependencies that are both an optional dependency of the top
level and a transitive dependency of a non-optional dependency of the top
level.
* requires: This is a mapping of module name to version. This is a list of
everything this module requires, regardless of where it will be
installed. The version should match via normal matching rules a
dependency either in our `dependencies` or in a level higher than us.
* dependencies: The dependencies of this dependency, exactly as at the top
level.
### See also
* [npm shrinkwrap](/commands/npm-shrinkwrap)
* [npm-shrinkwrap.json](/configuring-npm/npm-shrinkwrap-json)
* [package.json](/configuring-npm/package-json)
* [npm install](/commands/npm-install)

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More