@@ -48,6 +48,12 @@ function outdated (args, silent, cb) {
outdated_(args, dir, {}, 0, function (er, list) {
if (!list) list = []
if (er || silent || list.length === 0) return cb(er, list)
list.sort(function(a, b) {
var aa = a[1].toLowerCase()
, bb = b[1].toLowerCase()
return aa === bb ? 0
: aa < bb ? -1 : 1
})
if (npm.config.get("json")) {
console.log(makeJSON(list))
} else if (npm.config.get("parseable")) {
@@ -301,7 +307,7 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) {
}

if (args.length && args.indexOf(dep) === -1) return skip()
var parsed = npa(req)
var parsed = npa(dep + '@' + req)
if (parsed.type === "git" || (parsed.hosted && parsed.hosted.type === "github")) {
return doIt("git", "git")
}
@@ -313,8 +319,35 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) {
npm.registry.get(uri, { auth : auth }, updateDeps)
})

function updateLocalDeps (latestRegistryVersion) {
readJson(path.resolve(parsed.spec, 'package.json'), function (er, localDependency) {
if (er) return cb()

var wanted = localDependency.version
var latest = localDependency.version

if (latestRegistryVersion) {
latest = latestRegistryVersion
if (semver.lt(wanted, latestRegistryVersion)) {
wanted = latestRegistryVersion
req = dep + '@' + latest
}
}

if (curr.version !== wanted) {
doIt(wanted, latest)
} else {
skip()
}
})
}

function updateDeps (er, d) {
if (er) return cb()
if (er) {
if (parsed.type !== 'local') return cb()
return updateLocalDeps()
}

if (!d || !d["dist-tags"] || !d.versions) return cb()
var l = d.versions[d["dist-tags"].latest]
if (!l) return cb()
@@ -355,6 +388,8 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) {
if (!curr || dFromUrl && cFromUrl && d._from !== curr.from
|| d.version !== curr.version
|| d.version !== l.version) {
if (parsed.type === 'local') return updateLocalDeps(l.version)

doIt(d.version, l.version)
}
else {
@@ -7,13 +7,12 @@ var npm = require("./npm.js")
, readJson = require("read-package-json")
, lifecycle = require("./utils/lifecycle.js")
, chain = require("slide").chain
, Conf = require("./config/core.js").Conf
, CachingRegClient = require("./cache/caching-client.js")
, mapToRegistry = require("./utils/map-to-registry.js")
, cachedPackageRoot = require("./cache/cached-package-root.js")
, createReadStream = require("graceful-fs").createReadStream
, npa = require("npm-package-arg")
, semver = require('semver')
, getPublishConfig = require("./utils/get-publish-config.js")

publish.usage = "npm publish <tarball> [--tag <tagname>]"
+ "\nnpm publish <folder> [--tag <tagname>]"
@@ -83,22 +82,13 @@ function cacheAddPublish (dir, didPre, isRetry, cb) {
function publish_ (arg, data, isRetry, cachedir, cb) {
if (!data) return cb(new Error("no package.json file found"))

var registry = npm.registry
var config = npm.config

// check for publishConfig hash
if (data.publishConfig) {
config = new Conf(npm.config)
config.save = npm.config.save.bind(npm.config)

// don't modify the actual publishConfig object, in case we have
// to set a login token or some other data.
config.unshift(Object.keys(data.publishConfig).reduce(function (s, k) {
s[k] = data.publishConfig[k]
return s
}, {}))
registry = new CachingRegClient(config)
}
var mappedConfig = getPublishConfig(
data.publishConfig,
npm.config,
npm.registry
)
var config = mappedConfig.config
var registry = mappedConfig.client

data._npmVersion = npm.version
data._nodeVersion = process.versions.node
@@ -13,7 +13,6 @@ runScript.completion = function (opts, cb) {

// see if there's already a package specified.
var argv = opts.conf.argv.remain
, installedShallow = require("./utils/completion/installed-shallow.js")

if (argv.length >= 4) return cb()

@@ -41,33 +40,11 @@ runScript.completion = function (opts, cb) {
})
}

// complete against the installed-shallow, and the pwd's scripts.
// but only packages that have scripts
var installed
, scripts
installedShallow(opts, function (d) {
return d.scripts
}, function (er, inst) {
installed = inst
next()
})

if (npm.config.get("global")) {
scripts = []
next()
}
else readJson(path.join(npm.localPrefix, "package.json"), function (er, d) {
readJson(path.join(npm.localPrefix, "package.json"), function (er, d) {
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
d = d || {}
scripts = Object.keys(d.scripts || {})
next()
cb(null, Object.keys(d.scripts || {}))
})

function next () {
if (!installed || !scripts) return

cb(null, scripts.concat(installed))
}
}

function runScript (args, cb) {
@@ -2,11 +2,12 @@
module.exports = unpublish

var log = require("npmlog")
, npm = require("./npm.js")
, readJson = require("read-package-json")
, path = require("path")
, mapToRegistry = require("./utils/map-to-registry.js")
, npa = require("npm-package-arg")
var npm = require("./npm.js")
var readJson = require("read-package-json")
var path = require("path")
var mapToRegistry = require("./utils/map-to-registry.js")
var npa = require("npm-package-arg")
var getPublishConfig = require("./utils/get-publish-config.js")

unpublish.usage = "npm unpublish <project>[@<version>]"

@@ -71,34 +72,44 @@ function unpublish (args, cb) {
return readJson(cwdJson, function (er, data) {
if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er)
if (er) return cb("Usage:\n" + unpublish.usage)
gotProject(data.name, data.version, cb)
log.verbose('unpublish', data)
gotProject(data.name, data.version, data.publishConfig, cb)
})
}
return gotProject(project, version, cb)
}

function gotProject (project, version, cb_) {
function gotProject (project, version, publishConfig, cb_) {
if (typeof cb_ !== 'function') {
cb_ = publishConfig
publishConfig = null
}

function cb (er) {
if (er) return cb_(er)
console.log("- " + project + (version ? "@" + version : ""))
cb_()
}

var mappedConfig = getPublishConfig(publishConfig, npm.config, npm.registry)
var config = mappedConfig.config
var registry = mappedConfig.client

// remove from the cache first
npm.commands.cache(["clean", project, version], function (er) {
if (er) {
log.error("unpublish", "Failed to clean cache")
return cb(er)
}

mapToRegistry(project, npm.config, function (er, uri, auth) {
mapToRegistry(project, config, function (er, uri, auth) {
if (er) return cb(er)

var params = {
version : version,
auth : auth
version: version,
auth: auth
}
npm.registry.unpublish(uri, params, cb)
registry.unpublish(uri, params, cb)
})
})
}
@@ -12,6 +12,7 @@ var cbCalled = false
, rollbacks = npm.rollbacks
, chain = require("slide").chain
, writeStream = require("fs-write-stream-atomic")
, nameValidator = require("validate-npm-package-name")


process.on("exit", function (code) {
@@ -216,8 +217,21 @@ function errorHandler (er) {
case "E404":
var msg = [er.message]
if (er.pkgid && er.pkgid !== "-") {
msg.push("", "'"+er.pkgid+"' is not in the npm registry."
,"You should bug the author to publish it (or use the name yourself!)")
msg.push("", "'" + er.pkgid + "' is not in the npm registry.")

var valResult = nameValidator(er.pkgid)

if (valResult.validForNewPackages) {
msg.push("You should bug the author to publish it (or use the name yourself!)")
} else {
msg.push("Your package name is not valid, because", "")

var errorsArray = (valResult.errors || []).concat(valResult.warnings || [])
errorsArray.forEach(function(item, idx) {
msg.push(" " + (idx + 1) + ". " + item)
})
}

if (er.parent) {
msg.push("It was specified as a dependency of '"+er.parent+"'")
}
@@ -0,0 +1,25 @@
var Conf = require('../config/core.js').Conf
var CachingRegClient = require('../cache/caching-client.js')
var log = require('npmlog')

module.exports = getPublishConfig

function getPublishConfig (publishConfig, defaultConfig, defaultClient) {
var config = defaultConfig
var client = defaultClient
log.verbose('getPublishConfig', publishConfig)
if (publishConfig) {
config = new Conf(defaultConfig)
config.save = defaultConfig.save.bind(defaultConfig)

// don't modify the actual publishConfig object, in case we have
// to set a login token or some other data.
config.unshift(Object.keys(publishConfig).reduce(function (s, k) {
s[k] = publishConfig[k]
return s
}, {}))
client = new CachingRegClient(config)
}

return { config: config, client: client }
}
@@ -11,6 +11,7 @@ var semver = require("semver")
, npm = require("./npm.js")
, git = require("./utils/git.js")
, assert = require("assert")
, lifecycle = require("./utils/lifecycle.js")

version.usage = "npm version [<newversion> | major | minor | patch | prerelease | preminor | premajor ]\n"
+ "\n(run in package dir)\n"
@@ -26,23 +27,19 @@ function version (args, silent, cb_) {

var packagePath = path.join(npm.localPrefix, "package.json")
fs.readFile(packagePath, function (er, data) {
function cb (er) {
if (!er && !silent) console.log("v" + data.version)
cb_(er)
}

if (data) data = data.toString()
try {
data = JSON.parse(data)
}
catch (er) {
catch (e) {
er = e
data = null
}

if (!args.length) return dump(data, cb_)

if (er) {
log.error("version", "No package.json found")
log.error("version", "No valid package.json found")
return cb_(er)
}

@@ -51,18 +48,34 @@ function version (args, silent, cb_) {
if (!newVersion) return cb_(version.usage)
if (data.version === newVersion) return cb_(new Error("Version not changed"))
data.version = newVersion
var lifecycleData = Object.create(data)
lifecycleData._id = data.name + "@" + newVersion

var where = npm.prefix
chain([
[lifecycle, lifecycleData, "preversion", where]
, [version_, data, silent]
, [lifecycle, lifecycleData, "version", where]
, [lifecycle, lifecycleData, "postversion", where] ]
, cb_)
})
}

checkGit(function (er, hasGit) {
if (er) return cb_(er)
function version_ (data, silent, cb_) {
function cb (er) {
if (!er && !silent) console.log("v" + data.version)
cb_(er)
}

write(data, "package.json", function (er) {
if (er) return cb_(er)
checkGit(function (er, hasGit) {
if (er) return cb(new Error(er))

updateShrinkwrap(newVersion, function (er, hasShrinkwrap) {
if (er || !hasGit) return cb(er)
write(data, "package.json", function (er) {
if (er) return cb(new Error(er))

commit(data.version, hasShrinkwrap, cb)
})
updateShrinkwrap(data.version, function (er, hasShrinkwrap) {
if (er || !hasGit) return cb(er)
commit(data.version, hasShrinkwrap, cb)
})
})
})
@@ -155,7 +168,7 @@ function commit (version, hasShrinkwrap, cb) {
git.chainableExec([ "add", "package.json" ], options),
hasShrinkwrap && git.chainableExec([ "add", "npm-shrinkwrap.json" ] , options),
git.chainableExec([ "commit", "-m", message ], options),
git.chainableExec([ "tag", "v" + version, flag, message ], options)
git.chainableExec([ "tag", npm.config.get("tag-version-prefix") + version, flag, message ], options)
],
cb
)
@@ -1,4 +1,4 @@
.TH "NPM" "1" "April 2015" "" ""
.TH "NPM" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm\fR \- a JavaScript package manager
.P
@@ -133,16 +133,23 @@ this means that future npm installs will not remember the settings that
you have chosen\.
.SH Using npm Programmatically
.P
If you would like to use npm programmatically, you can do that\.
It's not very well documented, but it \fIis\fR rather simple\.
Although npm can be used programmatically, its API is meant for use by the CLI
\fIonly\fR, and no guarantees are made regarding its fitness for any other purpose\.
If you want to use npm to reliably perform some task, the safest thing to do is
to invoke the desired \fBnpm\fR command with appropriate arguments\.
.P
Most of the time, unless you actually want to do all the things that
npm does, you should try using one of npm's dependencies rather than
using npm itself, if possible\.
The semantic version of npm refers to the CLI itself, rather than the
underlying API\. \fIThe internal API is not guaranteed to remain stable even when
npm's version indicates no breaking changes have been made according to
semver\.\fR
.P
Eventually, npm will be just a thin cli wrapper around the modules
that it depends on, but for now, there are some things that you must
use npm itself to do\.
If you \fIstill\fR would like to use npm programmatically, it's \fIpossible\fR\|\. The API
isn't very well documented, but it \fIis\fR rather simple\.
.P
Eventually, npm will be just a thin CLI wrapper around the modules that it
depends on, but for now, there are some things that only the CLI can do\. You
should try using one of npm's dependencies first, and only use the API if what
you're trying to do is only supported by npm itself\.
.P
.RS 2
.nf
@@ -1,4 +1,4 @@
.TH "NPM\-ACCESS" "1" "April 2015" "" ""
.TH "NPM\-ACCESS" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-access\fR \- Set access level on published packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-ADDUSER" "1" "April 2015" "" ""
.TH "NPM\-ADDUSER" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-adduser\fR \- Add a registry user account
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-BIN" "1" "April 2015" "" ""
.TH "NPM\-BIN" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-BUGS" "1" "April 2015" "" ""
.TH "NPM\-BUGS" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-BUILD" "1" "April 2015" "" ""
.TH "NPM\-BUILD" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-build\fR \- Build a package
.SH SYNOPSIS
@@ -18,7 +18,14 @@ A folder containing a \fBpackage\.json\fR file in its root\.
.P
This is the plumbing command called by \fBnpm link\fR and \fBnpm install\fR\|\.
.P
It should generally not be called directly\.
It should generally be called during installation, but if you need to run it
directly, run:
.P
.RS 2
.nf
npm run\-script build
.fi
.RE
.SH SEE ALSO
.RS 0
.IP \(bu 2
@@ -1,4 +1,4 @@
.TH "NPM\-BUNDLE" "1" "April 2015" "" ""
.TH "NPM\-BUNDLE" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-bundle\fR \- REMOVED
.SH DESCRIPTION
@@ -1,4 +1,4 @@
.TH "NPM\-CACHE" "1" "April 2015" "" ""
.TH "NPM\-CACHE" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-cache\fR \- Manipulates packages cache
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-COMPLETION" "1" "April 2015" "" ""
.TH "NPM\-COMPLETION" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-completion\fR \- Tab Completion for npm
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-CONFIG" "1" "April 2015" "" ""
.TH "NPM\-CONFIG" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-DEDUPE" "1" "April 2015" "" ""
.TH "NPM\-DEDUPE" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-dedupe\fR \- Reduce duplication
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-DEPRECATE" "1" "April 2015" "" ""
.TH "NPM\-DEPRECATE" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-deprecate\fR \- Deprecate a version of a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-DIST\-TAG" "1" "April 2015" "" ""
.TH "NPM\-DIST\-TAG" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-dist-tag\fR \- Modify package distribution tags
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-DOCS" "1" "April 2015" "" ""
.TH "NPM\-DOCS" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-docs\fR \- Docs for a package in a web browser maybe
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-EDIT" "1" "April 2015" "" ""
.TH "NPM\-EDIT" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-edit\fR \- Edit an installed package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-EXPLORE" "1" "April 2015" "" ""
.TH "NPM\-EXPLORE" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-explore\fR \- Browse an installed package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-HELP\-SEARCH" "1" "April 2015" "" ""
.TH "NPM\-HELP\-SEARCH" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-help-search\fR \- Search npm help documentation
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-HELP" "1" "April 2015" "" ""
.TH "NPM\-HELP" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-help\fR \- Get help on npm
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-INIT" "1" "April 2015" "" ""
.TH "NPM\-INIT" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-init\fR \- Interactively create a package\.json file
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-INSTALL" "1" "April 2015" "" ""
.TH "NPM\-INSTALL" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-install\fR \- Install a package
.SH SYNOPSIS
@@ -181,33 +181,48 @@ fetch the package by name if it is not valid\.
.fi
.RE
.IP \(bu 2
\fBnpm install <githubname>/<githubrepo>\fR:
Install the package at \fBhttps://github\.com/githubname/githubrepo\fR by
attempting to clone it using \fBgit\fR\|\.
Example:
\fBnpm install <git remote url>\fR:
Install a package by cloning a git remote url\. The format of the git
url is:
.P
.RS 2
.nf
npm install mygithubuser/myproject
<protocol>://[<user>[:<password>]@]<hostname>[:<port>][:/]<path>[#<commit\-ish>]
.fi
.RE
\fB<protocol>\fR is one of \fBgit\fR, \fBgit+ssh\fR, \fBgit+http\fR, or
\fBgit+https\fR\|\. If no \fB<commit\-ish>\fR is specified, then \fBmaster\fR is
used\.
Examples:
.P
.RS 2
.nf
git+ssh://git@github\.com:npm/npm\.git#v1\.0\.27
git+https://isaacs@github\.com/npm/npm\.git
git://github\.com/npm/npm\.git#v1\.0\.27
.fi
.RE
To reference a package in a generic git repo (not on GitHub), see git remote
urls below\.
.IP \(bu 2
\fBnpm install github:<githubname>/<githubrepo>\fR:
The same as the above, but explicitly marked as a GitHub dependency\.
Example:
\fBnpm install <githubname>/<githubrepo>[#<commit\-ish>]\fR:
.IP \(bu 2
\fBnpm install github:<githubname>/<githubrepo>[#<commit\-ish>]\fR:
Install the package at \fBhttps://github\.com/githubname/githubrepo\fR by
attempting to clone it using \fBgit\fR\|\.
If you don't specify a \fIcommit\-ish\fR then \fBmaster\fR will be used\.
Examples:
.P
.RS 2
.nf
npm install github:npm/npm
npm install mygithubuser/myproject
npm install github:mygithubuser/myproject
.fi
.RE
.IP \(bu 2
\fBnpm install gist:[<githubname>/]<gistID>\fR:
\fBnpm install gist:[<githubname>/]<gistID>[#<commit\-ish>]\fR:
Install the package at \fBhttps://gist\.github\.com/gistID\fR by attempting to
clone it using \fBgit\fR\|\. The GitHub username associated with the gist is
optional and will not be saved in \fBpackage\.json\fR if \fB\-\-save\fR is used\.
If you don't specify a \fIcommit\-ish\fR then \fBmaster\fR will be used\.
Example:
.P
.RS 2
@@ -216,9 +231,10 @@ fetch the package by name if it is not valid\.
.fi
.RE
.IP \(bu 2
\fBnpm install bitbucket:<bitbucketname>/<bitbucketrepo>\fR:
\fBnpm install bitbucket:<bitbucketname>/<bitbucketrepo>[#<commit\-ish>]\fR:
Install the package at \fBhttps://bitbucket\.org/bitbucketname/bitbucketrepo\fR
by attempting to clone it using \fBgit\fR\|\.
If you don't specify a \fIcommit\-ish\fR then \fBmaster\fR will be used\.
Example:
.P
.RS 2
@@ -227,38 +243,17 @@ fetch the package by name if it is not valid\.
.fi
.RE
.IP \(bu 2
\fBnpm install gitlab:<gitlabname>/<gitlabrepo>\fR:
\fBnpm install gitlab:<gitlabname>/<gitlabrepo>[#<commit\-ish>]\fR:
Install the package at \fBhttps://gitlab\.com/gitlabname/gitlabrepo\fR
by attempting to clone it using \fBgit\fR\|\.
If you don't specify a \fIcommit\-ish\fR then \fBmaster\fR will be used\.
Example:
.P
.RS 2
.nf
npm install gitlab:mygitlabuser/myproject
.fi
.RE
.IP \(bu 2
\fBnpm install <git remote url>\fR:
Install a package by cloning a git remote url\. The format of the git
url is:
.P
.RS 2
.nf
<protocol>://[<user>[:<password>]@]<hostname><separator><path>[#<commit\-ish>]
.fi
.RE
\fB<protocol>\fR is one of \fBgit\fR, \fBgit+ssh\fR, \fBgit+http\fR, or
\fBgit+https\fR\|\. If no \fB<commit\-ish>\fR is specified, then \fBmaster\fR is
used\.
Examples:
.P
.RS 2
.nf
git+ssh://git@github\.com:npm/npm\.git#v1\.0\.27
git+https://isaacs@github\.com/npm/npm\.git
git://github\.com/npm/npm\.git#v1\.0\.27
.fi
.RE

.RE
.P
@@ -1,4 +1,4 @@
.TH "NPM\-LINK" "1" "April 2015" "" ""
.TH "NPM\-LINK" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-link\fR \- Symlink a package folder
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-LOGOUT" "1" "April 2015" "" ""
.TH "NPM\-LOGOUT" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-logout\fR \- Log out of the registry
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-LS" "1" "April 2015" "" ""
.TH "NPM\-LS" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-ls\fR \- List installed packages
.SH SYNOPSIS
@@ -23,7 +23,7 @@ For example, running \fBnpm ls promzard\fR in npm's source tree will show:
.P
.RS 2
.nf
npm@2.8.4 /path/to/npm
npm@2.11.2 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
@@ -1,4 +1,4 @@
.TH "NPM\-OUTDATED" "1" "April 2015" "" ""
.TH "NPM\-OUTDATED" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-outdated\fR \- Check for outdated packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-OWNER" "1" "April 2015" "" ""
.TH "NPM\-OWNER" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-owner\fR \- Manage package owners
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PACK" "1" "April 2015" "" ""
.TH "NPM\-PACK" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-pack\fR \- Create a tarball from a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PREFIX" "1" "April 2015" "" ""
.TH "NPM\-PREFIX" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-prefix\fR \- Display prefix
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PRUNE" "1" "April 2015" "" ""
.TH "NPM\-PRUNE" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-prune\fR \- Remove extraneous packages
.SH SYNOPSIS
@@ -18,8 +18,10 @@ removed\.
Extraneous packages are packages that are not listed on the parent
package's dependencies list\.
.P
If the \fB\-\-production\fR flag is specified, this command will remove the
packages specified in your \fBdevDependencies\fR\|\.
If the \fB\-\-production\fR flag is specified or the \fBNODE_ENV\fR environment
variable is set to \fBproduction\fR, this command will remove the packages
specified in your \fBdevDependencies\fR\|\. Setting \fB\-\-production=false\fR will
negate \fBNODE_ENV\fR being set to \fBproduction\fR\|\.
.SH SEE ALSO
.RS 0
.IP \(bu 2
@@ -1,4 +1,4 @@
.TH "NPM\-PUBLISH" "1" "April 2015" "" ""
.TH "NPM\-PUBLISH" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-REBUILD" "1" "April 2015" "" ""
.TH "NPM\-REBUILD" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-rebuild\fR \- Rebuild a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-REPO" "1" "April 2015" "" ""
.TH "NPM\-REPO" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-repo\fR \- Open package repository page in the browser
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-RESTART" "1" "April 2015" "" ""
.TH "NPM\-RESTART" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-restart\fR \- Restart a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-RM" "1" "April 2015" "" ""
.TH "NPM\-RM" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-rm\fR \- Remove a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-ROOT" "1" "April 2015" "" ""
.TH "NPM\-ROOT" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-root\fR \- Display npm root
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-RUN\-SCRIPT" "1" "April 2015" "" ""
.TH "NPM\-RUN\-SCRIPT" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-run-script\fR \- Run arbitrary package scripts
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-SEARCH" "1" "April 2015" "" ""
.TH "NPM\-SEARCH" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-search\fR \- Search for packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-SHRINKWRAP" "1" "April 2015" "" ""
.TH "NPM\-SHRINKWRAP" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-shrinkwrap\fR \- Lock down dependency versions
.SH SYNOPSIS
@@ -12,18 +12,18 @@ npm shrinkwrap
.P
This command locks down the versions of a package's dependencies so
that you can control exactly which versions of each dependency will be
used when your package is installed\. The "package\.json" file is still
required if you want to use "npm install"\.
used when your package is installed\. The \fBpackage\.json\fR file is still
required if you want to use \fBnpm install\fR\|\.
.P
By default, "npm install" recursively installs the target's
dependencies (as specified in package\.json), choosing the latest
By default, \fBnpm install\fR recursively installs the target's
dependencies (as specified in \fBpackage\.json\fR), choosing the latest
available version that satisfies the dependency's semver pattern\. In
some situations, particularly when shipping software where each change
is tightly managed, it's desirable to fully specify each version of
each dependency recursively so that subsequent builds and deploys do
not inadvertently pick up newer versions of a dependency that satisfy
the semver pattern\. Specifying specific semver patterns in each
dependency's package\.json would facilitate this, but that's not always
dependency's \fBpackage\.json\fR would facilitate this, but that's not always
possible or desirable, as when another author owns the npm package\.
It's also possible to check dependencies directly into source control,
but that may be undesirable for other reasons\.
@@ -61,14 +61,14 @@ and package C:
.RS 2
.nf
{
"name": "C,
"name": "C",
"version": "0\.0\.1"
}
.fi
.RE
.P
If these are the only versions of A, B, and C available in the
registry, then a normal "npm install A" will install:
registry, then a normal \fBnpm install A\fR will install:
.P
.RS 2
.nf
@@ -78,7 +78,7 @@ A@0\.1\.0
.fi
.RE
.P
However, if B@0\.0\.2 is published, then a fresh "npm install A" will
However, if B@0\.0\.2 is published, then a fresh \fBnpm install A\fR will
install:
.P
.RS 2
@@ -105,7 +105,7 @@ npm shrinkwrap
.fi
.RE
.P
This generates npm\-shrinkwrap\.json, which will look something like this:
This generates \fBnpm\-shrinkwrap\.json\fR, which will look something like this:
.P
.RS 2
.nf
@@ -127,50 +127,50 @@ This generates npm\-shrinkwrap\.json, which will look something like this:
.RE
.P
The shrinkwrap command has locked down the dependencies based on
what's currently installed in node_modules\. When "npm install"
installs a package with a npm\-shrinkwrap\.json file in the package
root, the shrinkwrap file (rather than package\.json files) completely
what's currently installed in node_modules\. When \fBnpm install\fR
installs a package with an \fBnpm\-shrinkwrap\.json\fR in the package
root, the shrinkwrap file (rather than \fBpackage\.json\fR files) completely
drives the installation of that package and all of its dependencies
(recursively)\. So now the author publishes A@0\.1\.0, and subsequent
installs of this package will use B@0\.0\.1 and C@0\.0\.1, regardless the
dependencies and versions listed in A's, B's, and C's package\.json
dependencies and versions listed in A's, B's, and C's \fBpackage\.json\fR
files\.
.SS Using shrinkwrapped packages
.P
Using a shrinkwrapped package is no different than using any other
package: you can "npm install" it by hand, or add a dependency to your
package\.json file and "npm install" it\.
package: you can \fBnpm install\fR it by hand, or add a dependency to your
\fBpackage\.json\fR file and \fBnpm install\fR it\.
.SS Building shrinkwrapped packages
.P
To shrinkwrap an existing package:
.RS 0
.IP 1. 3
Run "npm install" in the package root to install the current
Run \fBnpm install\fR in the package root to install the current
versions of all dependencies\.
.IP 2. 3
Validate that the package works as expected with these versions\.
.IP 3. 3
Run "npm shrinkwrap", add npm\-shrinkwrap\.json to git, and publish
Run \fBnpm shrinkwrap\fR, add \fBnpm\-shrinkwrap\.json\fR to git, and publish
your package\.

.RE
.P
To add or update a dependency in a shrinkwrapped package:
.RS 0
.IP 1. 3
Run "npm install" in the package root to install the current
Run \fBnpm install\fR in the package root to install the current
versions of all dependencies\.
.IP 2. 3
Add or update dependencies\. "npm install" each new or updated
package individually and then update package\.json\. Note that they
Add or update dependencies\. \fBnpm install\fR each new or updated
package individually and then update \fBpackage\.json\fR\|\. Note that they
must be explicitly named in order to be installed: running \fBnpm
install\fR with no arguments will merely reproduce the existing
shrinkwrap\.
.IP 3. 3
Validate that the package works as expected with the new
dependencies\.
.IP 4. 3
Run "npm shrinkwrap", commit the new npm\-shrinkwrap\.json, and
Run \fBnpm shrinkwrap\fR, commit the new \fBnpm\-shrinkwrap\.json\fR, and
publish your package\.

.RE
@@ -179,14 +179,14 @@ You can use npm help outdated to view dependencies with newer versions
available\.
.SS Other Notes
.P
A shrinkwrap file must be consistent with the package's package\.json
file\. "npm shrinkwrap" will fail if required dependencies are not
A shrinkwrap file must be consistent with the package's \fBpackage\.json\fR
file\. \fBnpm shrinkwrap\fR will fail if required dependencies are not
already installed, since that would result in a shrinkwrap that
wouldn't actually work\. Similarly, the command will fail if there are
extraneous packages (not referenced by package\.json), since that would
indicate that package\.json is not correct\.
extraneous packages (not referenced by \fBpackage\.json\fR), since that would
indicate that \fBpackage\.json\fR is not correct\.
.P
Since "npm shrinkwrap" is intended to lock down your dependencies for
Since \fBnpm shrinkwrap\fR is intended to lock down your dependencies for
production use, \fBdevDependencies\fR will not be included unless you
explicitly set the \fB\-\-dev\fR flag when you run \fBnpm shrinkwrap\fR\|\. If
installed \fBdevDependencies\fR are excluded, then npm will print a
@@ -1,4 +1,4 @@
.TH "NPM\-STAR" "1" "April 2015" "" ""
.TH "NPM\-STAR" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-star\fR \- Mark your favorite packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-STARS" "1" "April 2015" "" ""
.TH "NPM\-STARS" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-stars\fR \- View packages marked as favorites
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-START" "1" "April 2015" "" ""
.TH "NPM\-START" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-start\fR \- Start a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-STOP" "1" "April 2015" "" ""
.TH "NPM\-STOP" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-stop\fR \- Stop a package
.SH SYNOPSIS

This file was deleted.

@@ -1,4 +1,4 @@
.TH "NPM\-TAG" "1" "April 2015" "" ""
.TH "NPM\-TAG" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-tag\fR \- Tag a published version
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-TEST" "1" "April 2015" "" ""
.TH "NPM\-TEST" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-test\fR \- Test a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-RM" "1" "April 2015" "" ""
.TH "NPM\-RM" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-rm\fR \- Remove a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-UNPUBLISH" "1" "April 2015" "" ""
.TH "NPM\-UNPUBLISH" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-unpublish\fR \- Remove a package from the registry
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-UPDATE" "1" "April 2015" "" ""
.TH "NPM\-UPDATE" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-update\fR \- Update a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-VERSION" "1" "April 2015" "" ""
.TH "NPM\-VERSION" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-version\fR \- Bump a package version
.SH SYNOPSIS
@@ -50,6 +50,18 @@ user: "isaacs (http://blog\.izs\.me/) <i@izs\.me>"
Enter passphrase:
.fi
.RE
.P
If "preversion", "version", "postversion" in the "scripts" property of
the package\.json, it will execute by running \fBnpm version\fR\|\. preversion
and version ware executed before bump the package version, postversion
was executed after bump the package version\. For example to run \fBnpm version\fR
after passed all test:
.P
.RS 2
.nf
"scripts": { "preversion": "npm test" }
.fi
.RE
.SH CONFIGURATION
.SS git\-tag\-version
.RS 0
@@ -66,6 +78,10 @@ Commit and tag the version change\.
.IP \(bu 2
npm help init
.IP \(bu 2
npm help run\-script
.IP \(bu 2
npm help 7 scripts
.IP \(bu 2
npm help 5 package\.json
.IP \(bu 2
npm help 7 semver
@@ -1,4 +1,4 @@
.TH "NPM\-VIEW" "1" "April 2015" "" ""
.TH "NPM\-VIEW" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-view\fR \- View registry info
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-WHOAMI" "1" "April 2015" "" ""
.TH "NPM\-WHOAMI" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-whoami\fR \- Display npm username
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM" "1" "April 2015" "" ""
.TH "NPM" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm\fR \- javascript package manager
.SH SYNOPSIS
@@ -10,7 +10,7 @@ npm <command> [args]
.RE
.SH VERSION
.P
2.8.4
2.11.2
.SH DESCRIPTION
.P
npm is the package manager for the Node JavaScript platform\. It puts
@@ -1,4 +1,4 @@
.TH "NPM\-BIN" "3" "April 2015" "" ""
.TH "NPM\-BIN" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-BUGS" "3" "April 2015" "" ""
.TH "NPM\-BUGS" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-CACHE" "3" "April 2015" "" ""
.TH "NPM\-CACHE" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-cache\fR \- manage the npm cache programmatically
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-COMMANDS" "3" "April 2015" "" ""
.TH "NPM\-COMMANDS" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-commands\fR \- npm commands
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-CONFIG" "3" "April 2015" "" ""
.TH "NPM\-CONFIG" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-DEPRECATE" "3" "April 2015" "" ""
.TH "NPM\-DEPRECATE" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-deprecate\fR \- Deprecate a version of a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-DOCS" "3" "April 2015" "" ""
.TH "NPM\-DOCS" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-docs\fR \- Docs for a package in a web browser maybe
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-EDIT" "3" "April 2015" "" ""
.TH "NPM\-EDIT" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-edit\fR \- Edit an installed package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-EXPLORE" "3" "April 2015" "" ""
.TH "NPM\-EXPLORE" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-explore\fR \- Browse an installed package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-HELP\-SEARCH" "3" "April 2015" "" ""
.TH "NPM\-HELP\-SEARCH" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-help-search\fR \- Search the help pages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM" "" "April 2015" "" ""
.TH "NPM" "" "June 2015" "" ""
.SH "NAME"
\fBnpm\fR
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-INSTALL" "3" "April 2015" "" ""
.TH "NPM\-INSTALL" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-install\fR \- install a package programmatically
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-LINK" "3" "April 2015" "" ""
.TH "NPM\-LINK" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-link\fR \- Symlink a package folder
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-LOAD" "3" "April 2015" "" ""
.TH "NPM\-LOAD" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-load\fR \- Load config settings
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-LS" "3" "April 2015" "" ""
.TH "NPM\-LS" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-ls\fR \- List installed packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-OUTDATED" "3" "April 2015" "" ""
.TH "NPM\-OUTDATED" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-outdated\fR \- Check for outdated packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-OWNER" "3" "April 2015" "" ""
.TH "NPM\-OWNER" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-owner\fR \- Manage package owners
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PACK" "3" "April 2015" "" ""
.TH "NPM\-PACK" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-pack\fR \- Create a tarball from a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PREFIX" "3" "April 2015" "" ""
.TH "NPM\-PREFIX" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-prefix\fR \- Display prefix
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PRUNE" "3" "April 2015" "" ""
.TH "NPM\-PRUNE" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-prune\fR \- Remove extraneous packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-PUBLISH" "3" "April 2015" "" ""
.TH "NPM\-PUBLISH" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-REBUILD" "3" "April 2015" "" ""
.TH "NPM\-REBUILD" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-rebuild\fR \- Rebuild a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-REPO" "3" "April 2015" "" ""
.TH "NPM\-REPO" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-repo\fR \- Open package repository page in the browser
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-RESTART" "3" "April 2015" "" ""
.TH "NPM\-RESTART" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-restart\fR \- Restart a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-ROOT" "3" "April 2015" "" ""
.TH "NPM\-ROOT" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-root\fR \- Display npm root
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-RUN\-SCRIPT" "3" "April 2015" "" ""
.TH "NPM\-RUN\-SCRIPT" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-run-script\fR \- Run arbitrary package scripts
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-SEARCH" "3" "April 2015" "" ""
.TH "NPM\-SEARCH" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-search\fR \- Search for packages
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-SHRINKWRAP" "3" "April 2015" "" ""
.TH "NPM\-SHRINKWRAP" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-shrinkwrap\fR \- programmatically generate package shrinkwrap file
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-START" "3" "April 2015" "" ""
.TH "NPM\-START" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-start\fR \- Start a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-STOP" "3" "April 2015" "" ""
.TH "NPM\-STOP" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-stop\fR \- Stop a package
.SH SYNOPSIS

This file was deleted.

@@ -1,4 +1,4 @@
.TH "NPM\-TAG" "3" "April 2015" "" ""
.TH "NPM\-TAG" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-tag\fR \- Tag a published version
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-TEST" "3" "April 2015" "" ""
.TH "NPM\-TEST" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-test\fR \- Test a package
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-UNINSTALL" "3" "April 2015" "" ""
.TH "NPM\-UNINSTALL" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-uninstall\fR \- uninstall a package programmatically
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-UNPUBLISH" "3" "April 2015" "" ""
.TH "NPM\-UNPUBLISH" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-unpublish\fR \- Remove a package from the registry
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-UPDATE" "3" "April 2015" "" ""
.TH "NPM\-UPDATE" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-update\fR \- Update a package
.SH SYNOPSIS
@@ -8,7 +8,7 @@
npm\.commands\.update(packages, callback)
.fi
.RE
.TH "DESCRIPTION" "" "April 2015" "" ""
.TH "DESCRIPTION" "" "June 2015" "" ""
.SH "NAME"
\fBDESCRIPTION\fR
.P
@@ -1,4 +1,4 @@
.TH "NPM\-VERSION" "3" "April 2015" "" ""
.TH "NPM\-VERSION" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-version\fR \- Bump a package version
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-VIEW" "3" "April 2015" "" ""
.TH "NPM\-VIEW" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-view\fR \- View registry info
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-WHOAMI" "3" "April 2015" "" ""
.TH "NPM\-WHOAMI" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm-whoami\fR \- Display npm username
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM" "3" "April 2015" "" ""
.TH "NPM" "3" "June 2015" "" ""
.SH "NAME"
\fBnpm\fR \- javascript package manager
.SH SYNOPSIS
@@ -20,7 +20,7 @@ npm\.load([configObject, ]function (er, npm) {
.RE
.SH VERSION
.P
2.8.4
2.11.2
.SH DESCRIPTION
.P
This is the API documentation for npm\.
@@ -1,4 +1,4 @@
.TH "NPM\-FOLDERS" "5" "April 2015" "" ""
.TH "NPM\-FOLDERS" "5" "June 2015" "" ""
.SH "NAME"
\fBnpm-folders\fR \- Folder Structures Used by npm
.SH DESCRIPTION
@@ -1,4 +1,4 @@
.TH "NPM\-FOLDERS" "5" "April 2015" "" ""
.TH "NPM\-FOLDERS" "5" "June 2015" "" ""
.SH "NAME"
\fBnpm-folders\fR \- Folder Structures Used by npm
.SH DESCRIPTION
@@ -1,4 +1,4 @@
.TH "PACKAGE\.JSON" "5" "April 2015" "" ""
.TH "PACKAGE\.JSON" "5" "June 2015" "" ""
.SH "NAME"
\fBpackage.json\fR \- Specifics of npm's package\.json handling
.SH DESCRIPTION
@@ -16,17 +16,32 @@ them\. The name and version together form an identifier that is assumed
to be completely unique\. Changes to the package should come along with
changes to the version\.
.P
The name is what your thing is called\. Some tips:
The name is what your thing is called\.
.P
Some rules:
.RS 0
.IP \(bu 2
The name must be shorter than 214 characters\. This includes the scope for
scoped packages\.
.IP \(bu 2
The name can't start with a dot or an underscore\.
.IP \(bu 2
New packages must not have uppercase letters in the name\.
.IP \(bu 2
The name ends up being part of a URL, an argument on the command line, and a
folder name\. Therefore, the name can't contain any non\-URL\-safe characters\.

.RE
.P
Some tips:
.RS 0
.IP \(bu 2
Don't use the same name as a core Node module\.
.IP \(bu 2
Don't put "js" or "node" in the name\. It's assumed that it's js, since you're
writing a package\.json file, and you can specify the engine using the "engines"
field\. (See below\.)
.IP \(bu 2
The name ends up being part of a URL, an argument on the command line, and a
folder name\. Any name with non\-url\-safe characters will be rejected\.
Also, it can't start with a dot or an underscore\.
.IP \(bu 2
The name will probably be passed as an argument to require(), so it should
be something short, but also reasonably descriptive\.
.IP \(bu 2
@@ -92,9 +107,8 @@ If a url is provided, it will be used by the \fBnpm bugs\fR command\.
You should specify a license for your package so that people know how they are
permitted to use it, and any restrictions you're placing on it\.
.P
The simplest way, assuming you're using a common license such as BSD\-3\-Clause
or MIT, is to just specify the standard SPDX ID of the license you're using,
like this:
If you're using a common license such as BSD\-2\-Clause or MIT, add a
current SPDX license identifier for the license you're using, like this:
.P
.RS 2
.nf
@@ -106,8 +120,61 @@ You can check the full list of SPDX license IDs \fIhttps://spdx\.org/licenses/\f
Ideally you should pick one that is
OSI \fIhttp://opensource\.org/licenses/alphabetical\fR approved\.
.P
It's also a good idea to include a LICENSE file at the top level in
your package\.
If your package is licensed under multiple common licenses, use an SPDX license
expression syntax version 2\.0 string \fIhttp://npmjs\.com/package/spdx\fR, like this:
.P
.RS 2
.nf
{ "license" : "(ISC OR GPL\-3\.0)" }
.fi
.RE
.P
If you are using a license that hasn't been assigned an SPDX identifier, or if
you are using a custom license, use the following valid SPDX expression:
.P
.RS 2
.nf
{ "license" : "LicenseRef\-LICENSE" }
.fi
.RE
.P
Then include a LICENSE file at the top level of the package\.
.P
Some old packages used license objects or a "licenses" property containing an
array of license objects:
.P
.RS 2
.nf
// Not valid metadata
{ "license" :
{ "type" : "ISC"
, "url" : "http://opensource\.org/licenses/ISC"
}
}

// Not valid metadata
{ "licenses" :
[
{ "type": "MIT"
, "url": "http://www\.opensource\.org/licenses/mit\-license\.php"
}
, { "type": "Apache\-2\.0"
, "url": "http://opensource\.org/licenses/apache2\.0\.php"
}
]
}
.fi
.RE
.P
Those styles are now deprecated\. Instead, use SPDX expressions, like this:
.P
.RS 2
.nf
{ "license": "ISC" }

{ "license": "(MIT OR Apache\-2\.0)" }
.fi
.RE
.SH people fields: author, contributors
.P
The "author" is one person\. "contributors" is an array of people\. A "person"
@@ -526,7 +593,7 @@ themselves\. In dev mode (ie, locally running \fBnpm install\fR), it'll
run this script as well, so that you can test it easily\.
.SH peerDependencies
.P
In some cases, you want to express the compatibility of your package with an
In some cases, you want to express the compatibility of your package with a
host tool or library, while not necessarily doing a \fBrequire\fR of this host\.
This is usually referred to as a \fIplugin\fR\|\. Notably, your module may be exposing
a specific interface, expected and specified by the host documentation\.
@@ -1,4 +1,4 @@
.TH "NPMRC" "5" "April 2015" "" ""
.TH "NPMRC" "5" "June 2015" "" ""
.SH "NAME"
\fBnpmrc\fR \- The npm config files
.SH DESCRIPTION
@@ -19,7 +19,7 @@ per\-project config file (/path/to/my/project/\.npmrc)
.IP \(bu 2
per\-user config file (~/\.npmrc)
.IP \(bu 2
global config file ($PREFIX/npmrc)
global config file ($PREFIX/etc/npmrc)
.IP \(bu 2
npm builtin config file (/path/to/npm/npmrc)

@@ -48,6 +48,11 @@ key[] = "first value"
key[] = "second value"
.fi
.RE
.P
\fBNOTE:\fR Because local (per\-project or per\-user) \fB\|\.npmrc\fR files can contain
sensitive credentials, they must be readable and writable \fIonly\fR by your user
account (i\.e\. must have a mode of \fB0600\fR), otherwise they \fIwill be ignored by
npm!\fR
.SS Per\-project config file
.P
When working locally in a project, a \fB\|\.npmrc\fR file in the root of the
@@ -1,4 +1,4 @@
.TH "PACKAGE\.JSON" "5" "April 2015" "" ""
.TH "PACKAGE\.JSON" "5" "June 2015" "" ""
.SH "NAME"
\fBpackage.json\fR \- Specifics of npm's package\.json handling
.SH DESCRIPTION
@@ -16,17 +16,32 @@ them\. The name and version together form an identifier that is assumed
to be completely unique\. Changes to the package should come along with
changes to the version\.
.P
The name is what your thing is called\. Some tips:
The name is what your thing is called\.
.P
Some rules:
.RS 0
.IP \(bu 2
The name must be shorter than 214 characters\. This includes the scope for
scoped packages\.
.IP \(bu 2
The name can't start with a dot or an underscore\.
.IP \(bu 2
New packages must not have uppercase letters in the name\.
.IP \(bu 2
The name ends up being part of a URL, an argument on the command line, and a
folder name\. Therefore, the name can't contain any non\-URL\-safe characters\.

.RE
.P
Some tips:
.RS 0
.IP \(bu 2
Don't use the same name as a core Node module\.
.IP \(bu 2
Don't put "js" or "node" in the name\. It's assumed that it's js, since you're
writing a package\.json file, and you can specify the engine using the "engines"
field\. (See below\.)
.IP \(bu 2
The name ends up being part of a URL, an argument on the command line, and a
folder name\. Any name with non\-url\-safe characters will be rejected\.
Also, it can't start with a dot or an underscore\.
.IP \(bu 2
The name will probably be passed as an argument to require(), so it should
be something short, but also reasonably descriptive\.
.IP \(bu 2
@@ -92,9 +107,8 @@ If a url is provided, it will be used by the \fBnpm bugs\fR command\.
You should specify a license for your package so that people know how they are
permitted to use it, and any restrictions you're placing on it\.
.P
The simplest way, assuming you're using a common license such as BSD\-3\-Clause
or MIT, is to just specify the standard SPDX ID of the license you're using,
like this:
If you're using a common license such as BSD\-2\-Clause or MIT, add a
current SPDX license identifier for the license you're using, like this:
.P
.RS 2
.nf
@@ -106,8 +120,61 @@ You can check the full list of SPDX license IDs \fIhttps://spdx\.org/licenses/\f
Ideally you should pick one that is
OSI \fIhttp://opensource\.org/licenses/alphabetical\fR approved\.
.P
It's also a good idea to include a LICENSE file at the top level in
your package\.
If your package is licensed under multiple common licenses, use an SPDX license
expression syntax version 2\.0 string \fIhttp://npmjs\.com/package/spdx\fR, like this:
.P
.RS 2
.nf
{ "license" : "(ISC OR GPL\-3\.0)" }
.fi
.RE
.P
If you are using a license that hasn't been assigned an SPDX identifier, or if
you are using a custom license, use the following valid SPDX expression:
.P
.RS 2
.nf
{ "license" : "LicenseRef\-LICENSE" }
.fi
.RE
.P
Then include a LICENSE file at the top level of the package\.
.P
Some old packages used license objects or a "licenses" property containing an
array of license objects:
.P
.RS 2
.nf
// Not valid metadata
{ "license" :
{ "type" : "ISC"
, "url" : "http://opensource\.org/licenses/ISC"
}
}

// Not valid metadata
{ "licenses" :
[
{ "type": "MIT"
, "url": "http://www\.opensource\.org/licenses/mit\-license\.php"
}
, { "type": "Apache\-2\.0"
, "url": "http://opensource\.org/licenses/apache2\.0\.php"
}
]
}
.fi
.RE
.P
Those styles are now deprecated\. Instead, use SPDX expressions, like this:
.P
.RS 2
.nf
{ "license": "ISC" }

{ "license": "(MIT OR Apache\-2\.0)" }
.fi
.RE
.SH people fields: author, contributors
.P
The "author" is one person\. "contributors" is an array of people\. A "person"
@@ -526,7 +593,7 @@ themselves\. In dev mode (ie, locally running \fBnpm install\fR), it'll
run this script as well, so that you can test it easily\.
.SH peerDependencies
.P
In some cases, you want to express the compatibility of your package with an
In some cases, you want to express the compatibility of your package with a
host tool or library, while not necessarily doing a \fBrequire\fR of this host\.
This is usually referred to as a \fIplugin\fR\|\. Notably, your module may be exposing
a specific interface, expected and specified by the host documentation\.
@@ -1,4 +1,4 @@
.TH "NPM\-CODING\-STYLE" "7" "April 2015" "" ""
.TH "NPM\-CODING\-STYLE" "7" "June 2015" "" ""
.SH "NAME"
\fBnpm-coding-style\fR \- npm's "funny" coding style
.SH DESCRIPTION
@@ -1,4 +1,4 @@
.TH "NPM\-CONFIG" "7" "April 2015" "" ""
.TH "NPM\-CONFIG" "7" "June 2015" "" ""
.SH "NAME"
\fBnpm-config\fR \- More than you probably want to know about npm configuration
.SH DESCRIPTION
@@ -1101,6 +1101,22 @@ it will install the specified tag\.
.P
Also the tag that is added to the package@version specified by the \fBnpm
tag\fR command, if no explicit tag is given\.
.SS tag\-version\-prefix
.RS 0
.IP \(bu 2
Default: \fB"v"\fR
.IP \(bu 2
Type: String

.RE
.P
If set, alters the prefix used when tagging a new version when performing a
version increment using \fBnpm\-version\fR\|\. To remove the prefix altogether, set it
to the empty string: \fB""\fR\|\.
.P
Because other tools may rely on the convention that npm version tags look like
\fBv1\.0\.0\fR, \fIonly use this property if it is absolutely necessary\fR\|\. In
particular, use care when overriding this setting for public packages\.
.SS tmp
.RS 0
.IP \(bu 2
@@ -1,4 +1,4 @@
.TH "NPM\-DEVELOPERS" "7" "April 2015" "" ""
.TH "NPM\-DEVELOPERS" "7" "June 2015" "" ""
.SH "NAME"
\fBnpm-developers\fR \- Developer Guide
.SH DESCRIPTION
@@ -1,4 +1,4 @@
.TH "NPM\-DISPUTES" "7" "April 2015" "" ""
.TH "NPM\-DISPUTES" "7" "June 2015" "" ""
.SH "NAME"
\fBnpm-disputes\fR \- Handling Module Name Disputes
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "NPM\-FAQ" "7" "April 2015" "" ""
.TH "NPM\-FAQ" "7" "June 2015" "" ""
.SH "NAME"
\fBnpm-faq\fR \- Frequently Asked Questions
.SH Where can I find these docs in HTML?
@@ -351,9 +351,9 @@ on Freenode IRC\.
.SH Why no namespaces?
.P
npm has only one global namespace\. If you want to namespace your own packages,
you may: simply use the \fB\-\fR character to separate the names\. npm is a mostly
anarchic system\. There is not sufficient need to impose namespace rules on
everyone\.
you may: simply use the \fB\-\fR character to separate the names or use scoped
packages\. npm is a mostly anarchic system\. There is not sufficient need to
impose namespace rules on everyone\.
.P
As of 2\.0, npm supports scoped packages, which allow you to publish a group of
related modules without worrying about name collisions\.
@@ -363,11 +363,11 @@ user named \fBnpm\fR owns the scope \fB@npm\fR\|\. Scoped packages are publishe
scope by naming them as if they were files under the scope directory, e\.g\., by
setting \fBname\fR in \fBpackage\.json\fR to \fB@npm/npm\fR\|\.
.P
Scoped packages can coexist with public npm packages in a private npm registry\.
At present (2014\-11\-04) scoped packages may NOT be published to the public npm
registry\.
Scoped packages are supported by the public npm registry\. The npm client is
backwards\-compatible with un\-scoped registries, so it can be used to work with
scoped and un\-scoped registries at the same time\.
.P
Unscoped packages can only depend on other unscoped packages\. Scoped packages
Unscoped packages can only depend on other unscoped packages\. Scoped packages
can depend on packages from their own scope, a different scope, or the public
registry (unscoped)\.
.P
@@ -1,4 +1,4 @@
.TH "NPM\-INDEX" "7" "April 2015" "" ""
.TH "NPM\-INDEX" "7" "June 2015" "" ""
.SH "NAME"
\fBnpm-index\fR \- Index of all npm documentation
.SS npm help README
@@ -1,4 +1,4 @@
.TH "NPM\-REGISTRY" "7" "April 2015" "" ""
.TH "NPM\-REGISTRY" "7" "June 2015" "" ""
.SH "NAME"
\fBnpm-registry\fR \- The JavaScript Package Registry
.SH DESCRIPTION
@@ -30,9 +30,10 @@ similar) design doc to implement the APIs\.
If you set up continuous replication from the official CouchDB, and then
set your internal CouchDB as the registry config, then you'll be able
to read any published packages, in addition to your private ones, and by
default will only publish internally\. If you then want to publish a
package for the whole world to see, you can simply override the
\fB\-\-registry\fR config for that command\.
default will only publish internally\.
.P
If you then want to publish a package for the whole world to see, you can
simply override the \fB\-\-registry\fR option for that \fBpublish\fR command\.
.SH I don't want my package published in the official registry\. It's private\.
.P
Set \fB"private": true\fR in your package\.json to prevent it from being
@@ -1,4 +1,4 @@
.TH "NPM\-SCOPE" "7" "April 2015" "" ""
.TH "NPM\-SCOPE" "7" "June 2015" "" ""
.SH "NAME"
\fBnpm-scope\fR \- Scoped packages
.SH DESCRIPTION
@@ -17,9 +17,9 @@ followed by a slash, e\.g\.
Scopes are a way of grouping related packages together, and also affect a few
things about the way npm treats the package\.
.P
\fBAs of 2014\-09\-03, scoped packages are not supported by the public npm registry\fR\|\.
However, the npm client is backwards\-compatible with un\-scoped registries, so
it can be used to work with scoped and un\-scoped registries at the same time\.
Scoped packages are supported by the public npm registry\. The npm
client is backwards\-compatible with un\-scoped registries, so it can be
used to work with scoped and un\-scoped registries at the same time\.
.SH Installing scoped packages
.P
Scoped packages are installed to a sub\-folder of the regular installation
@@ -64,10 +64,27 @@ There is nothing special about the way Node treats scope folders, this is
just specifying to require the module \fBmypackage\fR in the folder called \fB@myorg\fR\|\.
.SH Publishing scoped packages
.P
Scoped packages can be published to any registry that supports them\.
\fIAs of 2014\-09\-03, the public npm registry does not support scoped packages\fR,
so attempting to publish a scoped package to the registry will fail unless
you have associated that scope with a different registry, see below\.
Scoped packages can be published to any registry that supports them, including
the public npm registry\.
.P
(As of 2015\-04\-19, the public npm registry \fBdoes\fR support scoped packages)
.P
If you wish, you may associate a scope with a registry; see below\.
.SS Publishing public scoped packages to the public npm registry
.P
To publish a public scoped package, you must specify \fB\-\-access public\fR with
the initial publication\. This will publish the package and set access
to \fBpublic\fR as if you had run \fBnpm access public\fR after publishing\.
.SS Publishing private scoped packages to the npm registry
.P
To publish a private scoped package to the npm registry, you must have
an npm Private Modules \fIhttps://www\.npmjs\.com/private\-modules\fR
account\.
.P
You can then publish the module with \fBnpm publish\fR or \fBnpm publish
\-\-access restricted\fR, and it will be present in the npm registry, with
restricted access\. You can then change the access permissions, if
desired, with \fBnpm access\fR or on the npmjs\.com website\.
.SH Associating a scope with a registry
.P
Scopes can be associated with a separate registry\. This allows you to
@@ -103,6 +120,8 @@ that registry instead\.
npm help install
.IP \(bu 2
npm help publish
.IP \(bu 2
npm help access

.RE

@@ -1,4 +1,4 @@
.TH "NPM\-SCRIPTS" "7" "April 2015" "" ""
.TH "NPM\-SCRIPTS" "7" "June 2015" "" ""
.SH "NAME"
\fBnpm-scripts\fR \- How npm handles the "scripts" field
.SH DESCRIPTION
@@ -26,6 +26,12 @@ Run BEFORE the package is uninstalled\.
postuninstall:
Run AFTER the package is uninstalled\.
.IP \(bu 2
preversion, version:
Run BEFORE bump the package version\.
.IP \(bu 2
postversion:
Run AFTER bump the package version\.
.IP \(bu 2
pretest, test, posttest:
Run by the \fBnpm test\fR command\.
.IP \(bu 2
@@ -1,4 +1,4 @@
.TH "NPM\-REMOVAL" "1" "April 2015" "" ""
.TH "NPM\-REMOVAL" "1" "June 2015" "" ""
.SH "NAME"
\fBnpm-removal\fR \- Cleaning the Slate
.SH SYNOPSIS
@@ -1,4 +1,4 @@
.TH "SEMVER" "7" "April 2015" "" ""
.TH "SEMVER" "7" "June 2015" "" ""
.SH "NAME"
\fBsemver\fR \- The semantic versioner for npm
.SH Usage