deps: update npm to 6.13.4

PR-URL: https://github.com/nodejs/node/pull/30904
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
This commit is contained in:
Audrey Eschright authored and Myles Borins committed 2019-12-13 12:03:30 -05:00
1 parent eac614332b
commit 369a23a670
2542 files changed
+147726 -71148

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
{
"licenses": {
"spdx": [
"CC-BY-3.0"
],
"blueOak": "bronze"
},
"corrections": true,
"packages": {
"config-chain": "1.1.12",
"cyclist": "0.2.2",
"json-schema": "0.2.3",
"qrcode-terminal": "0.12.0"
}
}
+10 -7
View File
@@ -2,13 +2,14 @@ Alex K. Wolfe <alexkwolfe@gmail.com>
Andrew Bradley <cspotcode@gmail.com>
Andrew Lunny <alunny@gmail.com>
Arlo Breault <arlolra@gmail.com>
Ashley Williams <ashley@npmjs.com> <ashley@bocoup.com>
Ashley Williams <ashley@npmjs.com> <ashley666ashley@gmail.com>
Ashley Williams <ashley@npmjs.com> <ashley@bocoup.com>
Benjamin Coe <bencoe@gmail.com>
Benjamin Coe <bencoe@gmail.com> <ben@npmjs.com>
Brian White <mscdex@mscdex.net> <mscdex@gmail.com>
Cedric Nelson <cedric.nelson@gmail.com>
Charlie Robbins <charlie.robbins@gmail.com>
Claudia Hernández <cghr1990@gmail.com>
Dalmais Maxence <root@ip-10-195-202-5.ec2.internal>
Danila Gerasimov <danila.gerasimov@gmail.com>
Dave Galbraith <dave@jut.io>
@@ -22,21 +23,23 @@ Evan Lucas <evan@btc.com> <evan.lucas@hattiesburgclinic.com>
Evan Lucas <evan@btc.com> <evanlucas@me.com>
Faiq Raza <faiqrazarizvi@gmail.com>
Forbes Lindesay <forbes@lindesay.co.uk>
Forrest L Norvell <ogd@aoaioxxysz.net> <forrest@npmjs.com> <othiym23@gmail.com>
Forrest L Norvell <ogd@aoaioxxysz.net> <forrest@npmjs.com>
Forrest L Norvell <ogd@aoaioxxysz.net> <othiym23@gmail.com>
Gabriel Barros <descartavel1@gmail.com>
Geoff Flarity <geoff.flarity@gmail.com> <gflarity@raptvm-x02.(none)>
Gregers Gram Rygg <gregers.gram.rygg@finn.no>
Ifeanyi Oraelosi <ifeanyioraelosi@gmail.com>
Isaac Z. Schlueter <i@izs.me> <i@foohack.com>
Isaac Z. Schlueter <i@izs.me> isaacs <i@izs.me>
isaacs <i@izs.me> <i@foohack.com>
isaacs <i@izs.me> <nope@not.real>
isaacs <i@izs.me> <isaacs@npmjs.com>
Jake Verbaten <raynos2@gmail.com>
James Sanders <jimmyjazz14@gmail.com>
James Treworgy <jamietre@gmail.com>
Jason Smith <jhs@iriscouch.com>
Jed Fox <git@twopointzero.us>
Jonas Weber <github@jonasw.de>
Joshua Bennett <legodudejb@gmail.com>
Joshua Bennett <legodudejb@gmail.com> <legodude17@users.noreply.github.com>
Jonas Weber <github@jonasw.de>
Julien Meddah <julien.meddah@deveryware.com>
Kat Marchán <kzm@zkat.tech> <kzm@sykosomatic.org>
Kevin Lorenz <mail@kevinlorenz.com>
@@ -50,12 +53,12 @@ Max Goodman <c@chromakode.com>
Maxim Bogushevich <boga1@mail.ru>
Maximilian Antoni <mail@maxantoni.de> <maximilian.antoni@juliusbaer.com>
Michael Hayes <michael@hayes.io> <mhayes@newrelic.com>
Nicolas Morel <marsup@gmail.com>
Misha Kaletsky <misha.kaletsky@gmail.com>
Nicolas Morel <marsup@gmail.com>
Olivier Melcher <olivier.melcher@gmail.com>
Ra'Shaun Stovall <rashaunstovall@gmail.com>
Rebecca Turner <me@re-becca.org> <turner@mikomi.org>
Rebecca Turner <me@re-becca.org> <rebecca@npmjs.com>
Rebecca Turner <me@re-becca.org> <turner@mikomi.org>
Ryan Emery <seebees@gmail.com>
Sam Mikes <smikes@cubane.com>
Sreenivas Alapati <sreenivas9alapati@gmail.com>
+3 -1
View File
@@ -1,11 +1,13 @@
*.swp
.*.swp
netlify.toml
npm-debug.log
/.github
/test
node_modules/marked
node_modules/ronn
node_modules/marked-man
node_modules/tap
tap-snapshots
node_modules/.bin
node_modules/npm-registry-mock
/npmrc
+34 -17
View File
@@ -1,35 +1,52 @@
sudo: false
# need to declare the language as well as the matrix below
language: node_js
os:
- linux
node_js:
- 12
- 10
- 8
env: "DEPLOY_VERSION=testing"
# having top-level `env:` adds a phantom build
# https://github.com/travis-ci/travis-ci/issues/4681
#env: DEPLOY_VERSION=testing
matrix:
include:
# LTS is our most important target
- node_js: "8"
# Run the sudotest, but only on Linux
- node_js: "12"
# DEPLOY_VERSION is used to set the couchapp setup mode for test/tap/registry.js
# only gather coverage info for LTS
env: DEPLOY_VERSION=testing COVERALLS_REPO_TOKEN="$COVERALLS_OPTIONAL_TOKEN"
script:
- "node . run tap-cover -- \"test/tap/*.js\""
- "unset COVERALLS_REPO_TOKEN ; node . run tap -- \"test/broken-under-*/*.js\""
# previous LTS is next most important
- node_js: "6"
env: DEPLOY_VERSION=testing
# run the sudo tests, with coverage enabled
- "sudo PATH=$PATH $(which node) . run tap -- \"test/tap/*.js\" --coverage --timeout 600"
# also run standard and license checking
- node_js: "10"
env: DEPLOY_VERSION=testing
- node_js: "9"
env: DEPLOY_VERSION=testing
script:
- "standard"
- "node . run tap -- \"test/tap/*.js\" \"test/broken-under-nyc/*.js\""
- "npx standard"
- "node . run licenses"
# separate out node 6 so we can turn off caching, because that
# always breaks for some reason.
- node_js: "6"
cache: false
env: "DEPLOY_VERSION=testing"
# only run one test on Windows, because it's hella slow
- node_js: "12"
os: "windows"
env: "DEPLOY_VERSION=testing"
notifications:
slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8
cache:
directories:
- node_modules/.cache
install:
- "node . install"
script:
- "node . run tap -- \"test/tap/*.js\" \"test/broken-under-nyc/*.js\""
- "node . run tap -- \"test/tap/*.js\" -t600 -Rclassic -c"
+77 -1
View File
@@ -1,5 +1,5 @@
# Authors sorted by whether or not they're me
Isaac Z. Schlueter <i@izs.me>
isaacs <i@izs.me>
Steve Steiner <ssteinerX@gmail.com>
Mikeal Rogers <mikeal.rogers@gmail.com>
Aaron Blohowiak <aaron.blohowiak@gmail.com>
@@ -601,3 +601,79 @@ 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>
+1486 -2
View File
File diff suppressed because it is too large. Load diff
+36 -87
View File
@@ -4,51 +4,25 @@ SHELL = bash
PUBLISHTAG = $(shell node scripts/publish-tag.js)
BRANCH = $(shell git rev-parse --abbrev-ref HEAD)
markdowns = $(shell find doc -name '*.md' | grep -v 'index') README.md
markdowns = $(shell find docs -name '*.md' | grep -v 'index') README.md
html_docdeps = html/dochead.html \
html/docfoot.html \
scripts/doc-build.sh \
package.json
cli_mandocs = $(shell find doc/cli -name '*.md' \
cli_mandocs = $(shell find docs/content/cli-commands -name '*.md' \
|sed 's|.md|.1|g' \
|sed 's|doc/cli/|man/man1/|g' ) \
|sed 's|docs/content/cli-commands/|man/man1/|g' ) \
man/man1/npm-README.1 \
man/man1/npx.1
files_mandocs = $(shell find doc/files -name '*.md' \
files_mandocs = $(shell find docs/content/configuring-npm -name '*.md' \
|sed 's|.md|.5|g' \
|sed 's|doc/files/|man/man5/|g' ) \
man/man5/npm-json.5 \
man/man5/npm-global.5
|sed 's|docs/content/configuring-npm/|man/man5/|g' ) \
misc_mandocs = $(shell find doc/misc -name '*.md' \
misc_mandocs = $(shell find docs/content/using-npm -name '*.md' \
|sed 's|.md|.7|g' \
|sed 's|doc/misc/|man/man7/|g' ) \
man/man7/npm-index.7
cli_htmldocs = $(shell find doc/cli -name '*.md' \
|sed 's|.md|.html|g' \
|sed 's|doc/cli/|html/doc/cli/|g' ) \
html/doc/README.html
files_htmldocs = $(shell find doc/files -name '*.md' \
|sed 's|.md|.html|g' \
|sed 's|doc/files/|html/doc/files/|g' ) \
html/doc/files/npm-json.html \
html/doc/files/npm-global.html
misc_htmldocs = $(shell find doc/misc -name '*.md' \
|sed 's|.md|.html|g' \
|sed 's|doc/misc/|html/doc/misc/|g' ) \
html/doc/index.html
|sed 's|docs/content/using-npm/|man/man7/|g' ) \
mandocs = $(cli_mandocs) $(files_mandocs) $(misc_mandocs)
htmldocs = $(cli_htmldocs) $(files_htmldocs) $(misc_htmldocs)
all: doc
all: docs
latest:
@echo "Installing latest published npm"
@@ -65,14 +39,21 @@ dev: install
link: uninstall
node bin/npm-cli.js link -f
clean: markedclean marked-manclean doc-clean
clean: markedclean marked-manclean docs-clean
rm -rf npmrc
node bin/npm-cli.js cache clean --force
uninstall:
node bin/npm-cli.js rm npm -g -f
doc: $(mandocs) $(htmldocs)
mandocs: $(mandocs)
htmldocs:
cd docs && node ../bin/npm-cli.js install && \
node ../bin/npm-cli.js run build:static echo>&2 && \
rm -rf node_modules .cache public/*js public/*json public/404* public/page-data public/manifest*
docs: mandocs htmldocs
markedclean:
rm -rf node_modules/marked node_modules/.bin/marked .building_marked
@@ -80,26 +61,28 @@ markedclean:
marked-manclean:
rm -rf node_modules/marked-man node_modules/.bin/marked-man .building_marked-man
docclean: doc-clean
doc-clean:
docsclean: docs-clean
docs-clean:
rm -rf \
.building_marked \
.building_marked-man \
html/doc \
man
man \
docs/node_modules \
docs/public \
docs/.cache
## build-time tools for the documentation
build-doc-tools := node_modules/.bin/marked \
node_modules/.bin/marked-man
# use `npm install marked-man` for this to work.
man/man1/npm-README.1: README.md scripts/doc-build.sh package.json $(build-doc-tools)
man/man1/npm-README.1: README.md scripts/docs-build.js package.json $(build-doc-tools)
@[ -d man/man1 ] || mkdir -p man/man1
scripts/doc-build.sh $< $@
node scripts/docs-build.js $< $@
man/man1/%.1: doc/cli/%.md scripts/doc-build.sh package.json $(build-doc-tools)
man/man1/%.1: docs/content/cli-commands/%.md scripts/docs-build.js package.json $(build-doc-tools)
@[ -d man/man1 ] || mkdir -p man/man1
scripts/doc-build.sh $< $@
node scripts/docs-build.js $< $@
man/man1/npx.1: node_modules/libnpx/libnpx.1
cat $< | sed s/libnpx/npx/ > $@
@@ -107,46 +90,16 @@ man/man1/npx.1: node_modules/libnpx/libnpx.1
man/man5/npm-json.5: man/man5/package.json.5
cp $< $@
man/man5/npm-global.5: man/man5/npm-folders.5
man/man5/npm-global.5: man/man5/folders.5
cp $< $@
man/man5/%.5: doc/files/%.md scripts/doc-build.sh package.json $(build-doc-tools)
man/man5/%.5: docs/content/configuring-npm/%.md scripts/docs-build.js package.json $(build-doc-tools)
@[ -d man/man5 ] || mkdir -p man/man5
scripts/doc-build.sh $< $@
node scripts/docs-build.js $< $@
doc/misc/npm-index.md: scripts/index-build.js package.json $(build-doc-tools)
node scripts/index-build.js > $@
html/doc/index.html: doc/misc/npm-index.md $(html_docdeps) $(build-doc-tools)
@[ -d html/doc ] || mkdir -p html/doc
scripts/doc-build.sh $< $@
man/man7/%.7: doc/misc/%.md scripts/doc-build.sh package.json $(build-doc-tools)
man/man7/%.7: docs/content/using-npm/%.md scripts/docs-build.js package.json $(build-doc-tools)
@[ -d man/man7 ] || mkdir -p man/man7
scripts/doc-build.sh $< $@
html/doc/README.html: README.md $(html_docdeps) $(build-doc-tools)
@[ -d html/doc ] || mkdir -p html/doc
scripts/doc-build.sh $< $@
html/doc/cli/%.html: doc/cli/%.md $(html_docdeps) $(build-doc-tools)
@[ -d html/doc/cli ] || mkdir -p html/doc/cli
scripts/doc-build.sh $< $@
html/doc/files/npm-json.html: html/doc/files/package.json.html
cp $< $@
html/doc/files/npm-global.html: html/doc/files/npm-folders.html
cp $< $@
html/doc/files/%.html: doc/files/%.md $(html_docdeps) $(build-doc-tools)
@[ -d html/doc/files ] || mkdir -p html/doc/files
scripts/doc-build.sh $< $@
html/doc/misc/%.html: doc/misc/%.md $(html_docdeps) $(build-doc-tools)
@[ -d html/doc/misc ] || mkdir -p html/doc/misc
scripts/doc-build.sh $< $@
node scripts/docs-build.js $< $@
marked: node_modules/.bin/marked
@@ -158,11 +111,7 @@ marked-man: node_modules/.bin/marked-man
node_modules/.bin/marked-man:
node bin/npm-cli.js install marked-man --no-global --no-timing --no-save
doc: man
man: $(cli_docs)
test: doc
test: docs
node bin/npm-cli.js test
tag:
@@ -174,17 +123,17 @@ ls-ok:
gitclean:
git clean -fd
publish: gitclean ls-ok link doc-clean doc
publish: gitclean ls-ok link docs-clean docs
@git push origin :v$(shell node bin/npm-cli.js --no-timing -v) 2>&1 || true
git push origin $(BRANCH) &&\
git push origin --tags &&\
node bin/npm-cli.js publish --tag=$(PUBLISHTAG)
release: gitclean ls-ok markedclean marked-manclean doc-clean doc
release: gitclean ls-ok markedclean marked-manclean docs-clean docs
node bin/npm-cli.js prune --production --no-save
@bash scripts/release.sh
sandwich:
@[ $$(whoami) = "root" ] && (echo "ok"; echo "ham" > sandwich) || (echo "make it yourself" && exit 13)
.PHONY: all latest install dev link doc clean uninstall test man doc-clean docclean release ls-ok realclean
.PHONY: all latest install dev link docs clean uninstall test man docs-clean docclean release ls-ok realclean
-1
View File
@@ -163,4 +163,3 @@ doubt tell you to put the output in a gist or email.
* npm(1)
* npm-help(1)
* npm-index(7)
+3
View File
@@ -8,6 +8,9 @@ case `uname` in
esac
NODE_EXE="$basedir/node.exe"
if ! [ -x "$NODE_EXE" ]; then
NODE_EXE="$basedir/node"
fi
if ! [ -x "$NODE_EXE" ]; then
NODE_EXE=node
fi
+2 -2
View File
@@ -25,7 +25,6 @@
unsupported.checkForUnsupportedNode()
var path = require('path')
var npm = require('../lib/npm.js')
var npmconf = require('../lib/config/core.js')
var errorHandler = require('../lib/utils/error-handler.js')
@@ -37,7 +36,7 @@
// if npm is called as "npmg" or "npm_g", then
// run in global mode.
if (path.basename(process.argv[1]).slice(-1) === 'g') {
if (process.argv[1][process.argv[1].length - 1] === 'g') {
process.argv.splice(1, 1, 'npm', '-g')
}
@@ -63,6 +62,7 @@
log.info('using', 'node@%s', process.version)
process.on('uncaughtException', errorHandler)
process.on('unhandledRejection', errorHandler)
if (conf.usage && npm.command !== 'help') {
npm.argv.unshift(npm.command)
+5 -5
View File
@@ -1,7 +1,7 @@
### v2.15.12 (2017-03-24):
This version brings the latest `node-gyp` to a soon to be released Node.js
4.x. The `node-gyp` update is paticularly important to Windows folks due to
4.x. The `node-gyp` update is particularly important to Windows folks due to
its addition of Visual Studio 2017 support.
* [`cdd60e733`](https://github.com/npm/npm/commit/cdd60e733905a9994e1d6d832996bfdd12abeaee)
@@ -372,7 +372,7 @@ Node.js 0.10 and 0.12, it's unlikely that patches that rely on ES 2015
functionality will land anytime soon.
Looking forward, the team's current plan is to drop support for Node.js 0.10
when its LTS maintenace window expires in October, 2016, and 0.12 when its
when its LTS maintenance window expires in October, 2016, and 0.12 when its
maintenance / LTS window ends at the end of 2016. We will also drop support for
Node.js 5.x when Node.js 6 becomes LTS and Node.js 7 is released, also in the
October-December 2016 timeframe.
@@ -1507,7 +1507,7 @@ change makes it do.
We _think_ this is what everyone wants, but if this causes problems for you, we
want to know! If it proves problematic for people we will consider reverting it
(preferrably before this becomes `npm@latest`).
(preferably before this becomes `npm@latest`).
Previously, when you ran `npm install foo` we would act as if you typed `npm
install foo@*`. Now, like any range-type specifier, in addition to matching the
@@ -2742,7 +2742,7 @@ NodeConf Adventure!
([@iarna](https://github.com/iarna))
* [`e02e85d`](https://github.com/npm/npm/commit/e02e85d)
`osenv@0.1.2`: Switches to using the `os-tmpdir` module instead of
`os.tmpdir()` for greate consistency in behavior between node versions.
`os.tmpdir()` for greater consistency in behavior between node versions.
([@iarna](https://github.com/iarna))
* [`a6f0265`](https://github.com/npm/npm/commit/a6f0265)
`ini@1.3.4` ([@isaacs](https://github.com/isaacs))
@@ -4588,7 +4588,7 @@ Other changes:
([@gfxmonk](https://github.com/gfxmonk))
* [`989624e`](https://github.com/npm/npm/commit/989624e8321f87734c1b1272fc2f646e7af1f81c)
[#6767](https://github.com/npm/npm/issues/6767) Actually pass parameters when
adding git repo to cach under Windows.
adding git repo to cache under Windows.
([@othiym23](https://github.com/othiym23))
* [`657af73`](https://github.com/npm/npm/commit/657af7308f7d6cd2f81389fcf0d762252acaf1ce)
[#6774](https://github.com/npm/npm/issues/6774) When verifying paths on
+7 -7
View File
@@ -47,7 +47,7 @@ This is gonna be a much, MUCH smaller major version than 3.x was. Maybe even
smaller than 2.x was. I can't tell you everything that'll be in there just
yet, but at the very least it's going to have what's in our
[4.x milestone](https://github.com/npm/npm/pulls?q=is%3Aopen+is%3Apr+milestone%3A4.x),
PLUS, the first steps in
PLUS, the first steps in
[making `prepublish` work](https://github.com/npm/npm/issues/10074) the way
people expect it to.
@@ -2143,7 +2143,7 @@ This release includes an updated `node-gyp` with fixes for Android.
([@watilde](https://github.com/watilde))
* [`47928cd`](https://github.com/npm/npm/commit/47928cd6264e1d6d0ef67435b71c66d01bea664a)
[#11003](https://github.com/npm/npm/issues/11003)
Remove "verison" typo from the help listing.
Remove "version" typo from the help listing.
([@doug-wade](https://github.com/doug-wade))
#### MORE COMPLETE CONFIG LISTINGS
@@ -2864,7 +2864,7 @@ Historically, if you used a pre-release version of Node.js, you would get
dozens and dozens of warnings when EVERY engine check failed across all of
your modules, because `>= 0.10.0` doesn't match prereleases.
You might find this stream of redundent warnings undesirable. I do.
You might find this stream of redundant warnings undesirable. I do.
We've moved this into a SINGLE warning you'll get about using a pre-release
version of Node.js and now suppress those other warnings.
@@ -3473,7 +3473,7 @@ Hey, you found the feature we added!
folder with the same layout as global modules. 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
elminate some deduping.
eliminate some deduping.
([@iarna](https://github.com/iarna))
#### TYPOS IN THE LICENSE, OH MY
@@ -3492,7 +3492,7 @@ this change makes it do.
We _think_ this is what everyone wants, but if this causes problems for
you, we want to know! If it proves problematic for people we will consider
reverting it (preferrably before this becomes `npm@latest`).
reverting it (preferably before this becomes `npm@latest`).
Previously, when you ran `npm install foo` we would act as if you typed
`npm install foo@*`. Now, like any range-type specifier, in addition to
@@ -3524,7 +3524,7 @@ it would just refuse to install anything. (We fixed that in
[#10338](https://github.com/npm/npm/pull/10338)
Updating a module could result in the module stealing some of its
dependencies from the top level, potentially breaking other modules or
resulting in many redundent installations. This bug was first introduced
resulting in many redundant installations. This bug was first introduced
by [`971fd47a`](https://github.com/npm/npm/commit/971fd47a).
([@iarna](https://github.com/iarna))
* [`5653366`](https://github.com/npm/npm/commit/5653366)
@@ -4070,7 +4070,7 @@ in line with `npm@2`.
* [`95ee92c`](https://github.com/npm/npm/commit/95ee92c)
[#9433](https://github.com/npm/npm/issues/9433)
Give better error messages for invalid URLs in the dependecy
Give better error messages for invalid URLs in the dependency
list.
([@jamietre](https://github.com/jamietre))
+2 -2
View File
@@ -296,7 +296,7 @@ Also there's maybe a bit of an easter egg in this release. 'Cause those are fun
### v4.4.1 (2017-03-06):
This is a quick little patch release to forgo the update notification
checker if you're on an unsuported (but not otherwise broken) version of
checker if you're on an unsupported (but not otherwise broken) version of
Node.js. Right now that means 0.10 or 0.12.
* [`56ac249`](https://github.com/npm/npm/commit/56ac249ef8ede1021f1bc62a0e4fe1e9ba556af2)
@@ -1434,7 +1434,7 @@ install`, and `prepublishOnly` will be removed, leaving `prepare` and
* [`9b4a227`](https://github.com/npm/npm/commit/9b4a2278cee0a410a107c8ea4d11614731e0a943) [`bc32078`](https://github.com/npm/npm/commit/bc32078fa798acef0e036414cb448645f135b570)
[#14290](https://github.com/npm/npm/pull/14290)
Add `prepare` and `prepublishOnly` lifecyle events.
Add `prepare` and `prepublishOnly` lifecycle events.
([@othiym23](https://github.com/othiym23))
* [`52fdefd`](https://github.com/npm/npm/commit/52fdefddb48f0c39c6e8eb4c118eb306c9436117)
[#14290](https://github.com/npm/npm/pull/14290)
+6 -6
View File
@@ -225,7 +225,7 @@ as `https://` URLs instead of versions.
zeros deleted resulted in authentication failures.
([@iarna](https://github.com/iarna))
* [`6eaa860ea`](https://github.com/npm/npm/commit/6eaa860ead3222a6dbd6d370b4271e7bf242b30b)
Eliminate direct use of `new Buffer` in `npm`. While the use of it in `npm` was safe, there
Eliminate direct use of `new Buffer` in `npm`. While the use of it in `npm` was safe, there
are two other reasons for this change:
1. Node 10 emits warnings about its use.
@@ -341,7 +341,7 @@ and a handful of bug fixes! Let's get right in!
### NEW PACKAGE VIEW
There's a new `npm view` in town. You might it as `npm info` or `npm show`.
There's a new `npm view` in town. You might it as `npm info` or `npm show`.
The new output gives you a nicely summarized view that for most packages
fits on one screen. If you ask it for `--json` you'll still get the same
results, so your scripts should still work fine.
@@ -377,7 +377,7 @@ you can double check your `.npmignore` settings before doing a publish.
### MERGE CONFLICT, SMERGE CONFLICT
If you resolve a `package-lock.json` merge conflict with `npm install` we
now suggest you setup a merge driver to handle these automatically for you.
now suggest you setup a merge driver to handle these automatically for you.
If you're reading this and you'd like to set it up now, run:
```console
@@ -1285,7 +1285,7 @@ had been held by 1.3.16 since _December of 2013_.
If you can't get enough of the bleeding edge, I encourage you to check out
our canary release of npm. Get it with `npm install -g npmc`. It's going to
be seeing some exciting stuff in the next couple of weeks, starting with a
rewriten `npm dedupe`, but moving on to… well, you'll just have to wait and
rewritten `npm dedupe`, but moving on to… well, you'll just have to wait and
find out.
### PERFORMANCE
@@ -1911,7 +1911,7 @@ right? Here's what's bumping that number for us this time:
([@KennethKinLum](https://github.com/KennethKinLum))
* [`c9b534a14`](https://github.com/npm/npm/commit/c9b534a148818d1a97787c0dfdba5f64ce3618a6)
[#17074](https://github.com/npm/npm/pull/17074)
Clarify config documention with multiple boolean flags.
Clarify config documentation with multiple boolean flags.
([@KennethKinLum](https://github.com/KennethKinLum))
* [`e111b0a40`](https://github.com/npm/npm/commit/e111b0a40c4bc6691d7b8d67ddce5419e67bfd27)
[#16768](https://github.com/npm/npm/pull/16768)
@@ -2117,7 +2117,7 @@ added 234 packages in .005ms
Fix a crash while installing with `--no-shrinkwrap`.
([@jacknagel](https://github.com/jacknagel))
### DOC UPATES
### DOC UPDATES
* [`89e0cb816`](https://github.com/npm/npm/commit/89e0cb8165dd9c3c7ac74d531617f367099608f4)
[#16818](https://github.com/npm/npm/pull/16818)
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# set configurations that will be "sticky" on this system,
# surviving npm self-updates.
-19
View File
@@ -1,19 +0,0 @@
npm-bin(1) -- Display npm bin folder
====================================
## SYNOPSIS
npm bin [-g|--global]
## DESCRIPTION
Print the folder where npm will install executables.
## SEE ALSO
* npm-prefix(1)
* npm-root(1)
* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
-43
View File
@@ -1,43 +0,0 @@
npm-bugs(1) -- Bugs for a package in a web browser maybe
========================================================
## SYNOPSIS
npm bugs [<pkgname>]
aliases: issues
## DESCRIPTION
This command tries to guess at the likely location of a package's
bug tracker URL, and then tries to open it using the `--browser`
config param. If no package name is provided, it will search for
a `package.json` in the current folder and use the `name` property.
## CONFIGURATION
### browser
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
* Type: String
The browser that is called by the `npm bugs` command to open websites.
### registry
* Default: https://registry.npmjs.org/
* Type: url
The base URL of the npm package registry.
## SEE ALSO
* npm-docs(1)
* npm-view(1)
* npm-publish(1)
* npm-registry(7)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* package.json(5)
-25
View File
@@ -1,25 +0,0 @@
npm-build(1) -- Build a package
===============================
## SYNOPSIS
npm build [<package-folder>]
* `<package-folder>`:
A folder containing a `package.json` file in its root.
## DESCRIPTION
This is the plumbing command called by `npm link` and `npm install`.
It should generally be called during installation, but if you need to run it
directly, run:
npm run-script build
## SEE ALSO
* npm-install(1)
* npm-link(1)
* npm-scripts(7)
* package.json(5)
-31
View File
@@ -1,31 +0,0 @@
npm-completion(1) -- Tab Completion for npm
===========================================
## SYNOPSIS
source <(npm completion)
## 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:
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` 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(7)
* npm(1)
-73
View File
@@ -1,73 +0,0 @@
npm-config(1) -- Manage the npm configuration files
===================================================
## SYNOPSIS
npm config set <key> <value> [-g|--global]
npm config get <key>
npm config delete <key>
npm config list [-l] [--json]
npm config edit
npm get <key>
npm set <key> <value> [-g|--global]
aliases: c
## DESCRIPTION
npm gets its config settings from the command line, environment
variables, `npmrc` files, and in some cases, the `package.json` file.
See npmrc(5) for more information about the npmrc files.
See `npm-config(7)` for a more thorough discussion of the mechanisms
involved.
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
npm config set key value
Sets the config key to the value.
If value is omitted, then it sets it to "true".
### get
npm config get key
Echo the config value to stdout.
### list
npm config list
Show all the config settings. Use `-l` to also show defaults. Use `--json`
to show the settings in json format.
### delete
npm config delete key
Deletes the key from all configuration files.
### edit
npm config edit
Opens the config file in an editor. Use the `--global` flag to edit the
global config.
## SEE ALSO
* npm-folders(5)
* npm-config(7)
* package.json(5)
* npmrc(5)
* npm(1)
-26
View File
@@ -1,26 +0,0 @@
npm-deprecate(1) -- Deprecate a version of a package
====================================================
## SYNOPSIS
npm deprecate <pkg>[@<version>] <message>
## 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 as well as specific versions, so you can do
something like this:
npm deprecate my-thing@"< 0.2.3" "critical bug fixed in v0.2.3"
Note that you must be the package owner to deprecate something. See the
`owner` and `adduser` help topics.
To un-deprecate a package, specify an empty string (`""`) for the `message` argument.
## SEE ALSO
* npm-publish(1)
* npm-registry(7)
-44
View File
@@ -1,44 +0,0 @@
npm-docs(1) -- Docs for a package in a web browser maybe
========================================================
## SYNOPSIS
npm docs [<pkgname> [<pkgname> ...]]
npm docs .
npm home [<pkgname> [<pkgname> ...]]
npm 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
### browser
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
* Type: String
The browser that is called by the `npm docs` command to open websites.
### registry
* Default: https://registry.npmjs.org/
* Type: url
The base URL of the npm package registry.
## SEE ALSO
* npm-view(1)
* npm-publish(1)
* npm-registry(7)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* package.json(5)
-37
View File
@@ -1,37 +0,0 @@
npm-edit(1) -- Edit an installed package
========================================
## SYNOPSIS
npm edit <pkg>[@<version>]
## DESCRIPTION
Opens the package folder in the default editor (or whatever you've
configured as the npm `editor` config -- see `npm-config(7)`.)
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
### editor
* Default: `EDITOR` environment variable if set, or `"vi"` on Posix,
or `"notepad"` on Windows.
* Type: path
The command to run for `npm edit` or `npm config edit`.
## SEE ALSO
* npm-folders(5)
* npm-explore(1)
* npm-install(1)
* npm-config(1)
* npm-config(7)
* npmrc(5)
-16
View File
@@ -1,16 +0,0 @@
# npm install-ci-test(1) -- Install a project with a clean slate and run tests
## SYNOPSIS
npm install-ci-test
alias: npm cit
## DESCRIPTION
This command runs an `npm ci` followed immediately by an `npm test`.
## SEE ALSO
- npm-ci(1)
- npm-test(1)
-25
View File
@@ -1,25 +0,0 @@
# npm install-test(1) -- Install package(s) and run tests
## SYNOPSIS
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`.
## SEE ALSO
- npm-install(1)
- npm-test(1)
-24
View File
@@ -1,24 +0,0 @@
npm-ping(1) -- Ping npm registry
================================
## SYNOPSIS
npm ping [--registry <registry>]
## DESCRIPTION
Ping the configured or given npm registry and verify authentication.
If it works it will output something like:
```
Ping success: {*Details about registry*}
```
otherwise you will get:
```
Ping error: {*Detail about error}
```
## SEE ALSO
* npm-config(1)
* npm-config(7)
* npmrc(5)
-23
View File
@@ -1,23 +0,0 @@
npm-prefix(1) -- Display prefix
===============================
## SYNOPSIS
npm prefix [-g]
## DESCRIPTION
Print the local prefix to standard out. This is the closest parent directory
to contain a package.json file unless `-g` is also specified.
If `-g` is specified, this will be the value of the global prefix. See
`npm-config(7)` for more detail.
## SEE ALSO
* npm-root(1)
* npm-bin(1)
* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
-19
View File
@@ -1,19 +0,0 @@
npm-rebuild(1) -- Rebuild a package
===================================
## SYNOPSIS
npm rebuild [[<@scope>/<name>]...]
alias: npm 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.
## SEE ALSO
* npm-build(1)
* npm-install(1)
-19
View File
@@ -1,19 +0,0 @@
npm-root(1) -- Display npm root
===============================
## SYNOPSIS
npm root [-g]
## DESCRIPTION
Print the effective `node_modules` folder to standard out.
## SEE ALSO
* npm-prefix(1)
* npm-bin(1)
* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
-25
View File
@@ -1,25 +0,0 @@
npm-shrinkwrap(1) -- Lock down dependency versions for publication
=====================================================
## SYNOPSIS
npm shrinkwrap
## 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 npm-package-locks(5).
## SEE ALSO
* npm-install(1)
* npm-run-script(1)
* npm-scripts(7)
* package.json(5)
* npm-package-locks(5)
* package-lock.json(5)
* npm-shrinkwrap.json(5)
* npm-ls(1)
-22
View File
@@ -1,22 +0,0 @@
npm-star(1) -- Mark your favorite packages
==========================================
## SYNOPSIS
npm star [<pkg>...]
npm unstar [<pkg>...]
## DESCRIPTION
"Starring" a package means that you have some interest in it. It's
a vaguely positive way to show that you care.
"Unstarring" is the same thing, but in reverse.
It's a boolean thing. Starring repeatedly has no additional effect.
## SEE ALSO
* npm-view(1)
* npm-whoami(1)
* npm-adduser(1)
-21
View File
@@ -1,21 +0,0 @@
npm-stars(1) -- View packages marked as favorites
=================================================
## SYNOPSIS
npm stars [<user>]
## 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.
## SEE ALSO
* npm-star(1)
* npm-view(1)
* npm-whoami(1)
* npm-adduser(1)
-24
View File
@@ -1,24 +0,0 @@
npm-start(1) -- Start a package
===============================
## SYNOPSIS
npm start [-- <args>]
## DESCRIPTION
This runs an arbitrary command specified in the package's `"start"` property of
its `"scripts"` object. If no `"start"` property is specified on the
`"scripts"` object, it will run `node server.js`.
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(1) for
more details.
## SEE ALSO
* npm-run-script(1)
* npm-scripts(7)
* npm-test(1)
* npm-restart(1)
* npm-stop(1)
-18
View File
@@ -1,18 +0,0 @@
npm-stop(1) -- Stop a package
=============================
## SYNOPSIS
npm stop [-- <args>]
## DESCRIPTION
This runs a package's "stop" script, if one was provided.
## SEE ALSO
* npm-run-script(1)
* npm-scripts(7)
* npm-test(1)
* npm-start(1)
* npm-restart(1)
-20
View File
@@ -1,20 +0,0 @@
npm-test(1) -- Test a package
=============================
## SYNOPSIS
npm test [-- <args>]
aliases: t, tst
## DESCRIPTION
This runs a package's "test" script, if one was provided.
## SEE ALSO
* npm-run-script(1)
* npm-scripts(7)
* npm-start(1)
* npm-restart(1)
* npm-stop(1)
-53
View File
@@ -1,53 +0,0 @@
npm-uninstall(1) -- Remove a package
=============================
## SYNOPSIS
npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|-D|--save-dev|-O|--save-optional|--no-save]
aliases: remove, rm, r, un, unlink
## DESCRIPTION
This uninstalls a package, completely removing everything npm installed
on its behalf.
Example:
npm uninstall sax
In global mode (ie, with `-g` or `--global` appended to the command),
it uninstalls the current package context as a global package.
`npm uninstall` takes 3 exclusive, optional flags which save or update
the package version in your main package.json:
* `-S, --save`: Package will be removed from your `dependencies`.
* `-D, --save-dev`: Package will be removed from your `devDependencies`.
* `-O, --save-optional`: Package will be removed from your `optionalDependencies`.
* `--no-save`: Package will not be removed from your `package.json` file.
Further, if you have an `npm-shrinkwrap.json` then it will be updated as
well.
Scope is optional and follows the usual rules for `npm-scope(7)`.
Examples:
npm uninstall sax --save
npm uninstall @myorg/privatepackage --save
npm uninstall node-tap --save-dev
npm uninstall dtrace-provider --save-optional
npm uninstall lodash --no-save
## SEE ALSO
* npm-prune(1)
* npm-install(1)
* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
-17
View File
@@ -1,17 +0,0 @@
npm-whoami(1) -- Display npm username
=====================================
## SYNOPSIS
npm whoami [--registry <registry>]
## DESCRIPTION
Print the `username` config to standard output.
## SEE ALSO
* npm-config(1)
* npm-config(7)
* npmrc(5)
* npm-adduser(1)
-192
View File
@@ -1,192 +0,0 @@
npm-coding-style(7) -- npm's "funny" coding style
=================================================
## DESCRIPTION
npm's coding style is a bit unconventional. It is not different for
difference's sake, but rather a carefully crafted style that is
designed to reduce visual clutter and make bugs more apparent.
If you want to contribute to npm (which is very encouraged), you should
make your code conform to npm's style.
Note: this concerns npm's code not the specific packages that you can download from the npm registry.
## Line Length
Keep lines shorter than 80 characters. It's better for lines to be
too short than to be too long. Break up long lists, objects, and other
statements onto multiple lines.
## Indentation
Two-spaces. Tabs are better, but they look like hell in web browsers
(and on GitHub), and node uses 2 spaces, so that's that.
Configure your editor appropriately.
## Curly braces
Curly braces belong on the same line as the thing that necessitates them.
Bad:
function ()
{
Good:
function () {
If a block needs to wrap to the next line, use a curly brace. Don't
use it if it doesn't.
Bad:
if (foo) { bar() }
while (foo)
bar()
Good:
if (foo) bar()
while (foo) {
bar()
}
## Semicolons
Don't use them except in four situations:
* `for (;;)` loops. They're actually required.
* null loops like: `while (something) ;` (But you'd better have a good
reason for doing that.)
* `case 'foo': doSomething(); break`
* In front of a leading `(` or `[` at the start of the line.
This prevents the expression from being interpreted
as a function call or property access, respectively.
Some examples of good semicolon usage:
;(x || y).doSomething()
;[a, b, c].forEach(doSomething)
for (var i = 0; i < 10; i ++) {
switch (state) {
case 'begin': start(); continue
case 'end': finish(); break
default: throw new Error('unknown state')
}
end()
}
Note that starting lines with `-` and `+` also should be prefixed
with a semicolon, but this is much less common.
## Comma First
If there is a list of things separated by commas, and it wraps
across multiple lines, put the comma at the start of the next
line, directly below the token that starts the list. Put the
final token in the list on a line by itself. For example:
var magicWords = [ 'abracadabra'
, 'gesundheit'
, 'ventrilo'
]
, spells = { 'fireball' : function () { setOnFire() }
, 'water' : function () { putOut() }
}
, a = 1
, b = 'abc'
, etc
, somethingElse
## Quotes
Use single quotes for strings except to avoid escaping.
Bad:
var notOk = "Just double quotes"
Good:
var ok = 'String contains "double" quotes'
var alsoOk = "String contains 'single' quotes or apostrophe"
## Whitespace
Put a single space in front of `(` for anything other than a function call.
Also use a single space wherever it makes things more readable.
Don't leave trailing whitespace at the end of lines. Don't indent empty
lines. Don't use more spaces than are helpful.
## Functions
Use named functions. They make stack traces a lot easier to read.
## Callbacks, Sync/async Style
Use the asynchronous/non-blocking versions of things as much as possible.
It might make more sense for npm to use the synchronous fs APIs, but this
way, the fs and http and child process stuff all uses the same callback-passing
methodology.
The callback should always be the last argument in the list. Its first
argument is the Error or null.
Be very careful never to ever ever throw anything. It's worse than useless.
Just send the error message back as the first argument to the callback.
## Errors
Always create a new Error object with your message. Don't just return a
string message to the callback. Stack traces are handy.
## Logging
Logging is done using the [npmlog](https://github.com/npm/npmlog)
utility.
Please clean up logs when they are no longer helpful. In particular,
logging the same object over and over again is not helpful. Logs should
report what's happening so that it's easier to track down where a fault
occurs.
Use appropriate log levels. See `npm-config(7)` and search for
"loglevel".
## Case, naming, etc.
Use `lowerCamelCase` for multiword identifiers when they refer to objects,
functions, methods, properties, or anything not specified in this section.
Use `UpperCamelCase` for class names (things that you'd pass to "new").
Use `all-lower-hyphen-css-case` for multiword filenames and config keys.
Use named functions. They make stack traces easier to follow.
Use `CAPS_SNAKE_CASE` for constants, things that should never change
and are rarely used.
Use a single uppercase letter for function names where the function
would normally be anonymous, but needs to call itself recursively. It
makes it clear that it's a "throwaway" function.
## null, undefined, false, 0
Boolean variables and functions should always be either `true` or
`false`. Don't set it to 0 unless it's supposed to be a number.
When something is intentionally missing or removed, set it to `null`.
Don't set things to `undefined`. Reserve that value to mean "not yet
set to anything."
Boolean objects are forbidden.
## SEE ALSO
* npm-developers(7)
* npm(1)
-319
View File
@@ -1,319 +0,0 @@
npm-index(7) -- Index of all npm documentation
==============================================
### README(1)
a JavaScript package manager
## Command Line Documentation
Using npm on the command line
### npm(1)
javascript package manager
### npm-access(1)
Set access level on published packages
### npm-adduser(1)
Add a registry user account
### npm-audit(1)
Run a security audit
### npm-bin(1)
Display npm bin folder
### npm-bugs(1)
Bugs for a package in a web browser maybe
### npm-build(1)
Build a package
### npm-bundle(1)
REMOVED
### npm-cache(1)
Manipulates packages cache
### npm-ci(1)
Install a project with a clean slate
### npm-completion(1)
Tab Completion for npm
### npm-config(1)
Manage the npm configuration files
### npm-dedupe(1)
Reduce duplication
### npm-deprecate(1)
Deprecate a version of a package
### npm-dist-tag(1)
Modify package distribution tags
### npm-docs(1)
Docs for a package in a web browser maybe
### npm-doctor(1)
Check your environments
### npm-edit(1)
Edit an installed package
### npm-explore(1)
Browse an installed package
### npm-help-search(1)
Search npm help documentation
### npm-help(1)
Get help on npm
### npm-hook(1)
Manage registry hooks
### npm-init(1)
create a package.json file
### npm-install-ci-test(1)
Install a project with a clean slate and run tests
### npm-install-test(1)
Install package(s) and run tests
### npm-install(1)
Install a package
### npm-link(1)
Symlink a package folder
### npm-logout(1)
Log out of the registry
### npm-ls(1)
List installed packages
### npm-outdated(1)
Check for outdated packages
### npm-owner(1)
Manage package owners
### npm-pack(1)
Create a tarball from a package
### npm-ping(1)
Ping npm registry
### npm-prefix(1)
Display prefix
### npm-profile(1)
Change settings on your registry profile
### npm-prune(1)
Remove extraneous packages
### npm-publish(1)
Publish a package
### npm-rebuild(1)
Rebuild a package
### npm-repo(1)
Open package repository page in the browser
### npm-restart(1)
Restart a package
### npm-root(1)
Display npm root
### npm-run-script(1)
Run arbitrary package scripts
### npm-search(1)
Search for packages
### npm-shrinkwrap(1)
Lock down dependency versions for publication
### npm-star(1)
Mark your favorite packages
### npm-stars(1)
View packages marked as favorites
### npm-start(1)
Start a package
### npm-stop(1)
Stop a package
### npm-team(1)
Manage organization teams and team memberships
### npm-test(1)
Test a package
### npm-token(1)
Manage your authentication tokens
### npm-uninstall(1)
Remove a package
### npm-unpublish(1)
Remove a package from the registry
### npm-update(1)
Update a package
### npm-version(1)
Bump a package version
### npm-view(1)
View registry info
### npm-whoami(1)
Display npm username
## API Documentation
Using npm in your Node programs
## Files
File system structures npm uses
### npm-folders(5)
Folder Structures Used by npm
### npm-package-locks(5)
An explanation of npm lockfiles
### npm-shrinkwrap.json(5)
A publishable lockfile
### npmrc(5)
The npm config files
### package-lock.json(5)
A manifestation of the manifest
### package.json(5)
Specifics of npm's package.json handling
## Misc
Various other bits and bobs
### npm-coding-style(7)
npm's "funny" coding style
### npm-config(7)
More than you probably want to know about npm configuration
### npm-developers(7)
Developer Guide
### npm-disputes(7)
Handling Module Name Disputes
### npm-index(7)
Index of all npm documentation
### npm-orgs(7)
Working with Teams & Orgs
### npm-registry(7)
The JavaScript Package Registry
### npm-scope(7)
Scoped packages
### npm-scripts(7)
How npm handles the "scripts" field
### removing-npm(7)
Cleaning the Slate
### semver(7)
The semantic versioner for npm
-151
View File
@@ -1,151 +0,0 @@
# `file:` specifiers
`specifier` refers to the value part of the `package.json`'s `dependencies`
object. This is a semver expression for registry dependencies and
URLs and URL-like strings for other types.
### Dependency Specifiers
* A `file:` specifier is either an absolute path (eg `/path/to/thing`, `d:\path\to\thing`):
* An absolute `file:///absolute/path` with any number of leading slashes
being treated as a single slash. That is, `file:/foo/bar` and
`file:///foo/bar` reference the same package.
* … or a relative path (eg `../path/to/thing`, `path\to\subdir`). Leading
slashes on a file specifier will be removed, that is 'file://../foo/bar`
references the same package as same as `file:../foo/bar`. The latter is
considered canonical.
* Attempting to install a specifier that has a windows drive letter will
produce an error on non-Windows systems.
* A valid `file:` specifier points is:
* a valid package file. That is, a `.tar`, `.tar.gz` or `.tgz` containing
`<dir>/package.json`.
* OR, a directory that contains a `package.json`
Relative specifiers are relative to the file they were found in, or, if
provided on the command line, the CWD that the command was run from.
An absolute specifier found in a `package.json` or `npm-shrinkwrap.json` is
probably an error as it's unlikely to be portable between computers and
should warn.
A specifier provided as a command line argument that is on a different drive
is an error. That is, `npm install file:d:/foo/bar` is an error if the
current drive is `c`. The point of this rule is that if we can't produce a
relative path then it's an error.
### Specifier Disambiguation
On the command line, plain paths are allowed. These paths can be ambiguous
as they could be a path, a plain package name or a github shortcut. This
ambiguity is resolved by checking to see if either a directory exists that
contains a `package.json`. If either is the case then the specifier is a
file specifier, otherwise it's a registry or github specifier.
### Specifier Matching
A specifier is considered to match a dependency on disk when the `realpath`
of the fully resolved specifier matches the `realpath` of the package on disk.
### Saving File Specifiers
When saving to both `package.json` and `npm-shrinkwrap.json` they will be
saved using the `file:../relative/path` form, and the relative path will be
relative to the project's root folder. This is particularly important to
note for the `npm-shrinkwrap.json` as it means the specifier there will
be different then the original `package.json` (where it was relative to that
`package.json`).
When shrinkwrapping file specifiers, the contents of the destination
package's `node_modules` WILL NOT be included in the shrinkwrap. If you want to lock
down the destination package's `node_modules` you should create a shrinkwrap for it
separately.
This is necessary to support the mono repo use case where many projects file
to the same package. If each project included its own `npm-shrinkwrap.json`
then they would each have their own distinct set of transitive dependencies
and they'd step on each other any time you ran an install in one or the other.
NOTE: This should not have an effect on shrinkwrapping of other sorts of
shrinkwrapped packages.
### Installation
#### File type specifiers pointing at tarballs
File-type specifiers pointing at a `.tgz` or `.tar.gz` or `.tar` file will
install it as a package file in the same way we would a remote tarball. The
checksum of the package file should be recorded so that we can check for updates.
#### File type specifers pointing at directories
File-type specifiers that point at directories will necessarily not do
anything for `fetch` and `extract` phases.
The symlink should be created during the `finalize` phase.
The `preinstall` for file-type specifiers MUST be run AFTER the
`finalize` phase as the symlink may be a relative path reaching outside the
current project root and a symlink that resolves in `.staging` won't resolve
in the package's final resting place.
If the module is inside the package root that we're running the install for then
dependencies of the linked package will be hoisted to the top level as usual.
If the module is outside the package root then dependencies will be installed inside
the linked module's `node_modules` folder.
### Removal
Removal should remove the symlink.
Removal MUST NOT remove the transitive dependencies IF they're installed in
the linked module's `node_modules` folder.
### Listing
In listings they should not include a version as the version is not
something `npm` is concerned about. This also makes them easily
distinguishable from symlinks of packages that have other dependency
specifiers.
If you had run:
```
npm install --save file:../a
```
And then run:
```
npm ls
```
You would see:
```
example-package@1.0.0 /path/to/example-package
└── a → file:../a
```
```
example-package@1.0.0 /path/to/example-package
+-- a -> file:../a
```
Of note here: No version is included as the relevant detail is WHERE the
package came from, not what version happened to be in that path.
### Outdated
Local specifiers should only show up in `npm outdated` if they're missing
and when they do, they should be reported as:
```
Package Current Wanted Latest Location
a MISSING LOCAL LOCAL example-package
```
### Updating
If a dependency with a local specifier is already installed then `npm
update` shouldn't do anything. If one is missing then it should be
installed as if you ran `npm install`.
-276
View File
@@ -1,276 +0,0 @@
# package-lock and npm-shrinkwrap
`npm` can have one of two different lock files:
* `package-lock.json`, which is ordinarily always present and is never published.
* `npm-shrinkwrap.json`, which is created with `npm shrinkwrap` and usually published.
You can only have one of them and in the event that you have both,
`npm-shrinkwrap.json` takes precedence. The files are exactly the same
format and in fact all the `npm shrinkwrap` command does is rename your
`package-lock.json`.
Through the rest of this document we will refer to the package-lock and
`package-lock.json` but everything also applies to `npm-shrinkwrap.json`.
## File Format
### name
The name of the package this is a package-lock for. This must match what's in `package.json`.
### version
The version of the package this is a package-lock for. This must match what's in `package.json`.
### lockfileVersion *(new)*
An integer version, starting at `1` with the version number of this document
whose semantics were used when generating this `package-lock.json`.
### preserveSymlinks *(new)*
Indicates that the install was done with the environment variable
`NODE_PRESERVE_SYMLINKS` enabled. The installer should insist that the value of this
property match that environment variable.
### dependencies
These are the modules installed in the `node_modules`. Some of these are
dependencies some of these are transitive dependencies (that is,
dependencies of our dependencies).
This is a mapping of package name to dependency object. Dependency objects have the
following properties:
#### version *(changed)*
This is a specifier that uniquely identifies this package and should be
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 *(new)*
This is a [Standard Subresource
Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/) for
this resource.
* For bundled dependencies this is not included, regardless of source.
* For registry sources, this is the `integrity` that the registry provided, or if one wasn't provided the SHA1 in `shasum`.
* For git sources this is the specific commit hash we cloned from.
* For remote tarball sources this is an integrity based on a SHA512 of
the file.
* For local tarball sources: This is an integrity field based on the SHA512 of the file.
#### resolved
* For bundled dependencies this is not included, regardless of source.
* 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.
#### link *(new)*
If this module was symlinked in development but had semver in the
`package.json` then this is the relative path of that link.
Discussion of the semantics of this will go in the symlinks RFC.
Implementation note: To be implemented post npm@5.
#### bundled *(new)*
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.
All optional dependencies should be included even if they're uninstallable
on the current platform.
#### from
This is a record of what specifier was used to originally install this
package. This should be used only for git dependencies.
#### 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
Exactly like `dependencies` at the top level, this is a list of modules to
install in the `node_modules` of this module.
## Generating
### `npm init`
If neither a `package-lock.json` nor an `npm-shrinkwrap.json` exist then
`npm init` will create a `package-lock.json`. This is functionally
equivalent to running `npm shrinkwrap` after the current init completes and
renaming the result to `package-lock.json`.
### `npm install --save`
If either an `npm-shrinkwrap.json` or a `package-lock.json` exists then it
will be updated.
If neither exist then a `package-lock.json` should be generated.
If a `package.json` does not exist, it should be generated. The generated
`package.json` should be empty, as in:
```
{
"dependencies": {
}
}
```
If the user wants to get a default package name/version added they can run `npm init`.
### `npm shrinkwrap`
If a `package-lock.json` exists, rename it to `npm-shrinkwrap.json`.
Refresh the data from the installer's ideal tree.
The top level `name` and `version` come from the `package.json`. It is an
error if either are missing or invalid.
#### dependencies.dev
This is `true` if this dependency is ONLY installed to fulfill either a top
level development dependency, or one of its transitive dependencies.
Given:
```
B (Dev) → C
```
Then both B and C would be `dev: true`.
Given:
```
A → B → C
B (Dev) -> C
```
Then all dependencies would be `dev: false`.
#### dependencies.optional
This is `true` if this dependency is ONLY ever either an optional dependency
or a transitive dependency of optional dependencies.
Given:
```
A (Opt) → B → C
```
Then all three of A, B and C would be flagged as optional.
Given:
```
A (Opt) → B → C
D → C
```
Then A and B would be flagged as optional, but C would not be.
Given:
```
A (Opt) → B → C
D → A
```
Then none would be flagged as optional.
## Installing
If the `packageIntegrity` in the `package-lock.json` differs from the one
computed from the `package.json` then places where the `package.json` is
incompatible with the `package-lock.json` a new module should be installed.
That is, while the `package-lock.json` ordinarily defines the state of your
project, if your `package.json` is edited independently it will take
precedence.
The `package-lock.json` describes the exact tree that `npm` should create.
Any deviation between the `package.json` and the shrinkwrap/lock should
result in a warning be issued. This includes:
* Modules in `package.json` but missing from the `package-lock.json`
* Modules in the `package-lock.json` but missing from the `package.json`.
* Modules in `package.json` whose specifiers don't match the version in `package-lock.json`.
Warn if the `lockfileVersion` in the `package-lock.json` is for a different
major version than we implement.
Module resolution from package-lock data works as such:
* If install was run with `--resolve-links` and a dependency has a `link`
property then a symlink is made using that. If the version of the
destination can not be matched to the package-lock and/or the package.json
then a warning will be issued.
* Otherwise, if a `integrity` is available then we try to install it from the cache using it.
If `integrity` is unavailable or we are unable to locate a module from the `integrity` then:
* If `lockfileVersion` is set:
* Install using the value of `version` and validate the result against the
`integrity`.
* Otherwise, try these in turn and validate the result against the `integrity`:
* `resolved`, then `from`, then `version.
* `from` can be either `package@specifier` or just `specifier`.
Regardless of how the module is installed the metadata in the installed
module should be identical to what it would have been if the module were
installed w/o a package-lock.
## Implied Changes To Other Commands
### `npm rm --save`
Currently if you ask to remove a package that's both a direct and a
transitive dependency, we'll remove the package from `node_modules` even if
this results in a broken tree. This was chosen at the time because we felt
that users would expect `npm rm pkgname` to be equivalent of
`rm -rf node_modules/pkgname`.
As you are no longer going to be allowed to put your `node_modules` in a
state that's not a valid package-lock, this means this behavior is no longer
valid. Instead we should follow normal rules, removing it from the
dependencies for the top level but only removing the module on disk if
nothing requires it any more.
## Additional fields / Adding new fields
Installers should ignore any field they aren't aware of. It's not an error
to have additional properties in the package-lock or lock file.
Installers that want to add new fields should either have one added via RFC
in the npm issue tracker and an accompanying documentation PR, or should prefix
it with the name of their project.
+22
View File
@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2015 gatsbyjs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -1,19 +1,31 @@
npm-access(1) -- Set access level on published packages
=======================================================
---
section: cli-commands
title: npm-access
description: Set access level on published packages
---
## SYNOPSIS
# npm-access(1)
npm access public [<package>]
npm access restricted [<package>]
## Set access level on published packages
npm access grant <read-only|read-write> <scope:team> [<package>]
npm access revoke <scope:team> [<package>]
### Synopsis
npm access ls-packages [<user>|<scope>|<scope:team>]
npm access ls-collaborators [<package> [<user>]]
npm access edit [<package>]
```bash
npm access public [<package>]
npm access restricted [<package>]
## DESCRIPTION
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.
@@ -28,6 +40,10 @@ subcommand.
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
@@ -41,7 +57,7 @@ subcommand.
* edit:
Set the access privileges for a package at once using `$EDITOR`.
## DETAILS
### Details
`npm access` always operates directly on the current registry, configurable
from the command line using `--registry=<registry url>`.
@@ -68,9 +84,10 @@ with an HTTP 402 status code (logically enough), unless you use
Management of teams and team memberships is done with the `npm team` command.
## SEE ALSO
### See Also
* npm-team(1)
* npm-publish(1)
* npm-config(7)
* npm-registry(7)
* [`libnpmaccess`](https://npm.im/libnpmaccess)
* [npm team](/cli-commands/npm-team)
* [npm publish](/cli-commands/npm-publish)
* [npm config](/cli-commands/npm-config)
* [npm registry](/using-npm/registry)
@@ -1,17 +1,26 @@
npm-adduser(1) -- Add a registry user account
=============================================
---
section: cli-commands
title: npm-adduser
description: Set access level on published packages
---
## SYNOPSIS
# npm-adduser(1)
npm adduser [--registry=url] [--scope=@orgname] [--always-auth] [--auth-type=legacy]
## Add a registry user account
aliases: login, add-user
### Synopsis
## DESCRIPTION
```bash
npm adduser [--registry=url] [--scope=@orgname] [--always-auth] [--auth-type=legacy]
aliases: login, add-user
```
### 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 `npm-config(7)`).
the default registry will be used (see [`config`](/using-npm/config)).
The username, password, and email are read in from prompts.
@@ -26,30 +35,32 @@ your existing record.
`npm login` is an alias to `adduser` and behaves exactly the same way.
## CONFIGURATION
### Configuration
### registry
#### registry
Default: https://registry.npmjs.org/
The base URL of the npm package registry. If `scope` is also specified,
this registry will only be used for packages with that scope. `scope` defaults
to the scope of the project directory you're currently in, if any. See `npm-scope(7)`.
to the scope of the project directory you're currently in, if any. See [`scope`](/using-npm/scope).
### scope
#### scope
Default: none
If specified, the user and login credentials given will be associated
with the specified scope. See `npm-scope(7)`. You can use both at the same time,
with the specified scope. See [`scope`](/using-npm/scope). You can use both at the same time,
e.g.
```bash
npm adduser --registry=http://myregistry.example.com --scope=@myco
```
This will set a registry for the given scope and login or create a user for
that registry at the same time.
### always-auth
#### always-auth
Default: false
@@ -57,16 +68,16 @@ If specified, save configuration indicating that all requests to the given
registry should include authorization information. Useful for private
registries. Can be used with `--registry` and / or `--scope`, e.g.
```bash
npm adduser --registry=http://private-registry.example.com --always-auth
```
This will ensure that all requests to that registry (including for tarballs)
include an authorization header. This setting may be necessary for use with
private registries where metadata and package tarballs are stored on hosts with
different hostnames. See `always-auth` in `npm-config(7)` for more details on
always-auth. Registry-specific configuration of `always-auth` takes precedence
over any global configuration.
different hostnames. See `always-auth` in [`config`](/using-npm/config) for more details on always-auth. Registry-specific configuration of `always-auth` takes precedence over any global configuration.
### auth-type
#### auth-type
* Default: `'legacy'`
* Type: `'legacy'`, `'sso'`, `'saml'`, `'oauth'`
@@ -75,11 +86,10 @@ What authentication strategy to use with `adduser`/`login`. Some npm registries
(for example, npmE) might support alternative auth strategies besides classic
username/password entry in legacy npm.
## SEE ALSO
### See Also
* npm-registry(7)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* npm-owner(1)
* npm-whoami(1)
* [npm registry](/using-npm/registry)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm owner](/cli-commands/npm-owner)
* [npm whoami](/cli-commands/npm-whoami)
@@ -1,71 +1,88 @@
npm-audit(1) -- Run a security audit
====================================
---
section: cli-commands
title: npm-audit
description: Run a security audit
---
## SYNOPSIS
# npm-audit(1)
npm audit [--json|--parseable]
npm audit fix [--force|--package-lock-only|--dry-run|--production|--only=dev]
## Run a security audit
## EXAMPLES
### Synopsis
```bash
npm audit [--json|--parseable|--audit-level=(low|moderate|high|critical)]
npm audit fix [--force|--package-lock-only|--dry-run]
common options: [--production] [--only=(dev|prod)]
```
### 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
```
Get the detailed audit report in plain text result, separated by tab characters, allowing for
future reuse in scripting or command line post processing, like for example, selecting
some of the columns printed:
```
```bash
$ npm audit --parseable
```
To parse columns, you can use for example `awk`, and just print some of them:
```
```bash
$ npm audit --parseable | awk -F $'\t' '{print $1,$4}'
```
## DESCRIPTION
Fail an audit only if the results include a vulnerability with a level of moderate or higher:
```bash
$ npm audit --audit-level=moderate
```
### 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. The report returned includes instructions on how to act on
this information.
this information. The command will exit with a 0 exit code if no
vulnerabilities were found.
You can also have npm automatically fix the vulnerabilities by running `npm
audit fix`. Note that some vulnerabilities cannot be fixed automatically and
@@ -74,7 +91,13 @@ 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.
## CONTENT SUBMITTED
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.
### Content Submitted
* npm_version
* node_version
@@ -82,7 +105,7 @@ installer will also apply to `npm install` -- so things like `npm audit fix
* node_env
* A scrubbed version of your package-lock.json or npm-shrinkwrap.json
### SCRUBBING
#### Scrubbing
In order to ensure that potentially sensitive information is not included in
the audit data bundle, some dependencies may have their names (and sometimes
@@ -99,8 +122,15 @@ The non-reversible identifiers are a sha256 of a session-specific UUID and the
value being replaced, ensuring a consistent value within the payload that is
different between runs.
## SEE ALSO
### Exit Code
* npm-install(1)
* package-locks(5)
* config(7)
The `npm audit` command will exit with a 0 exit code if no vulnerabilities were found.
If vulnerabilities were found the exit code will depend on the `audit-level`
configuration setting.
### See Also
* [npm install](/cli-commands/npm-install)
* [package-locks](/configuring-npm/package-locks)
* [config](/using-npm/config)
+26
View File
@@ -0,0 +1,26 @@
---
section: cli-commands
title: npm-bin
description: Display npm bin folder
---
# npm-bin(1)
## Display npm bin folder
### Synopsis
```bash
npm bin [-g|--global]
```
### Description
Print the folder where npm will install executables.
### See Also
* [npm prefix](/cli-commands/npm-prefix)
* [npm root](/cli-commands/npm-root)
* [npm folders](/configuring-npm/folders)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
+50
View File
@@ -0,0 +1,50 @@
---
section: cli-commands
title: npm-bugs
description: Bugs for a package in a web browser maybe
---
# npm-bugs(1)
## Bugs for a package in a web browser maybe
### Synopsis
```bash
npm bugs [<pkgname>]
aliases: issues
```
### Description
This command tries to guess at the likely location of a package's
bug tracker URL, and then tries to open it using the `--browser`
config param. If no package name is provided, it will search for
a `package.json` in the current folder and use the `name` property.
### Configuration
#### browser
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
* Type: String
The browser that is called by the `npm bugs` command to open websites.
#### registry
* Default: https://registry.npmjs.org/
* Type: url
The base URL of the npm package registry.
### See Also
* [npm docs](/cli-commands/npm-docs)
* [npm view](/cli-commands/npm-view)
* [npm publish](/cli-commands/npm-publish)
* [npm registry](/using-npm/registry)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [package.json](/configuring-npm/package-json)
+34
View File
@@ -0,0 +1,34 @@
---
section: cli-commands
title: npm-build
description: Build a package
---
# npm-build(1)
## Build a package
### Synopsis
```shell
npm build [<package-folder>]
```
* `<package-folder>`:
A folder containing a `package.json` file in its root.
### Description
This is the plumbing command called by `npm link` and `npm install`.
It should generally be called during installation, but if you need to run it
directly, run:
```bash
npm run-script build
```
### See Also
* [npm install](/cli-commands/npm-install)
* [npm link](/cli-commands/npm-link)
* [npm scripts](/using-npm/scripts)
* [package.json](/configuring-npm/package-json)
@@ -1,7 +1,14 @@
npm-bundle(1) -- REMOVED
========================
---
section: cli-commands
title: npm-bundle
description: REMOVED
---
## DESCRIPTION
# npm-bundle(1)
## REMOVED
### Description
The `npm bundle` command has been removed in 1.0, for the simple reason
that it is no longer necessary, as the default behavior is now to
@@ -9,6 +16,6 @@ install packages into the local space.
Just use `npm install` now to do what `npm bundle` used to do.
## SEE ALSO
### See Also
* npm-install(1)
* [npm install](/cli-commands/npm-install)
@@ -1,19 +1,28 @@
npm-cache(1) -- Manipulates packages cache
==========================================
---
section: cli-commands
title: npm-cache
description: Manipulates packages cache
---
## SYNOPSIS
# npm-cache(1)
npm cache add <tarball file>
npm cache add <folder>
npm cache add <tarball url>
npm cache add <name>@<version>
## Manipulates packages cache
npm cache clean [<path>]
aliases: npm cache clear, npm cache rm
### Synopsis
npm cache verify
```bash
npm cache add <tarball file>
npm cache add <folder>
npm cache add <tarball url>
npm cache add <name>@<version>
## DESCRIPTION
npm cache clean [<path>]
aliases: npm cache clear, npm cache rm
npm cache verify
```
### Description
Used to add, list, or clean the npm cache folder.
@@ -29,7 +38,7 @@ Used to add, list, or clean the npm cache folder.
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
### Details
npm stores cache data in an opaque directory within the configured `cache`,
named `_cacache`. This directory is a `cacache`-based content-addressable cache
@@ -51,7 +60,7 @@ directly.
npm will not remove data by itself: the cache will grow as new packages are
installed.
## A NOTE ABOUT THE CACHE'S DESIGN
### 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
@@ -62,22 +71,21 @@ 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
### Configuration
### cache
#### cache
Default: `~/.npm` on Posix, or `%AppData%/npm-cache` on Windows.
The root cache folder.
## SEE ALSO
### See Also
* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* npm-install(1)
* npm-publish(1)
* npm-pack(1)
* [npm folders](/configuring-npm/folders)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm install](/cli-commands/npm-install)
* [npm publish](/cli-commands/npm-publish)
* [npm pack](/cli-commands/npm-pack)
* https://npm.im/cacache
* https://npm.im/pacote
@@ -1,15 +1,23 @@
npm-ci(1) -- Install a project with a clean slate
===================================
---
section: cli-commands
title: npm-ci
description: Install a project with a clean slate
---
## SYNOPSIS
# npm-ci(1)
npm ci
## Install a project with a clean slate
## EXAMPLE
### Synopsis
```bash
npm ci
```
### 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
@@ -18,14 +26,14 @@ $ 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
@@ -35,13 +43,14 @@ cache:
- "$HOME/.npm"
```
## DESCRIPTION
### Description
This command is similar to `npm-install(1)`, except it's meant to be used in
This command is similar to [`npm install`](/cli-commands/npm-install), except it's meant to be used in
automated environments such as test platforms, continuous integration, and
deployment. It can be significantly faster than a regular npm install by
skipping certain user-oriented features. It is also more strict than a regular
install, which can help catch errors or inconsistencies caused by the
deployment -- or any situation where you want to make sure you're doing a clean
install of your dependencies. It can be significantly faster than a regular npm
install by skipping certain user-oriented features. It is also more strict than
a regular install, which can help catch errors or inconsistencies caused by the
incrementally-installed local environments of most npm users.
In short, the main differences between using `npm install` and `npm ci` are:
@@ -52,7 +61,7 @@ In short, the main differences between using `npm install` and `npm ci` are:
* 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.
## SEE ALSO
### See Also
* npm-install(1)
* npm-package-locks(5)
* [npm install](/cli-commands/npm-install)
* [package-locks](/configuring-npm/package-locks)
+42
View File
@@ -0,0 +1,42 @@
---
section: cli-commands
title: npm-completion
description: Tab Completion for npm
---
# npm-completion(1)
## Tab Completion for npm
### Synopsis
```bash
source <(npm completion)
```
### 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](/cli-commands/npm)
+85
View File
@@ -0,0 +1,85 @@
---
section: cli-commands
title: npm-config
description: Manage the npm configuration files
---
# npm-config(1)
## Manage the npm configuration files
### Synopsis
```bash
npm config set <key> <value> [-g|--global]
npm config get <key>
npm config delete <key>
npm config list [-l] [--json]
npm config edit
npm get <key>
npm set <key> <value> [-g|--global]
aliases: c
```
### 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](/using-npm/config) for a more thorough discussion of the mechanisms
involved.
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
```
Sets the config key to the value.
If value is omitted, then it sets it to "true".
#### get
```bash
npm config get key
```
Echo the config value to stdout.
#### 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
```
Deletes the key 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.
### See Also
* [npm folders](/configuring-npm/folders)
* [npm config](/cli-commands/npm-config)
* [package.json](/configuring-npm/package-json)
* [npmrc](/configuring-npm/npmrc)
* [npm](/cli-commands/npm)
@@ -1,14 +1,22 @@
npm-dedupe(1) -- Reduce duplication
===================================
---
section: cli-commands
title: npm-dedupe
description: Reduce duplication
---
## SYNOPSIS
# npm-dedupe(1)
npm dedupe
npm ddp
## Reduce duplication
aliases: find-dupes, ddp
### Synopsis
```bash
npm dedupe
npm ddp
## DESCRIPTION
aliases: find-dupes, ddp
```
### Description
Searches the local package tree and attempts to simplify the overall
structure by moving dependencies further up the tree, where they can
@@ -16,18 +24,22 @@ 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(1)` will transform the tree to:
a
+-- b
+-- d
```bash
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
@@ -48,8 +60,8 @@ Modules
Note that this operation transforms the dependency tree, but will never
result in new modules being installed.
## SEE ALSO
### See Also
* npm-ls(1)
* npm-update(1)
* npm-install(1)
* [npm ls](/cli-commands/npm-ls)
* [npm update](/cli-commands/npm-update)
* [npm install](/cli-commands/npm-install)
+36
View File
@@ -0,0 +1,36 @@
---
section: cli-commands
title: npm-deprecate
description: Deprecate a version of a package
---
# npm-deprecate(1)
## Deprecate a version of a package
### Synopsis
```bash
npm deprecate <pkg>[@<version>] <message>
```
### 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"
```
Note that 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.
### See Also
* [npm publish](/cli-commands/npm-publish)
* [npm registry](/using-npm/registry)
@@ -1,39 +1,52 @@
npm-dist-tag(1) -- Modify package distribution tags
===================================================
---
section: cli-commands
title: npm-dist-tag
description: Modify package distribution tags
---
## SYNOPSIS
# npm-dist-tag(1)
npm dist-tag add <pkg>@<version> [<tag>]
npm dist-tag rm <pkg> <tag>
npm dist-tag ls [<pkg>]
## Modify package distribution tags
aliases: dist-tags
## DESCRIPTION
### 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 the tag you're adding is `latest` and you
have two-factor authentication on auth-and-writes then you'll need to include
an otp on the command line with `--otp`.
`--tag` config if not specified. If you have two-factor authentication on
auth-and-writes then you’ll need to include a one-time password on the
command line with `--otp <one-time password>`.
* rm:
Clear a tag that is no longer in use from the package.
* ls:
Show all of the dist-tags for a package, defaulting to the package in
the current prefix.
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:
npm install <name>@<tag>
```bash
npm install <name>@<tag>
```
When installing dependencies, a preferred tagged version may be specified:
npm install --tag <tag>
```bash
npm install --tag <tag>
```
This also applies to `npm dedupe`.
@@ -43,7 +56,7 @@ Publishing a package sets the `latest` tag to the published version unless the
By default, `npm install <pkg>` (without any `@<version>` or `@<tag>`
specifier) installs the `latest` tag.
## PURPOSE
### Purpose
Tags can be used to provide an alias instead of version numbers.
@@ -62,7 +75,7 @@ The `next` tag is used by some projects to identify the upcoming version.
By default, other than `latest`, no tag has any special significance to npm
itself.
## CAVEATS
### Caveats
This command used to be known as `npm tag`, which only created new tags, and so
had a different syntax.
@@ -77,12 +90,11 @@ example, `v1.4` cannot be used as a tag, because it is interpreted by semver as
The simplest way to avoid semver problems with tags is to use tags that do not
begin with a number or the letter `v`.
## SEE ALSO
### See Also
* npm-publish(1)
* npm-install(1)
* npm-dedupe(1)
* npm-registry(7)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* [npm publish](/cli-commands/npm-publish)
* [npm install](/cli-commands/npm-install)
* [npm dedupe](/cli-commands/npm-dedupe)
* [npm registry](/using-npm/registry)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
+52
View File
@@ -0,0 +1,52 @@
---
section: cli-commands
title: npm-docs
description: Docs for a package in a web browser maybe
---
# npm-docs(1)
## Docs for a package in a web browser maybe
### Synopsis
```bash
npm docs [<pkgname> [<pkgname> ...]]
npm docs .
npm home [<pkgname> [<pkgname> ...]]
npm 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
#### browser
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
* Type: String
The browser that is called by the `npm docs` command to open websites.
#### registry
* Default: https://registry.npmjs.org/
* Type: url
The base URL of the npm package registry.
### See Also
* [npm view](/cli-commands/npm-view)
* [npm publish](/cli-commands/npm-publish)
* [npm registry](/using-npm/registry)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [package.json](/configuring-npm/package-json)
@@ -1,11 +1,20 @@
npm-doctor(1) -- Check your environments
========================================================
---
section: cli-commands
title: npm-doctor
description: Check your environments
---
## SYNOPSIS
# npm-doctor(1)
npm doctor
## Check your environments
## DESCRIPTION
### Synopsis
```bash
npm doctor
```
### 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
@@ -29,7 +38,7 @@ 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`
#### `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
@@ -42,7 +51,7 @@ 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`
#### `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
@@ -52,7 +61,7 @@ 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`
#### `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
@@ -61,7 +70,7 @@ running a newer version, and some of you 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`
#### `npm config get registry`
Some of you may be installing from private package registries for your project
or company. That's great! Others of you may be following tutorials or
@@ -70,7 +79,7 @@ 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`
#### `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
@@ -78,14 +87,14 @@ installed to do many of the things that it does. Also, in some cases
accessible via your `PATH` so that npm can find it. This check ensures that Git
is available.
### Permissions checks
#### 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
#### 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
@@ -95,8 +104,8 @@ get cache`, and see what's in that cache with `npm cache ls` – probably more
than you were expecting!). In the event that there are corrupt packages in your
cache, you should probably run `npm cache clean` and reset the cache.
## SEE ALSO
### See Also
* npm-bugs(1)
* npm-help(1)
* npm-ping(1)
* [npm bugs](/cli-commands/npm-bugs)
* [npm help](/cli-commands/npm-help)
* [npm ping](/cli-commands/npm-ping)
+47
View File
@@ -0,0 +1,47 @@
---
section: cli-commands
title: npm-edit
description: Edit an installed package
---
# npm-edit(1)
## Edit an installed package
### Synopsis
```bash
npm edit <pkg>[/<subpkg>...]
```
### Description
Selects a (sub)dependency in the current
working directory 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
#### editor
* Default: `EDITOR` environment variable if set, or `"vi"` on Posix,
or `"notepad"` on Windows.
* Type: path
The command to run for `npm edit` or `npm config edit`.
### See Also
* [npm folders](/configuring-npm/folders)
* [npm explore](/cli-commands/npm-explore)
* [npm install](/cli-commands/npm-install)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
@@ -1,11 +1,20 @@
npm-explore(1) -- Browse an installed package
=============================================
---
section: cli-commands
title: npm-explore
description: Browse an installed package
---
## SYNOPSIS
# npm-explore(1)
npm explore <pkg> [ -- <command>]
## Browse an installed package
## DESCRIPTION
### Synopsis
```bash
npm explore <pkg> [ -- <command>]
```
### Description
Spawn a subshell in the directory of the installed package specified.
@@ -15,14 +24,16 @@ immediately terminates.
This is particularly handy in the case of git submodules in the
`node_modules` folder:
npm explore some-dependency -- git pull origin master
```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
### Configuration
### shell
#### shell
* Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
Windows
@@ -30,10 +41,10 @@ sure to use `npm rebuild <pkg>` if you make any changes.
The shell to run for the `npm explore` command.
## SEE ALSO
### See Also
* npm-folders(5)
* npm-edit(1)
* npm-rebuild(1)
* npm-build(1)
* npm-install(1)
* [npm folders](/configuring-npm/folders)
* [npm edit](/cli-commands/npm-edit)
* [npm rebuild](/cli-commands/npm-rebuild)
* [npm build](/cli-commands/npm-build)
* [npm install](/cli-commands/npm-install)
+60
View File
@@ -0,0 +1,60 @@
---
section: cli-commands
title: npm-fund
description: Retrieve funding information
---
# npm-fund(1)
## Retrieve funding information
### Synopsis
```bash
npm fund [<pkg>]
```
### 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 in which
are listed 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.
The list will avoid duplicated entries and will stack all packages
that share the same type/url as a single entry. Given this nature the
list is not going to have the same shape of the output from `npm ls`.
### Configuration
#### browser
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
* Type: String
The browser that is called by the `npm fund` command to open websites.
#### json
* Default: false
* Type: Boolean
Show information in JSON format.
#### unicode
* Type: Boolean
* Default: true
Whether to represent the tree structure using unicode characters.
Set it to `false` in order to use all-ansi output.
## See Also
* [npm docs](/cli-commands/npm-docs)
* [npm config](/cli-commands/npm-config)
* [npm install](/cli-commands/npm-install)
* [npm ls](/cli-commands/npm-ls)
@@ -1,11 +1,20 @@
npm-help-search(1) -- Search npm help documentation
===================================================
---
section: cli-commands
title: npm-help-search
description: Search npm help documentation
---
## SYNOPSIS
# npm-help-search(1)
npm help-search <text>
## Search npm help documentation
## DESCRIPTION
### Synopsis
```bash
npm help-search <text>
```
### Description
This command will search the npm markdown documentation files for the
terms provided, and then list the results, sorted by relevance.
@@ -16,9 +25,9 @@ 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
### Configuration
### long
#### long
* Type: Boolean
* Default: false
@@ -28,7 +37,7 @@ where the terms were found in the documentation.
If false, then help-search will just list out the help topics found.
## SEE ALSO
### See Also
* npm(1)
* npm-help(1)
* [npm](/cli-commands/npm)
* [npm help](/cli-commands/npm-help)
@@ -1,11 +1,20 @@
npm-help(1) -- Get help on npm
==============================
---
section: cli-commands
title: npm-help
description: Get help on npm
---
## SYNOPSIS
# npm-help(1)
npm help <term> [<terms..>]
## Get help on npm
## DESCRIPTION
### Synopsis
```bash
npm help <term> [<terms..>]
```
### Description
If supplied a topic, then show the appropriate documentation page.
@@ -14,9 +23,9 @@ 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
### Configuration
### viewer
#### viewer
* Default: "man" on Posix, "browser" on Windows
* Type: path
@@ -25,14 +34,11 @@ The program to use to view help content.
Set to `"browser"` to view html help content in the default web browser.
## SEE ALSO
### See Also
* npm(1)
* README
* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* package.json(5)
* npm-help-search(1)
* npm-index(7)
* [npm](/cli-commands/npm)
* [npm folders](/configuring-npm/folders)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [package.json](/configuring-npm/package-json)
* [npm help-search](/cli-commands/npm-help-search)
@@ -1,54 +1,62 @@
npm-hook(1) -- Manage registry hooks
===================================
---
section: cli-commands
title: npm-hook
description: Manage registry hooks
---
## SYNOPSIS
# npm-hook(1)
npm hook ls [pkg]
npm hook add <entity> <url> <secret>
npm hook update <id> <url> [secret]
npm hook rm <id>
## Manage registry hooks
## EXAMPLE
### Synopsis
```bash
npm hook ls [pkg]
npm hook add <entity> <url> <secret>
npm hook update <id> <url> [secret]
npm hook rm <id>
```
### 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
```
## DESCRIPTION
### Description
Allows you to manage [npm
hooks](https://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifications-of-npm),
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
@@ -67,6 +75,6 @@ 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.
## SEE ALSO
### See Also
* ["Introducing Hooks" blog post](https://blog.npmjs.org/post/145260155635/introducing-hooks-get-notifications-of-npm)
@@ -1,43 +1,51 @@
npm-init(1) -- create a package.json file
=======================================================
---
section: cli-commands
title: npm-init
description: create a package.json file
---
## SYNOPSIS
# npm-init(1)
npm init [--force|-f|--yes|-y|--scope]
npm init <@scope> (same as `npx <@scope>/create`)
npm init [<@scope>/]<name> (same as `npx [<@scope>/]create-<name>`)
## create a package.json file
## EXAMPLES
### Synopsis
```bash
npm init [--force|-f|--yes|-y|--scope]
npm init <@scope> (same as `npx <@scope>/create`)
npm init [<@scope>/]<name> (same as `npx [<@scope>/]create-<name>`)
```
### 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
```
## DESCRIPTION
### 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 [`npx(1)`](https://npm.im/npx), and then have its main bin
will be installed by [`npx`](https://npm.im/npx), and then have its main bin
executed -- presumably creating or updating `package.json` and running any other
initialization-related operations.
@@ -58,9 +66,9 @@ 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.
## SEE ALSO
### See Also
* <https://github.com/isaacs/init-package-json>
* package.json(5)
* npm-version(1)
* npm-scope(7)
* [package.json](/configuring-npm/package-json)
* [npm version](/cli-commands/npm-version)
* [npm scope](/using-npm/scope)
@@ -0,0 +1,26 @@
---
section: cli-commands
title: npm-install-ci-test
description: Install a project with a clean slate and run tests
---
# npm install-ci-test(1)
## Install a project with a clean slate and run tests
### Synopsis
```bash
npm install-ci-test
alias: npm cit
```
### Description
This command runs an `npm ci` followed immediately by an `npm test`.
### See Also
* [npm ci](/cli-commands/npm-ci)
* [npm test](/cli-commands/npm-test)
+35
View File
@@ -0,0 +1,35 @@
---
section: cli-commands
title: npm-install-test
description: Install package(s) and run tests
---
# npm install-test(1)
## 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`.
### See Also
* [npm install](/cli-commands/npm-install)
* [npm test](/cli-commands/npm-test)
@@ -1,36 +1,46 @@
npm-install(1) -- Install a package
===================================
---
section: cli-commands
title: npm-install
description: Install a package
---
## SYNOPSIS
# npm-install(1)
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 <git-host>:<git-user>/<repo-name>
npm install <git repo url>
npm install <tarball file>
npm install <tarball url>
npm install <folder>
## Install a package
alias: npm i
common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run]
### Synopsis
## DESCRIPTION
```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] [-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 shrinkwrap file, the installation of dependencies
will be driven by that, with an `npm-shrinkwrap.json` taking precedence if both
files exist. See package-lock.json(5) and npm-shrinkwrap(1).
files exist. See [package-lock.json](/configuring-npm/package-lock-json) and [`npm shrinkwrap`](/cli-commands/npm-shrinkwrap).
A `package` is:
* a) a folder containing a program described by a `package.json(5)` file
* 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 `npm-registry(7)`) with (c)
* e) a `<name>@<tag>` (see `npm-dist-tag(1)`) that points to (d)
* 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`](/cli-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)
@@ -49,11 +59,13 @@ after packing it up into a tarball (b).
directory) as a global package.
By default, `npm install` will install all modules listed as dependencies
in `package.json(5)`.
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`.
`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.
@@ -93,7 +105,7 @@ after packing it up into a tarball (b).
* `npm install [<@scope>/]<name>`:
Do a `<name>@<tag>` install, where `<tag>` is the "tag" config. (See
`npm-config(7)`. The config's default value is `latest`.)
[`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.
@@ -102,6 +114,24 @@ after packing it up into a tarball (b).
npm install sax
* `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:
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` saves any specified packages into `dependencies` by default.
Additionally, you can control where and how they get saved with some
additional flags:
@@ -129,7 +159,7 @@ after packing it up into a tarball (b).
`<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 `npm-scope(7)`.
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
@@ -137,14 +167,15 @@ after packing it up into a tarball (b).
Examples:
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
```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
@@ -158,8 +189,10 @@ after packing it up into a tarball (b).
Example:
npm install sax@latest
npm install @myorg/mypackage@latest
```bash
npm install sax@latest
npm install @myorg/mypackage@latest
```
* `npm install [<@scope>/]<name>@<version>`:
@@ -168,28 +201,33 @@ after packing it up into a tarball (b).
Example:
npm install sax@0.1.1
npm install @myorg/privatepackage@1.5.0
```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(5)`.
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:
npm install sax@">=0.1.0 <0.2.0"
npm install @myorg/privatepackage@">=0.1.0 <0.2.0"
```bash
npm install sax@">=0.1.0 <0.2.0"
npm install @myorg/privatepackage@">=0.1.0 <0.2.0"
```
* `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.
<protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish> | #semver:<semver>]
```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`.
@@ -199,7 +237,7 @@ after packing it up into a tarball (b).
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.
specified, then the default branch of the repository is used.
If the repository makes use of submodules, those submodules will be cloned
as well.
@@ -223,11 +261,13 @@ after packing it up into a tarball (b).
Examples:
npm install git+ssh://git@github.com:npm/cli.git#v1.0.27
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
```bash
npm install git+ssh://git@github.com:npm/cli.git#v1.0.27
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>]`:
@@ -247,9 +287,11 @@ after packing it up into a tarball (b).
done installing.
Examples:
npm install mygithubuser/myproject
npm install github:mygithubuser/myproject
```bash
npm install mygithubuser/myproject
npm install github:mygithubuser/myproject
```
* `npm install gist:[<githubname>/]<gistID>[#<commit-ish>|#semver:<semver>]`:
@@ -262,8 +304,10 @@ after packing it up into a tarball (b).
done installing.
Example:
npm install gist:101a11beef
```bash
npm install gist:101a11beef
```
* `npm install bitbucket:<bitbucketname>/<bitbucketrepo>[#<commit-ish>]`:
@@ -282,8 +326,10 @@ after packing it up into a tarball (b).
done installing.
Example:
npm install bitbucket:mybitbucketuser/myproject
```bash
npm install bitbucket:mybitbucketuser/myproject
```
* `npm install gitlab:<gitlabname>/<gitlabrepo>[#<commit-ish>]`:
@@ -302,14 +348,18 @@ after packing it up into a tarball (b).
done installing.
Example:
npm install gitlab:mygitlabuser/myproject
npm install gitlab:myusr/myproj#semver:^5.0
```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:
npm install sax@">=0.1.0 <0.2.0" bench supervisor
```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
@@ -324,10 +374,16 @@ 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.
npm install sax --force
```bash
npm install sax --force
```
The `--no-fund` argument will hide the message displayed at the end of each
install that acknowledges the number of dependencies looking for funding.
See `npm-fund(1)`
The `-g` or `--global` argument will cause npm to install the package globally
rather than locally. See `npm-folders(5)`.
rather than locally. See [folders](/configuring-npm/folders).
The `--global-style` argument will cause npm to install the package into
your local `node_modules` folder with the same layout it uses with the
@@ -336,7 +392,7 @@ global `node_modules` folder. Only your direct dependencies will show in
`node_modules` folders. This obviously will eliminate some deduping.
The `--ignore-scripts` argument will cause npm to not execute any
scripts defined in the package.json. See `npm-scripts(7)`.
scripts defined in the package.json. See [`scripts`](/using-npm/scripts).
The `--legacy-bundling` argument will cause npm to install the package such
that versions of npm prior to 1.4, such as the one included with node 0.8,
@@ -365,33 +421,36 @@ The `--only={prod[uction]|dev[elopment]}` argument will cause either only
`devDependencies` or only non-`devDependencies` to be installed regardless of the `NODE_ENV`.
The `--no-audit` argument can be used to disable sending of audit reports to
the configured registries. See `npm-audit(1)` for details on what is sent.
the configured registries. See [`npm-audit`](npm-audit) for details on what is sent.
See `npm-config(7)`. Many of the configuration params have some
See [`config`](/using-npm/config). Many of the configuration params have some
effect on installation, since that's most of what npm does.
## ALGORITHM
#### Algorithm
To install a package, npm uses the following algorithm:
load the existing node_modules tree from disk
clone the tree
fetch the package.json and assorted metadata and add it to the clone
walk the clone and add any missing dependencies
dependencies will be added as close to the top as is possible
without breaking any other modules
compare the original tree with the cloned tree and make a list of
actions to take to convert one to the other
execute all of the actions, deepest first
kinds of actions are install, update, remove and move
```bash
load the existing node_modules tree from disk
clone the tree
fetch the package.json and assorted metadata and add it to the clone
walk the clone and add any missing dependencies
dependencies will be added as close to the top as is possible
without breaking any other modules
compare the original tree with the cloned tree and make a list of
actions to take to convert one to the other
execute all of the actions, deepest first
kinds of actions are install, update, remove and move
```
For this `package{dep}` structure: `A{B,C}, B{C}, C{D}`,
this algorithm produces:
A
+-- B
+-- C
+-- D
```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
@@ -399,19 +458,20 @@ at the top level because nothing conflicts with it.
For `A{B,C}, B{C,D@1}, C{D@2}`, this algorithm produces:
A
+-- B
+-- C
`-- D@2
+-- D@1
```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 npm-folders(5) for a more detailed description of the specific
folder structures that npm creates.
See [folders](/configuring-npm/folders) for a more detailed description of the specific folder structures that npm creates.
### Limitations of npm's Install Algorithm
@@ -423,7 +483,9 @@ There are some very rare and pathological edge-cases where a cycle can
cause npm to try to install a never-ending tree of packages. Here is
the simplest case:
A -> B -> A' -> B' -> A -> B -> A' -> B' -> A -> ...
```bash
A -> B -> A' -> B' -> A -> B -> A' -> B' -> A -> ...
```
where `A` is some version of a package, and `A'` is a different version
of the same package. Because `B` depends on a different version of `A`
@@ -438,20 +500,20 @@ folder ancestors. A more correct, but more complex, solution would be
to symlink the existing version into the new location. If this ever
affects a real use-case, it will be investigated.
## SEE ALSO
### See Also
* npm-folders(5)
* npm-update(1)
* npm-audit(1)
* npm-link(1)
* npm-rebuild(1)
* npm-scripts(7)
* npm-build(1)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* npm-registry(7)
* npm-dist-tag(1)
* npm-uninstall(1)
* npm-shrinkwrap(1)
* package.json(5)
* [npm folders](/configuring-npm/folders)
* [npm update](/cli-commands/npm-update)
* [npm audit](/cli-commands/npm-audit)
* [npm fund](/cli-commands/npm-fund)
* [npm link](/cli-commands/npm-link)
* [npm rebuild](/cli-commands/npm-rebuild)
* [npm scripts](/using-npm/scripts)
* [npm build](/cli-commands/npm-build)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm registry](/using-npm/registry)
* [npm dist-tag](/cli-commands/npm-dist-tag)
* [npm uninstall](/cli-commands/npm-uninstall)
* [npm shrinkwrap](/cli-commands/npm-shrinkwrap)
* [package.json](/configuring-npm/package-json)
@@ -1,20 +1,29 @@
npm-link(1) -- Symlink a package folder
=======================================
---
section: cli-commands
title: npm-link
description: Symlink a package folder
---
## SYNOPSIS
# npm-link(1)
npm link (in package dir)
npm link [<@scope>/]<pkg>[@<version>]
## Symlink a package folder
alias: npm ln
### Synopsis
## DESCRIPTION
```bash
npm link (in package dir)
npm link [<@scope>/]<pkg>[@<version>]
alias: npm ln
```
### Description
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. (see `npm-config(7)` for the value of `prefix`). It
link` command was executed. (see [`npm-config`](npm-config) for the value of `prefix`). It
will also link any bins in the package to `{prefix}/bin/{name}`.
Next, in some other location, `npm link package-name` will create a
@@ -24,7 +33,7 @@ of the current folder.
Note that `package-name` is taken from `package.json`,
not from directory name.
The package name can be optionally prefixed with a scope. See `npm-scope(7)`.
The package name can be optionally prefixed with a scope. See [`scope`](/using-npm/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
@@ -35,10 +44,12 @@ test it iteratively without having to continually rebuild.
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
@@ -47,13 +58,17 @@ 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:
cd ~/projects/node-bloggy # go into the dir of your main project
npm link ../node-redis # link the dir of your dependency
```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:
(cd ../node-redis; npm link)
npm link redis
```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.
@@ -61,17 +76,17 @@ 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 `npm-scope(7)`) your link command must
include that scope, e.g.
If your linked package is scoped (see [`scope`](/using-npm/npm-scope)) your link command must include that scope, e.g.
npm link @myorg/privatepackage
```bash
npm link @myorg/privatepackage
```
## SEE ALSO
### See Also
* npm-developers(7)
* package.json(5)
* npm-install(1)
* npm-folders(5)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* [npm developers](/using-npm/developers)
* [package.json](/configuring-npm/package-json)
* [npm- nstall](/cli-commands/npm-install)
* [npm folders](/configuring-npm/folders)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
@@ -1,11 +1,20 @@
npm-logout(1) -- Log out of the registry
========================================
---
section: cli-commands
title: npm-logout
description: Log out of the registry
---
## SYNOPSIS
# npm-logout(1)
npm logout [--registry=<url>] [--scope=<@scope>]
## Log out of the registry
## DESCRIPTION
### Synopsis
```bash
npm logout [--registry=<url>] [--scope=<@scope>]
```
### Description
When logged into a registry that supports token-based authentication, tell the
server to end this token's session. This will invalidate the token everywhere
@@ -18,28 +27,28 @@ the current environment.
If `--scope` is provided, this will find the credentials for the registry
connected to that scope, if set.
## CONFIGURATION
### Configuration
### registry
#### registry
Default: https://registry.npmjs.org/
The base URL of the npm package registry. If `scope` is also specified,
it takes precedence.
### scope
#### scope
Default: The scope of your current project, if any, otherwise none.
If specified, you will be logged out of the specified scope. See `npm-scope(7)`.
If specified, you will be logged out of the specified scope. See [`scope`](/using-npm/npm-scope).
npm logout --scope=@myco
```bash
npm logout --scope=@myco
```
## SEE ALSO
### See Also
* npm-adduser(1)
* npm-registry(7)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* npm-whoami(1)
* [npm adduser](/cli-commands/npm-adduser)
* [npm registry](/using-npm/registry)
* [npm config](/cli-commands/npm-config)
* [npm whoami](/cli-commands/npm-whoami)
@@ -1,13 +1,22 @@
npm-ls(1) -- List installed packages
======================================
---
section: cli-commands
title: npm-ls
description: List installed packages
---
## SYNOPSIS
# npm-ls(1)
npm ls [[<@scope>/]<pkg> ...]
## List installed packages
aliases: list, la, ll
### Synopsis
## DESCRIPTION
```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, in a tree-structure.
@@ -17,9 +26,11 @@ 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.
@@ -32,30 +43,30 @@ dependencies, not the physical layout of your node_modules folder.
When run as `ll` or `la`, it shows extended information by default.
## CONFIGURATION
### Configuration
### json
#### json
* Default: false
* Type: Boolean
Show information in JSON format.
### long
#### long
* Default: false
* Type: Boolean
Show extended information.
### parseable
#### parseable
* Default: false
* Type: Boolean
Show parseable output instead of tree view.
### global
#### global
* Default: false
* Type: Boolean
@@ -63,27 +74,27 @@ Show parseable output instead of tree view.
List packages in the global install prefix instead of in the current
project.
### depth
#### depth
* Type: Int
Max display depth of the dependency tree.
### prod / production
#### prod / production
* Type: Boolean
* Default: false
Display only the dependency tree for packages in `dependencies`.
### dev / development
#### dev / development
* Type: Boolean
* Default: false
Display only the dependency tree for packages in `devDependencies`.
### only
#### only
* Type: String
@@ -91,21 +102,28 @@ When "dev" or "development", is an alias to `dev`.
When "prod" or "production", is an alias to `production`.
### link
#### link
* Type: Boolean
* Default: false
Display only dependencies which are linked
## SEE ALSO
#### unicode
* npm-config(1)
* npm-config(7)
* npmrc(5)
* npm-folders(5)
* npm-install(1)
* npm-link(1)
* npm-prune(1)
* npm-outdated(1)
* npm-update(1)
* Type: Boolean
* Default: true
Whether to represent the tree structure using unicode characters.
Set it to false in order to use all-ansi output.
### See Also
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm folders](/configuring-npm/folders)
* [npm install](/cli-commands/npm-install)
* [npm link](/cli-commands/npm-link)
* [npm prune](/cli-commands/npm-prune)
* [npm outdated](/cli-commands/npm-outdated)
* [npm update](/cli-commands/npm-update)
+65
View File
@@ -0,0 +1,65 @@
---
section: cli-commands
title: npm-org
description: Manage orgs
---
# npm-org(1)
## Manage orgs
### Synopsis
```bash
npm org set <orgname> <username> [developer | admin | owner]
npm org rm <orgname> <username>
npm org ls <orgname> [<username>]
```
### 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.
### See Also
* [Documentation on npm Orgs](https://docs.npmjs.com/orgs/)
@@ -1,11 +1,20 @@
npm-outdated(1) -- Check for outdated packages
==============================================
---
section: cli-commands
title: npm-outdated
description: Check for outdated packages
---
## SYNOPSIS
# npm-outdated(1)
npm outdated [[<@scope>/]<pkg> ...]
## Check for outdated packages
## DESCRIPTION
### Synopsis
```bash
npm outdated [[<@scope>/]<pkg> ...]
```
### Description
This command will check the registry to see if any (or, specific) installed
packages are currently outdated.
@@ -20,19 +29,20 @@ In the output:
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(1).
on how the package's developer manages the latest [dist-tag](npm-dist-tag).
* `location` is where in the dependency tree the package is located. Note that
`npm outdated` defaults to a depth of 0, so unless you override that, you'll
always be seeing only top-level dependencies that are outdated.
* `package type` (when using `--long` / `-l`) tells you whether this package is
a `dependency` or a `devDependency`. Packages not included in `package.json`
are always marked `dependencies`.
* `homepage` (when using `--long` / `-l`) is the `homepage` value contained in the package's `package.json`
* 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
glob 5.0.15 5.0.15 6.0.1 test-outdated-output
@@ -68,30 +78,30 @@ A few things to note:
* `once` is just plain out of date. Reinstalling `node_modules` from scratch or
running `npm update` will bring it up to spec.
## CONFIGURATION
### Configuration
### json
#### json
* Default: false
* Type: Boolean
Show information in JSON format.
### long
#### long
* Default: false
* Type: Boolean
Show extended information.
### parseable
#### parseable
* Default: false
* Type: Boolean
Show parseable output instead of tree view.
### global
#### global
* Default: false
* Type: Boolean
@@ -99,16 +109,16 @@ Show parseable output instead of tree view.
Check packages in the global install prefix instead of in the current
project.
### depth
#### depth
* Default: 0
* Type: Int
Max depth for checking dependency tree.
## SEE ALSO
### See Also
* npm-update(1)
* npm-dist-tag(1)
* npm-registry(7)
* npm-folders(5)
* [npm update](/cli-commands/npm-update)
* [npm dist-tag](/cli-commands/npm-dist-tag)
* [npm registry](/using-npm/registry)
* [npm folders](/configuring-npm/folders)
@@ -1,15 +1,23 @@
npm-owner(1) -- Manage package owners
=====================================
---
section: cli-commands
title: npm-owner
description: Manage package owners
---
## SYNOPSIS
# npm-owner(1)
## Manage package owners
npm owner add <user> [<@scope>/]<pkg>
npm owner rm <user> [<@scope>/]<pkg>
npm owner ls [<@scope>/]<pkg>
### Synopsis
aliases: author
```bash
npm owner add <user> [<@scope>/]<pkg>
npm owner rm <user> [<@scope>/]<pkg>
npm owner ls [<@scope>/]<pkg>
## DESCRIPTION
aliases: author
```
### Description
Manage ownership of published packages.
@@ -31,9 +39,9 @@ If you have two-factor authentication enabled with `auth-and-writes` then
you'll need to include an otp on the command line when changing ownership
with `--otp`.
## SEE ALSO
### See Also
* npm-publish(1)
* npm-registry(7)
* npm-adduser(1)
* npm-disputes(7)
* [npm publish](/cli-commands/npm-publish)
* [npm registry](/using-npm/registry)
* [npm adduser](/cli-commands/npm-adduser)
* [npm disputes](/using-npm/disputes)
@@ -1,11 +1,20 @@
npm-pack(1) -- Create a tarball from a package
==============================================
---
section: cli-commands
title: npm-pack
description: Create a tarball from a package
---
## SYNOPSIS
# npm-pack(1)
npm pack [[<@scope>/]<pkg>...] [--dry-run]
## Create a tarball from a package
## DESCRIPTION
### Synopsis
```bash
npm pack [[<@scope>/]<pkg>...] [--dry-run]
```
### Description
For anything that's installable (that is, a package folder, tarball,
tarball url, name@tag, name@version, name, or scoped name), this
@@ -21,10 +30,9 @@ If no arguments are supplied, then npm packs the current package folder.
The `--dry-run` argument will do everything that pack usually does without
actually packing anything. Reports on what would have gone into the tarball.
## SEE ALSO
### See Also
* npm-cache(1)
* npm-publish(1)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* [npm cache](/cli-commands/npm-cache)
* [npm publish](/cli-commands/npm-publish)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
+33
View File
@@ -0,0 +1,33 @@
---
section: cli-commands
title: npm-ping
description: Ping npm registry
---
# npm-ping(1)
## Ping npm registry
### Synopsis
```bash
npm ping [--registry <registry>]
```
### 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}
```
### See Also
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
+32
View File
@@ -0,0 +1,32 @@
---
section: cli-commands
title: npm-prefix
description: Display prefix
---
# npm-prefix(1)
## Display prefix
### Synopsis
```bash
npm prefix [-g]
```
### Description
Print the local prefix to standard out. 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`](/cli-commands/npm-config) for more detail.
### See Also
* [npm root](/cli-commands/npm-root)
* [npm bin](/cli-commands/npm-bin)
* [npm folders](/configuring-npm/folders)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
@@ -1,15 +1,23 @@
npm-profile(1) -- Change settings on your registry profile
==========================================================
---
section: cli-commands
title: npm-profile
description: Change settings on your registry profile
---
## SYNOPSIS
# npm-profile(1)
## Change settings on your registry profile
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
### Synopsis
## DESCRIPTION
```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
```
### Description
Change your profile information on the registry. This not be available if
you're using a non-npmjs registry.
@@ -18,7 +26,7 @@ you're using a non-npmjs registry.
Display all of the properties of your profile, or one or more specific
properties. It looks like:
```
```bash
+-----------------+---------------------------+
| name | example |
+-----------------+---------------------------+
@@ -41,7 +49,7 @@ you're using a non-npmjs registry.
| 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
@@ -63,12 +71,12 @@ you're using a non-npmjs registry.
* `npm profile disable-2fa`:
Disables two-factor authentication.
## DETAILS
### Details
All of the `npm profile` subcommands accept `--json` and `--parseable` and
will tailor their output based on those. Some of these commands may not be
available on non npmjs.com registries.
## SEE ALSO
### See Also
* npm-config(7)
* [npm config](/cli-commands/npm-config)
@@ -1,11 +1,19 @@
npm-prune(1) -- Remove extraneous packages
==========================================
---
section: cli-commands
title: npm-prune
description: Remove extraneous packages
---
## SYNOPSIS
# npm-prune(1)
## Remove extraneous packages
npm prune [[<@scope>/]<pkg>...] [--production] [--dry-run] [--json]
### Synopsis
## DESCRIPTION
```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
@@ -31,8 +39,8 @@ this command with the `--production` flag.
If you've disabled package-locks then extraneous modules will not be removed
and it's up to you to run `npm prune` from time-to-time to remove them.
## SEE ALSO
### See Also
* npm-uninstall(1)
* npm-folders(5)
* npm-ls(1)
* [npm uninstall](/cli-commands/npm-uninstall)
* [npm folders](/configuring-npm/folders)
* [npm ls](/cli-commands/npm-ls)
@@ -1,26 +1,31 @@
npm-publish(1) -- Publish a package
===================================
---
section: cli-commands
title: npm-publish
description: Publish a package
---
# npm-publish(1)
## SYNOPSIS
## Publish a package
npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>] [--otp otpcode] [--dry-run]
### 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
Publishes '.' if no argument supplied
Sets tag 'latest' if no --tag specified
```
## DESCRIPTION
### Description
Publishes a package to the registry so that it can be installed by name. All
files in the package directory are included if no local `.gitignore` or
`.npmignore` file exists. If both files exist and a file is ignored by
`.gitignore` but not by `.npmignore` then it will be included. See
`npm-developers(7)` for full details on what's included in the published
package, as well as details on how the package is built.
[`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.
By default npm will publish to the public registry. This can be overridden by
specifying a different default registry or using a `npm-scope(7)` in the name
(see `package.json(5)`).
specifying a different default registry or using a [`scope`](/using-npm/npm-scope) in the name (see [`package.json`](/configuring-npm/package-json)).
* `<folder>`:
A folder containing a package.json file
@@ -32,7 +37,7 @@ specifying a different default registry or using a `npm-scope(7)` in the name
* `[--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(1)` for
and `npm install` installs the `latest` tag. See [`npm-dist-tag`](npm-dist-tag) for
details about tags.
* `[--access <public|restricted>]`
@@ -47,30 +52,30 @@ specifying a different default registry or using a `npm-scope(7)` in the name
don't include this and you're running from a TTY then you'll be prompted.
* `[--dry-run]`
Does everything publish would do except actually publishing to the registry.
Reports the details of what would have been published.
As of `npm@6`, does everything publish would do except actually publishing
to the registry. Reports the details of what would have been published.
Fails if the package name and version combination already exists in
the specified registry.
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(1).
it is removed with [`npm unpublish`](/cli-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(1)`, which figures out the files to be
Similar to `--dry-run` see [`npm pack`](/cli-commands/npm-pack), which figures out the files to be
included and packs them into a tarball to be uploaded to the registry.
## SEE ALSO
### See Also
* npm-registry(7)
* npm-scope(7)
* npm-adduser(1)
* npm-owner(1)
* npm-deprecate(1)
* npm-dist-tag(1)
* npm-pack(1)
* npm-profile(1)
* [npm registry](/using-npm/registry)
* [npm scope](/using-npm/scope)
* [npm adduser](/cli-commands/npm-adduser)
* [npm owner](/cli-commands/npm-owner)
* [npm deprecate](/cli-commands/npm-deprecate)
* [npm dist-tag](/cli-commands/npm-dist-tag)
* [npm pack](/cli-commands/npm-pack)
* [npm profile](/cli-commands/npm-profile)
+26
View File
@@ -0,0 +1,26 @@
---
section: cli-commands
title: npm-rebuild
description: Rebuild a package
---
# npm-rebuild(1)
## Rebuild a package
### Synopsis
```bash
npm rebuild [[<@scope>/<name>]...]
alias: npm 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.
### See Also
* [npm build](/cli-commands/npm-build)
* [npm install](/cli-commands/npm-install)
@@ -1,27 +1,36 @@
npm-repo(1) -- Open package repository page in the browser
========================================================
---
section: cli-commands
title: npm-repo
description: Open package repository page in the browser
---
## SYNOPSIS
# npm-repo(1)
npm repo [<pkg>]
## Open package repository page in the browser
## DESCRIPTION
### Synopsis
```bash
npm repo [<pkg>]
```
### Description
This command tries to guess at the likely location of a package's
repository URL, and then tries to open it using the `--browser`
config param. If no package name is provided, it will search for
a `package.json` in the current folder and use the `name` property.
## CONFIGURATION
### Configuration
### browser
#### browser
* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
* Type: String
The browser that is called by the `npm repo` command to open websites.
## SEE ALSO
### See Also
* npm-docs(1)
* npm-config(1)
* [npm docs](/cli-commands/npm-docs)
* [npm config](/cli-commands/npm-config)
@@ -1,11 +1,20 @@
npm-restart(1) -- Restart a package
===================================
---
section: cli-commands
title: npm-restart
description: Restart a package
---
## SYNOPSIS
# npm-restart(1)
npm restart [-- <args>]
## Restart a package
## DESCRIPTION
### Synopsis
```bash
npm restart [-- <args>]
```
### Description
This restarts a package.
@@ -22,7 +31,7 @@ pre- and post- scripts, in the order given below:
8. poststart
9. postrestart
## NOTE
### Note
Note that the "restart" script is run **in addition to** the "stop"
and "start" scripts, not instead of them.
@@ -30,11 +39,11 @@ and "start" scripts, not instead of them.
This is the behavior as of `npm` major version 2. A change in this
behavior will be accompanied by an increase in major version number
## SEE ALSO
### See Also
* npm-run-script(1)
* npm-scripts(7)
* npm-test(1)
* npm-start(1)
* npm-stop(1)
* npm-restart(3)
* [npm run-script](/cli-commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [npm test](/cli-commands/npm-test)
* [npm start](/cli-commands/npm-start)
* [npm stop](/cli-commands/npm-stop)
* [npm restart](/cli-commands/npm-restart)
+26
View File
@@ -0,0 +1,26 @@
---
section: cli-commands
title: npm-root
description: Display npm root
---
# npm-root(1)
## Display npm root
### Synopsis
```bash
npm root [-g]
```
### Description
Print the effective `node_modules` folder to standard out.
### See Also
* [npm prefix](/cli-commands/npm-prefix)
* [npm bin](/cli-commands/npm-bin)
* [npm folders](/configuring-npm/folders)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
@@ -1,13 +1,22 @@
npm-run-script(1) -- Run arbitrary package scripts
==================================================
---
section: cli-commands
title: npm-run-script
description: Run arbitrary package scripts
---
## SYNOPSIS
# npm-run-script(1)
npm run-script <command> [--silent] [-- <args>...]
## Run arbitrary package scripts
alias: npm run
### Synopsis
## DESCRIPTION
```bash
npm run-script <command> [--silent] [-- <args>...]
alias: npm run
```
### 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
@@ -20,7 +29,9 @@ use custom arguments when executing scripts. The special option `--` is used by
[getopt](https://goo.gl/KxMmtG) to delimit the end of the options. npm will pass
all the arguments after the `--` directly to your script:
npm run test -- --grep="pattern"
```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.
@@ -36,11 +47,15 @@ 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:
"scripts": {"test": "tap test/\*.js"}
```bash
"scripts": {"test": "tap test/\*.js"}
```
instead of
"scripts": {"test": "node_modules/.bin/tap test/\*.js"}
```bash
"scripts": {"test": "node_modules/.bin/tap test/\*.js"}
```
to run your tests.
@@ -72,11 +87,11 @@ You can use the `--if-present` flag to avoid exiting with a non-zero exit code
when the script is undefined. This lets you run potentially undefined scripts
without breaking the execution chain.
## SEE ALSO
### See Also
* npm-scripts(7)
* npm-test(1)
* npm-start(1)
* npm-restart(1)
* npm-stop(1)
* npm-config(7)
* [npm scripts](/using-npm/scripts)
* [npm test](/cli-commands/npm-test)
* [npm start](/cli-commands/npm-start)
* [npm restart](/cli-commands/npm-restart)
* [npm stop](/cli-commands/npm-stop)
* [npm config](/cli-commands/npm-config)
@@ -1,13 +1,22 @@
npm-search(1) -- Search for packages
====================================
---
section: cli-commands
title: npm-search
description: Search for packages
---
## SYNOPSIS
# npm-search(1)
npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...]
## Search for packages
aliases: s, se, find
### Synopsis
## DESCRIPTION
```bash
npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...]
aliases: s, se, find
```
### Description
Search the registry for packages matching the search terms. `npm search`
performs a linear, incremental, lexically-ordered search through package
@@ -31,9 +40,9 @@ quoted in most shells.)
### A Note on caching
## CONFIGURATION
### Configuration
### description
#### description
* Default: true
* Type: Boolean
@@ -41,21 +50,21 @@ quoted in most shells.)
Used as `--no-description`, disables search matching in package descriptions and
suppresses display of that field in results.
### json
#### json
* Default: false
* Type: Boolean
Output search results as a JSON array.
### parseable
#### parseable
* Default: false
* Type: Boolean
Output search results as lines with tab-separated columns.
### long
#### long
* Default: false
* Type: Boolean
@@ -65,28 +74,28 @@ lines. When disabled (default) search results are truncated to fit
neatly on a single line. Modules with extremely long names will
fall on multiple lines.
### searchopts
#### searchopts
* Default: ""
* Type: String
Space-separated options that are always passed to search.
### searchexclude
#### searchexclude
* Default: ""
* Type: String
Space-separated options that limit the results from search.
### searchstaleness
#### searchstaleness
* Default: 900 (15 minutes)
* Type: Number
The age of the cache, in seconds, before another registry request is made.
### registry
#### registry
* Default: https://registry.npmjs.org/
* Type: url
@@ -97,10 +106,9 @@ repository, `npm search` will default to that registry when searching. Pass a
different registry url such as the default above in order to override this
setting.
## SEE ALSO
### See Also
* npm-registry(7)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* npm-view(1)
* [npm registry](/using-npm/registry)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm view](/cli-commands/npm-view)
+34
View File
@@ -0,0 +1,34 @@
---
section: cli-commands
title: npm-shrinkwrap
description: Lock down dependency versions for publication
---
# npm-shrinkwrap(1)
## Lock down dependency versions for publication
### Synopsis
```bash
npm shrinkwrap
```
### 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-locks](/configuring-npm/package-locks).
### See Also
* [npm install](/cli-commands/npm-install)
* [npm run-script](/cli-commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [package.js](/configuring-npm/package-json)
* [package-locks](/configuring-npm/package-locks)
* [package-lock.json](/configuring-npm/package-lock-json)
* [shrinkwrap.json](/configuring-npm/shrinkwrap-json)
* [npm ls](/cli-commands/npm-ls)
+31
View File
@@ -0,0 +1,31 @@
---
section: cli-commands
title: npm-star
description: Mark your favorite packages
---
# npm-star(1)
## Mark your favorite packages
### Synopsis
```bash
npm star [<pkg>...]
npm unstar [<pkg>...]
```
### Description
"Starring" a package means that you have some interest in it. It's
a vaguely positive way to show that you care.
"Unstarring" is the same thing, but in reverse.
It's a boolean thing. Starring repeatedly has no additional effect.
### See Also
* [npm view](/cli-commands/npm-view)
* [npm whoami](/cli-commands/npm-whoami)
* [npm adduser](/cli-commands/npm-adduser)
+29
View File
@@ -0,0 +1,29 @@
---
section: cli-commands
title: npm-stars
description: View packages marked as favorites
---
# npm-stars(1)
## View packages marked as favorites
### Synopsis
```bash
npm stars [<user>]
```
### 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.
### See Also
* [npm star](/cli-commands/npm-star)
* [npm view](/cli-commands/npm-view)
* [npm whoami](/cli-commands/npm-whoami)
* [npm adduser](/cli-commands/npm-adduser)
+32
View File
@@ -0,0 +1,32 @@
---
section: cli-commands
title: npm-start
description: Start a package
---
# npm-start(1)
## Start a package
### Synopsis
```bash
npm start [-- <args>]
```
### Description
This runs an arbitrary command specified in the package's `"start"` property of
its `"scripts"` object. If no `"start"` property is specified on the
`"scripts"` object, it will run `node server.js`.
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`](/cli-commands/npm-run-script) for more details.
### See Also
* [npm run-script](/cli-commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [npm test](/cli-commands/npm-test)
* [npm restart](/cli-commands/npm-restart)
* [npm stop](/cli-commands/npm-stop)
+27
View File
@@ -0,0 +1,27 @@
---
section: cli-commands
title: npm-stop
description: Stop a package
---
# npm-stop(1)
## Stop a package
### Synopsis
```bash
npm stop [-- <args>]
```
### Description
This runs a package's "stop" script, if one was provided.
### See Also
* [npm run-script](/cli-commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [npm test](/cli-commands/npm-test)
* [npm start](/cli-commands/npm-start)
* [npm restart](/cli-commands/npm-restart)
@@ -1,31 +1,37 @@
npm-team(1) -- Manage organization teams and team memberships
=============================================================
---
section: cli-commands
title: npm-team
description: Manage organization teams and team memberships
---
## SYNOPSIS
# npm-team(1)
npm team create <scope:team>
npm team destroy <scope:team>
## Manage organization teams and team memberships
npm team add <scope:team> <user>
npm team rm <scope:team> <user>
### Synopsis
npm team ls <scope>|<scope:team>
```bash
npm team create <scope:team>
npm team destroy <scope:team>
npm team edit <scope:team>
npm team add <scope:team> <user>
npm team rm <scope:team> <user>
## DESCRIPTION
npm team ls <scope>|<scope:team>
npm team edit <scope:team>
```
### 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
`developers` team on a `foo` organization, you must always refer to that team as
`foo:developers` in these commands.
when operating on them, separated by a colon (`:`). That is, if you have a `wombats` team in a `wisdom` organization, you must always refer to that team as `wisdom:wombats` in these commands.
* create / destroy:
Create a new team, or destroy an existing one.
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>
* add / rm:
Add a user to an existing team, or remove a user from a team they belong to.
@@ -37,7 +43,7 @@ when operating on them, separated by a colon (`:`). That is, if you have a
* edit:
Edit a current team.
## DETAILS
### Details
`npm team` always operates directly on the current registry, configurable from
the command line using `--registry=<registry url>`.
@@ -52,7 +58,7 @@ 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.
## SEE ALSO
### See Also
* npm-access(1)
* npm-registry(7)
* [npm access](/cli-commands/npm-access)
* [npm registry](/using-npm/registry)
+29
View File
@@ -0,0 +1,29 @@
---
section: cli-commands
title: npm-test
description: Test a package
---
# npm-test(1)
## Test a package
### Synopsis
```bash
npm test [-- <args>]
aliases: t, tst
```
### Description
This runs a package's "test" script, if one was provided.
### See Also
* [npm run-script](/cli-commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [npm start](/cli-commands/npm-start)
* [npm restart](/cli-commands/npm-restart)
* [npm stop](/cli-commands/npm-stop)
@@ -1,20 +1,29 @@
npm-token(1) -- Manage your authentication tokens
=================================================
---
section: cli-commands
title: npm-token
description: Manage your authentication tokens
---
## SYNOPSIS
# npm-token(1)
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>
## Manage your authentication tokens
## DESCRIPTION
### 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>
```
This list you list, create and revoke authentication tokens.
### 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 |
+--------+---------+------------+----------+----------------+
@@ -40,7 +49,7 @@ This list you list, create and revoke authentication tokens.
limit use of this token to. This will prompt you for your password, and, if you have
two-factor authentication enabled, an otp.
```
```bash
+----------------+--------------------------------------+
| token | a73c9572-f1b9-8983-983d-ba3ac3cc913d |
+----------------+--------------------------------------+
@@ -55,5 +64,5 @@ This list you list, create and revoke authentication tokens.
* `npm token revoke <token|id>`:
This removes an authentication token, making it immediately unusable. This can accept
both complete tokens (as you get back from `npm token create` and will
find in your `.npmrc`) and ids as seen in the `npm token list` output.
find in your `.npmrc`) and ids as seen in the `npm token list` output.
This will NOT accept the truncated token found in `npm token list` output.
+64
View File
@@ -0,0 +1,64 @@
---
section: cli-commands
title: npm-uninstall
description: Remove a package
---
# npm-uninstall(1)
## Remove a package
### Synopsis
```bash
npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|-D|--save-dev|-O|--save-optional|--no-save]
aliases: remove, rm, r, un, unlink
```
### Description
This uninstalls a package, completely removing everything npm installed
on its behalf.
Example:
```bash
npm uninstall sax
```
In global mode (ie, with `-g` or `--global` appended to the command),
it uninstalls the current package context as a global package.
`npm uninstall` takes 3 exclusive, optional flags which save or update
the package version in your main package.json:
* `-S, --save`: Package will be removed from your `dependencies`.
* `-D, --save-dev`: Package will be removed from your `devDependencies`.
* `-O, --save-optional`: Package will be removed from your `optionalDependencies`.
* `--no-save`: Package will not be removed from your `package.json` file.
Further, if you have an `npm-shrinkwrap.json` then it will be updated as
well.
Scope is optional and follows the usual rules for [`scope`](/using-npm/scope).
Examples:
```bash
npm uninstall sax --save
npm uninstall @myorg/privatepackage --save
npm uninstall node-tap --save-dev
npm uninstall dtrace-provider --save-optional
npm uninstall lodash --no-save
```
### See Also
* [npm prune](/cli-commands/npm-prune)
* [npm install](/cli-commands/npm-install)
* [npm folders](/configuring-npm/folders)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
@@ -1,11 +1,20 @@
npm-unpublish(1) -- Remove a package from the registry
======================================================
---
section: cli-commands
title: npm-unpublish
description: Remove a package from the registry
---
## SYNOPSIS
# npm-unpublish(1)
npm unpublish [<@scope>/]<pkg>[@<version>]
## Remove a package from the registry
## WARNING
### Synopsis
```bash
npm unpublish [<@scope>/]<pkg>[@<version>]
```
### Warning
**It is generally considered bad behavior to remove versions of a library
that others are depending on!**
@@ -15,7 +24,7 @@ instead, if your intent is to encourage users to upgrade.
There is plenty of room on the registry.
## DESCRIPTION
### Description
This removes a package version from the registry, deleting its
entry and removing the tarball.
@@ -34,12 +43,12 @@ only allowed with versions published in the last 72 hours. If you
are trying to unpublish a version published longer ago than that,
contact support@npmjs.com.
The scope is optional and follows the usual rules for `npm-scope(7)`.
The scope is optional and follows the usual rules for [`scope`](/using-npm/scope).
## SEE ALSO
### See Also
* npm-deprecate(1)
* npm-publish(1)
* npm-registry(7)
* npm-adduser(1)
* npm-owner(1)
* [npm deprecate](/cli-commands/npm-deprecate)
* [npm publish](/cli-commands/npm-publish)
* [npm registry](/using-npm/registry)
* [npm adduser](/cli-commands/npm-adduser)
* [npm owner](/cli-commands/npm-owner)
@@ -1,13 +1,22 @@
npm-update(1) -- Update a package
=================================
---
section: cli-commands
title: npm-update
description: Update a package
---
## SYNOPSIS
# npm-update(1)
npm update [-g] [<pkg>...]
## Update a package
aliases: up, upgrade
### Synopsis
## DESCRIPTION
```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.
@@ -26,11 +35,11 @@ As of `npm@2.6.1`, the `npm update` will only inspect top-level packages.
Prior versions of `npm` would also recursively inspect all dependencies.
To get the old behavior, use `npm --depth 9999 update`.
As of `npm@5.0.0`, the `npm update` will change `package.json` to save the
new version as the minimum required dependency. To get the old behavior,
As of `npm@5.0.0`, the `npm update` will change `package.json` to save the
new version as the minimum required dependency. To get the old behavior,
use `npm update --no-save`.
## EXAMPLES
### Example
IMPORTANT VERSION NOTE: these examples assume `npm@2.6.1` or later. For
older versions of `npm`, you must specify `--depth 0` to get the behavior
@@ -39,7 +48,7 @@ described below.
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": [
@@ -56,11 +65,11 @@ on dependencies, `dep1` (`dep2`, .. etc.). The published versions of `dep1` are
}
```
### Caret Dependencies
#### Caret Dependencies
If `app`'s `package.json` contains:
```
```json
"dependencies": {
"dep1": "^1.1.1"
}
@@ -69,11 +78,11 @@ If `app`'s `package.json` contains:
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
#### Tilde Dependencies
However, if `app`'s `package.json` contains:
```
```json
"dependencies": {
"dep1": "~1.1.1"
}
@@ -84,11 +93,11 @@ tag points to `1.2.2`, this version does not satisfy `~1.1.1`, which is equivale
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
#### 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"
}
@@ -99,7 +108,7 @@ versions which satisfy `^0.2.0`.
If the dependence were on `^0.4.0`:
```
```json
"dependencies": {
"dep1": "^0.4.0"
}
@@ -109,7 +118,7 @@ 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
#### 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
@@ -119,11 +128,11 @@ NOTE: If a package has been upgraded to a version newer than `latest`, it will
be _downgraded_.
## SEE ALSO
### See Also
* npm-install(1)
* npm-outdated(1)
* npm-shrinkwrap(1)
* npm-registry(7)
* npm-folders(5)
* npm-ls(1)
* [npm install](/cli-commands/npm-install)
* [npm outdated](/cli-commands/npm-outdated)
* [npm shrinkwrap](/cli-commands/npm-shrinkwrap)
* [npm registry](/using-npm/registry)
* [npm folders](/configuring-npm/folders)
* [npm ls](/cli-commands/npm-ls)
@@ -1,15 +1,24 @@
npm-version(1) -- Bump a package version
========================================
---
section: cli-commands
title: npm-version
description: Bump a package version
---
## SYNOPSIS
# npm-version(1)
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
## Bump a package version
'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
### Synopsis
## DESCRIPTION
```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
```
### 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`.
@@ -31,20 +40,24 @@ 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:
npm version patch -m "Upgrade to %s for reasons"
```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:
$ npm config set sign-git-tag true
$ npm version patch
```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
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:
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`.
@@ -66,41 +79,43 @@ The exact order of execution is as follows:
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.
## CONFIGURATION
### Configuration
### allow-same-version
#### allow-same-version
* Default: false
* Type: Boolean
Prevents throwing an error when `npm version` is used to set the new version
Prevents throwing an error when `npm version` is used to set the new version
to the same value as the current version.
### git-tag-version
#### git-tag-version
* Default: true
* Type: Boolean
Commit and tag the version change.
### commit-hooks
#### commit-hooks
* Default: true
* Type: Boolean
Run git commit hooks when committing the version change.
### sign-git-tag
#### sign-git-tag
* Default: false
* Type: Boolean
@@ -109,11 +124,11 @@ Pass the `-s` flag to git to sign the tag.
Note that you must have a default GPG key set up in your git config for this to work properly.
## SEE ALSO
### See Also
* npm-init(1)
* npm-run-script(1)
* npm-scripts(7)
* package.json(5)
* semver(7)
* config(7)
* [npm init](/cli-commands/npm-init)
* [npm run-script](/cli-commands/npm-run-script)
* [npm scripts](/using-npm/scripts)
* [package.json](/configuring-npm/package-json)
* [semver](/using-npm/semver)
* [config](/using-npm/config)
@@ -1,13 +1,22 @@
npm-view(1) -- View registry info
=================================
---
section: cli-commands
title: npm-view
description: View registry info
---
## SYNOPSIS
# npm-view(1)
npm view [<@scope>/]<name>[@<version>] [<field>[.<subfield>]...]
## View registry info
aliases: info, show, v
### Synopsis
## DESCRIPTION
```bash
npm view [<@scope>/]<name>[@<version>] [<field>[.<subfield>]...]
aliases: info, show, v
```
### Description
This command shows data about a package and prints it to the stream
referenced by the `outfd` config, which defaults to stdout.
@@ -15,7 +24,9 @@ referenced by the `outfd` config, which defaults to stdout.
To show the package registry entry for the `connect` package, you can do
this:
npm view connect
```bash
npm view connect
```
The default version is "latest" if unspecified.
@@ -23,56 +34,74 @@ 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:
npm view ronn@0.3.5 dependencies
```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 could
do this:
npm view npm repository.url
```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 can do this:
npm view opts@$(npm view ronn dependencies.opts)
```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" project, you can do this:
npm view express contributors.email
```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 do this:
npm view express contributors[0].email
```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:
npm view express contributors.name contributors.email
```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(5)` for more on this.)
the shortened string format. (See [`package.json`](/configuring-npm/package.json) for more on this.)
npm view npm contributors
```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:
npm view yui3@'>0.5.4' dependencies.jsdom
```bash
npm view yui3@'>0.5.4' dependencies.jsdom
```
To show the `connect` package version history, you can do
this:
npm view connect versions
```bash
npm view connect versions
```
## OUTPUT
### Output
If only a single string field for a single version is output, then it
will not be colorized or quoted, so as to enable piping the output to
@@ -86,11 +115,10 @@ will be prefixed with the version it applies to.
If multiple fields are requested, than each of them are prefixed with
the field name.
## SEE ALSO
### See Also
* npm-search(1)
* npm-registry(7)
* npm-config(1)
* npm-config(7)
* npmrc(5)
* npm-docs(1)
* [npm search](/cli-commands/npm-search)
* [npm registry](/using-npm/registry)
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm docs](/cli-commands/npm-docs)
+24
View File
@@ -0,0 +1,24 @@
---
section: cli-commands
title: npm-whoami
description: Display npm username
---
# npm-whoami(1)
## Display npm username
### Synopsis
```bash
npm whoami [--registry <registry>]
```
### Description
Print the `username` config to standard output.
### See Also
* [npm config](/cli-commands/npm-config)
* [npmrc](/configuring-npm/npmrc)
* [npm adduser](/cli-commands/npm-adduser)
Loaded 100 of 2542 files, more files were not shown because too many files have changed in this diff. Show more