From ace4fe566fc3af4876c7458f983feeb5eae3df26 Mon Sep 17 00:00:00 2001
From: Myles Borins
Check out the docs,
+Check out the docs.
You can use the npm help
command to read any of them.
If you're a developer, and you want to use npm to publish your program, -you should read this
+you should read this.When you find issues, please report them:
npm publish --access=public
, or set their access as pu
If you have two-factor authentication enabled then you'll have to pass in an
+otp with --otp
when making access changes.
If your account is not paid, then attempts to publish scoped packages will fail
with an HTTP 402 status code (logically enough), unless you use
--access=public
.
package.json
in the current folder and use the name
npm config set <key> <value> [-g|--global]
npm config get <key>
npm config delete <key>
-npm config list [-l]
+npm config list [-l] [--json]
npm config edit
npm get <key>
npm set <key> <value> [-g|--global]
@@ -39,7 +39,8 @@ of the user and global npmrc files.
Echo the config value to stdout.
npm config list
-
Show all the config settings. Use -l
to also show defaults.
Show all the config settings. Use -l
to also show defaults. Use --json
+to show the settings in json format.
npm config delete key
Deletes the key from all configuration files.
@@ -67,5 +68,5 @@ global config.add:
Tags the specified version of the package with the specified tag, or the
---tag
config if not specified.
--tag
config if not specified. 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
.
rm: Clear a tag that is no longer in use from the package.
@@ -86,5 +88,5 @@ begin with a number or the letterv
.
name
property.
npm cache clean
and reset the cache.
"notepad"
on Windows.npm install
.
npm ls promzard
in npm's source tree will show:
-npm@5.3.0 /path/to/npm
+npm@5.5.1 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
It will print out extraneous, missing, and invalid packages.
@@ -110,5 +110,5 @@ project.
-
+
diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html
index b25aaec3d3..fb3e111220 100644
--- a/deps/npm/html/doc/cli/npm-outdated.html
+++ b/deps/npm/html/doc/cli/npm-outdated.html
@@ -116,5 +116,5 @@ project.
-
+
diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html
index 7b9980c67c..707ea4bf9d 100644
--- a/deps/npm/html/doc/cli/npm-owner.html
+++ b/deps/npm/html/doc/cli/npm-owner.html
@@ -32,6 +32,9 @@ privileges.
Note that there is only one level of access. Either you can modify a package,
or you can't. Future versions may contain more fine-grained access levels, but
that is not implemented at this time.
+If you have two-factor authentication enabled with auth-and-writes
then
+you'll need to include an otp on the command line when changing ownership
+with --otp
.
SEE ALSO
- npm-publish(1)
@@ -51,5 +54,5 @@ that is not implemented at this time.
-
+
diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html
index 2d66916d8b..73319eb3bf 100644
--- a/deps/npm/html/doc/cli/npm-pack.html
+++ b/deps/npm/html/doc/cli/npm-pack.html
@@ -41,5 +41,5 @@ overwritten the second time.
-
+
diff --git a/deps/npm/html/doc/cli/npm-ping.html b/deps/npm/html/doc/cli/npm-ping.html
index 68a5e85749..9eb3be589d 100644
--- a/deps/npm/html/doc/cli/npm-ping.html
+++ b/deps/npm/html/doc/cli/npm-ping.html
@@ -13,8 +13,12 @@
SYNOPSIS
npm ping [--registry <registry>]
DESCRIPTION
-Ping the configured or given npm registry and verify authentication.
-SEE ALSO
+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)
@@ -32,5 +36,5 @@
-
+
diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html
index 2560340d5e..09bd66affe 100644
--- a/deps/npm/html/doc/cli/npm-prefix.html
+++ b/deps/npm/html/doc/cli/npm-prefix.html
@@ -38,5 +38,5 @@ to contain a package.json file unless -g
is also specified.
-
+
diff --git a/deps/npm/html/doc/cli/npm-profile.html b/deps/npm/html/doc/cli/npm-profile.html
new file mode 100644
index 0000000000..106695ee84
--- /dev/null
+++ b/deps/npm/html/doc/cli/npm-profile.html
@@ -0,0 +1,93 @@
+
+
+ npm-profile
+
+
+
+
+
+
+
+
+npm-profile
Change settings on your registry profile
+SYNOPSIS
+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.
+
+npm profile get [<property>]
:
+Display all of the properties of your profile, or one or more specific
+properties. It looks like:
+
++-----------------+---------------------------+
+| name | example |
++-----------------+---------------------------+
+| email | me@example.com (verified) |
++-----------------+---------------------------+
+| two factor auth | auth-and-writes |
++-----------------+---------------------------+
+| fullname | Example User |
++-----------------+---------------------------+
+| homepage | |
++-----------------+---------------------------+
+| freenode | |
++-----------------+---------------------------+
+| twitter | |
++-----------------+---------------------------+
+| github | |
++-----------------+---------------------------+
+| created | 2015-02-26T01:38:35.892Z |
++-----------------+---------------------------+
+| updated | 2017-10-02T21:29:45.922Z |
++-----------------+---------------------------+
+
+npm profile set <property> <value>
:
+Set the value of a profile property. You can set the following properties this way:
+ email, fullname, homepage, freenode, twitter, github
+
+npm profile set password
:
+Change your password. This is interactive, you'll be prompted for your
+current password and a new password. You'll also be prompted for an OTP
+if you have two-factor authentication enabled.
+
+npm profile enable-2fa [auth-and-writes|auth-only]
:
+Enables two-factor authentication. Defaults to auth-and-writes
mode. Modes are:
+
+auth-only
: Require an OTP when logging in or making changes to your
+account's authentication. The OTP will be required on both the website
+and the command line.
+auth-and-writes
: Requires an OTP at all the times auth-only
does, and also requires one when
+publishing a module, setting the latest
dist-tag, or changing access
+via npm access
and npm owner
.
+
+
+npm profile disable-2fa
:
+Disables two-factor authentication.
+
+
+DETAILS
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html
index a7073a9e02..0e03cd52e3 100644
--- a/deps/npm/html/doc/cli/npm-prune.html
+++ b/deps/npm/html/doc/cli/npm-prune.html
@@ -40,5 +40,5 @@ negate NODE_ENV
being set to production
.
-
+
diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html
index 2d3b1d1db8..14bac448e3 100644
--- a/deps/npm/html/doc/cli/npm-publish.html
+++ b/deps/npm/html/doc/cli/npm-publish.html
@@ -11,7 +11,7 @@
npm-publish
Publish a package
SYNOPSIS
-
npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>]
+npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>] [--otp otpcode]
Publishes '.' if no argument supplied
Sets tag 'latest' if no --tag specified
@@ -45,6 +45,11 @@ restricted. Only applies to scoped packages, which default to restricted
If you don't have a paid account, you must publish with --access public
to publish scoped packages.
+[--otp <otpcode>]
+If you have two-factor authentication enabled in auth-and-writes
mode
+then you can provide a code from your authenticator with this. If you
+don't include this and you're running from a TTY then you'll be prompted.
+
Fails if the package name and version combination already exists in
the specified registry.
@@ -66,6 +71,7 @@ packs them into a tarball to be uploaded to the registry.
npm-deprecate(1)
npm-dist-tag(1)
npm-pack(1)
+npm-profile(1)
@@ -79,5 +85,5 @@ packs them into a tarball to be uploaded to the registry.
-
+
diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html
index bc8ee78771..021ecf7f55 100644
--- a/deps/npm/html/doc/cli/npm-rebuild.html
+++ b/deps/npm/html/doc/cli/npm-rebuild.html
@@ -35,5 +35,5 @@ the new binary.
-
+
diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html
index e2ef9ee958..fdf446784b 100644
--- a/deps/npm/html/doc/cli/npm-repo.html
+++ b/deps/npm/html/doc/cli/npm-repo.html
@@ -41,5 +41,5 @@ a package.json
in the current folder and use the name
-
+
diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html
index a6648c5716..01f57667e4 100644
--- a/deps/npm/html/doc/cli/npm-restart.html
+++ b/deps/npm/html/doc/cli/npm-restart.html
@@ -53,5 +53,5 @@ behavior will be accompanied by an increase in major version number
-
+
diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html
index 94b59687ab..a513f8c7a4 100644
--- a/deps/npm/html/doc/cli/npm-root.html
+++ b/deps/npm/html/doc/cli/npm-root.html
@@ -35,5 +35,5 @@
-
+
diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html
index 037ad1a64c..72b946b21e 100644
--- a/deps/npm/html/doc/cli/npm-run-script.html
+++ b/deps/npm/html/doc/cli/npm-run-script.html
@@ -29,7 +29,7 @@ all the arguments after the --
directly to your script:
and not to any pre or post script.
The env
script is a special built-in command that can be used to list
environment variables that will be available to the script at runtime. If an
-"env" command is defined in your package it will take precedence over the
+"env" command is defined in your package, it will take precedence over the
built-in.
In addition to the shell's pre-existing PATH
, npm run
adds
node_modules/.bin
to the PATH
provided to scripts. Any binaries provided by
@@ -37,7 +37,14 @@ 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"}
-
instead of "scripts": {"test": "node_modules/.bin/tap test/\*.js"}
to run your tests.
+
instead of
+"scripts": {"test": "node_modules/.bin/tap test/\*.js"}
+
to run your tests.
+Scripts are run from the root of the module, regardless of what your current
+working directory is when you call npm run
. If you want your script to
+use different behavior based on what subdirectory you're in, you can use the
+INIT_CWD
environment variable, which holds the full path you were in when
+you ran npm run
.
npm run
sets the NODE
environment variable to the node
executable with
which npm
is executed. Also, if the --scripts-prepend-node-path
is passed,
the directory within which node
resides is added to the
@@ -67,5 +74,5 @@ you will be given a warning to run npm install
, just in case you
-
+
diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html
index e136612e96..413da85416 100644
--- a/deps/npm/html/doc/cli/npm-search.html
+++ b/deps/npm/html/doc/cli/npm-search.html
@@ -109,5 +109,5 @@ setting.
-
+
diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html
index c68795a33f..a8d3d7e5e9 100644
--- a/deps/npm/html/doc/cli/npm-shrinkwrap.html
+++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html
@@ -41,5 +41,5 @@ of package locks in npm, see npm-packa
-
+
diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html
index 7f16258c09..dd57a76118 100644
--- a/deps/npm/html/doc/cli/npm-star.html
+++ b/deps/npm/html/doc/cli/npm-star.html
@@ -36,5 +36,5 @@ a vaguely positive way to show that you care.
-
+
diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html
index cac0603d22..060faeed4b 100644
--- a/deps/npm/html/doc/cli/npm-stars.html
+++ b/deps/npm/html/doc/cli/npm-stars.html
@@ -36,5 +36,5 @@ you will most certainly enjoy this command.
-
+
diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html
index 0322627378..6cd9df603b 100644
--- a/deps/npm/html/doc/cli/npm-start.html
+++ b/deps/npm/html/doc/cli/npm-start.html
@@ -39,5 +39,5 @@ more details.
-
+
diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html
index ac2e46f74a..7e795163b8 100644
--- a/deps/npm/html/doc/cli/npm-stop.html
+++ b/deps/npm/html/doc/cli/npm-stop.html
@@ -34,5 +34,5 @@
-
+
diff --git a/deps/npm/html/doc/cli/npm-team.html b/deps/npm/html/doc/cli/npm-team.html
index a80d86c3ad..a24bc6558a 100644
--- a/deps/npm/html/doc/cli/npm-team.html
+++ b/deps/npm/html/doc/cli/npm-team.html
@@ -67,5 +67,5 @@ use the npm access
command to grant or revoke the appropriate permi
-
+
diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html
index ecbbc74b9a..1aaa8687c1 100644
--- a/deps/npm/html/doc/cli/npm-test.html
+++ b/deps/npm/html/doc/cli/npm-test.html
@@ -36,5 +36,5 @@
-
+
diff --git a/deps/npm/html/doc/cli/npm-token.html b/deps/npm/html/doc/cli/npm-token.html
new file mode 100644
index 0000000000..a2e4ce1814
--- /dev/null
+++ b/deps/npm/html/doc/cli/npm-token.html
@@ -0,0 +1,76 @@
+
+
+ npm-token
+
+
+
+
+
+
+
+
+npm-token
Manage your authentication tokens
+SYNOPSIS
+npm token list [--json|--parseable]
+npm token create [--read-only] [--cidr=1.1.1.1/24,2.2.2.2/16]
+npm token delete <id|token>
+
DESCRIPTION
+This list you list, create and delete 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
.
++--------+---------+------------+----------+----------------+
+| id | token | created | read-only | CIDR whitelist |
++--------+---------+------------+----------+----------------+
+| 7f3134 | 1fa9ba… | 2017-10-02 | yes | |
++--------+---------+------------+----------+----------------+
+| c03241 | af7aef… | 2017-10-02 | no | 192.168.0.1/24 |
++--------+---------+------------+----------+----------------+
+| e0cf92 | 3a436a… | 2017-10-02 | no | |
++--------+---------+------------+----------+----------------+
+| 63eb9d | 74ef35… | 2017-09-28 | no | |
++--------+---------+------------+----------+----------------+
+| 2daaa8 | cbad5f… | 2017-09-26 | no | |
++--------+---------+------------+----------+----------------+
+| 68c2fe | 127e51… | 2017-09-23 | no | |
++--------+---------+------------+----------+----------------+
+| 6334e1 | 1dadd1… | 2017-09-23 | no | |
++--------+---------+------------+----------+----------------+
+
+npm token create [--read-only] [--cidr=<cidr-ranges>]
:
+Create a new authentication token. It can be --read-only
or accept a list of
+CIDR ranges to
+limit use of this token to. This will prompt you for your password, and, if you have
+two-factor authentication enabled, an otp.
+
+
++----------------+--------------------------------------+
+| token | a73c9572-f1b9-8983-983d-ba3ac3cc913d |
++----------------+--------------------------------------+
+| cidr_whitelist | |
++----------------+--------------------------------------+
+| readonly | false |
++----------------+--------------------------------------+
+| created | 2017-10-02T07:52:24.838Z |
++----------------+--------------------------------------+
+
+npm token delete <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.
+This will NOT accept the truncated token found in npm token list
output.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html
index 5e60ae3038..454f575ce3 100644
--- a/deps/npm/html/doc/cli/npm-uninstall.html
+++ b/deps/npm/html/doc/cli/npm-uninstall.html
@@ -63,5 +63,5 @@ npm uninstall lodash --no-save
-
+
diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html
index 220efe599a..e278eb29ef 100644
--- a/deps/npm/html/doc/cli/npm-unpublish.html
+++ b/deps/npm/html/doc/cli/npm-unpublish.html
@@ -51,5 +51,5 @@ contact support@npmjs.com.
-
+
diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html
index 471db2baba..c2ee6bfe10 100644
--- a/deps/npm/html/doc/cli/npm-update.html
+++ b/deps/npm/html/doc/cli/npm-update.html
@@ -118,5 +118,5 @@ be downgraded.
-
+
diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html
index e821d71fc6..5e1d389d77 100644
--- a/deps/npm/html/doc/cli/npm-version.html
+++ b/deps/npm/html/doc/cli/npm-version.html
@@ -86,6 +86,12 @@ to the same value as the current version.
Type: Boolean
Commit and tag the version change.
+commit-hooks
+
+- Default: true
+- Type: Boolean
+
+Run git commit hooks when committing the version change.
sign-git-tag
- Default: false
@@ -114,5 +120,5 @@ to the same value as the current version.
-
+
diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html
index 9d30ff9031..691ea8ee43 100644
--- a/deps/npm/html/doc/cli/npm-view.html
+++ b/deps/npm/html/doc/cli/npm-view.html
@@ -86,5 +86,5 @@ the field name.
-
+
diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html
index 9c8b91e4d5..f4190a3682 100644
--- a/deps/npm/html/doc/cli/npm-whoami.html
+++ b/deps/npm/html/doc/cli/npm-whoami.html
@@ -33,5 +33,5 @@
-
+
diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html
index 06414eebab..c6a68d7652 100644
--- a/deps/npm/html/doc/cli/npm.html
+++ b/deps/npm/html/doc/cli/npm.html
@@ -13,7 +13,7 @@
SYNOPSIS
npm <command> [args]
VERSION
-5.3.0
+5.5.1
DESCRIPTION
npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
@@ -126,7 +126,7 @@ will no doubt tell you to put the output in a gist or email.
Isaac Z. Schlueter ::
isaacs ::
@izs ::
-i@izs.me
+i@izs.me
SEE ALSO
- npm-help(1)
@@ -150,5 +150,5 @@ will no doubt tell you to put the output in a gist or email.
-
+
diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html
index 915750606c..295df46b52 100644
--- a/deps/npm/html/doc/files/npm-folders.html
+++ b/deps/npm/html/doc/files/npm-folders.html
@@ -181,5 +181,5 @@ cannot be found elsewhere. See packa
-
+
diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html
index 915750606c..295df46b52 100644
--- a/deps/npm/html/doc/files/npm-global.html
+++ b/deps/npm/html/doc/files/npm-global.html
@@ -181,5 +181,5 @@ cannot be found elsewhere. See packa
-
+
diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html
index 6374cc5a7d..6bf69dca1d 100644
--- a/deps/npm/html/doc/files/npm-json.html
+++ b/deps/npm/html/doc/files/npm-json.html
@@ -129,13 +129,21 @@ is an object with a "name" field and optionally "url" and &q
Both email and url are optional either way.
npm also sets a top-level "maintainers" field with your npm user info.
files
-The "files" field is an array of files to include in your project. If
-you name a folder in the array, then it will also include the files
-inside that folder. (Unless they would be ignored by another rule.)
-You can also provide a ".npmignore" file in the root of your package or
-in subdirectories, which will keep files from being included, even
-if they would be picked up by the files array. The .npmignore
file
-works just like a .gitignore
.
+The optional "files" field is an array of file patterns that describes
+the entries to be included when your package is installed as a
+dependency. If the files array is omitted, everything except
+automatically-excluded files will be included in your publish. If you
+name a folder in the array, then it will also include the files inside
+that folder (unless they would be ignored by another rule in this
+section.).
+You can also provide a .npmignore
file in the root of your package or
+in subdirectories, which will keep files from being included. At the
+root of your package it will not override the "files" field, but in
+subdirectories it will. The .npmignore
file works just like a
+.gitignore
. If there is a .gitignore
file, and .npmignore
is
+missing, .gitignore
's contents will be used instead.
+Files included with the "package.json#files" field cannot be excluded
+through .npmignore
or .gitignore
.
Certain files are always included, regardless of settings:
package.json
@@ -593,5 +601,5 @@ ignored.
-
+
diff --git a/deps/npm/html/doc/files/npm-package-locks.html b/deps/npm/html/doc/files/npm-package-locks.html
index 21029d3a9d..91b18778b9 100644
--- a/deps/npm/html/doc/files/npm-package-locks.html
+++ b/deps/npm/html/doc/files/npm-package-locks.html
@@ -87,7 +87,7 @@ which will look something like this:
}
}
This file describes an exact, and more importantly reproducible
-node_modules
tree. Once it's present, and future installation will base its
+node_modules
tree. Once it's present, any future installation will base its
work off this file, instead of recalculating dependency versions off
package.json(5).
The presence of a package lock changes the installation behavior such that:
@@ -145,4 +145,4 @@ if any transitive dependencies were updated, hoisted, etc.Both email and url are optional either way.
npm also sets a top-level "maintainers" field with your npm user info.
The "files" field is an array of files to include in your project. If -you name a folder in the array, then it will also include the files -inside that folder. (Unless they would be ignored by another rule.)
-You can also provide a ".npmignore" file in the root of your package or
-in subdirectories, which will keep files from being included, even
-if they would be picked up by the files array. The .npmignore
file
-works just like a .gitignore
.
The optional "files" field is an array of file patterns that describes +the entries to be included when your package is installed as a +dependency. If the files array is omitted, everything except +automatically-excluded files will be included in your publish. If you +name a folder in the array, then it will also include the files inside +that folder (unless they would be ignored by another rule in this +section.).
+You can also provide a .npmignore
file in the root of your package or
+in subdirectories, which will keep files from being included. At the
+root of your package it will not override the "files" field, but in
+subdirectories it will. The .npmignore
file works just like a
+.gitignore
. If there is a .gitignore
file, and .npmignore
is
+missing, .gitignore
's contents will be used instead.
Files included with the "package.json#files" field cannot be excluded
+through .npmignore
or .gitignore
.
Certain files are always included, regardless of settings:
package.json
Ping npm registry
Display prefix
+Change settings on your registry profile
Remove extraneous packages
Manage organization teams and team memberships
Test a package
+Manage your authentication tokens
Remove a package
Notice that you need to use underscores instead of dashes, so --allow-same-version
+would become npm_config_allow_same_version=true
.
The four relevant files are:
The Certificate Authority signing certificate that is trusted for SSL -connections to the registry. Values should be in PEM format with newlines +connections to the registry. Values should be in PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string "\n". For example:
ca="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
Set to null
to only allow "known" registrars, or to a specific CA cert
@@ -221,9 +223,15 @@ well as for the CA information to be stored in a file on disk.
A client certificate to pass when accessing the registry. Values should be in -PEM format with newlines replaced by the string "\n". For example:
+PEM format (Windows calls it "Base-64 encoded X.509 (.CER)") with newlines replaced by the string "\n". For example:cert="-----BEGIN CERTIFICATE-----\nXXXX\nXXXX\n-----END CERTIFICATE-----"
It is not the path to a certificate file (and there is no "certfile" option).
+null
This is a list of CIDR address to be used when configuring limited access tokens with the npm token create
command.
Tag the commit when using the npm version
command.
true
Run git commit hooks when using the npm version
command.
What level of logs to report. On failure, all logs are written to
npm-debug.log
in the current working directory.
Any logs of a higher level than the setting are shown. -The default is "warn", which shows warn and error output.
+Any logs of a higher level than the setting are shown. The default is "notice".
Attempt to install packages in the optionalDependencies
object. Note
that if these packages fail to install, the overall installation
process is not aborted.
This is a one-time password from a two-factor authenticator. It's needed
+when publishing or changing package permissions with npm access
.
npm install
without any arguments.
When set to true
, npm will display a progress bar during time intensive
operations, if process.stderr
is a TTY.
Set to false
to suppress the progress bar.
Whether or not to include proprietary extended attributes in the -tarballs created by npm.
-Unless you are expecting to unpack package tarballs with something other -than npm -- particularly a very outdated tar implementation -- leave -this as true.
A proxy to use for outgoing http requests. If the HTTP_PROXY
or
http_proxy
environment variables are set, proxy settings will be
honored by the underlying request
library.
This is used to mark a token as unable to publish when configuring limited access tokens with the npm token create
command.
node_modules
to .npmignore
.
CHANGELOG
(and its variants)LICENSE
/ LICENCE
If, given the structure of your project, you find .npmignore
to be a
+maintenance headache, you might instead try populating the files
+property of package.json
, which is an array of file or directory names
+that should be included in your package. Sometimes a whitelist is easier
+to manage than a blacklist.
.npmignore
or files
config worksIf you want to double check that your package will include only the files
+you intend it to when published, you can run the npm pack
command locally
+which will generate a tarball in the working directory, the same way it
+does for publishing.
npm link
is designed to install a development package and see the
changes in real time without having to keep re-installing it. (You do
@@ -194,5 +204,5 @@ from a fresh checkout.
npm owner ls <pkgname>
Don't squat on package names. Publish code or move out of the way.
@@ -55,12 +55,12 @@ because Yusuf'sfoo
is in the way.
add alice foo
to add Alice as an owner of the
foo package.If you see bad behavior like this, please report it to abuse@npmjs.com right +
If you see bad behavior like this, please report it to abuse@npmjs.com right away. You are never expected to resolve abusive behavior on your own. We are here to help.
If you think another npm publisher is infringing your trademark, such as by -using a confusingly similar package name, email abuse@npmjs.com with a link to +using a confusingly similar package name, email abuse@npmjs.com with a link to the package or user account on https://npmjs.com. Attach a copy of your trademark registration certificate.
If we see that the package's publisher is intentionally misleading others by @@ -134,5 +134,5 @@ License.
Ping npm registry
Display prefix
+Change settings on your registry profile
Remove extraneous packages
Manage organization teams and team memberships
Test a package
+Manage your authentication tokens
Remove a package
How npm handles the "scripts" field
npm supports the "scripts" property of the package.json script, for the +
npm supports the "scripts" property of the package.json file, for the following scripts:
The semantic versioner for npm
+npm install --save semver
+`
+
$ npm install semver
-$ node
-var semver = require('semver')
+As a node module:
+const semver = require('semver')
semver.valid('1.2.3') // '1.2.3'
semver.valid('a.b.c') // null
@@ -21,10 +24,11 @@ semver.clean(' =v1.2.3 ') // '1.2.3'
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
semver.gt('1.2.3', '9.8.7') // false
semver.lt('1.2.3', '9.8.7') // true
-
As a command-line utility:
+
+As a command-line utility:
$ semver -h
-SemVer 5.1.0
+SemVer 5.3.0
A JavaScript implementation of the http://semver.org/ specification
Copyright Isaac Z. Schlueter
@@ -113,15 +117,15 @@ similar risk on the next set of prerelease versions.
Prerelease Identifiers
The method .inc
takes an additional identifier
string argument that
will append the value of the string as a prerelease identifier:
-> semver.inc('1.2.3', 'prerelease', 'beta')
-'1.2.4-beta.0'
+semver.inc('1.2.3', 'prerelease', 'beta')
+// '1.2.4-beta.0'
command-line example:
-$ semver 1.2.3 -i prerelease --preid beta
+$ semver 1.2.3 -i prerelease --preid beta
1.2.4-beta.0
Which then can be used to increment further:
-$ semver 1.2.4-beta.0 -i prerelease
+$ semver 1.2.4-beta.0 -i prerelease
1.2.4-beta.1
Advanced Range Syntax
@@ -263,6 +267,8 @@ if none exist. Example: prerelease('1.2.3-alpha.1') -> ['al
major(v)
: Return the major version number.
minor(v)
: Return the minor version number.
patch(v)
: Return the patch version number.
+intersects(r1, r2, loose)
: Return true if the two supplied ranges
+or comparators intersect.
Comparison
@@ -286,6 +292,10 @@ in descending order when passed to Array.sort()
.
(major
, premajor
, minor
, preminor
, patch
, prepatch
, or prerelease
),
or null if the versions are the same.
+Comparators
+
+intersects(comparator)
: Return true if the comparators intersect
+
Ranges
validRange(range)
: Return the valid range or null if it's not valid
@@ -303,6 +313,7 @@ versions possible in the range.
the bounds of the range in either the high or low direction. The
hilo
argument must be either the string '>'
or '<'
. (This is
the function called by gtr
and ltr
.)
+intersects(range)
: Return true if any of the ranges comparators intersect
Note that, since ranges may be non-contiguous, a version might not be
greater than a range, less than a range, or satisfy a range! For
@@ -325,5 +336,5 @@ range, use the satisfies(version, range)
function.
-
+
--
cgit v1.2.3