Jakob Krigovsky <jakob.krigovsky@gmail.com>
Charmander <~@charmander.me>
erik wienhold <git@ewie.name>
+James Butler <james.butler@sandfox.co.uk>
+### v2.9.0 (2015-04-23):
+
+This week was kind of a breather to concentrate on fixing up the tests on the
+`multi-stage` branch, and not mess with git issues for a little while.
+Unfortunately, There are now enough severe git issues that we'll probably have
+to spend another couple weeks tackling them. In the meantime, enjoy these two
+small features. They're just enough to qualify for a semver-minor bump:
+
+#### NANOFEATURES
+
+* [`2799322`](https://github.com/npm/npm/commit/279932298ce5b589c5eea9439ac40b88b99c6a4a)
+ [#7426](https://github.com/npm/npm/issues/7426) Include local modules in `npm
+ outdated` and `npm update`. ([@ArnaudRinquin](https://github.com/ArnaudRinquin))
+* [`2114862`](https://github.com/npm/npm/commit/21148620fa03a582f4ec436bb16bd472664f2737)
+ [#8014](https://github.com/npm/npm/issues/8014) The prefix used before the
+ version on version tags is now configurable via `tag-version-prefix`. Be
+ careful with this one and read the docs before using it.
+ ([@kkragenbrink](https://github.com/kkragenbrink))
+
+#### OTHER MINOR TWEAKS
+
+* [`18ce0ec`](https://github.com/npm/npm/commit/18ce0ecd2d94ad3af01e997f1396515892dd363c)
+ [#3032](https://github.com/npm/npm/issues/3032) `npm unpublish` will now use
+ the registry set in `package.json`, just like `npm publish`. This only
+ applies, for now, when unpublishing the entire package, as unpublishing a
+ single version requires the name be included on the command line and
+ therefore doesn't read from `package.json`. ([@watilde](https://github.com/watilde))
+* [`9ad2100`](https://github.com/npm/npm/commit/9ad210042242e51d52b2a8b633d8e59248f5faa4)
+ [#8008](https://github.com/npm/npm/issues/8008) Once again, when considering
+ what to install on `npm install`, include `devDependencies`.
+ ([@smikes](https://github.com/smikes))
+* [`5466260`](https://github.com/npm/npm/commit/546626059909dca1906454e820ca4e315c1795bd)
+ [#8003](https://github.com/npm/npm/issues/8003) Clarify the documentation
+ around scopes to make it easier to understand how they support private
+ packages. ([@smikes](https://github.com/smikes))
+
+#### DEPENDENCIES WILL NOT STOP UNTIL YOU ARE VERY SLEEPY
+
+* [`faf65a7`](https://github.com/npm/npm/commit/faf65a7bbb2fad13216f64ed8f1243bafe743f97)
+ `init-package-json@1.4.2`: If there are multiple validation errors and
+ warnings, ensure they all get displayed (includes a rad new way of testing
+ `init-package-json` contributed by
+ [@michaelnisi](https://github.com/michaelnisi)).
+ ([@MisumiRize](https://github.com/MisumiRize))
+* [`7f10f38`](https://github.com/npm/npm/commit/7f10f38d29a8423d7cde8103fa7b64ac728da1e0)
+ `editor@1.0.0`: `1.0.0` is literally more than `0.1.0` (no change aside from
+ version number). ([@substack](https://github.com/substack))
+* [`4979af3`](https://github.com/npm/npm/commit/4979af3fcae5a3962383b7fdad3162381e62eefe)
+ [#6805](https://github.com/npm/npm/issues/6805) `npm-registry-client@6.3.3`:
+ Decode scoped package names sent by the registry so they look nicer.
+ ([@mmalecki](https://github.com/mmalecki))
+
+### v2.8.4 (2015-04-16):
+
+This is the fourth release of npm this week, so it's mostly just landing a few
+small outstanding PRs on dependencies and some tiny documentation tweaks.
+`npm@2.8.3` is where the real action is.
+
+* [`ee2bd77`](https://github.com/npm/npm/commit/ee2bd77f3c64d38735d1d31028224a5c40422a9b)
+ [#7983](https://github.com/npm/npm/issues/7983) `tar@2.1.0`: Better error
+ reporting in corrupted tar files, and add support for the `fromBase` flag
+ (rescued from the dustbin of history by
+ [@deanmarano](https://github.com/deanmarano)).
+ ([@othiym23](https://github.com/othiym23))
+* [`d8eee6c`](https://github.com/npm/npm/commit/d8eee6cf9d2ff7aca68dfaed2de76824a3e0d9af)
+ `init-package-json@1.4.1`: Add support for a default author, and only add
+ scope to a package name once. ([@othiym23](https://github.com/othiym23))
+* [`4fc5d98`](https://github.com/npm/npm/commit/4fc5d98b785f601c60d4dc0a2c8674f0cccf6262)
+ `lru-cache@2.6.1`: Small tweaks to cache value aging and entry counting that
+ are irrelevant to npm. ([@isaacs](https://github.com/isaacs))
+* [`1fe5840`](https://github.com/npm/npm/commit/1fe584089f5bef133de5518aa26eaf6064be2bf7)
+ [#7946](https://github.com/npm/npm/issues/7946) Make `npm init` text
+ friendlier. ([@sandfox](https://github.com/sandfox))
+
### v2.8.3 (2015-04-15):
#### TWO SMALL GIT TWEAKS
Now, any changes to ~/projects/node-redis will be reflected in
~/projects/node-bloggy/node_modules/node-redis/. Note that the link should
-be to the package name, not the directory name for that package.
+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:
## DESCRIPTION
-npm gets its configuration values from 6 sources, in this priority:
+npm gets its configuration values from the following sources, sorted by priority:
### Command Line Flags
Also the tag that is added to the package@version specified by the `npm
tag` command, if no explicit tag is given.
+### tag-version-prefix
+
+* Default: `"v"`
+* Type: String
+
+If set, alters the prefix used when tagging a new version when performing a
+version increment using `npm-version`. To remove the prefix altogether, set it
+to the empty string: `""`.
+
+Because other tools may rely on the convention that npm version tags look like
+`v1.0.0`, _only use this property if it is absolutely necessary_. In
+particular, use care when overriding this setting for public packages.
+
### tmp
* Default: TMPDIR environment variable, or "/tmp"
Scopes are a way of grouping related packages together, and also affect a few
things about the way npm treats the package.
-**As of 2014-09-03, scoped packages are not supported by the public npm registry**.
-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.
## Installing scoped packages
## Publishing scoped packages
-Scoped packages can be published to any registry that supports them.
-*As of 2014-09-03, the public npm registry does not support scoped packages*,
-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.
+
+(As of 2015-04-19, the public npm registry **does** support scoped packages)
+
+If you wish, you may associate a scope with a registry; see below.
+
+### Publishing public scoped packages to the public npm registry
+
+To publish a public scoped package, you must specify `--access public` with
+the initial publication. This will publish the package and set access
+to `public` as if you had run `npm access public` after publishing.
+
+### Publishing private scoped packages to the npm registry
+
+To publish a private scoped package to the npm registry, you must have
+an [npm Private Modules](https://www.npmjs.com/private-modules)
+account.
+
+You can then publish the module with `npm publish` or `npm publish
+--access restricted`, and it will be present in the npm registry, with
+restricted access. You can then change the access permissions, if
+desired, with `npm access` or on the npmjs.com website.
## Associating a scope with a registry
## SEE ALSO
* npm-install(1)
-* npm-publish(1)
\ No newline at end of file
+* npm-publish(1)
+* npm-access(1)
<p>If you have a complaint about a package in the public npm registry,
and cannot <a href="https://docs.npmjs.com/misc/disputes">resolve it with the package
owner</a>, please email
-<a href="mailto:support@npmjs.com">support@npmjs.com</a> and explain the situation.</p>
+<a href="mailto:support@npmjs.com">support@npmjs.com</a> and explain the situation.</p>
<p>Any data published to The npm Registry (including user account
information) may be removed or modified at the sole discretion of the
npm server administrators.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer"><a href="../doc/README.html">README</a> — npm@2.8.3</p>
+<p id="footer"><a href="../doc/README.html">README</a> — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-bin — npm@2.8.3</p>
+<p id="footer">npm-bin — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-bugs — npm@2.8.3</p>
+<p id="footer">npm-bugs — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-cache — npm@2.8.3</p>
+<p id="footer">npm-cache — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-commands — npm@2.8.3</p>
+<p id="footer">npm-commands — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-config — npm@2.8.3</p>
+<p id="footer">npm-config — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-deprecate — npm@2.8.3</p>
+<p id="footer">npm-deprecate — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-docs — npm@2.8.3</p>
+<p id="footer">npm-docs — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-edit — npm@2.8.3</p>
+<p id="footer">npm-edit — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-explore — npm@2.8.3</p>
+<p id="footer">npm-explore — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-help-search — npm@2.8.3</p>
+<p id="footer">npm-help-search — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-init — npm@2.8.3</p>
+<p id="footer">npm-init — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-install — npm@2.8.3</p>
+<p id="footer">npm-install — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-link — npm@2.8.3</p>
+<p id="footer">npm-link — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-load — npm@2.8.3</p>
+<p id="footer">npm-load — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-ls — npm@2.8.3</p>
+<p id="footer">npm-ls — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-outdated — npm@2.8.3</p>
+<p id="footer">npm-outdated — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-owner — npm@2.8.3</p>
+<p id="footer">npm-owner — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-pack — npm@2.8.3</p>
+<p id="footer">npm-pack — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-prefix — npm@2.8.3</p>
+<p id="footer">npm-prefix — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-prune — npm@2.8.3</p>
+<p id="footer">npm-prune — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-publish — npm@2.8.3</p>
+<p id="footer">npm-publish — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-rebuild — npm@2.8.3</p>
+<p id="footer">npm-rebuild — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-repo — npm@2.8.3</p>
+<p id="footer">npm-repo — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-restart — npm@2.8.3</p>
+<p id="footer">npm-restart — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-root — npm@2.8.3</p>
+<p id="footer">npm-root — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-run-script — npm@2.8.3</p>
+<p id="footer">npm-run-script — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-search — npm@2.8.3</p>
+<p id="footer">npm-search — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-shrinkwrap — npm@2.8.3</p>
+<p id="footer">npm-shrinkwrap — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-start — npm@2.8.3</p>
+<p id="footer">npm-start — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-stop — npm@2.8.3</p>
+<p id="footer">npm-stop — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-tag — npm@2.8.3</p>
+<p id="footer">npm-tag — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-test — npm@2.8.3</p>
+<p id="footer">npm-test — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-uninstall — npm@2.8.3</p>
+<p id="footer">npm-uninstall — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-unpublish — npm@2.8.3</p>
+<p id="footer">npm-unpublish — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-update — npm@2.8.3</p>
+<p id="footer">npm-update — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-version — npm@2.8.3</p>
+<p id="footer">npm-version — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-view — npm@2.8.3</p>
+<p id="footer">npm-view — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-whoami — npm@2.8.3</p>
+<p id="footer">npm-whoami — npm@2.9.0</p>
npm.commands.install(["package"], cb)
})
</code></pre><h2 id="version">VERSION</h2>
-<p>2.8.3</p>
+<p>2.9.0</p>
<h2 id="description">DESCRIPTION</h2>
<p>This is the API documentation for npm.
To find documentation of the command line
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm — npm@2.8.3</p>
+<p id="footer">npm — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-access — npm@2.8.3</p>
+<p id="footer">npm-access — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-adduser — npm@2.8.3</p>
+<p id="footer">npm-adduser — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-bin — npm@2.8.3</p>
+<p id="footer">npm-bin — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-bugs — npm@2.8.3</p>
+<p id="footer">npm-bugs — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-build — npm@2.8.3</p>
+<p id="footer">npm-build — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-bundle — npm@2.8.3</p>
+<p id="footer">npm-bundle — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-cache — npm@2.8.3</p>
+<p id="footer">npm-cache — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-completion — npm@2.8.3</p>
+<p id="footer">npm-completion — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-config — npm@2.8.3</p>
+<p id="footer">npm-config — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-dedupe — npm@2.8.3</p>
+<p id="footer">npm-dedupe — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-deprecate — npm@2.8.3</p>
+<p id="footer">npm-deprecate — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-dist-tag — npm@2.8.3</p>
+<p id="footer">npm-dist-tag — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-docs — npm@2.8.3</p>
+<p id="footer">npm-docs — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-edit — npm@2.8.3</p>
+<p id="footer">npm-edit — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-explore — npm@2.8.3</p>
+<p id="footer">npm-explore — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-help-search — npm@2.8.3</p>
+<p id="footer">npm-help-search — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-help — npm@2.8.3</p>
+<p id="footer">npm-help — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-init — npm@2.8.3</p>
+<p id="footer">npm-init — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-install — npm@2.8.3</p>
+<p id="footer">npm-install — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-link — npm@2.8.3</p>
+<p id="footer">npm-link — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-logout — npm@2.8.3</p>
+<p id="footer">npm-logout — npm@2.9.0</p>
limit the results to only the paths to the packages named. Note that
nested packages will <em>also</em> show the paths to the specified packages.
For example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
-<pre><code>npm@2.8.3 /path/to/npm
+<pre><code>npm@2.9.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre><p>It will print out extraneous, missing, and invalid packages.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-ls — npm@2.8.3</p>
+<p id="footer">npm-ls — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-outdated — npm@2.8.3</p>
+<p id="footer">npm-outdated — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-owner — npm@2.8.3</p>
+<p id="footer">npm-owner — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-pack — npm@2.8.3</p>
+<p id="footer">npm-pack — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-prefix — npm@2.8.3</p>
+<p id="footer">npm-prefix — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-prune — npm@2.8.3</p>
+<p id="footer">npm-prune — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-publish — npm@2.8.3</p>
+<p id="footer">npm-publish — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-rebuild — npm@2.8.3</p>
+<p id="footer">npm-rebuild — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-repo — npm@2.8.3</p>
+<p id="footer">npm-repo — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-restart — npm@2.8.3</p>
+<p id="footer">npm-restart — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-rm — npm@2.8.3</p>
+<p id="footer">npm-rm — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-root — npm@2.8.3</p>
+<p id="footer">npm-root — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-run-script — npm@2.8.3</p>
+<p id="footer">npm-run-script — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-search — npm@2.8.3</p>
+<p id="footer">npm-search — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-shrinkwrap — npm@2.8.3</p>
+<p id="footer">npm-shrinkwrap — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-star — npm@2.8.3</p>
+<p id="footer">npm-star — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-stars — npm@2.8.3</p>
+<p id="footer">npm-stars — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-start — npm@2.8.3</p>
+<p id="footer">npm-start — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-stop — npm@2.8.3</p>
+<p id="footer">npm-stop — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-tag — npm@2.8.3</p>
+<p id="footer">npm-tag — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-test — npm@2.8.3</p>
+<p id="footer">npm-test — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-uninstall — npm@2.8.3</p>
+<p id="footer">npm-uninstall — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-unpublish — npm@2.8.3</p>
+<p id="footer">npm-unpublish — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-update — npm@2.8.3</p>
+<p id="footer">npm-update — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-version — npm@2.8.3</p>
+<p id="footer">npm-version — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-view — npm@2.8.3</p>
+<p id="footer">npm-view — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-whoami — npm@2.8.3</p>
+<p id="footer">npm-whoami — npm@2.9.0</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm <command> [args]
</code></pre><h2 id="version">VERSION</h2>
-<p>2.8.3</p>
+<p>2.9.0</p>
<h2 id="description">DESCRIPTION</h2>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
the issues list or ask on the mailing list.</p>
<ul>
<li><a href="http://github.com/npm/npm/issues">http://github.com/npm/npm/issues</a></li>
-<li><a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com</a></li>
+<li><a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com</a></li>
</ul>
<h2 id="bugs">BUGS</h2>
<p>When you find issues, please report them:</p>
<li>web:
<a href="http://github.com/npm/npm/issues">http://github.com/npm/npm/issues</a></li>
<li>email:
-<a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com</a></li>
+<a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com</a></li>
</ul>
<p>Be sure to include <em>all</em> of the output from the npm command that didn't work
as expected. The <code>npm-debug.log</code> file is also helpful to provide.</p>
<p><a href="http://blog.izs.me/">Isaac Z. Schlueter</a> ::
<a href="https://github.com/isaacs/">isaacs</a> ::
<a href="http://twitter.com/izs">@izs</a> ::
-<a href="mailto:i@izs.me">i@izs.me</a></p>
+<a href="mailto:i@izs.me">i@izs.me</a></p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-help.html"><a href="../cli/npm-help.html">npm-help(1)</a></a></li>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm — npm@2.8.3</p>
+<p id="footer">npm — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-folders — npm@2.8.3</p>
+<p id="footer">npm-folders — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-global — npm@2.8.3</p>
+<p id="footer">npm-global — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-json — npm@2.8.3</p>
+<p id="footer">npm-json — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npmrc — npm@2.8.3</p>
+<p id="footer">npmrc — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">package.json — npm@2.8.3</p>
+<p id="footer">package.json — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">index — npm@2.8.3</p>
+<p id="footer">index — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-coding-style — npm@2.8.3</p>
+<p id="footer">npm-coding-style — npm@2.9.0</p>
<h1><a href="../misc/npm-config.html">npm-config</a></h1> <p>More than you probably want to know about npm configuration</p>
<h2 id="description">DESCRIPTION</h2>
-<p>npm gets its configuration values from 6 sources, in this priority:</p>
+<p>npm gets its configuration values from the following sources, sorted by priority:</p>
<h3 id="command-line-flags">Command Line Flags</h3>
<p>Putting <code>--foo bar</code> on the command line sets the <code>foo</code> configuration
parameter to <code>"bar"</code>. A <code>--</code> argument tells the cli parser to stop
it will install the specified tag.</p>
<p>Also the tag that is added to the package@version specified by the <code>npm
tag</code> command, if no explicit tag is given.</p>
+<h3 id="tag-version-prefix">tag-version-prefix</h3>
+<ul>
+<li>Default: <code>"v"</code></li>
+<li>Type: String</li>
+</ul>
+<p>If set, alters the prefix used when tagging a new version when performing a
+version increment using <code>npm-version</code>. To remove the prefix altogether, set it
+to the empty string: <code>""</code>.</p>
+<p>Because other tools may rely on the convention that npm version tags look like
+<code>v1.0.0</code>, <em>only use this property if it is absolutely necessary</em>. In
+particular, use care when overriding this setting for public packages.</p>
<h3 id="tmp">tmp</h3>
<ul>
<li>Default: TMPDIR environment variable, or "/tmp"</li>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-config — npm@2.8.3</p>
+<p id="footer">npm-config — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-developers — npm@2.8.3</p>
+<p id="footer">npm-developers — npm@2.9.0</p>
<h2 id="synopsis">SYNOPSIS</h2>
<ol>
<li>Get the author email with <code>npm owner ls <pkgname></code></li>
-<li>Email the author, CC <a href="mailto:support@npmjs.com">support@npmjs.com</a></li>
+<li>Email the author, CC <a href="mailto:support@npmjs.com">support@npmjs.com</a></li>
<li>After a few weeks, if there's no resolution, we'll sort it out.</li>
</ol>
<p>Don't squat on package names. Publish code or move out of the way.</p>
owner (Bob).</li>
<li>Joe emails Bob, explaining the situation <strong>as respectfully as
possible</strong>, and what he would like to do with the module name. He
-adds the npm support staff <a href="mailto:support@npmjs.com">support@npmjs.com</a> to the CC list of
+adds the npm support staff <a href="mailto:support@npmjs.com">support@npmjs.com</a> to the CC list of
the email. Mention in the email that Bob can run <code>npm owner add
joe foo</code> to add Joe as an owner of the <code>foo</code> package.</li>
<li>After a reasonable amount of time, if Bob has not responded, or if
Bob and Joe can't come to any sort of resolution, email support
-<a href="mailto:support@npmjs.com">support@npmjs.com</a> and we'll sort it out. ("Reasonable" is
+<a href="mailto:support@npmjs.com">support@npmjs.com</a> and we'll sort it out. ("Reasonable" is
usually at least 4 weeks, but extra time is allowed around common
holidays.)</li>
</ol>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-disputes — npm@2.8.3</p>
+<p id="footer">npm-disputes — npm@2.9.0</p>
<p>To check if the registry is down, open up
<a href="https://registry.npmjs.org/">https://registry.npmjs.org/</a> in a web browser. This will also tell
you if you are just unable to access the internet for some reason.</p>
-<p>If the registry IS down, let us know by emailing <a href="mailto:support@npmjs.com">support@npmjs.com</a>
+<p>If the registry IS down, let us know by emailing <a href="mailto:support@npmjs.com">support@npmjs.com</a>
or posting an issue at <a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a>. If it's
down for the world (and not just on your local network) then we're
probably already being pinged about it.</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-faq — npm@2.8.3</p>
+<p id="footer">npm-faq — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-index — npm@2.8.3</p>
+<p id="footer">npm-index — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-registry — npm@2.8.3</p>
+<p id="footer">npm-registry — npm@2.9.0</p>
<pre><code>@somescope/somepackagename
</code></pre><p>Scopes are a way of grouping related packages together, and also affect a few
things about the way npm treats the package.</p>
-<p><strong>As of 2014-09-03, scoped packages are not supported by the public npm registry</strong>.
-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.</p>
+<p>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>
<h2 id="installing-scoped-packages">Installing scoped packages</h2>
<p>Scoped packages are installed to a sub-folder of the regular installation
folder, e.g. if your other packages are installed in <code>node_modules/packagename</code>,
</code></pre><p>There is nothing special about the way Node treats scope folders, this is
just specifying to require the module <code>mypackage</code> in the folder called <code>@myorg</code>.</p>
<h2 id="publishing-scoped-packages">Publishing scoped packages</h2>
-<p>Scoped packages can be published to any registry that supports them.
-<em>As of 2014-09-03, the public npm registry does not support scoped packages</em>,
-so attempting to publish a scoped package to the registry will fail unless
-you have associated that scope with a different registry, see below.</p>
+<p>Scoped packages can be published to any registry that supports them, including
+the public npm registry.</p>
+<p>(As of 2015-04-19, the public npm registry <strong>does</strong> support scoped packages)</p>
+<p>If you wish, you may associate a scope with a registry; see below.</p>
+<h3 id="publishing-public-scoped-packages-to-the-public-npm-registry">Publishing public scoped packages to the public npm registry</h3>
+<p>To publish a public scoped package, you must specify <code>--access public</code> with
+the initial publication. This will publish the package and set access
+to <code>public</code> as if you had run <code>npm access public</code> after publishing.</p>
+<h3 id="publishing-private-scoped-packages-to-the-npm-registry">Publishing private scoped packages to the npm registry</h3>
+<p>To publish a private scoped package to the npm registry, you must have
+an <a href="https://www.npmjs.com/private-modules">npm Private Modules</a>
+account.</p>
+<p>You can then publish the module with <code>npm publish</code> or <code>npm publish
+--access restricted</code>, and it will be present in the npm registry, with
+restricted access. You can then change the access permissions, if
+desired, with <code>npm access</code> or on the npmjs.com website.</p>
<h2 id="associating-a-scope-with-a-registry">Associating a scope with a registry</h2>
<p>Scopes can be associated with a separate registry. This allows you to
seamlessly use a mix of packages from the public npm registry and one or more
<ul>
<li><a href="../cli/npm-install.html"><a href="../cli/npm-install.html">npm-install(1)</a></a></li>
<li><a href="../cli/npm-publish.html"><a href="../cli/npm-publish.html">npm-publish(1)</a></a></li>
+<li><a href="../cli/npm-access.html"><a href="../cli/npm-access.html">npm-access(1)</a></a></li>
</ul>
</div>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-scope — npm@2.8.3</p>
+<p id="footer">npm-scope — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">npm-scripts — npm@2.8.3</p>
+<p id="footer">npm-scripts — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">removing-npm — npm@2.8.3</p>
+<p id="footer">removing-npm — npm@2.9.0</p>
<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6> </td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)"> </td></tr>
<tr><td colspan=5 style="width:50px;height:10px;background:#fff"> </td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4> </td><td style="width:90px;height:10px;background:#fff" colspan=9> </td></tr>
</table>
-<p id="footer">semver — npm@2.8.3</p>
+<p id="footer">semver — npm@2.9.0</p>
<p>If you have a complaint about a package in the public npm registry,
and cannot <a href="https://docs.npmjs.com/misc/disputes">resolve it with the package
owner</a>, please email
-<a href="mailto:support@npmjs.com">support@npmjs.com</a> and explain the situation.</p>
+<a href="mailto:support@npmjs.com">support@npmjs.com</a> and explain the situation.</p>
<p>Any data published to The npm Registry (including user account
information) may be removed or modified at the sole discretion of the
npm server administrators.</p>
npm.commands.install(["package"], cb)
})
</code></pre><h2 id="version">VERSION</h2>
-<p>2.8.3</p>
+<p>2.9.0</p>
<h2 id="description">DESCRIPTION</h2>
<p>This is the API documentation for npm.
To find documentation of the command line
limit the results to only the paths to the packages named. Note that
nested packages will <em>also</em> show the paths to the specified packages.
For example, running <code>npm ls promzard</code> in npm's source tree will show:</p>
-<pre><code>npm@2.8.3 /path/to/npm
+<pre><code>npm@2.9.0 /path/to/npm
└─┬ init-package-json@0.0.4
└── promzard@0.1.5
</code></pre><p>It will print out extraneous, missing, and invalid packages.</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm <command> [args]
</code></pre><h2 id="version">VERSION</h2>
-<p>2.8.3</p>
+<p>2.9.0</p>
<h2 id="description">DESCRIPTION</h2>
<p>npm is the package manager for the Node JavaScript platform. It puts
modules in place so that node can find them, and manages dependency
the issues list or ask on the mailing list.</p>
<ul>
<li><a href="http://github.com/npm/npm/issues">http://github.com/npm/npm/issues</a></li>
-<li><a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com</a></li>
+<li><a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com</a></li>
</ul>
<h2 id="bugs">BUGS</h2>
<p>When you find issues, please report them:</p>
<li>web:
<a href="http://github.com/npm/npm/issues">http://github.com/npm/npm/issues</a></li>
<li>email:
-<a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com</a></li>
+<a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com</a></li>
</ul>
<p>Be sure to include <em>all</em> of the output from the npm command that didn't work
as expected. The <code>npm-debug.log</code> file is also helpful to provide.</p>
<p><a href="http://blog.izs.me/">Isaac Z. Schlueter</a> ::
<a href="https://github.com/isaacs/">isaacs</a> ::
<a href="http://twitter.com/izs">@izs</a> ::
-<a href="mailto:i@izs.me">i@izs.me</a></p>
+<a href="mailto:i@izs.me">i@izs.me</a></p>
<h2 id="see-also">SEE ALSO</h2>
<ul>
<li><a href="../cli/npm-help.html">npm-help(1)</a></li>
<h1><a href="../misc/npm-config.html">npm-config</a></h1> <p>More than you probably want to know about npm configuration</p>
<h2 id="description">DESCRIPTION</h2>
-<p>npm gets its configuration values from 6 sources, in this priority:</p>
+<p>npm gets its configuration values from the following sources, sorted by priority:</p>
<h3 id="command-line-flags">Command Line Flags</h3>
<p>Putting <code>--foo bar</code> on the command line sets the <code>foo</code> configuration
parameter to <code>"bar"</code>. A <code>--</code> argument tells the cli parser to stop
it will install the specified tag.</p>
<p>Also the tag that is added to the package@version specified by the <code>npm
tag</code> command, if no explicit tag is given.</p>
+<h3 id="tag-version-prefix">tag-version-prefix</h3>
+<ul>
+<li>Default: <code>"v"</code></li>
+<li>Type: String</li>
+</ul>
+<p>If set, alters the prefix used when tagging a new version when performing a
+version increment using <code>npm-version</code>. To remove the prefix altogether, set it
+to the empty string: <code>""</code>.</p>
+<p>Because other tools may rely on the convention that npm version tags look like
+<code>v1.0.0</code>, <em>only use this property if it is absolutely necessary</em>. In
+particular, use care when overriding this setting for public packages.</p>
<h3 id="tmp">tmp</h3>
<ul>
<li>Default: TMPDIR environment variable, or "/tmp"</li>
<h2 id="synopsis">SYNOPSIS</h2>
<ol>
<li>Get the author email with <code>npm owner ls <pkgname></code></li>
-<li>Email the author, CC <a href="mailto:support@npmjs.com">support@npmjs.com</a></li>
+<li>Email the author, CC <a href="mailto:support@npmjs.com">support@npmjs.com</a></li>
<li>After a few weeks, if there's no resolution, we'll sort it out.</li>
</ol>
<p>Don't squat on package names. Publish code or move out of the way.</p>
owner (Bob).</li>
<li>Joe emails Bob, explaining the situation <strong>as respectfully as
possible</strong>, and what he would like to do with the module name. He
-adds the npm support staff <a href="mailto:support@npmjs.com">support@npmjs.com</a> to the CC list of
+adds the npm support staff <a href="mailto:support@npmjs.com">support@npmjs.com</a> to the CC list of
the email. Mention in the email that Bob can run <code>npm owner add
joe foo</code> to add Joe as an owner of the <code>foo</code> package.</li>
<li>After a reasonable amount of time, if Bob has not responded, or if
Bob and Joe can't come to any sort of resolution, email support
-<a href="mailto:support@npmjs.com">support@npmjs.com</a> and we'll sort it out. ("Reasonable" is
+<a href="mailto:support@npmjs.com">support@npmjs.com</a> and we'll sort it out. ("Reasonable" is
usually at least 4 weeks, but extra time is allowed around common
holidays.)</li>
</ol>
<p>To check if the registry is down, open up
<a href="https://registry.npmjs.org/">https://registry.npmjs.org/</a> in a web browser. This will also tell
you if you are just unable to access the internet for some reason.</p>
-<p>If the registry IS down, let us know by emailing <a href="mailto:support@npmjs.com">support@npmjs.com</a>
+<p>If the registry IS down, let us know by emailing <a href="mailto:support@npmjs.com">support@npmjs.com</a>
or posting an issue at <a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a>. If it's
down for the world (and not just on your local network) then we're
probably already being pinged about it.</p>
<pre><code>@somescope/somepackagename
</code></pre><p>Scopes are a way of grouping related packages together, and also affect a few
things about the way npm treats the package.</p>
-<p><strong>As of 2014-09-03, scoped packages are not supported by the public npm registry</strong>.
-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.</p>
+<p>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>
<h2 id="installing-scoped-packages">Installing scoped packages</h2>
<p>Scoped packages are installed to a sub-folder of the regular installation
folder, e.g. if your other packages are installed in <code>node_modules/packagename</code>,
</code></pre><p>There is nothing special about the way Node treats scope folders, this is
just specifying to require the module <code>mypackage</code> in the folder called <code>@myorg</code>.</p>
<h2 id="publishing-scoped-packages">Publishing scoped packages</h2>
-<p>Scoped packages can be published to any registry that supports them.
-<em>As of 2014-09-03, the public npm registry does not support scoped packages</em>,
-so attempting to publish a scoped package to the registry will fail unless
-you have associated that scope with a different registry, see below.</p>
+<p>Scoped packages can be published to any registry that supports them, including
+the public npm registry.</p>
+<p>(As of 2015-04-19, the public npm registry <strong>does</strong> support scoped packages)</p>
+<p>If you wish, you may associate a scope with a registry; see below.</p>
+<h3 id="publishing-public-scoped-packages-to-the-public-npm-registry">Publishing public scoped packages to the public npm registry</h3>
+<p>To publish a public scoped package, you must specify <code>--access public</code> with
+the initial publication. This will publish the package and set access
+to <code>public</code> as if you had run <code>npm access public</code> after publishing.</p>
+<h3 id="publishing-private-scoped-packages-to-the-npm-registry">Publishing private scoped packages to the npm registry</h3>
+<p>To publish a private scoped package to the npm registry, you must have
+an <a href="https://www.npmjs.com/private-modules">npm Private Modules</a>
+account.</p>
+<p>You can then publish the module with <code>npm publish</code> or <code>npm publish
+--access restricted</code>, and it will be present in the npm registry, with
+restricted access. You can then change the access permissions, if
+desired, with <code>npm access</code> or on the npmjs.com website.</p>
<h2 id="associating-a-scope-with-a-registry">Associating a scope with a registry</h2>
<p>Scopes can be associated with a separate registry. This allows you to
seamlessly use a mix of packages from the public npm registry and one or more
<ul>
<li><a href="../cli/npm-install.html">npm-install(1)</a></li>
<li><a href="../cli/npm-publish.html">npm-publish(1)</a></li>
+<li><a href="../cli/npm-access.html">npm-access(1)</a></li>
</ul>
, spin: true
, "strict-ssl": true
, tag : "latest"
+ , "tag-version-prefix" : "v"
, tmp : temp
, unicode : true
, "unsafe-perm" : process.platform === "win32"
, userconfig : path
, umask: Umask
, version : Boolean
+ , "tag-version-prefix" : String
, versions : Boolean
, viewer: String
, _exit : Boolean
if (!initJson.yes(npm.config)) {
console.log(
["This utility will walk you through creating a package.json file."
- ,"It only covers the most common items, and tries to guess sane defaults."
+ ,"It only covers the most common items, and tries to guess sensible defaults."
,""
,"See `npm help json` for definitive documentation on these fields"
,"and exactly what they do."
var parent = data
- var d = data.dependencies || {}
-
// if we're explicitly installing "what" into "where", then the shrinkwrap
// for "where" doesn't apply. This would be the case if someone were adding
// a new package to a shrinkwrapped package. (data.dependencies will not be
// there's no harm in using that.)
if (context.explicit) wrap = null
+ var deps = data.dependencies || {}
+ var devDeps = data.devDependencies || {}
+
// what is a list of things.
// resolve each one.
asyncMap( what
- , targetResolver(where, context, d)
+ , targetResolver(where, context, deps, devDeps)
, function (er, targets) {
if (er) return cb(er)
})
}
-function targetResolver (where, context, deps) {
+function targetResolver (where, context, deps, devDeps) {
var alreadyInstalledManually = []
, resolveLeft = 0
, nm = path.resolve(where, "node_modules")
// otherwise, make sure that it's a semver match with what we want.
var bd = parent.bundleDependencies
var isBundled = bd && bd.indexOf(d.name) !== -1
- var currentIsSatisfactory = semver.satisfies(d.version, deps[d.name] || "*", true)
+ var expectedVersion = deps[d.name] || (devDeps && devDeps[d.name]) || "*"
+ var currentIsSatisfactory = semver.satisfies(d.version, expectedVersion, true)
if (isBundled || currentIsSatisfactory || deps[d.name] === d._resolved) {
return cb(null, d.name)
}
}
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")
}
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()
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 {
, 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>]"
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
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>]"
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) {
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)
})
})
}
--- /dev/null
+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 }
+}
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
)
-.TH "NPM" "1" "April 2015" "" ""
+.TH "NPM" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm\fR \- a JavaScript package manager
.P
-.TH "NPM\-ACCESS" "1" "April 2015" "" ""
+.TH "NPM\-ACCESS" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-access\fR \- Set access level on published packages
.SH SYNOPSIS
-.TH "NPM\-ADDUSER" "1" "April 2015" "" ""
+.TH "NPM\-ADDUSER" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-adduser\fR \- Add a registry user account
.SH SYNOPSIS
-.TH "NPM\-BIN" "1" "April 2015" "" ""
+.TH "NPM\-BIN" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SH SYNOPSIS
-.TH "NPM\-BUGS" "1" "April 2015" "" ""
+.TH "NPM\-BUGS" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe
.SH SYNOPSIS
-.TH "NPM\-BUILD" "1" "April 2015" "" ""
+.TH "NPM\-BUILD" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-build\fR \- Build a package
.SH SYNOPSIS
-.TH "NPM\-BUNDLE" "1" "April 2015" "" ""
+.TH "NPM\-BUNDLE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-bundle\fR \- REMOVED
.SH DESCRIPTION
-.TH "NPM\-CACHE" "1" "April 2015" "" ""
+.TH "NPM\-CACHE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-cache\fR \- Manipulates packages cache
.SH SYNOPSIS
-.TH "NPM\-COMPLETION" "1" "April 2015" "" ""
+.TH "NPM\-COMPLETION" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-completion\fR \- Tab Completion for npm
.SH SYNOPSIS
-.TH "NPM\-CONFIG" "1" "April 2015" "" ""
+.TH "NPM\-CONFIG" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SH SYNOPSIS
-.TH "NPM\-DEDUPE" "1" "April 2015" "" ""
+.TH "NPM\-DEDUPE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-dedupe\fR \- Reduce duplication
.SH SYNOPSIS
-.TH "NPM\-DEPRECATE" "1" "April 2015" "" ""
+.TH "NPM\-DEPRECATE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-deprecate\fR \- Deprecate a version of a package
.SH SYNOPSIS
-.TH "NPM\-DIST\-TAG" "1" "April 2015" "" ""
+.TH "NPM\-DIST\-TAG" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-dist-tag\fR \- Modify package distribution tags
.SH SYNOPSIS
-.TH "NPM\-DOCS" "1" "April 2015" "" ""
+.TH "NPM\-DOCS" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-docs\fR \- Docs for a package in a web browser maybe
.SH SYNOPSIS
-.TH "NPM\-EDIT" "1" "April 2015" "" ""
+.TH "NPM\-EDIT" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-edit\fR \- Edit an installed package
.SH SYNOPSIS
-.TH "NPM\-EXPLORE" "1" "April 2015" "" ""
+.TH "NPM\-EXPLORE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-explore\fR \- Browse an installed package
.SH SYNOPSIS
-.TH "NPM\-HELP\-SEARCH" "1" "April 2015" "" ""
+.TH "NPM\-HELP\-SEARCH" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-help-search\fR \- Search npm help documentation
.SH SYNOPSIS
-.TH "NPM\-HELP" "1" "April 2015" "" ""
+.TH "NPM\-HELP" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-help\fR \- Get help on npm
.SH SYNOPSIS
-.TH "NPM\-INIT" "1" "April 2015" "" ""
+.TH "NPM\-INIT" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-init\fR \- Interactively create a package\.json file
.SH SYNOPSIS
-.TH "NPM\-INSTALL" "1" "April 2015" "" ""
+.TH "NPM\-INSTALL" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-install\fR \- Install a package
.SH SYNOPSIS
-.TH "NPM\-LINK" "1" "April 2015" "" ""
+.TH "NPM\-LINK" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-link\fR \- Symlink a package folder
.SH SYNOPSIS
.P
Now, any changes to ~/projects/node\-redis will be reflected in
~/projects/node\-bloggy/node_modules/node\-redis/\. Note that the link should
-be to the package name, not the directory name for that package\.
+be to the package name, not the directory name for that package\.
.P
You may also shortcut the two steps in one\. For example, to do the
above use\-case in a shorter way:
-.TH "NPM\-LOGOUT" "1" "April 2015" "" ""
+.TH "NPM\-LOGOUT" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-logout\fR \- Log out of the registry
.SH SYNOPSIS
-.TH "NPM\-LS" "1" "April 2015" "" ""
+.TH "NPM\-LS" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-ls\fR \- List installed packages
.SH SYNOPSIS
.P
.RS 2
.nf
-npm@2.8.3 /path/to/npm
+npm@2.9.0 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
-.TH "NPM\-OUTDATED" "1" "April 2015" "" ""
+.TH "NPM\-OUTDATED" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-outdated\fR \- Check for outdated packages
.SH SYNOPSIS
-.TH "NPM\-OWNER" "1" "April 2015" "" ""
+.TH "NPM\-OWNER" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-owner\fR \- Manage package owners
.SH SYNOPSIS
-.TH "NPM\-PACK" "1" "April 2015" "" ""
+.TH "NPM\-PACK" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-pack\fR \- Create a tarball from a package
.SH SYNOPSIS
-.TH "NPM\-PREFIX" "1" "April 2015" "" ""
+.TH "NPM\-PREFIX" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-prefix\fR \- Display prefix
.SH SYNOPSIS
-.TH "NPM\-PRUNE" "1" "April 2015" "" ""
+.TH "NPM\-PRUNE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-prune\fR \- Remove extraneous packages
.SH SYNOPSIS
-.TH "NPM\-PUBLISH" "1" "April 2015" "" ""
+.TH "NPM\-PUBLISH" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SH SYNOPSIS
-.TH "NPM\-REBUILD" "1" "April 2015" "" ""
+.TH "NPM\-REBUILD" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-rebuild\fR \- Rebuild a package
.SH SYNOPSIS
-.TH "NPM\-REPO" "1" "April 2015" "" ""
+.TH "NPM\-REPO" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-repo\fR \- Open package repository page in the browser
.SH SYNOPSIS
-.TH "NPM\-RESTART" "1" "April 2015" "" ""
+.TH "NPM\-RESTART" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-restart\fR \- Restart a package
.SH SYNOPSIS
-.TH "NPM\-RM" "1" "April 2015" "" ""
+.TH "NPM\-RM" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-rm\fR \- Remove a package
.SH SYNOPSIS
-.TH "NPM\-ROOT" "1" "April 2015" "" ""
+.TH "NPM\-ROOT" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-root\fR \- Display npm root
.SH SYNOPSIS
-.TH "NPM\-RUN\-SCRIPT" "1" "April 2015" "" ""
+.TH "NPM\-RUN\-SCRIPT" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-run-script\fR \- Run arbitrary package scripts
.SH SYNOPSIS
-.TH "NPM\-SEARCH" "1" "April 2015" "" ""
+.TH "NPM\-SEARCH" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-search\fR \- Search for packages
.SH SYNOPSIS
-.TH "NPM\-SHRINKWRAP" "1" "April 2015" "" ""
+.TH "NPM\-SHRINKWRAP" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-shrinkwrap\fR \- Lock down dependency versions
.SH SYNOPSIS
-.TH "NPM\-STAR" "1" "April 2015" "" ""
+.TH "NPM\-STAR" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-star\fR \- Mark your favorite packages
.SH SYNOPSIS
-.TH "NPM\-STARS" "1" "April 2015" "" ""
+.TH "NPM\-STARS" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-stars\fR \- View packages marked as favorites
.SH SYNOPSIS
-.TH "NPM\-START" "1" "April 2015" "" ""
+.TH "NPM\-START" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-start\fR \- Start a package
.SH SYNOPSIS
-.TH "NPM\-STOP" "1" "April 2015" "" ""
+.TH "NPM\-STOP" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-stop\fR \- Stop a package
.SH SYNOPSIS
-.TH "NPM\-TAG" "1" "April 2015" "" ""
+.TH "NPM\-TAG" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-tag\fR \- Tag a published version
.SH SYNOPSIS
-.TH "NPM\-TEST" "1" "April 2015" "" ""
+.TH "NPM\-TEST" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-test\fR \- Test a package
.SH SYNOPSIS
-.TH "NPM\-RM" "1" "April 2015" "" ""
+.TH "NPM\-RM" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-rm\fR \- Remove a package
.SH SYNOPSIS
-.TH "NPM\-UNPUBLISH" "1" "April 2015" "" ""
+.TH "NPM\-UNPUBLISH" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-unpublish\fR \- Remove a package from the registry
.SH SYNOPSIS
-.TH "NPM\-UPDATE" "1" "April 2015" "" ""
+.TH "NPM\-UPDATE" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-update\fR \- Update a package
.SH SYNOPSIS
-.TH "NPM\-VERSION" "1" "April 2015" "" ""
+.TH "NPM\-VERSION" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-version\fR \- Bump a package version
.SH SYNOPSIS
-.TH "NPM\-VIEW" "1" "April 2015" "" ""
+.TH "NPM\-VIEW" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-view\fR \- View registry info
.SH SYNOPSIS
-.TH "NPM\-WHOAMI" "1" "April 2015" "" ""
+.TH "NPM\-WHOAMI" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-whoami\fR \- Display npm username
.SH SYNOPSIS
-.TH "NPM" "1" "April 2015" "" ""
+.TH "NPM" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm\fR \- javascript package manager
.SH SYNOPSIS
.RE
.SH VERSION
.P
-2.8.3
+2.9.0
.SH DESCRIPTION
.P
npm is the package manager for the Node JavaScript platform\. It puts
-.TH "NPM\-BIN" "3" "April 2015" "" ""
+.TH "NPM\-BIN" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-bin\fR \- Display npm bin folder
.SH SYNOPSIS
-.TH "NPM\-BUGS" "3" "April 2015" "" ""
+.TH "NPM\-BUGS" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe
.SH SYNOPSIS
-.TH "NPM\-CACHE" "3" "April 2015" "" ""
+.TH "NPM\-CACHE" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-cache\fR \- manage the npm cache programmatically
.SH SYNOPSIS
-.TH "NPM\-COMMANDS" "3" "April 2015" "" ""
+.TH "NPM\-COMMANDS" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-commands\fR \- npm commands
.SH SYNOPSIS
-.TH "NPM\-CONFIG" "3" "April 2015" "" ""
+.TH "NPM\-CONFIG" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-config\fR \- Manage the npm configuration files
.SH SYNOPSIS
-.TH "NPM\-DEPRECATE" "3" "April 2015" "" ""
+.TH "NPM\-DEPRECATE" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-deprecate\fR \- Deprecate a version of a package
.SH SYNOPSIS
-.TH "NPM\-DOCS" "3" "April 2015" "" ""
+.TH "NPM\-DOCS" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-docs\fR \- Docs for a package in a web browser maybe
.SH SYNOPSIS
-.TH "NPM\-EDIT" "3" "April 2015" "" ""
+.TH "NPM\-EDIT" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-edit\fR \- Edit an installed package
.SH SYNOPSIS
-.TH "NPM\-EXPLORE" "3" "April 2015" "" ""
+.TH "NPM\-EXPLORE" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-explore\fR \- Browse an installed package
.SH SYNOPSIS
-.TH "NPM\-HELP\-SEARCH" "3" "April 2015" "" ""
+.TH "NPM\-HELP\-SEARCH" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-help-search\fR \- Search the help pages
.SH SYNOPSIS
-.TH "NPM" "" "April 2015" "" ""
+.TH "NPM" "" "May 2015" "" ""
.SH "NAME"
\fBnpm\fR
.SH SYNOPSIS
-.TH "NPM\-INSTALL" "3" "April 2015" "" ""
+.TH "NPM\-INSTALL" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-install\fR \- install a package programmatically
.SH SYNOPSIS
-.TH "NPM\-LINK" "3" "April 2015" "" ""
+.TH "NPM\-LINK" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-link\fR \- Symlink a package folder
.SH SYNOPSIS
-.TH "NPM\-LOAD" "3" "April 2015" "" ""
+.TH "NPM\-LOAD" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-load\fR \- Load config settings
.SH SYNOPSIS
-.TH "NPM\-LS" "3" "April 2015" "" ""
+.TH "NPM\-LS" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-ls\fR \- List installed packages
.SH SYNOPSIS
-.TH "NPM\-OUTDATED" "3" "April 2015" "" ""
+.TH "NPM\-OUTDATED" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-outdated\fR \- Check for outdated packages
.SH SYNOPSIS
-.TH "NPM\-OWNER" "3" "April 2015" "" ""
+.TH "NPM\-OWNER" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-owner\fR \- Manage package owners
.SH SYNOPSIS
-.TH "NPM\-PACK" "3" "April 2015" "" ""
+.TH "NPM\-PACK" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-pack\fR \- Create a tarball from a package
.SH SYNOPSIS
-.TH "NPM\-PREFIX" "3" "April 2015" "" ""
+.TH "NPM\-PREFIX" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-prefix\fR \- Display prefix
.SH SYNOPSIS
-.TH "NPM\-PRUNE" "3" "April 2015" "" ""
+.TH "NPM\-PRUNE" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-prune\fR \- Remove extraneous packages
.SH SYNOPSIS
-.TH "NPM\-PUBLISH" "3" "April 2015" "" ""
+.TH "NPM\-PUBLISH" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-publish\fR \- Publish a package
.SH SYNOPSIS
-.TH "NPM\-REBUILD" "3" "April 2015" "" ""
+.TH "NPM\-REBUILD" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-rebuild\fR \- Rebuild a package
.SH SYNOPSIS
-.TH "NPM\-REPO" "3" "April 2015" "" ""
+.TH "NPM\-REPO" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-repo\fR \- Open package repository page in the browser
.SH SYNOPSIS
-.TH "NPM\-RESTART" "3" "April 2015" "" ""
+.TH "NPM\-RESTART" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-restart\fR \- Restart a package
.SH SYNOPSIS
-.TH "NPM\-ROOT" "3" "April 2015" "" ""
+.TH "NPM\-ROOT" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-root\fR \- Display npm root
.SH SYNOPSIS
-.TH "NPM\-RUN\-SCRIPT" "3" "April 2015" "" ""
+.TH "NPM\-RUN\-SCRIPT" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-run-script\fR \- Run arbitrary package scripts
.SH SYNOPSIS
-.TH "NPM\-SEARCH" "3" "April 2015" "" ""
+.TH "NPM\-SEARCH" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-search\fR \- Search for packages
.SH SYNOPSIS
-.TH "NPM\-SHRINKWRAP" "3" "April 2015" "" ""
+.TH "NPM\-SHRINKWRAP" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-shrinkwrap\fR \- programmatically generate package shrinkwrap file
.SH SYNOPSIS
-.TH "NPM\-START" "3" "April 2015" "" ""
+.TH "NPM\-START" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-start\fR \- Start a package
.SH SYNOPSIS
-.TH "NPM\-STOP" "3" "April 2015" "" ""
+.TH "NPM\-STOP" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-stop\fR \- Stop a package
.SH SYNOPSIS
-.TH "NPM\-TAG" "3" "April 2015" "" ""
+.TH "NPM\-TAG" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-tag\fR \- Tag a published version
.SH SYNOPSIS
-.TH "NPM\-TEST" "3" "April 2015" "" ""
+.TH "NPM\-TEST" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-test\fR \- Test a package
.SH SYNOPSIS
-.TH "NPM\-UNINSTALL" "3" "April 2015" "" ""
+.TH "NPM\-UNINSTALL" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-uninstall\fR \- uninstall a package programmatically
.SH SYNOPSIS
-.TH "NPM\-UNPUBLISH" "3" "April 2015" "" ""
+.TH "NPM\-UNPUBLISH" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-unpublish\fR \- Remove a package from the registry
.SH SYNOPSIS
-.TH "NPM\-UPDATE" "3" "April 2015" "" ""
+.TH "NPM\-UPDATE" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-update\fR \- Update a package
.SH SYNOPSIS
npm\.commands\.update(packages, callback)
.fi
.RE
-.TH "DESCRIPTION" "" "April 2015" "" ""
+.TH "DESCRIPTION" "" "May 2015" "" ""
.SH "NAME"
\fBDESCRIPTION\fR
.P
-.TH "NPM\-VERSION" "3" "April 2015" "" ""
+.TH "NPM\-VERSION" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-version\fR \- Bump a package version
.SH SYNOPSIS
-.TH "NPM\-VIEW" "3" "April 2015" "" ""
+.TH "NPM\-VIEW" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-view\fR \- View registry info
.SH SYNOPSIS
-.TH "NPM\-WHOAMI" "3" "April 2015" "" ""
+.TH "NPM\-WHOAMI" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm-whoami\fR \- Display npm username
.SH SYNOPSIS
-.TH "NPM" "3" "April 2015" "" ""
+.TH "NPM" "3" "May 2015" "" ""
.SH "NAME"
\fBnpm\fR \- javascript package manager
.SH SYNOPSIS
.RE
.SH VERSION
.P
-2.8.3
+2.9.0
.SH DESCRIPTION
.P
This is the API documentation for npm\.
-.TH "NPM\-FOLDERS" "5" "April 2015" "" ""
+.TH "NPM\-FOLDERS" "5" "May 2015" "" ""
.SH "NAME"
\fBnpm-folders\fR \- Folder Structures Used by npm
.SH DESCRIPTION
-.TH "NPM\-FOLDERS" "5" "April 2015" "" ""
+.TH "NPM\-FOLDERS" "5" "May 2015" "" ""
.SH "NAME"
\fBnpm-folders\fR \- Folder Structures Used by npm
.SH DESCRIPTION
-.TH "PACKAGE\.JSON" "5" "April 2015" "" ""
+.TH "PACKAGE\.JSON" "5" "May 2015" "" ""
.SH "NAME"
\fBpackage.json\fR \- Specifics of npm's package\.json handling
.SH DESCRIPTION
-.TH "NPMRC" "5" "April 2015" "" ""
+.TH "NPMRC" "5" "May 2015" "" ""
.SH "NAME"
\fBnpmrc\fR \- The npm config files
.SH DESCRIPTION
-.TH "PACKAGE\.JSON" "5" "April 2015" "" ""
+.TH "PACKAGE\.JSON" "5" "May 2015" "" ""
.SH "NAME"
\fBpackage.json\fR \- Specifics of npm's package\.json handling
.SH DESCRIPTION
-.TH "NPM\-CODING\-STYLE" "7" "April 2015" "" ""
+.TH "NPM\-CODING\-STYLE" "7" "May 2015" "" ""
.SH "NAME"
\fBnpm-coding-style\fR \- npm's "funny" coding style
.SH DESCRIPTION
-.TH "NPM\-CONFIG" "7" "April 2015" "" ""
+.TH "NPM\-CONFIG" "7" "May 2015" "" ""
.SH "NAME"
\fBnpm-config\fR \- More than you probably want to know about npm configuration
.SH DESCRIPTION
.P
-npm gets its configuration values from 6 sources, in this priority:
+npm gets its configuration values from the following sources, sorted by priority:
.SS Command Line Flags
.P
Putting \fB\-\-foo bar\fR on the command line sets the \fBfoo\fR configuration
.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
-.TH "NPM\-DEVELOPERS" "7" "April 2015" "" ""
+.TH "NPM\-DEVELOPERS" "7" "May 2015" "" ""
.SH "NAME"
\fBnpm-developers\fR \- Developer Guide
.SH DESCRIPTION
-.TH "NPM\-DISPUTES" "7" "April 2015" "" ""
+.TH "NPM\-DISPUTES" "7" "May 2015" "" ""
.SH "NAME"
\fBnpm-disputes\fR \- Handling Module Name Disputes
.SH SYNOPSIS
-.TH "NPM\-FAQ" "7" "April 2015" "" ""
+.TH "NPM\-FAQ" "7" "May 2015" "" ""
.SH "NAME"
\fBnpm-faq\fR \- Frequently Asked Questions
.SH Where can I find these docs in HTML?
-.TH "NPM\-INDEX" "7" "April 2015" "" ""
+.TH "NPM\-INDEX" "7" "May 2015" "" ""
.SH "NAME"
\fBnpm-index\fR \- Index of all npm documentation
.SS npm help README
-.TH "NPM\-REGISTRY" "7" "April 2015" "" ""
+.TH "NPM\-REGISTRY" "7" "May 2015" "" ""
.SH "NAME"
\fBnpm-registry\fR \- The JavaScript Package Registry
.SH DESCRIPTION
-.TH "NPM\-SCOPE" "7" "April 2015" "" ""
+.TH "NPM\-SCOPE" "7" "May 2015" "" ""
.SH "NAME"
\fBnpm-scope\fR \- Scoped packages
.SH DESCRIPTION
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
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
npm help install
.IP \(bu 2
npm help publish
+.IP \(bu 2
+npm help access
.RE
-.TH "NPM\-SCRIPTS" "7" "April 2015" "" ""
+.TH "NPM\-SCRIPTS" "7" "May 2015" "" ""
.SH "NAME"
\fBnpm-scripts\fR \- How npm handles the "scripts" field
.SH DESCRIPTION
-.TH "NPM\-REMOVAL" "1" "April 2015" "" ""
+.TH "NPM\-REMOVAL" "1" "May 2015" "" ""
.SH "NAME"
\fBnpm-removal\fR \- Cleaning the Slate
.SH SYNOPSIS
-.TH "SEMVER" "7" "April 2015" "" ""
+.TH "SEMVER" "7" "May 2015" "" ""
.SH "NAME"
\fBsemver\fR \- The semantic versioner for npm
.SH Usage
{
"name": "editor",
- "version": "0.1.0",
+ "version": "1.0.0",
"description": "launch $EDITOR in your program",
"main": "index.js",
"directories": {
"engine": {
"node": ">=0.6"
},
+ "gitHead": "15200af2c417c65a4df153f39f32143dcd476375",
"bugs": {
"url": "https://github.com/substack/node-editor/issues"
},
- "_id": "editor@0.1.0",
- "dist": {
- "shasum": "542f4662c6a8c88e862fc11945e204e51981b9a1",
- "tarball": "http://registry.npmjs.org/editor/-/editor-0.1.0.tgz"
- },
- "_from": "editor@latest",
- "_npmVersion": "1.3.21",
+ "_id": "editor@1.0.0",
+ "_shasum": "60c7f87bd62bcc6a894fa8ccd6afb7823a24f742",
+ "_from": "editor@>=1.0.0 <1.1.0",
+ "_npmVersion": "2.7.5",
+ "_nodeVersion": "1.6.3",
"_npmUser": {
"name": "substack",
- "email": "mail@substack.net"
+ "email": "substack@gmail.com"
+ },
+ "dist": {
+ "shasum": "60c7f87bd62bcc6a894fa8ccd6afb7823a24f742",
+ "tarball": "http://registry.npmjs.org/editor/-/editor-1.0.0.tgz"
},
"maintainers": [
{
"email": "mail@substack.net"
}
],
- "_shasum": "542f4662c6a8c88e862fc11945e204e51981b9a1",
- "_resolved": "https://registry.npmjs.org/editor/-/editor-0.1.0.tgz"
+ "_resolved": "https://registry.npmjs.org/editor/-/editor-1.0.0.tgz"
}
Currently this supports Github, Bitbucket and Gitlab. Pull requests for
additional hosts welcome.
+
--- /dev/null
+language: node_js
+node_js:
+ - "0.10"
+ - "0.11"
A node module to get your node module started.
+[![Build Status](https://secure.travis-ci.org/npm/init-package-json.svg)](http://travis-ci.org/npm/init-package-json)
+
## Usage
```javascript
var fs = require('fs')
var glob = require('glob')
var path = require('path')
-var validateName = require("validate-npm-package-name")
+var validateName = require('validate-npm-package-name')
+var npa = require('npm-package-arg')
// more popular packages should go here, maybe?
function isTestPkg (p) {
}}
var name = package.name || basename
+var spec = npa(name)
var scope = config.get('scope')
if (scope) {
if (scope.charAt(0) !== '@') scope = '@' + scope
- name = scope + '/' + name
+ if (spec.scope) {
+ name = scope + '/' + spec.name.split('/')[1]
+ } else {
+ name = scope + '/' + name
+ }
}
exports.name = yes ? name : prompt('name', name, function (data) {
var its = validateName(data)
if (its.validForNewPackages) return data
- var er = new Error('Sorry, ' + its.errors.join(' and ') + '.')
+ var errors = (its.errors || []).concat(its.warnings || [])
+ var er = new Error('Sorry, ' + errors.join(' and ') + '.')
er.notValid = true
return er
})
"url" : config.get('init.author.url') ||
config.get('init-author-url')
}
- : prompt('author')
+ : yes ? '' : prompt('author')
}
var license = package.license ||
var init = require('../init-package-json.js')
-var path = require('path')
var dir = process.cwd()
var initFile = require.resolve('./init/basic-init.js')
var init = require('../init-package-json.js')
-var path = require('path')
var dir = process.cwd()
init(dir, 'file that does not exist', function (err, data) {
var init = require('../init-package-json.js')
-var path = require('path')
var dir = process.cwd()
var npm = require('npm')
console.log('written successfully')
})
})
-
"description": "prompting wizardly",
"version": "0.3.0",
"repository": {
- "url": "git://github.com/isaacs/promzard"
+ "url": "git://github.com/isaacs/promzard.git"
},
"dependencies": {
"read": "1"
-0.0.7 / 2014-09-01
+0.0.7 / 2014-09-01
==================
* update .repository
-0.0.6 / 2014-09-01
+0.0.6 / 2014-09-01
==================
* add travis
* add timers
-0.0.3 / 2014-02-22
+0.0.3 / 2014-02-22
==================
* add buffer
-0.0.2 / 2014-02-11
+0.0.2 / 2014-02-11
==================
* add assert
-0.0.1 / 2014-02-11
+0.0.1 / 2014-02-11
==================
* add main
"description": "List of node.js builtin modules",
"repository": {
"type": "git",
- "url": "git://github.com/juliangruber/builtins"
+ "url": "git://github.com/juliangruber/builtins.git"
},
"license": "MIT",
"main": "builtins.json",
},
"repository": {
"type": "git",
- "url": "https://github.com/npm/validate-npm-package-name"
+ "url": "git+https://github.com/npm/validate-npm-package-name.git"
},
"keywords": [
"npm",
{
"name": "init-package-json",
- "version": "1.4.0",
+ "version": "1.4.2",
"main": "init-package-json.js",
"scripts": {
"test": "tap test/*.js"
},
"repository": {
"type": "git",
- "url": "git://github.com/isaacs/init-package-json"
+ "url": "git://github.com/isaacs/init-package-json.git"
},
"author": {
"name": "Isaac Z. Schlueter",
"description": "A node module to get your node module started",
"dependencies": {
"glob": "^5.0.3",
+ "npm-package-arg": "^4.0.0",
"promzard": "^0.3.0",
"read": "~1.0.1",
"read-package-json": "1 || 2",
"prompt",
"start"
],
- "gitHead": "c422f6b38ab02d0859d757ec381e473657d4d195",
+ "readme": "# init-package-json\n\nA node module to get your node module started.\n\n[![Build Status](https://secure.travis-ci.org/npm/init-package-json.svg)](http://travis-ci.org/npm/init-package-json)\n\n## Usage\n\n```javascript\nvar init = require('init-package-json')\nvar path = require('path')\n\n// a path to a promzard module. In the event that this file is\n// not found, one will be provided for you.\nvar initFile = path.resolve(process.env.HOME, '.npm-init')\n\n// the dir where we're doin stuff.\nvar dir = process.cwd()\n\n// extra stuff that gets put into the PromZard module's context.\n// In npm, this is the resolved config object. Exposed as 'config'\n// Optional.\nvar configData = { some: 'extra stuff' }\n\n// Any existing stuff from the package.json file is also exposed in the\n// PromZard module as the `package` object. There will also be free\n// vars for:\n// * `filename` path to the package.json file\n// * `basename` the tip of the package dir\n// * `dirname` the parent of the package dir\n\ninit(dir, initFile, configData, function (er, data) {\n // the data's already been written to {dir}/package.json\n // now you can do stuff with it\n})\n```\n\nOr from the command line:\n\n```\n$ npm-init\n```\n\nSee [PromZard](https://github.com/isaacs/promzard) for details about\nwhat can go in the config file.\n",
+ "readmeFilename": "README.md",
+ "gitHead": "99bddf908a582daeacf27cf05bd46ec5b0ec5e42",
"bugs": {
"url": "https://github.com/isaacs/init-package-json/issues"
},
- "homepage": "https://github.com/isaacs/init-package-json",
- "_id": "init-package-json@1.4.0",
- "_shasum": "50b49cbe284cb7a48e037f36d03817af1022f070",
- "_from": "init-package-json@1.4.0",
- "_npmVersion": "2.7.5",
- "_nodeVersion": "1.6.2",
- "_npmUser": {
- "name": "iarna",
- "email": "me@re-becca.org"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- {
- "name": "othiym23",
- "email": "ogd@aoaioxxysz.net"
- },
- {
- "name": "iarna",
- "email": "me@re-becca.org"
- }
- ],
- "dist": {
- "shasum": "50b49cbe284cb7a48e037f36d03817af1022f070",
- "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-1.4.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.4.0.tgz"
+ "homepage": "https://github.com/isaacs/init-package-json#readme",
+ "_id": "init-package-json@1.4.2",
+ "_shasum": "66e606c5ab458340fb229fa4c25f9062879ffa88",
+ "_from": "init-package-json@>=1.4.2 <1.5.0"
}
-var tap = require('tap')
+var common = require('./lib/common')
var init = require('../')
+var path = require('path')
var rimraf = require('rimraf')
+var test = require('tap').test
-tap.test('the basics', function (t) {
- var i = __dirname + '/basic.input'
- var dir = __dirname
- init(dir, i, {foo:'bar'}, function (er, data) {
+test('the basics', function (t) {
+ var i = path.join(__dirname, 'basic.input')
+ init(__dirname, i, { foo: 'bar' }, function (er, data) {
if (er) throw er
- var expect =
- { name: 'the-name',
- version: '1.2.5',
- description: 'description',
- author: 'npmbot <n@p.m> (http://npm.im)',
- scripts: { test: 'make test' },
- main: 'main.js',
- config: { foo: 'bar' },
- package: {} }
+ var expect = {
+ name: 'the-name',
+ version: '1.2.5',
+ description: 'description',
+ author: 'npmbot <n@p.m> (http://npm.im)',
+ scripts: { test: 'make test' },
+ main: 'main.js',
+ config: { foo: 'bar' },
+ package: {}
+ }
t.same(data, expect)
t.end()
})
- setTimeout(function () {
- process.stdin.emit('data', 'the-name\n')
- }, 50)
- setTimeout(function () {
- process.stdin.emit('data', 'description\n')
- }, 100)
- setTimeout(function () {
- process.stdin.emit('data', 'yes\n')
- }, 150)
+ common.drive([
+ 'the-name\n',
+ 'description\n',
+ 'yes\n'
+ ])
})
-tap.test('teardown', function (t) {
+test('teardown', function (t) {
rimraf(__dirname + '/package.json', t.end.bind(t))
})
--- /dev/null
+module.exports.drive = drive
+
+var semver = require('semver')
+
+function drive (input) {
+ var stdin = process.stdin
+ function emit (chunk, ms) {
+ setTimeout(function () {
+ stdin.emit('data', chunk)
+ }, ms)
+ }
+ if (semver.gte(process.versions.node, '0.11.0')) {
+ input.forEach(function (chunk) {
+ stdin.push(chunk)
+ })
+ } else {
+ stdin.once('readable', function () {
+ var ms = 0
+ input.forEach(function (chunk) {
+ emit(chunk, ms += 50)
+ })
+ })
+ }
+}
--- /dev/null
+var test = require('tap').test
+var init = require('../')
+var rimraf = require('rimraf')
+var common = require('./lib/common')
+
+test('spaces', function (t) {
+ init(__dirname, '', {}, function (er, data) {
+ t.ok(!er, 'should not error')
+ var wanted = {
+ name: 'the-name',
+ version: '1.0.0',
+ description: '',
+ scripts: { test: 'echo "Error: no test specified" && exit 1' },
+ license: 'ISC',
+ author: '',
+ main: 'basic.js'
+ }
+ t.same(data, wanted)
+ t.end()
+ })
+ common.drive([
+ 'the name\n',
+ 'the-name\n',
+ '\n',
+ '\n',
+ '\n',
+ '\n',
+ '\n',
+ '\n',
+ '\n',
+ '\n',
+ 'yes\n'
+ ])
+})
+
+test('teardown', function (t) {
+ rimraf(__dirname + '/package.json', t.end.bind(t))
+})
--- /dev/null
+var test = require('tap').test
+var init = require('../')
+var rimraf = require('rimraf')
+var common = require('./lib/common')
+
+test('uppercase', function (t) {
+ init(__dirname, '', {}, function (er, data) {
+ t.ok(!er, 'should not error')
+ var wanted = {
+ name: 'the-name',
+ version: '1.0.0',
+ description: '',
+ scripts: { test: 'echo "Error: no test specified" && exit 1' },
+ license: 'ISC',
+ author: '',
+ main: 'basic.js'
+ }
+ t.same(data, wanted)
+ t.end()
+ })
+ common.drive([
+ 'THE-NAME\n',
+ 'the-name\n',
+ '\n',
+ '\n',
+ '\n',
+ '\n',
+ '\n',
+ '\n',
+ '\n',
+ '\n',
+ 'yes\n'
+ ])
+})
+
+test('teardown', function (t) {
+ rimraf(__dirname + '/package.json', t.end.bind(t))
+})
-var test = require("tap").test
-var rimraf = require("rimraf")
-var resolve = require("path").resolve
+var test = require('tap').test
+var rimraf = require('rimraf')
+var resolve = require('path').resolve
-var npm = require("npm")
-var init = require("../")
+var npm = require('npm')
+var init = require('../')
var EXPECTED = {
- name : "test",
- version : "3.1.4",
- description : "",
- main : "basic.js",
- scripts : {
- test : 'echo "Error: no test specified" && exit 1'
+ name: 'test',
+ version: '3.1.4',
+ description: '',
+ main: 'basic.js',
+ scripts: {
+ test: 'echo "Error: no test specified" && exit 1'
},
- keywords : [],
- author : "npmbot <n@p.m> (http://npm.im/)",
- license : "WTFPL"
+ keywords: [],
+ author: 'npmbot <n@p.m> (http://npm.im/)',
+ license: 'WTFPL'
}
-test("npm configuration values pulled from environment", function (t) {
+test('npm configuration values pulled from environment', function (t) {
/*eslint camelcase:0 */
- process.env.npm_config_yes = "yes"
+ process.env.npm_config_yes = 'yes'
- process.env.npm_config_init_author_name = "npmbot"
- process.env.npm_config_init_author_email = "n@p.m"
- process.env.npm_config_init_author_url = "http://npm.im"
+ process.env.npm_config_init_author_name = 'npmbot'
+ process.env.npm_config_init_author_email = 'n@p.m'
+ process.env.npm_config_init_author_url = 'http://npm.im'
process.env.npm_config_init_license = EXPECTED.license
process.env.npm_config_init_version = EXPECTED.version
npm.load({}, function (err) {
- t.ifError(err, "npm loaded successfully")
+ t.ifError(err, 'npm loaded successfully')
// clear out dotted names from test environment
- npm.config.del("init.author.name")
- npm.config.del("init.author.email")
- npm.config.del("init.author.url")
+ npm.config.del('init.author.name')
+ npm.config.del('init.author.email')
+ npm.config.del('init.author.url')
// the following have npm defaults, and need to be explicitly overridden
- npm.config.set("init.license", "")
- npm.config.set("init.version", "")
+ npm.config.set('init.license', '')
+ npm.config.set('init.version', '')
process.chdir(resolve(__dirname))
init(__dirname, __dirname, npm.config, function (er, data) {
- t.ifError(err, "init ran successfully")
+ t.ifError(err, 'init ran successfully')
- t.same(data, EXPECTED, "got the package data from the environment")
+ t.same(data, EXPECTED, 'got the package data from the environment')
t.end()
})
})
})
-test("npm configuration values pulled from dotted config", function (t) {
+test('npm configuration values pulled from dotted config', function (t) {
/*eslint camelcase:0 */
var config = {
- yes : "yes",
+ yes: 'yes',
- "init.author.name" : "npmbot",
- "init.author.email" : "n@p.m",
- "init.author.url" : "http://npm.im",
+ 'init.author.name': 'npmbot',
+ 'init.author.email': 'n@p.m',
+ 'init.author.url': 'http://npm.im',
- "init.license" : EXPECTED.license,
- "init.version" : EXPECTED.version
+ 'init.license': EXPECTED.license,
+ 'init.version': EXPECTED.version
}
npm.load(config, function (err) {
- t.ifError(err, "npm loaded successfully")
+ t.ifError(err, 'npm loaded successfully')
process.chdir(resolve(__dirname))
init(__dirname, __dirname, npm.config, function (er, data) {
- t.ifError(err, "init ran successfully")
+ t.ifError(err, 'init ran successfully')
- t.same(data, EXPECTED, "got the package data from the config")
+ t.same(data, EXPECTED, 'got the package data from the config')
t.end()
})
})
})
-test("npm configuration values pulled from dashed config", function (t) {
+test('npm configuration values pulled from dashed config', function (t) {
/*eslint camelcase:0 */
var config = {
- yes : "yes",
+ yes: 'yes',
- "init-author-name" : "npmbot",
- "init-author-email" : "n@p.m",
- "init-author-url" : "http://npm.im",
+ 'init-author-name': 'npmbot',
+ 'init-author-email': 'n@p.m',
+ 'init-author-url': 'http://npm.im',
- "init-license" : EXPECTED.license,
- "init-version" : EXPECTED.version
+ 'init-license': EXPECTED.license,
+ 'init-version': EXPECTED.version
}
npm.load(config, function (err) {
- t.ifError(err, "npm loaded successfully")
+ t.ifError(err, 'npm loaded successfully')
process.chdir(resolve(__dirname))
init(__dirname, __dirname, npm.config, function (er, data) {
- t.ifError(err, "init ran successfully")
+ t.ifError(err, 'init ran successfully')
- t.same(data, EXPECTED, "got the package data from the config")
+ t.same(data, EXPECTED, 'got the package data from the config')
t.end()
})
})
})
-test("cleanup", function (t) {
- rimraf.sync(resolve(__dirname, "package.json"))
- t.pass("cleaned up")
+test('cleanup', function (t) {
+ rimraf.sync(resolve(__dirname, 'package.json'))
+ t.pass('cleaned up')
t.end()
})
--- /dev/null
+var fs = require('fs')
+var path = require('path')
+
+var rimraf = require('rimraf')
+var tap = require('tap')
+
+var init = require('../')
+
+var EXPECT = {
+ name: '@scoped/test',
+ version: '1.0.0',
+ description: '',
+ author: '',
+ scripts: { test: 'echo \"Error: no test specified\" && exit 1' },
+ main: 'basic.js',
+ keywords: [],
+ license: 'ISC'
+}
+
+tap.test('--yes with scope', function (t) {
+ init(__dirname, __dirname, { yes: 'yes', scope: '@scoped' }, function (er, data) {
+ if (er) throw er
+
+ t.same(EXPECT, data)
+ t.end()
+ })
+})
+
+var json = {
+ name: '@already/scoped',
+ version: '1.0.0'
+}
+
+tap.test('with existing package.json', function (t) {
+ fs.writeFileSync(path.join(__dirname, 'package.json'), JSON.stringify(json, null, 2))
+ init(__dirname, __dirname, { yes: 'yes', scope: '@still' }, function (er, data) {
+ if (er) throw er
+
+ t.equal(data.name, '@still/scoped', 'new scope is added, basic name is kept')
+ t.end()
+ })
+})
+
+tap.test('teardown', function (t) {
+ rimraf.sync(path.join(__dirname, 'package.json'))
+ t.end()
+})
-var tap = require("tap")
-var init = require("../")
-var rimraf = require("rimraf")
+var tap = require('tap')
+var init = require('../')
+var rimraf = require('rimraf')
var EXPECT = {
- name: "@foo/test"
- , version: "1.2.5"
- , description: "description"
- , author: "npmbot <n@p.m> (http://npm.im)"
- , scripts: { test: "make test" }
- , main: "main.js"
- , config: { scope: "@foo" }
- , package: {}
+ name: '@foo/test',
+ version: '1.2.5',
+ description: 'description',
+ author: 'npmbot <n@p.m> (http://npm.im)',
+ scripts: { test: 'make test' },
+ main: 'main.js',
+ config: { scope: '@foo' },
+ package: {}
}
-tap.test("the scope", function (t) {
- var i = __dirname + "/basic.input"
+tap.test('the scope', function (t) {
+ var i = __dirname + '/basic.input'
var dir = __dirname
- init(dir, i, {scope: "@foo"}, function (er, data) {
+ init(dir, i, {scope: '@foo'}, function (er, data) {
if (er) throw er
t.same(EXPECT, data)
t.end()
})
setTimeout(function () {
- process.stdin.emit("data", "@foo/test\n")
+ process.stdin.emit('data', '@foo/test\n')
}, 50)
setTimeout(function () {
- process.stdin.emit("data", "description\n")
+ process.stdin.emit('data', 'description\n')
}, 100)
setTimeout(function () {
- process.stdin.emit("data", "yes\n")
+ process.stdin.emit('data', 'yes\n')
}, 150)
})
-tap.test("teardown", function (t) {
- rimraf(__dirname + "/package.json", t.end.bind(t))
+tap.test('teardown', function (t) {
+ rimraf(__dirname + '/package.json', t.end.bind(t))
})
--- /dev/null
+var tap = require('tap')
+var init = require('../')
+var rimraf = require('rimraf')
+
+var EXPECT = {
+ name: 'test',
+ version: '1.0.0',
+ description: '',
+ author: '',
+ scripts: { test: 'echo "Error: no test specified" && exit 1' },
+ main: 'basic.js',
+ keywords: [],
+ license: 'ISC'
+}
+
+tap.test('--yes defaults', function (t) {
+ init(__dirname, __dirname, {yes: 'yes'}, function (er, data) {
+ if (er) throw er
+
+ t.same(EXPECT, data, 'used the default data')
+ t.end()
+ })
+})
+
+tap.test('teardown', function (t) {
+ rimraf(__dirname + '/package.json', t.end.bind(t))
+})
## API
-* `set(key, value)`
+* `set(key, value, max)`
* `get(key) => value`
Both of these will update the "recently used"-ness of the key.
- They do what you think.
+ They do what you think. `max` is optional and overrides the
+ cache `max` option if provided.
* `peek(key)`
* `values()`
Return an array of the values in the cache.
+
+* `length()`
+
+ Return total length of objects in cache taking into account
+ `length` options function.
+
+* `itemCount()`
+
+ Return total quantity of objects currently in cache. Note, that
+ `stale` (see options) items are returned as part of this item
+ count.
LRUCache.prototype.forEach = function (fn, thisp) {
thisp = thisp || this
- var i = 0;
- for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
+ var i = 0
+ var itemCount = this._itemCount
+
+ for (var k = this._mru - 1; k >= 0 && i < itemCount; k--) if (this._lruList[k]) {
i++
var hit = this._lruList[k]
- if (this._maxAge && (Date.now() - hit.now > this._maxAge)) {
+ if (isStale(this, hit)) {
del(this, hit)
if (!this._allowStale) hit = undefined
}
return this._lruList
}
-LRUCache.prototype.set = function (key, value) {
+LRUCache.prototype.set = function (key, value, maxAge) {
+ maxAge = maxAge || this._maxAge
+ var now = maxAge ? Date.now() : 0
+
if (hOP(this._cache, key)) {
// dispose of the old one before overwriting
- if (this._dispose) this._dispose(key, this._cache[key].value)
- if (this._maxAge) this._cache[key].now = Date.now()
+ if (this._dispose)
+ this._dispose(key, this._cache[key].value)
+
+ this._cache[key].now = now
+ this._cache[key].maxAge = maxAge
this._cache[key].value = value
this.get(key)
return true
}
var len = this._lengthCalculator(value)
- var age = this._maxAge ? Date.now() : 0
- var hit = new Entry(key, value, this._mru++, len, age)
+ var hit = new Entry(key, value, this._mru++, len, now, maxAge)
// oversized objects fall out of cache automatically.
if (hit.length > this._max) {
this._lruList[hit.lu] = this._cache[key] = hit
this._itemCount ++
- if (this._length > this._max) trim(this)
+ if (this._length > this._max)
+ trim(this)
+
return true
}
LRUCache.prototype.has = function (key) {
if (!hOP(this._cache, key)) return false
var hit = this._cache[key]
- if (this._maxAge && (Date.now() - hit.now > this._maxAge)) {
+ if (isStale(this, hit)) {
return false
}
return true
function get (self, key, doUse) {
var hit = self._cache[key]
if (hit) {
- if (self._maxAge && (Date.now() - hit.now > self._maxAge)) {
+ if (isStale(self, hit)) {
del(self, hit)
if (!self._allowStale) hit = undefined
} else {
return hit
}
+function isStale(self, hit) {
+ if (!hit || (!hit.maxAge && !self._maxAge)) return false
+ var stale = false;
+ var diff = Date.now() - hit.now
+ if (hit.maxAge) {
+ stale = diff > hit.maxAge
+ } else {
+ stale = self._maxAge && (diff > self._maxAge)
+ }
+ return stale;
+}
+
function use (self, hit) {
shiftLU(self, hit)
hit.lu = self._mru ++
}
// classy, since V8 prefers predictable objects.
-function Entry (key, value, lu, length, now) {
+function Entry (key, value, lu, length, now, maxAge) {
this.key = key
this.value = value
this.lu = lu
this.length = length
this.now = now
+ if (maxAge) this.maxAge = maxAge
}
})()
{
"name": "lru-cache",
"description": "A cache object that deletes the least-recently-used items.",
- "version": "2.5.2",
+ "version": "2.6.1",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me"
},
+ "keywords": [
+ "mru",
+ "lru",
+ "cache"
+ ],
"scripts": {
"test": "tap test --gc"
},
"type": "MIT",
"url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE"
},
- "gitHead": "ec01cc48ac06ee07b2b56a219d5aa931f899b21b",
+ "gitHead": "ff3dfd40e437fa619f09610f45d1ac523bbf27c9",
"bugs": {
"url": "https://github.com/isaacs/node-lru-cache/issues"
},
- "homepage": "https://github.com/isaacs/node-lru-cache",
- "_id": "lru-cache@2.5.2",
- "_shasum": "1fddad938aae1263ce138680be1b3f591c0ab41c",
- "_from": "lru-cache@>=2.5.2 <2.6.0",
- "_npmVersion": "2.7.6",
+ "homepage": "https://github.com/isaacs/node-lru-cache#readme",
+ "_id": "lru-cache@2.6.1",
+ "_shasum": "9933eff15453fae1d27096365143c724e85c6cbd",
+ "_from": "lru-cache@>=2.6.1 <2.7.0",
+ "_npmVersion": "2.8.1",
"_nodeVersion": "1.4.2",
"_npmUser": {
"name": "isaacs",
- "email": "i@izs.me"
+ "email": "isaacs@npmjs.com"
+ },
+ "dist": {
+ "shasum": "9933eff15453fae1d27096365143c724e85c6cbd",
+ "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.6.1.tgz"
},
"maintainers": [
{
"email": "i@izs.me"
}
],
- "dist": {
- "shasum": "1fddad938aae1263ce138680be1b3f591c0ab41c",
- "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.5.2.tgz"
- },
"directories": {},
- "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.5.2.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.6.1.tgz"
}
+++ /dev/null
-var LRU = require("./");
-
-var cache = LRU( {
- max: 1,
- maxAge: 1000
-} );
-
-cache.set( "1234", 1 );
-
-setTimeout( function() {
- cache.set( "1234", 2 );
- console.log( "testing after 5s: " + cache.get( "1234" ) );
-}, 500 );
-
-setTimeout( function() {
- console.log( "testing after 9s: " + cache.get( "1234" ) );
-}, 900 );
-
-setTimeout( function() {
- console.log( "testing after 11s: " + cache.get( "1234" ) );
-}, 1100 );
-
-setTimeout( function() {
- console.log( "testing after 16s: " + cache.get( "1234" ) );
-}, 1600 );
}, 155)
})
+test("individual item can have it's own maxAge", function(t) {
+ var cache = new LRU({
+ max: 5,
+ maxAge: 50
+ })
+
+ cache.set("a", "A", 20)
+ setTimeout(function () {
+ t.notOk(cache.get("a"))
+ t.end()
+ }, 25)
+})
+
+test("individual item can have it's own maxAge > cache's", function(t) {
+ var cache = new LRU({
+ max: 5,
+ maxAge: 20
+ })
+
+ cache.set("a", "A", 50)
+ setTimeout(function () {
+ t.equal(cache.get("a"), "A")
+ t.end()
+ }, 25)
+})
+
test("disposal function", function(t) {
var disposed = false
var cache = new LRU({
t.equal(key, j.toString())
t.equal(val, j.toString(2))
})
+ t.equal(i, order.length);
t.end()
})
t.end()
})
+
+test('all entries are iterated over', function(t) {
+ var l = new LRU(5)
+ for (var i = 0; i < 10; i ++) {
+ l.set(i.toString(), i.toString(2))
+ }
+
+ var i = 0
+ l.forEach(function (val, key, cache) {
+ if (i > 0) {
+ cache.del(key)
+ }
+ i += 1
+ })
+
+ t.equal(i, 5)
+ t.equal(l.keys().length, 1)
+
+ t.end()
+})
+
+test('all stale entries are removed', function(t) {
+ var l = new LRU({ max: 5, maxAge: -5, stale: true })
+ for (var i = 0; i < 10; i ++) {
+ l.set(i.toString(), i.toString(2))
+ }
+
+ var i = 0
+ l.forEach(function () {
+ i += 1
+ })
+
+ t.equal(i, 5)
+ t.equal(l.keys().length, 0)
+
+ t.end()
+})
+
+test('expires', function (t) {
+ var l = new LRU({
+ max: 10,
+ maxAge: 50
+ })
+ for (var i = 0; i < 10; i++) {
+ l.set(i.toString(), i.toString(2), ((i % 2) ? 25 : undefined))
+ }
+
+ var i = 0
+ var order = [ 8, 6, 4, 2, 0 ]
+ setTimeout(function () {
+ l.forEach(function (val, key, cache) {
+ var j = order[i++]
+ t.equal(cache, l)
+ t.equal(key, j.toString())
+ t.equal(val, j.toString(2))
+ })
+ t.equal(i, order.length);
+ t.end()
+
+ setTimeout(function () {
+ var count = 0;
+ l.forEach(function (val, key, cache) { count++; })
+ t.equal(0, count);
+ t.end()
+ }, 25)
+
+ }, 26)
+})
{
'target_defaults': {
'type': 'loadable_module',
- 'win_delay_load_hook': 'true',
'product_prefix': '',
-
'include_dirs': [
'<(node_root_dir)/src',
'<(node_root_dir)/deps/uv/include',
'product_extension': 'node',
'defines': [ 'BUILDING_NODE_EXTENSION' ],
}],
-
['_type=="static_library"', {
# set to `1` to *disable* the -T thin archive 'ld' flag.
# older linkers don't support this flag.
'standalone_static_library': '<(standalone_static_library)'
}],
-
- ['_win_delay_load_hook=="true"', {
- # If the addon specifies `'win_delay_load_hook': 'true'` in its
- # binding.gyp, link a delay-load hook into the DLL. This hook ensures
- # that the addon will work regardless of whether the node/iojs binary
- # is named node.exe, iojs.exe, or something else.
- 'conditions': [
- [ 'OS=="win"', {
- 'sources': [
- 'src/win_delay_load_hook.c',
- ],
- 'msvs_settings': {
- 'VCLinkerTool': {
- 'DelayLoadDLLs': [ 'iojs.exe', 'node.exe' ],
- # Don't print a linker warning when no imports from either .exe
- # are used.
- 'AdditionalOptions': [ '/ignore:4199' ],
- },
- },
- }],
- ],
- }],
],
'conditions': [
'-luuid.lib',
'-lodbc32.lib',
'-lDelayImp.lib',
- '-l"<(node_root_dir)/$(ConfigurationName)/iojs.lib"'
+ '-l"<(node_root_dir)/$(ConfigurationName)/node.lib"'
],
# warning C4251: 'node::ObjectWrap::handle_' : class 'v8::Persistent<T>'
# needs to have dll-interface to be used by clients of class 'node::ObjectWrap'
}
/**
- * Copies the iojs.lib file for the current target architecture into the
+ * Copies the node.lib file for the current target architecture into the
* current proper dev dir location.
*/
if (!win || !copyDevLib) return doBuild()
var buildDir = path.resolve(nodeDir, buildType)
- , archNodeLibPath = path.resolve(nodeDir, arch, 'iojs.lib')
- , buildNodeLibPath = path.resolve(buildDir, 'iojs.lib')
+ , archNodeLibPath = path.resolve(nodeDir, arch, 'node.lib')
+ , buildNodeLibPath = path.resolve(buildDir, 'node.lib')
mkdirp(buildDir, function (err, isNew) {
if (err) return callback(err)
log.verbose('"' + buildType + '" dir needed to be created?', isNew)
var rs = fs.createReadStream(archNodeLibPath)
, ws = fs.createWriteStream(buildNodeLibPath)
- log.verbose('copying "iojs.lib" for ' + arch, buildNodeLibPath)
+ log.verbose('copying "node.lib" for ' + arch, buildNodeLibPath)
rs.pipe(ws)
rs.on('error', callback)
ws.on('error', callback)
}
}
- var distUrl = gyp.opts['dist-url'] || gyp.opts.disturl || 'https://iojs.org/dist'
+ var distUrl = gyp.opts['dist-url'] || gyp.opts.disturl || 'http://nodejs.org/dist'
// Determine which node dev files version we are installing
// now download the node tarball
var tarPath = gyp.opts['tarball']
- var tarballUrl = tarPath ? tarPath : distUrl + '/v' + version + '/iojs-v' + version + '.tar.gz'
+ var tarballUrl = tarPath ? tarPath : distUrl + '/v' + version + '/node-v' + version + '.tar.gz'
, badDownload = false
, extractCount = 0
, gunzip = zlib.createGunzip()
var async = 0
if (win) {
- // need to download iojs.lib
+ // need to download node.lib
async++
downloadNodeLib(deref)
}
}
function downloadNodeLib (done) {
- log.verbose('on Windows; need to download `iojs.lib`...')
+ log.verbose('on Windows; need to download `node.lib`...')
var dir32 = path.resolve(devDir, 'ia32')
, dir64 = path.resolve(devDir, 'x64')
- , nodeLibPath32 = path.resolve(dir32, 'iojs.lib')
- , nodeLibPath64 = path.resolve(dir64, 'iojs.lib')
- , nodeLibUrl32 = distUrl + '/v' + version + '/win-x86/iojs.lib'
- , nodeLibUrl64 = distUrl + '/v' + version + '/win-x64/iojs.lib'
+ , nodeLibPath32 = path.resolve(dir32, 'node.lib')
+ , nodeLibPath64 = path.resolve(dir64, 'node.lib')
+ , nodeLibUrl32 = distUrl + '/v' + version + '/node.lib'
+ , nodeLibUrl64 = distUrl + '/v' + version + '/x64/node.lib'
- log.verbose('32-bit iojs.lib dir', dir32)
- log.verbose('64-bit iojs.lib dir', dir64)
- log.verbose('`iojs.lib` 32-bit url', nodeLibUrl32)
- log.verbose('`iojs.lib` 64-bit url', nodeLibUrl64)
+ log.verbose('32-bit node.lib dir', dir32)
+ log.verbose('64-bit node.lib dir', dir64)
+ log.verbose('`node.lib` 32-bit url', nodeLibUrl32)
+ log.verbose('`node.lib` 64-bit url', nodeLibUrl64)
var async = 2
mkdir(dir32, function (err) {
if (err) return done(err)
- log.verbose('streaming 32-bit iojs.lib to:', nodeLibPath32)
+ log.verbose('streaming 32-bit node.lib to:', nodeLibPath32)
var req = download(nodeLibUrl32)
if (!req) return
req.on('error', done)
req.on('response', function (res) {
if (res.statusCode !== 200) {
- done(new Error(res.statusCode + ' status code downloading 32-bit iojs.lib'))
+ done(new Error(res.statusCode + ' status code downloading 32-bit node.lib'))
return
}
getContentSha(res, function (_, checksum) {
- contentShasums['win-x86/iojs.lib'] = checksum
- log.verbose('content checksum', 'win-x86/iojs.lib', checksum)
+ contentShasums['node.lib'] = checksum
+ log.verbose('content checksum', 'node.lib', checksum)
})
var ws = fs.createWriteStream(nodeLibPath32)
})
mkdir(dir64, function (err) {
if (err) return done(err)
- log.verbose('streaming 64-bit iojs.lib to:', nodeLibPath64)
+ log.verbose('streaming 64-bit node.lib to:', nodeLibPath64)
var req = download(nodeLibUrl64)
if (!req) return
req.on('error', done)
req.on('response', function (res) {
if (res.statusCode !== 200) {
- done(new Error(res.statusCode + ' status code downloading 64-bit iojs.lib'))
+ done(new Error(res.statusCode + ' status code downloading 64-bit node.lib'))
return
}
getContentSha(res, function (_, checksum) {
- contentShasums['win-x64/iojs.lib'] = checksum
- log.verbose('content checksum', 'win-x64/iojs.lib', checksum)
+ contentShasums['x64/node.lib'] = checksum
+ log.verbose('content checksum', 'x64/node.lib', checksum)
})
var ws = fs.createWriteStream(nodeLibPath64)
# brace-expansion
-[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
+[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
as known from sh/bash, in JavaScript.
[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion)
console.log(expand('http://www.letters.com/file{a..z..2}.txt'));
console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}'));
console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}'));
+
@node_modules/.bin/tape test/*.js
.PHONY: test
+
console.log(balanced('{', '}', 'pre{in{nested}}post'));
console.log(balanced('{', '}', 'pre{first}between{second}post'));
+
console.error(" <<<EOF")
})
})
+
return isNaN(res) ? null : res
}
+
+++ /dev/null
-/*
- * When this file is linked to a DLL, it sets up a delay-load hook that
- * intervenes when the DLL is trying to load 'node.exe' or 'iojs.exe'
- * dynamically. Instead of trying to locate the .exe file it'll just return
- * a handle to the process image.
- *
- * This allows compiled addons to work when node.exe or iojs.exe is renamed.
- */
-
-#ifdef _MSC_VER
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#include <delayimp.h>
-#include <string.h>
-
-static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) {
- if (event != dliNotePreLoadLibrary)
- return NULL;
-
- if (_stricmp(info->szDll, "iojs.exe") != 0 &&
- _stricmp(info->szDll, "node.exe") != 0)
- return NULL;
-
- HMODULE m = GetModuleHandle(NULL);
- return (FARPROC) m;
-}
-
-PfnDliHook __pfnDliNotifyHook2 = load_exe_hook;
-
-#endif
```javascript
var RegClient = require('npm-registry-client')
var client = new RegClient(config)
-var uri = "npm://registry.npmjs.org/npm"
+var uri = "https://registry.npmjs.org/npm"
var params = {timeout: 1000}
client.get(uri, params, function (error, data, raw, res) {
var name
if (!w.match(/^-/)) {
w = w.split('/')
- name = w[w.indexOf('_rewrite') + 1]
+ name = decodeURIComponent(w[w.indexOf('_rewrite') + 1])
}
if (!parsed.error) {
er = new Error('404 Not Found: ' + name)
} else {
er = new Error(
- parsed.error + ' ' + (parsed.reason || '') + ': ' + w
+ parsed.error + ' ' + (parsed.reason || '') + ': ' + (name || w)
)
}
if (name) er.pkgid = name
},
"readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n",
"readmeFilename": "README.md",
- "homepage": "https://github.com/isaacs/core-util-is",
+ "homepage": "https://github.com/isaacs/core-util-is#readme",
"_id": "core-util-is@1.0.1",
- "dist": {
- "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538",
- "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
- },
- "_from": "core-util-is@>=1.0.0 <1.1.0",
- "_npmVersion": "1.3.23",
- "_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- }
- ],
- "directories": {},
"_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538",
- "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
+ "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz",
+ "_from": "core-util-is@>=1.0.0 <1.1.0"
}
"url": "http://juliangruber.com"
},
"license": "MIT",
- "_id": "isarray@0.0.1",
- "dist": {
- "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
- "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
- },
- "_from": "isarray@0.0.1",
- "_npmVersion": "1.2.18",
- "_npmUser": {
- "name": "juliangruber",
- "email": "julian@juliangruber.com"
- },
- "maintainers": [
- {
- "name": "juliangruber",
- "email": "julian@juliangruber.com"
- }
- ],
- "directories": {},
- "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
- "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+ "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/juliangruber/isarray/issues"
},
- "readme": "ERROR: No README data found!"
+ "_id": "isarray@0.0.1",
+ "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf",
+ "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+ "_from": "isarray@0.0.1"
}
"browserify"
],
"license": "MIT",
- "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0",
+ "readme": "**string_decoder.js** (`require('string_decoder')`) from Node.js core\n\nCopyright Joyent, Inc. and other Node contributors. See LICENCE file for details.\n\nVersion numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**\n\nThe *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.",
+ "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/rvagg/string_decoder/issues"
},
"_id": "string_decoder@0.10.31",
"_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
- "_from": "string_decoder@>=0.10.0 <0.11.0",
- "_npmVersion": "1.4.23",
- "_npmUser": {
- "name": "rvagg",
- "email": "rod@vagg.org"
- },
- "maintainers": [
- {
- "name": "substack",
- "email": "mail@substack.net"
- },
- {
- "name": "rvagg",
- "email": "rod@vagg.org"
- }
- ],
- "dist": {
- "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
- "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
- },
- "directories": {},
"_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
- "readme": "ERROR: No README data found!"
+ "_from": "string_decoder@>=0.10.0 <0.11.0"
}
},
"name": "npm-registry-client",
"description": "Client for the npm registry",
- "version": "6.3.2",
+ "version": "6.3.3",
"repository": {
"url": "git://github.com/isaacs/npm-registry-client.git"
},
"npmlog": ""
},
"license": "ISC",
- "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\nvar uri = \"npm://registry.npmjs.org/npm\"\nvar params = {timeout: 1000}\n\nclient.get(uri, params, function (error, data, raw, res) {\n // error is an error if there was a problem.\n // data is the parsed data object\n // raw is the json string\n // res is the response from couch\n})\n```\n\n# Registry URLs\n\nThe registry calls take either a full URL pointing to a resource in the\nregistry, or a base URL for the registry as a whole (including the registry\npath – but be sure to terminate the path with `/`). `http` and `https` URLs are\nthe only ones supported.\n\n## Using the client\n\nEvery call to the client follows the same pattern:\n\n* `uri` {String} The *fully-qualified* URI of the registry API method being\n invoked.\n* `params` {Object} Per-request parameters.\n* `callback` {Function} Callback to be invoked when the call is complete.\n\n### Credentials\n\nMany requests to the registry can by authenticated, and require credentials\nfor authorization. These credentials always look the same:\n\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n**or**\n\n* `token` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n## API\n\n### client.access(uri, params, cb)\n\n* `uri` {String} Registry URL for the package's access API endpoint.\n Looks like `/-/package/<package name>/access`.\n* `params` {Object} Object containing per-request properties.\n * `access` {String} New access level for the package. Can be either\n `public` or `restricted`. Registry will raise an error if trying\n to change the access level of an unscoped package.\n * `auth` {Credentials}\n\nSet the access level for scoped packages. For now, there are only two\naccess levels: \"public\" and \"restricted\".\n\n### client.adduser(uri, params, cb)\n\n* `uri` {String} Base registry URL.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nAdd a user account to the registry, or verify the credentials.\n\n### client.deprecate(uri, params, cb)\n\n* `uri` {String} Full registry URI for the deprecated package.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Semver version range.\n * `message` {String} The message to use as a deprecation warning.\n * `auth` {Credentials}\n* `cb` {Function}\n\nDeprecate a version of a package in the registry.\n\n### client.distTags.fetch(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `auth` {Credentials}\n* `cb` {Function}\n\nFetch all of the `dist-tags` for the named package.\n\n### client.distTags.add(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTag` {String} Name of the new `dist-tag`.\n * `version` {String} Exact version to be mapped to the `dist-tag`.\n * `auth` {Credentials}\n* `cb` {Function}\n\nAdd (or replace) a single dist-tag onto the named package.\n\n### client.distTags.set(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTags` {Object} Object containing a map from tag names to package\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nSet all of the `dist-tags` for the named package at once, creating any\n`dist-tags` that do not already exit. Any `dist-tags` not included in the\n`distTags` map will be removed.\n\n### client.distTags.update(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTags` {Object} Object containing a map from tag names to package\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nUpdate the values of multiple `dist-tags`, creating any `dist-tags` that do\nnot already exist. Any pre-existing `dist-tags` not included in the `distTags`\nmap will be left alone.\n\n### client.distTags.rm(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTag` {String} Name of the new `dist-tag`.\n * `auth` {Credentials}\n* `cb` {Function}\n\nRemove a single `dist-tag` from the named package.\n\n### client.get(uri, params, cb)\n\n* `uri` {String} The complete registry URI to fetch\n* `params` {Object} Object containing per-request properties.\n * `timeout` {Number} Duration before the request times out. Optional\n (default: never).\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `staleOk` {Boolean} If there's cached data available, then return that to\n the callback quickly, and update the cache the background. Optional\n (default: false).\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n\nFetches data from the registry via a GET request, saving it in the cache folder\nwith the ETag or the \"Last Modified\" timestamp.\n\n### client.publish(uri, params, cb)\n\n* `uri` {String} The registry URI for the package to publish.\n* `params` {Object} Object containing per-request properties.\n * `metadata` {Object} Package metadata.\n * `access` {String} Access for the package. Can be `public` or `restricted` (no default).\n * `body` {Stream} Stream of the package body / tarball.\n * `auth` {Credentials}\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder.\n\n### client.star(uri, params, cb)\n\n* `uri` {String} The complete registry URI for the package to star.\n* `params` {Object} Object containing per-request properties.\n * `starred` {Boolean} True to star the package, false to unstar it. Optional\n (default: false).\n * `auth` {Credentials}\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or unstar a\npackage, though other writes do require that the user be the package owner.\n\n### client.stars(uri, params, cb)\n\n* `uri` {String} The base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `username` {String} Name of user to fetch starred packages for. Optional\n (default: user in `auth`).\n * `auth` {Credentials} Optional (required if `username` is omitted).\n* `cb` {Function}\n\nView your own or another user's starred packages.\n\n### client.tag(uri, params, cb)\n\n* `uri` {String} The complete registry URI to tag\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Version to tag.\n * `tag` {String} Tag name to apply.\n * `auth` {Credentials}\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the\nspecified version.\n\n### client.unpublish(uri, params, cb)\n\n* `uri` {String} The complete registry URI of the package to unpublish.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} version to unpublish. Optional – omit to unpublish all\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry. When the\nlast version us unpublished, the entire document is removed from the database.\n\n### client.whoami(uri, params, cb)\n\n* `uri` {String} The base registry for the URI.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n\nSimple call to see who the registry thinks you are. Especially useful with\ntoken-based auth.\n\n\n## PLUMBING\n\nThe below are primarily intended for use by the rest of the API, or by the npm\ncaching logic directly.\n\n### client.request(uri, params, cb)\n\n* `uri` {String} URI pointing to the resource to request.\n* `params` {Object} Object containing per-request properties.\n * `method` {String} HTTP method. Optional (default: \"GET\").\n * `body` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON. Optional – body\n only used for write operations.\n * `etag` {String} The cached ETag. Optional.\n * `lastModified` {String} The cached Last-Modified timestamp. Optional.\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nMake a generic request to the registry. All the other methods are wrappers\naround `client.request`.\n\n### client.fetch(uri, params, cb)\n\n* `uri` {String} The complete registry URI to upload to\n* `params` {Object} Object containing per-request properties.\n * `headers` {Stream} HTTP headers to be included with the request. Optional.\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n\nFetch a package from a URL, with auth set appropriately if included. Used to\ncache remote tarballs as well as request package tarballs from the registry.\n\n# Configuration\n\nThe client uses its own configuration, which is just passed in as a simple\nnested object. The following are the supported values (with their defaults, if\nany):\n\n* `proxy.http` {URL} The URL to proxy HTTP requests through.\n* `proxy.https` {URL} The URL to proxy HTTPS requests through. Defaults to be\n the same as `proxy.http` if unset.\n* `proxy.localAddress` {IP} The local address to use on multi-homed systems.\n* `ssl.ca` {String} Certificate signing authority certificates to trust.\n* `ssl.certificate` {String} Client certificate (PEM encoded). Enable access\n to servers that require client certificates.\n* `ssl.key` {String} Private key (PEM encoded) for client certificate.\n* `ssl.strict` {Boolean} Whether or not to be strict with SSL certificates.\n Default = `true`\n* `retry.count` {Number} Number of times to retry on GET failures. Default = 2.\n* `retry.factor` {Number} `factor` setting for `node-retry`. Default = 10.\n* `retry.minTimeout` {Number} `minTimeout` setting for `node-retry`.\n Default = 10000 (10 seconds)\n* `retry.maxTimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default = 60000 (60 seconds)\n* `userAgent` {String} User agent header to send. Default =\n `\"node/{process.version}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `defaultTag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `couchToken` {Object} A token for use with\n [couch-login](https://npmjs.org/package/couch-login).\n* `sessionToken` {string} A random identifier for this set of client requests.\n Default = 8 random hexadecimal bytes.\n",
+ "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\nvar uri = \"https://registry.npmjs.org/npm\"\nvar params = {timeout: 1000}\n\nclient.get(uri, params, function (error, data, raw, res) {\n // error is an error if there was a problem.\n // data is the parsed data object\n // raw is the json string\n // res is the response from couch\n})\n```\n\n# Registry URLs\n\nThe registry calls take either a full URL pointing to a resource in the\nregistry, or a base URL for the registry as a whole (including the registry\npath – but be sure to terminate the path with `/`). `http` and `https` URLs are\nthe only ones supported.\n\n## Using the client\n\nEvery call to the client follows the same pattern:\n\n* `uri` {String} The *fully-qualified* URI of the registry API method being\n invoked.\n* `params` {Object} Per-request parameters.\n* `callback` {Function} Callback to be invoked when the call is complete.\n\n### Credentials\n\nMany requests to the registry can by authenticated, and require credentials\nfor authorization. These credentials always look the same:\n\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n**or**\n\n* `token` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n## API\n\n### client.access(uri, params, cb)\n\n* `uri` {String} Registry URL for the package's access API endpoint.\n Looks like `/-/package/<package name>/access`.\n* `params` {Object} Object containing per-request properties.\n * `access` {String} New access level for the package. Can be either\n `public` or `restricted`. Registry will raise an error if trying\n to change the access level of an unscoped package.\n * `auth` {Credentials}\n\nSet the access level for scoped packages. For now, there are only two\naccess levels: \"public\" and \"restricted\".\n\n### client.adduser(uri, params, cb)\n\n* `uri` {String} Base registry URL.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nAdd a user account to the registry, or verify the credentials.\n\n### client.deprecate(uri, params, cb)\n\n* `uri` {String} Full registry URI for the deprecated package.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Semver version range.\n * `message` {String} The message to use as a deprecation warning.\n * `auth` {Credentials}\n* `cb` {Function}\n\nDeprecate a version of a package in the registry.\n\n### client.distTags.fetch(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `auth` {Credentials}\n* `cb` {Function}\n\nFetch all of the `dist-tags` for the named package.\n\n### client.distTags.add(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTag` {String} Name of the new `dist-tag`.\n * `version` {String} Exact version to be mapped to the `dist-tag`.\n * `auth` {Credentials}\n* `cb` {Function}\n\nAdd (or replace) a single dist-tag onto the named package.\n\n### client.distTags.set(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTags` {Object} Object containing a map from tag names to package\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nSet all of the `dist-tags` for the named package at once, creating any\n`dist-tags` that do not already exit. Any `dist-tags` not included in the\n`distTags` map will be removed.\n\n### client.distTags.update(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTags` {Object} Object containing a map from tag names to package\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nUpdate the values of multiple `dist-tags`, creating any `dist-tags` that do\nnot already exist. Any pre-existing `dist-tags` not included in the `distTags`\nmap will be left alone.\n\n### client.distTags.rm(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTag` {String} Name of the new `dist-tag`.\n * `auth` {Credentials}\n* `cb` {Function}\n\nRemove a single `dist-tag` from the named package.\n\n### client.get(uri, params, cb)\n\n* `uri` {String} The complete registry URI to fetch\n* `params` {Object} Object containing per-request properties.\n * `timeout` {Number} Duration before the request times out. Optional\n (default: never).\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `staleOk` {Boolean} If there's cached data available, then return that to\n the callback quickly, and update the cache the background. Optional\n (default: false).\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n\nFetches data from the registry via a GET request, saving it in the cache folder\nwith the ETag or the \"Last Modified\" timestamp.\n\n### client.publish(uri, params, cb)\n\n* `uri` {String} The registry URI for the package to publish.\n* `params` {Object} Object containing per-request properties.\n * `metadata` {Object} Package metadata.\n * `access` {String} Access for the package. Can be `public` or `restricted` (no default).\n * `body` {Stream} Stream of the package body / tarball.\n * `auth` {Credentials}\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder.\n\n### client.star(uri, params, cb)\n\n* `uri` {String} The complete registry URI for the package to star.\n* `params` {Object} Object containing per-request properties.\n * `starred` {Boolean} True to star the package, false to unstar it. Optional\n (default: false).\n * `auth` {Credentials}\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or unstar a\npackage, though other writes do require that the user be the package owner.\n\n### client.stars(uri, params, cb)\n\n* `uri` {String} The base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `username` {String} Name of user to fetch starred packages for. Optional\n (default: user in `auth`).\n * `auth` {Credentials} Optional (required if `username` is omitted).\n* `cb` {Function}\n\nView your own or another user's starred packages.\n\n### client.tag(uri, params, cb)\n\n* `uri` {String} The complete registry URI to tag\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Version to tag.\n * `tag` {String} Tag name to apply.\n * `auth` {Credentials}\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the\nspecified version.\n\n### client.unpublish(uri, params, cb)\n\n* `uri` {String} The complete registry URI of the package to unpublish.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} version to unpublish. Optional – omit to unpublish all\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry. When the\nlast version us unpublished, the entire document is removed from the database.\n\n### client.whoami(uri, params, cb)\n\n* `uri` {String} The base registry for the URI.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n\nSimple call to see who the registry thinks you are. Especially useful with\ntoken-based auth.\n\n\n## PLUMBING\n\nThe below are primarily intended for use by the rest of the API, or by the npm\ncaching logic directly.\n\n### client.request(uri, params, cb)\n\n* `uri` {String} URI pointing to the resource to request.\n* `params` {Object} Object containing per-request properties.\n * `method` {String} HTTP method. Optional (default: \"GET\").\n * `body` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON. Optional – body\n only used for write operations.\n * `etag` {String} The cached ETag. Optional.\n * `lastModified` {String} The cached Last-Modified timestamp. Optional.\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nMake a generic request to the registry. All the other methods are wrappers\naround `client.request`.\n\n### client.fetch(uri, params, cb)\n\n* `uri` {String} The complete registry URI to upload to\n* `params` {Object} Object containing per-request properties.\n * `headers` {Stream} HTTP headers to be included with the request. Optional.\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n\nFetch a package from a URL, with auth set appropriately if included. Used to\ncache remote tarballs as well as request package tarballs from the registry.\n\n# Configuration\n\nThe client uses its own configuration, which is just passed in as a simple\nnested object. The following are the supported values (with their defaults, if\nany):\n\n* `proxy.http` {URL} The URL to proxy HTTP requests through.\n* `proxy.https` {URL} The URL to proxy HTTPS requests through. Defaults to be\n the same as `proxy.http` if unset.\n* `proxy.localAddress` {IP} The local address to use on multi-homed systems.\n* `ssl.ca` {String} Certificate signing authority certificates to trust.\n* `ssl.certificate` {String} Client certificate (PEM encoded). Enable access\n to servers that require client certificates.\n* `ssl.key` {String} Private key (PEM encoded) for client certificate.\n* `ssl.strict` {Boolean} Whether or not to be strict with SSL certificates.\n Default = `true`\n* `retry.count` {Number} Number of times to retry on GET failures. Default = 2.\n* `retry.factor` {Number} `factor` setting for `node-retry`. Default = 10.\n* `retry.minTimeout` {Number} `minTimeout` setting for `node-retry`.\n Default = 10000 (10 seconds)\n* `retry.maxTimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default = 60000 (60 seconds)\n* `userAgent` {String} User agent header to send. Default =\n `\"node/{process.version}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `defaultTag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `couchToken` {Object} A token for use with\n [couch-login](https://npmjs.org/package/couch-login).\n* `sessionToken` {string} A random identifier for this set of client requests.\n Default = 8 random hexadecimal bytes.\n",
"readmeFilename": "README.md",
- "gitHead": "dd4029904febd6e0c30371b2addad5715526cd68",
+ "gitHead": "bd0ab6fb27f614fca299bc9426dcfbea2fc83adc",
"bugs": {
"url": "https://github.com/isaacs/npm-registry-client/issues"
},
"homepage": "https://github.com/isaacs/npm-registry-client#readme",
- "_id": "npm-registry-client@6.3.2",
- "_shasum": "a662a36c6eda56c184099631cf429ba69b73d65b",
- "_from": "npm-registry-client@>=6.3.2 <6.4.0"
+ "_id": "npm-registry-client@6.3.3",
+ "_shasum": "fe9cc45b3b8404dfa888b99d7aff3964f3470fb0",
+ "_from": "npm-registry-client@6.3.3"
}
})
test('run request through its paces', function (t) {
- t.plan(27)
+ t.plan(28)
server.expect('/request-defaults', function (req, res) {
t.equal(req.method, 'GET', 'uses GET by default')
}))
})
+ server.expect('GET', '/@scoped%2Fpackage-failing', function (req, res) {
+ req.pipe(concat(function () {
+ res.statusCode = 402
+ res.json({ error: 'payment required' })
+ }))
+ })
+
var defaults = {}
client.request(
common.registry + '/request-defaults',
client.request(common.registry + '/body-error-object', defaults, function (er) {
t.ifError(er, 'call worked')
})
+
+ client.request(common.registry + '/@scoped%2Fpackage-failing', defaults, function (er) {
+ t.equals(er.message, 'payment required : @scoped/package-failing')
+ })
})
console.log(top.completed()) // 0.2
fs.stat("file", function(er, stat) {
- if (er) throw er
+ if (er) throw er
var stream = top.newStream("file", stat.size)
console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete
// and 50% * 20% == 10%
**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12.
**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"`
+
--- a/lib/_stream_duplex.js
+++ b/lib/_stream_duplex.js
@@ -26,8 +26,8 @@
-
+
module.exports = Duplex;
var util = require('util');
-var Readable = require('_stream_readable');
-var Writable = require('_stream_writable');
+var Readable = require('./_stream_readable');
+var Writable = require('./_stream_writable');
-
+
util.inherits(Duplex, Readable);
-
+
diff --git a/lib/_stream_passthrough.js b/lib/_stream_passthrough.js
index a5e9864..330c247 100644
--- a/lib/_stream_passthrough.js
+++ b/lib/_stream_passthrough.js
@@ -25,7 +25,7 @@
-
+
module.exports = PassThrough;
-
+
-var Transform = require('_stream_transform');
+var Transform = require('./_stream_transform');
var util = require('util');
util.inherits(PassThrough, Transform);
-
+
diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js
index 0c3fe3e..90a8298 100644
--- a/lib/_stream_readable.js
+++ b/lib/_stream_readable.js
@@ -23,10 +23,34 @@ module.exports = Readable;
Readable.ReadableState = ReadableState;
-
+
var EE = require('events').EventEmitter;
+if (!EE.listenerCount) EE.listenerCount = function(emitter, type) {
+ return emitter.listeners(type).length;
+} catch (er) {
+ debug = function() {};
+}
-
+
util.inherits(Readable, Stream);
-
+
@@ -380,7 +404,7 @@ function chunkInvalid(state, chunk) {
-
-
+
+
function onEofChunk(stream, state) {
- if (state.decoder && !state.ended) {
+ if (state.decoder && !state.ended && state.decoder.end) {
--- a/lib/_stream_transform.js
+++ b/lib/_stream_transform.js
@@ -64,8 +64,14 @@
-
+
module.exports = Transform;
-
+
-var Duplex = require('_stream_duplex');
+var Duplex = require('./_stream_duplex');
var util = require('util');
+ }
+}
util.inherits(Transform, Duplex);
-
-
+
+
diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js
index ba2e920..f49288b 100644
--- a/lib/_stream_writable.js
+++ b/lib/_stream_writable.js
@@ -27,6 +27,12 @@ module.exports = Writable;
Writable.WritableState = WritableState;
-
+
var util = require('util');
+if (!util.isUndefined) {
+ var utilIs = require('core-util-is');
+ }
+}
var Stream = require('stream');
-
+
util.inherits(Writable, Stream);
@@ -119,7 +125,7 @@ function WritableState(options, stream) {
function Writable(options) {
- if (!(this instanceof Writable) && !(this instanceof Stream.Duplex))
+ if (!(this instanceof Writable) && !(this instanceof require('./_stream_duplex')))
return new Writable(options);
-
+
this._writableState = new WritableState(options, this);
diff --git a/test/simple/test-stream-big-push.js b/test/simple/test-stream-big-push.js
index e3787e4..8cd2127 100644
--- a/test/simple/test-stream-big-push.js
+++ b/test/simple/test-stream-big-push.js
@@ -21,7 +21,7 @@
-
+
var common = require('../common');
var assert = require('assert');
-var stream = require('stream');
+var stream = require('../../');
var str = 'asdfasdfasdfasdfasdf';
-
+
var r = new stream.Readable({
diff --git a/test/simple/test-stream-end-paused.js b/test/simple/test-stream-end-paused.js
index bb73777..d40efc7 100644
--- a/test/simple/test-stream-end-paused.js
+++ b/test/simple/test-stream-end-paused.js
@@ -25,7 +25,7 @@ var gotEnd = false;
-
+
// Make sure we don't miss the end event for paused 0-length streams
-
+
-var Readable = require('stream').Readable;
+var Readable = require('../../').Readable;
var stream = new Readable();
@@ -22,8 +22,8 @@
var common = require('../common');
var assert = require('assert');
-
+
-var Readable = require('_stream_readable');
-var Writable = require('_stream_writable');
+var Readable = require('../../lib/_stream_readable');
+var Writable = require('../../lib/_stream_writable');
var util = require('util');
-
+
util.inherits(TestReadable, Readable);
diff --git a/test/simple/test-stream-pipe-cleanup.js b/test/simple/test-stream-pipe-cleanup.js
deleted file mode 100644
--- a/test/simple/test-stream-pipe-error-handling.js
+++ b/test/simple/test-stream-pipe-error-handling.js
@@ -21,7 +21,7 @@
-
+
var common = require('../common');
var assert = require('assert');
-var Stream = require('stream').Stream;
+var Stream = require('../../').Stream;
-
+
(function testErrorListenerCatches() {
var source = new Stream();
diff --git a/test/simple/test-stream-pipe-event.js b/test/simple/test-stream-pipe-event.js
+++ b/test/simple/test-stream-pipe-event.js
@@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+
var common = require('../common');
-var stream = require('stream');
+var stream = require('../../');
var assert = require('assert');
var util = require('util');
-
+
diff --git a/test/simple/test-stream-push-order.js b/test/simple/test-stream-push-order.js
index f2e6ec2..a5c9bf9 100644
--- a/test/simple/test-stream-push-order.js
+++ b/test/simple/test-stream-push-order.js
@@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+
var common = require('../common.js');
-var Readable = require('stream').Readable;
+var Readable = require('../../').Readable;
var assert = require('assert');
-
+
var s = new Readable({
diff --git a/test/simple/test-stream-push-strings.js b/test/simple/test-stream-push-strings.js
index 06f43dc..1701a9a 100644
@@ -22,7 +22,7 @@
var common = require('../common');
var assert = require('assert');
-
+
-var Readable = require('stream').Readable;
+var Readable = require('../../').Readable;
var util = require('util');
-
+
util.inherits(MyStream, Readable);
diff --git a/test/simple/test-stream-readable-event.js b/test/simple/test-stream-readable-event.js
index ba6a577..a8e6f7b 100644
@@ -22,7 +22,7 @@
var common = require('../common');
var assert = require('assert');
-
+
-var Readable = require('stream').Readable;
+var Readable = require('../../').Readable;
-
+
(function first() {
// First test, not reading when the readable is added.
diff --git a/test/simple/test-stream-readable-flow-recursion.js b/test/simple/test-stream-readable-flow-recursion.js
@@ -27,7 +27,7 @@ var assert = require('assert');
// more data continuously, but without triggering a nextTick
// warning or RangeError.
-
+
-var Readable = require('stream').Readable;
+var Readable = require('../../').Readable;
-
+
// throw an error if we trigger a nextTick warning.
process.throwDeprecation = true;
diff --git a/test/simple/test-stream-unshift-empty-chunk.js b/test/simple/test-stream-unshift-empty-chunk.js
--- a/test/simple/test-stream-unshift-empty-chunk.js
+++ b/test/simple/test-stream-unshift-empty-chunk.js
@@ -24,7 +24,7 @@ var assert = require('assert');
-
- // This test verifies that stream.unshift(Buffer(0)) or
+
+ // This test verifies that stream.unshift(Buffer(0)) or
// stream.unshift('') does not set state.reading=false.
-var Readable = require('stream').Readable;
+var Readable = require('../../').Readable;
-
+
var r = new Readable();
var nChunks = 10;
diff --git a/test/simple/test-stream-unshift-read-race.js b/test/simple/test-stream-unshift-read-race.js
@@ -29,7 +29,7 @@ var assert = require('assert');
// 3. push() after the EOF signaling null is an error.
// 4. _read() is not called after pushing the EOF null chunk.
-
+
-var stream = require('stream');
+var stream = require('../../');
var hwm = 10;
var r = stream.Readable({ highWaterMark: hwm });
var chunks = 10;
@@ -51,7 +51,14 @@ r._read = function(n) {
-
+
function push(fast) {
assert(!pushedNull, 'push() after null push');
- var c = pos >= data.length ? null : data.slice(pos, pos + n);
@@ -22,7 +22,7 @@
var common = require('../common');
var assert = require('assert');
-
+
-var stream = require('stream');
+var stream = require('../../');
-
+
var queue = [];
for (var decode = 0; decode < 2; decode++) {
diff --git a/test/simple/test-stream2-basic.js b/test/simple/test-stream2-basic.js
--- a/test/simple/test-stream2-basic.js
+++ b/test/simple/test-stream2-basic.js
@@ -21,7 +21,7 @@
-
-
+
+
var common = require('../common.js');
-var R = require('_stream_readable');
+var R = require('../../lib/_stream_readable');
var assert = require('assert');
-
+
var util = require('util');
diff --git a/test/simple/test-stream2-compatibility.js b/test/simple/test-stream2-compatibility.js
index 6cdd4e9..f0fa84b 100644
--- a/test/simple/test-stream2-compatibility.js
+++ b/test/simple/test-stream2-compatibility.js
@@ -21,7 +21,7 @@
-
-
+
+
var common = require('../common.js');
-var R = require('_stream_readable');
+var R = require('../../lib/_stream_readable');
var assert = require('assert');
-
+
var util = require('util');
diff --git a/test/simple/test-stream2-finish-pipe.js b/test/simple/test-stream2-finish-pipe.js
index 39b274f..006a19b 100644
+++ b/test/simple/test-stream2-finish-pipe.js
@@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+
var common = require('../common.js');
-var stream = require('stream');
+var stream = require('../../');
var Buffer = require('buffer').Buffer;
-
+
var r = new stream.Readable();
diff --git a/test/simple/test-stream2-fs.js b/test/simple/test-stream2-fs.js
deleted file mode 100644
@@ -30,7 +30,7 @@ var PUSHSIZE = 20;
var PUSHCOUNT = 1000;
var HWM = 50;
-
+
-var Readable = require('stream').Readable;
+var Readable = require('../../').Readable;
var r = new Readable({
});
@@ -39,23 +39,23 @@ var rs = r._readableState;
r._read = push;
-
+
r.on('readable', function() {
- console.error('>> readable');
+ //console.error('>> readable');
- console.error(' < %j (%d remain)', ret && ret.length, rs.length);
+ //console.error(' < %j (%d remain)', ret && ret.length, rs.length);
} while (ret && ret.length === READSIZE);
-
+
- console.error('<< after read()',
- ret && ret.length,
- rs.needReadable,
+ // rs.needReadable,
+ // rs.length);
});
-
+
var endEmitted = false;
r.on('end', function() {
endEmitted = true;
- console.error('end');
+ //console.error('end');
});
-
+
var pushes = 0;
@@ -64,11 +64,11 @@ function push() {
return;
-
+
if (pushes++ === PUSHCOUNT) {
- console.error(' push(EOF)');
+ //console.error(' push(EOF)');
return r.push(null);
}
-
+
- console.error(' push #%d', pushes);
+ //console.error(' push #%d', pushes);
if (r.push(new Buffer(PUSHSIZE)))
--- a/test/simple/test-stream2-objects.js
+++ b/test/simple/test-stream2-objects.js
@@ -21,8 +21,8 @@
-
-
+
+
var common = require('../common.js');
-var Readable = require('_stream_readable');
-var Writable = require('_stream_writable');
+var Readable = require('../../lib/_stream_readable');
+var Writable = require('../../lib/_stream_writable');
var assert = require('assert');
-
+
// tiny node-tap lookalike.
diff --git a/test/simple/test-stream2-pipe-error-handling.js b/test/simple/test-stream2-pipe-error-handling.js
index cf7531c..e3f3e4e 100644
--- a/test/simple/test-stream2-pipe-error-handling.js
+++ b/test/simple/test-stream2-pipe-error-handling.js
@@ -21,7 +21,7 @@
-
+
var common = require('../common');
var assert = require('assert');
-var stream = require('stream');
+var stream = require('../../');
-
+
(function testErrorListenerCatches() {
var count = 1000;
diff --git a/test/simple/test-stream2-pipe-error-once-listener.js b/test/simple/test-stream2-pipe-error-once-listener.js
+++ b/test/simple/test-stream2-pipe-error-once-listener.js
@@ -24,7 +24,7 @@ var common = require('../common.js');
var assert = require('assert');
-
+
var util = require('util');
-var stream = require('stream');
+var stream = require('../../');
-
-
+
+
var Read = function() {
diff --git a/test/simple/test-stream2-push.js b/test/simple/test-stream2-push.js
index b63edc3..eb2b0e9 100644
+++ b/test/simple/test-stream2-push.js
@@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+
var common = require('../common.js');
-var stream = require('stream');
+var stream = require('../../');
--- a/test/simple/test-stream2-read-sync-stack.js
+++ b/test/simple/test-stream2-read-sync-stack.js
@@ -21,7 +21,7 @@
-
+
var common = require('../common');
var assert = require('assert');
-var Readable = require('stream').Readable;
+var Readable = require('../../').Readable;
var r = new Readable();
var N = 256 * 1024;
-
+
diff --git a/test/simple/test-stream2-readable-empty-buffer-no-eof.js b/test/simple/test-stream2-readable-empty-buffer-no-eof.js
index cd30178..4b1659d 100644
--- a/test/simple/test-stream2-readable-empty-buffer-no-eof.js
@@ -22,10 +22,9 @@
var common = require('../common');
var assert = require('assert');
-
+
-var Readable = require('stream').Readable;
+var Readable = require('../../').Readable;
-
+
test1();
-test2();
-
+
function test1() {
var r = new Readable();
@@ -88,31 +87,3 @@ function test1() {
--- a/test/simple/test-stream2-readable-from-list.js
+++ b/test/simple/test-stream2-readable-from-list.js
@@ -21,7 +21,7 @@
-
+
var assert = require('assert');
var common = require('../common.js');
-var fromList = require('_stream_readable')._fromList;
+var fromList = require('../../lib/_stream_readable')._fromList;
-
+
// tiny node-tap lookalike.
var tests = [];
diff --git a/test/simple/test-stream2-readable-legacy-drain.js b/test/simple/test-stream2-readable-legacy-drain.js
@@ -22,7 +22,7 @@
var common = require('../common');
var assert = require('assert');
-
+
-var Stream = require('stream');
+var Stream = require('../../');
var Readable = Stream.Readable;
-
+
var r = new Readable();
diff --git a/test/simple/test-stream2-readable-non-empty-end.js b/test/simple/test-stream2-readable-non-empty-end.js
index 7314ae7..c971898 100644
--- a/test/simple/test-stream2-readable-non-empty-end.js
+++ b/test/simple/test-stream2-readable-non-empty-end.js
@@ -21,7 +21,7 @@
-
+
var assert = require('assert');
var common = require('../common.js');
-var Readable = require('_stream_readable');
+var Readable = require('../../lib/_stream_readable');
-
+
var len = 0;
var chunks = new Array(10);
diff --git a/test/simple/test-stream2-readable-wrap-empty.js b/test/simple/test-stream2-readable-wrap-empty.js
@@ -22,7 +22,7 @@
var common = require('../common');
var assert = require('assert');
-
+
-var Readable = require('_stream_readable');
+var Readable = require('../../lib/_stream_readable');
var EE = require('events').EventEmitter;
-
+
var oldStream = new EE();
diff --git a/test/simple/test-stream2-readable-wrap.js b/test/simple/test-stream2-readable-wrap.js
index 90eea01..6b177f7 100644
@@ -22,8 +22,8 @@
var common = require('../common');
var assert = require('assert');
-
+
-var Readable = require('_stream_readable');
-var Writable = require('_stream_writable');
+var Readable = require('../../lib/_stream_readable');
+var Writable = require('../../lib/_stream_writable');
var EE = require('events').EventEmitter;
-
+
var testRuns = 0, completedRuns = 0;
diff --git a/test/simple/test-stream2-set-encoding.js b/test/simple/test-stream2-set-encoding.js
index 5d2c32a..685531b 100644
--- a/test/simple/test-stream2-set-encoding.js
+++ b/test/simple/test-stream2-set-encoding.js
@@ -22,7 +22,7 @@
-
+
var common = require('../common.js');
var assert = require('assert');
-var R = require('_stream_readable');
+var R = require('../../lib/_stream_readable');
var util = require('util');
-
+
// tiny node-tap lookalike.
diff --git a/test/simple/test-stream2-transform.js b/test/simple/test-stream2-transform.js
index 9c9ddd8..a0cacc6 100644
--- a/test/simple/test-stream2-transform.js
+++ b/test/simple/test-stream2-transform.js
@@ -21,8 +21,8 @@
-
+
var assert = require('assert');
var common = require('../common.js');
-var PassThrough = require('_stream_passthrough');
-var Transform = require('_stream_transform');
+var PassThrough = require('../../').PassThrough;
+var Transform = require('../../').Transform;
-
+
// tiny node-tap lookalike.
var tests = [];
diff --git a/test/simple/test-stream2-unpipe-drain.js b/test/simple/test-stream2-unpipe-drain.js
--- a/test/simple/test-stream2-unpipe-drain.js
+++ b/test/simple/test-stream2-unpipe-drain.js
@@ -22,7 +22,7 @@
-
+
var common = require('../common.js');
var assert = require('assert');
-var stream = require('stream');
+var stream = require('../../');
var crypto = require('crypto');
-
+
var util = require('util');
diff --git a/test/simple/test-stream2-unpipe-leak.js b/test/simple/test-stream2-unpipe-leak.js
index 99f8746..17c92ae 100644
--- a/test/simple/test-stream2-unpipe-leak.js
+++ b/test/simple/test-stream2-unpipe-leak.js
@@ -22,7 +22,7 @@
-
+
var common = require('../common.js');
var assert = require('assert');
-var stream = require('stream');
+var stream = require('../../');
-
+
var chunk = new Buffer('hallo');
-
+
diff --git a/test/simple/test-stream2-writable.js b/test/simple/test-stream2-writable.js
index 704100c..209c3a6 100644
--- a/test/simple/test-stream2-writable.js
+++ b/test/simple/test-stream2-writable.js
@@ -20,8 +20,8 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.
-
+
var common = require('../common.js');
-var W = require('_stream_writable');
-var D = require('_stream_duplex');
+var W = require('../../').Writable;
+var D = require('../../').Duplex;
var assert = require('assert');
-
+
var util = require('util');
diff --git a/test/simple/test-stream3-pause-then-read.js b/test/simple/test-stream3-pause-then-read.js
index b91bde3..2f72c15 100644
@@ -22,7 +22,7 @@
var common = require('../common');
var assert = require('assert');
-
+
-var stream = require('stream');
+var stream = require('../../');
var Readable = stream.Readable;
var Writable = stream.Writable;
+
});
require.alias("isarray/index.js", "isarray/index.js");
+
t.is(er, null, "finishAll: on change event fired")
t.is(onChangeName, name, "finishAll: on change emits the correct name")
t.is(track.completed(), 1, "Finishing everything ")
-
+
track = new TrackerGroup(name)
a = track.newItem("a", 10, 2)
b = track.newItem("b", 10, 1)
t.is(er, null, "weightedFinishAll: on change event fired")
t.is(onChangeName, name, "weightedFinishAll: on change emits the correct name")
t.is(track.completed(), 1, "weightedFinishaAll: Finishing everything ")
-
+
track = new TrackerGroup(name)
a = track.newGroup("a", 10)
b = track.newGroup("b", 10)
If the template element is an object, it can have the following keys:
* *type* can be:
- * `name` – The most recent name passed to `show`; if this is in response to a
+ * `name` – The most recent name passed to `show`; if this is in response to a
`pulse` then the name passed to `pulse` will be appended along with the
subsection property from the theme.
* `spinner` – If you've ever called `pulse` this will be one of the characters
will be padded according to the *align* value.
* *align* – (Default: left) Possible values "left", "right" and "center". Works
as you'd expect from word processors.
-* *length* – Provides a single value for both *minLength* and *maxLength*. If both
+* *length* – Provides a single value for both *minLength* and *maxLength*. If both
*length* and *minLength or *maxLength* are specifed then the latter take precedence.
### Tracking Completion
If the template element is an object, it can have the following keys:
* *type* can be:
- * `name` – The most recent name passed to `show`; if this is in response to a
+ * `name` – The most recent name passed to `show`; if this is in response to a
`pulse` then the name passed to `pulse` will be appended along with the
subsection property from the theme.
* `spinner` – If you've ever called `pulse` this will be one of the characters
will be padded according to the *align* value.
* *align* – (Default: left) Possible values "left", "right" and "center". Works
as you'd expect from word processors.
-* *length* – Provides a single value for both *minLength* and *maxLength*. If both
+* *length* – Provides a single value for both *minLength* and *maxLength*. If both
*length* and *minLength or *maxLength* are specifed then the latter take precedence.
### Tracking Completion
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
### Unix Like Operating Systems
We look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in
-that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value.
+that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value.
For `LC_CTYPE` it looks to see if the value is `UTF-8`. This is sufficient
for most POSIX systems. While locale data can be put in `/etc/locale.conf`
as well, AFAIK it's always copied into the environment.
+
}
t.is(actions.length, output.length, msg)
tests.forEach(function (test) {
- t.is(actions[test.cmd] ? actions[test.cmd][test.arg] : null,
+ t.is(actions[test.cmd] ? actions[test.cmd][test.arg] : null,
output[test.cmd][test.arg],
msg + ': ' + output[test.cmd] + (test.arg ? ' arg #'+test.arg : ''))
})
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.
+
Yet again, this feature comes with a performance hit, so if user experience matters to you more than performance, use this module. If your JSON will be consumed by machines, use JSON.stringify instead.
As a rule of thumb, if you use "space" argument to indent your JSON, you'd better use this module instead.
+
-JSON5 grammar expressed in EBNF form.
+JSON5 grammar expressed in EBNF form.
PS: I don't know what is appropriate syntax highlighter for this, so I'm using "modula2" because why not. I also inserted <ZWSP> after backslash to preserve syntax highlighting, this character has nothing to do with actual JSON5 syntax and should be ignored.
ascii_letter = ascii_letter_lowercase
| ascii_letter_uppercase
-ascii_letter_lowercase = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i'
+ascii_letter_lowercase = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i'
| 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r'
| 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'
-ascii_letter_uppercase = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I'
+ascii_letter_uppercase = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I'
| 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R'
| 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z'
module.exports.update = function updateJSON(source, new_value, options) {
return Document(source, options).update(new_value).toString()
}
+
tokens.data = module.exports.parse(input, options)
return tokens
}
+
return _stringify(object, options, 0, '')
}
+
throw Error('this function is removed, use express-json5 instead')
}
}
+
license:
type: WTFPL
url: http://www.wtfpl.net/txt/copying/
+
var t = analyze("{foo:'bar', \"bar\":'baz', \"baz\":\"quux\"}")
addTest(t.quote, '"')
addTest(t.quote_keys, false)
+
var x = err.stack.match(/parseObject/g)
assert(!x || x.length < 2, "shouldn't blow up the stack with internal calls")
}
+
//console.log(rnd, x, y, z)
if (x !== y && x !== z) throw 'ERROR'
}
+
{ raw: '}', type: 'separator', stack: [5] },
{ raw: ',', type: 'separator', stack: [] },
{ raw: ']', type: 'separator', stack: [] } ])
+
assert.strictEqual(test.test(jju, test.input), test.output)
})
})
+
}
return jju.update(input, obj)
}
+
obj.foo.bar.qwe = {rty: {aaa: {bbb: 1}}}
return jju.update(input, obj, {mode:'json'})
}
+
delete obj.dependencies.bar
return jju.update(input, obj, {mode:'json'})
}
+
obj.bundleDependencies.push('quux')
return jju.update(input, obj, {mode:'json'})
}
+
obj.dependencies.qwerty = '1'
return jju.update(input, obj, {mode:'json'})
}
+
_from: 'npm-test-array-bin/' }
return jju.update(input, obj)
}
+
}
return jju.update(input, upd)
}
+
, net = require('net')
, tls = require('tls')
, AgentSSL = require('https').Agent
-
-function getConnectionName(host, port) {
+
+function getConnectionName(host, port) {
var name = ''
if (typeof host === 'string') {
name = host + ':' + port
name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':')
}
return name
-}
+}
function ForeverAgent(options) {
var self = this
ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest
ForeverAgent.prototype.addRequest = function(req, host, port) {
var name = getConnectionName(host, port)
-
+
if (typeof host !== 'string') {
var options = host
port = options.port
// Here is a simple object with an (unnecessarily roundabout) squaring method
var AsyncSquaringLibrary = {
squareExponent: 2,
- square: function(number, callback){
+ square: function(number, callback){
var result = Math.pow(number, this.squareExponent);
setTimeout(function(){
callback(null, result);
async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){
// result is [1, 4, 9]
// With the help of bind we can attach a context to the iterator before
- // passing it to async. Now the square function will be executed in its
+ // passing it to async. Now the square function will be executed in its
// 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`
// will be as expected.
});
## In the Browser
-So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5.
+So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5.
Usage:
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err)` which must be called once it has
- completed. If no error has occured, the `callback` should be run without
+ The iterator is passed a `callback(err)` which must be called once it has
+ completed. If no error has occured, the `callback` should be run without
arguments or with an explicit `null` argument.
* `callback(err)` - A callback which is called when all `iterator` functions
have finished, or an error occurs.
```
```js
-// assuming openFiles is an array of file names
+// assuming openFiles is an array of file names
async.each(openFiles, function( file, callback) {
-
+
// Perform operation on file here.
console.log('Processing file ' + file);
-
+
if( file.length > 32 ) {
console.log('This file name is too long');
callback('File name too long');
### eachSeries(arr, iterator, callback)
The same as [`each`](#each), only `iterator` is applied to each item in `arr` in
-series. The next `iterator` is only called once the current one has completed.
+series. The next `iterator` is only called once the current one has completed.
This means the `iterator` functions will complete in order.
<a name="eachLimit" />
### eachLimit(arr, limit, iterator, callback)
-The same as [`each`](#each), only no more than `limit` `iterator`s will be simultaneously
+The same as [`each`](#each), only no more than `limit` `iterator`s will be simultaneously
running at any time.
-Note that the items in `arr` are not processed in batches, so there is no guarantee that
+Note that the items in `arr` are not processed in batches, so there is no guarantee that
the first `limit` `iterator` functions will complete before any others are started.
__Arguments__
* `arr` - An array to iterate over.
* `limit` - The maximum number of `iterator`s to run at any time.
* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err)` which must be called once it has
- completed. If no error has occured, the callback should be run without
+ The iterator is passed a `callback(err)` which must be called once it has
+ completed. If no error has occured, the callback should be run without
arguments or with an explicit `null` argument.
* `callback(err)` - A callback which is called when all `iterator` functions
have finished, or an error occurs.
Produces a new array of values by mapping each value in `arr` through
the `iterator` function. The `iterator` is called with an item from `arr` and a
-callback for when it has finished processing. Each of these callback takes 2 arguments:
-an `error`, and the transformed item from `arr`. If `iterator` passes an error to this
+callback for when it has finished processing. Each of these callback takes 2 arguments:
+an `error`, and the transformed item from `arr`. If `iterator` passes an error to this
callback, the main `callback` (for the `map` function) is immediately called with the error.
Note, that since this function applies the `iterator` to each item in parallel,
-there is no guarantee that the `iterator` functions will complete in order.
+there is no guarantee that the `iterator` functions will complete in order.
However, the results array will be in the same order as the original `arr`.
__Arguments__
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err, transformed)` which must be called once
+ The iterator is passed a `callback(err, transformed)` which must be called once
it has completed with an error (which can be `null`) and a transformed item.
* `callback(err, results)` - A callback which is called when all `iterator`
functions have finished, or an error occurs. Results is an array of the
### mapSeries(arr, iterator, callback)
The same as [`map`](#map), only the `iterator` is applied to each item in `arr` in
-series. The next `iterator` is only called once the current one has completed.
+series. The next `iterator` is only called once the current one has completed.
The results array will be in the same order as the original.
<a name="mapLimit" />
### mapLimit(arr, limit, iterator, callback)
-The same as [`map`](#map), only no more than `limit` `iterator`s will be simultaneously
+The same as [`map`](#map), only no more than `limit` `iterator`s will be simultaneously
running at any time.
-Note that the items are not processed in batches, so there is no guarantee that
+Note that the items are not processed in batches, so there is no guarantee that
the first `limit` `iterator` functions will complete before any others are started.
__Arguments__
* `arr` - An array to iterate over.
* `limit` - The maximum number of `iterator`s to run at any time.
* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err, transformed)` which must be called once
+ The iterator is passed a `callback(err, transformed)` which must be called once
it has completed with an error (which can be `null`) and a transformed item.
* `callback(err, results)` - A callback which is called when all `iterator`
calls have finished, or an error occurs. The result is an array of the
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
- The `iterator` is passed a `callback(truthValue)`, which must be called with a
+ The `iterator` is passed a `callback(truthValue)`, which must be called with a
boolean argument once it has completed.
* `callback(results)` - A callback which is called after all the `iterator`
functions have finished.
__Alias:__ `selectSeries`
The same as [`filter`](#filter) only the `iterator` is applied to each item in `arr` in
-series. The next `iterator` is only called once the current one has completed.
+series. The next `iterator` is only called once the current one has completed.
The results array will be in the same order as the original.
---------------------------------------
__Aliases:__ `inject`, `foldl`
Reduces `arr` into a single value using an async `iterator` to return
-each successive step. `memo` is the initial state of the reduction.
-This function only operates in series.
+each successive step. `memo` is the initial state of the reduction.
+This function only operates in series.
-For performance reasons, it may make sense to split a call to this function into
-a parallel map, and then use the normal `Array.prototype.reduce` on the results.
-This function is for situations where each step in the reduction needs to be async;
+For performance reasons, it may make sense to split a call to this function into
+a parallel map, and then use the normal `Array.prototype.reduce` on the results.
+This function is for situations where each step in the reduction needs to be async;
if you can get the data before reducing it, then it's probably a good idea to do so.
__Arguments__
* `memo` - The initial state of the reduction.
* `iterator(memo, item, callback)` - A function applied to each item in the
array to produce the next step in the reduction. The `iterator` is passed a
- `callback(err, reduction)` which accepts an optional error as its first
- argument, and the state of the reduction as the second. If an error is
- passed to the callback, the reduction is stopped and the main `callback` is
+ `callback(err, reduction)` which accepts an optional error as its first
+ argument, and the state of the reduction as the second. If an error is
+ passed to the callback, the reduction is stopped and the main `callback` is
immediately called with the error.
* `callback(err, result)` - A callback which is called after all the `iterator`
functions have finished. Result is the reduced value.
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
- The iterator is passed a `callback(truthValue)` which must be called with a
+ The iterator is passed a `callback(truthValue)` which must be called with a
boolean argument once it has completed.
* `callback(result)` - A callback which is called as soon as any iterator returns
`true`, or after all the `iterator` functions have finished. Result will be
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A truth test to apply to each item in the array
- in parallel. The iterator is passed a callback(truthValue) which must be
+ in parallel. The iterator is passed a callback(truthValue) which must be
called with a boolean argument once it has completed.
* `callback(result)` - A callback which is called as soon as any iterator returns
`true`, or after all the iterator functions have finished. Result will be
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A truth test to apply to each item in the array
- in parallel. The iterator is passed a callback(truthValue) which must be
+ in parallel. The iterator is passed a callback(truthValue) which must be
called with a boolean argument once it has completed.
* `callback(result)` - A callback which is called after all the `iterator`
functions have finished. Result will be either `true` or `false` depending on
* `arr` - An array to iterate over.
* `iterator(item, callback)` - A function to apply to each item in `arr`.
- The iterator is passed a `callback(err, results)` which must be called once it
+ The iterator is passed a `callback(err, results)` which must be called once it
has completed with an error (which can be `null`) and an array of results.
* `callback(err, results)` - A callback which is called after all the `iterator`
functions have finished, or an error occurs. Results is an array containing
Run the functions in the `tasks` array in series, each one running once the previous
function has completed. If any functions in the series pass an error to its
-callback, no more functions are run, and `callback` is immediately called with the value of the error.
+callback, no more functions are run, and `callback` is immediately called with the value of the error.
Otherwise, `callback` receives an array of results when `tasks` have completed.
It is also possible to use an object instead of an array. Each property will be
[`series`](#series).
**Note** that while many implementations preserve the order of object properties, the
-[ECMAScript Language Specifcation](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
+[ECMAScript Language Specifcation](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
explicitly states that
> The mechanics and order of enumerating the properties is not specified.
So if you rely on the order in which your series of functions are executed, and want
-this to work on all platforms, consider using an array.
+this to work on all platforms, consider using an array.
__Arguments__
a `callback(err, result)` it must call on completion with an error `err` (which can
be `null`) and an optional `result` value.
* `callback(err, results)` - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
+ have completed. This function gets a results array (or object) containing all
the result arguments passed to the `task` callbacks.
__Example__
__Arguments__
-* `tasks` - An array or object containing functions to run. Each function is passed
- a `callback(err, result)` which it must call on completion with an error `err`
+* `tasks` - An array or object containing functions to run. Each function is passed
+ a `callback(err, result)` which it must call on completion with an error `err`
(which can be `null`) and an optional `result` value.
* `callback(err, results)` - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
+ have completed. This function gets a results array (or object) containing all
the result arguments passed to the task callbacks.
__Example__
<a name="parallelLimit" />
### parallelLimit(tasks, limit, [callback])
-The same as [`parallel`](#parallel), only `tasks` are executed in parallel
+The same as [`parallel`](#parallel), only `tasks` are executed in parallel
with a maximum of `limit` tasks executing at any time.
-Note that the `tasks` are not executed in batches, so there is no guarantee that
+Note that the `tasks` are not executed in batches, so there is no guarantee that
the first `limit` tasks will complete before any others are started.
__Arguments__
-* `tasks` - An array or object containing functions to run, each function is passed
+* `tasks` - An array or object containing functions to run, each function is passed
a `callback(err, result)` it must call on completion with an error `err` (which can
be `null`) and an optional `result` value.
* `limit` - The maximum number of `tasks` to run at any time.
* `callback(err, results)` - An optional callback to run once all the functions
- have completed. This function gets a results array (or object) containing all
+ have completed. This function gets a results array (or object) containing all
the result arguments passed to the `task` callbacks.
---------------------------------------
* `test()` - synchronous truth test to perform before each execution of `fn`.
* `fn(callback)` - A function which is called each time `test` passes. The function is
- passed a `callback(err)`, which must be called once it has completed with an
+ passed a `callback(err)`, which must be called once it has completed with an
optional `err` argument.
* `callback(err)` - A callback which is called after the test fails and repeated
execution of `fn` has stopped.
<a name="doWhilst" />
### doWhilst(fn, test, callback)
-The post-check version of [`whilst`](#whilst). To reflect the difference in
-the order of operations, the arguments `test` and `fn` are switched.
+The post-check version of [`whilst`](#whilst). To reflect the difference in
+the order of operations, the arguments `test` and `fn` are switched.
`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
__Arguments__
-* `tasks` - An array of functions to run, each function is passed a
+* `tasks` - An array of functions to run, each function is passed a
`callback(err, result1, result2, ...)` it must call on completion. The first
- argument is an error (which can be `null`) and any further arguments will be
+ argument is an error (which can be `null`) and any further arguments will be
passed as arguments in order to the next task.
* `callback(err, [results])` - An optional callback to run once all the functions
have completed. This will be passed the results of the last task's callback.
callback(null, 'done');
}
], function (err, result) {
- // result now equals 'done'
+ // result now equals 'done'
});
```
### seq(fn1, fn2...)
Version of the compose function that is more natural to read.
-Each following function consumes the return value of the latter function.
+Each following function consumes the return value of the latter function.
Each function is executed with the `this` binding of the composed function.
```js
// Requires lodash (or underscore), express3 and dresende's orm2.
// Part of an app, that fetches cats of the logged user.
-// This example uses `seq` function to avoid overnesting and error
+// This example uses `seq` function to avoid overnesting and error
// handling clutter.
app.get('/cats', function(request, response) {
function handleError(err, data, callback) {
<a name="applyEach" />
### applyEach(fns, args..., callback)
-Applies the provided arguments to each function in the array, calling
+Applies the provided arguments to each function in the array, calling
`callback` after all functions have completed. If you only provide the first
argument, then it will return a function which lets you pass in the
arguments as if it were a single function call.
Creates a `queue` object with the specified `concurrency`. Tasks added to the
`queue` are processed in parallel (up to the `concurrency` limit). If all
-`worker`s are in progress, the task is queued until one becomes available.
+`worker`s are in progress, the task is queued until one becomes available.
Once a `worker` completes a `task`, that `task`'s callback is called.
__Arguments__
* `worker(task, callback)` - An asynchronous function for processing a queued
- task, which must call its `callback(err)` argument when finished, with an
+ task, which must call its `callback(err)` argument when finished, with an
optional `error` as an argument.
* `concurrency` - An `integer` for determining how many `worker` functions should be
run in parallel.
* `concurrency` - an integer for determining how many `worker` functions should be
run in parallel. This property can be changed after a `queue` is created to
alter the concurrency on-the-fly.
-* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once
+* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once
the `worker` has finished processing the task. Instead of a single task, a `tasks` array
can be submitted. The respective callback is used for every task in the list.
* `unshift(task, [callback])` - add a new task to the front of the `queue`.
-* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,
+* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,
and further tasks will be queued.
* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.
* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.
__Arguments__
* `worker(tasks, callback)` - An asynchronous function for processing an array of
- queued tasks, which must call its `callback(err)` argument when finished, with
+ queued tasks, which must call its `callback(err)` argument when finished, with
an optional `err` argument.
* `payload` - An optional `integer` for determining how many tasks should be
processed per round; if omitted, the default is unlimited.
process per round. This property can be changed after a `cargo` is created to
alter the payload on-the-fly.
* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called
- once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`
+ once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`
can be submitted. The respective callback is used for every task in the list.
* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.
* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.
<a name="auto" />
### auto(tasks, [callback])
-Determines the best order for running the functions in `tasks`, based on their
-requirements. Each function can optionally depend on other functions being completed
-first, and each function is run as soon as its requirements are satisfied.
+Determines the best order for running the functions in `tasks`, based on their
+requirements. Each function can optionally depend on other functions being completed
+first, and each function is run as soon as its requirements are satisfied.
-If any of the functions pass an error to their callback, it will not
-complete (so any other functions depending on it will not run), and the main
-`callback` is immediately called with the error. Functions also receive an
+If any of the functions pass an error to their callback, it will not
+complete (so any other functions depending on it will not run), and the main
+`callback` is immediately called with the error. Functions also receive an
object containing the results of functions which have completed so far.
-Note, all functions are called with a `results` object as a second argument,
+Note, all functions are called with a `results` object as a second argument,
so it is unsafe to pass functions in the `tasks` object which cannot handle the
-extra argument.
+extra argument.
For example, this snippet of code:
fs.readFile('data.txt', 'utf-8', cb, {});
```
-Instead, wrap the call to `readFile` in a function which does not forward the
+Instead, wrap the call to `readFile` in a function which does not forward the
`results` object:
```js
requirements, with the function itself the last item in the array. The object's key
of a property serves as the name of the task defined by that property,
i.e. can be used when specifying requirements for other tasks.
- The function receives two arguments: (1) a `callback(err, result)` which must be
- called when finished, passing an `error` (which can be `null`) and the result of
+ The function receives two arguments: (1) a `callback(err, result)` which must be
+ called when finished, passing an `error` (which can be `null`) and the result of
the function's execution, and (2) a `results` object, containing the results of
the previously executed functions.
* `callback(err, results)` - An optional callback which is called when all the
- tasks have been completed. It receives the `err` argument if any `tasks`
- pass an error to their callback. Results are always returned; however, if
+ tasks have been completed. It receives the `err` argument if any `tasks`
+ pass an error to their callback. Results are always returned; however, if
an error occurs, no further `tasks` will be performed, and the results
object will only contain partial results.
* `times` - An integer indicating how many times to attempt the `task` before giving up. Defaults to 5.
* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`
- which must be called when finished, passing `err` (which can be `null`) and the `result` of
+ which must be called when finished, passing `err` (which can be `null`) and the `result` of
the function's execution, and (2) a `results` object, containing the results of
the previously executed functions (if nested inside another control flow).
* `callback(err, results)` - An optional callback which is called when the
<a name="apply" />
### apply(function, arguments..)
-Creates a continuation function with some arguments already applied.
+Creates a continuation function with some arguments already applied.
Useful as a shorthand when combined with other control flow functions. Any arguments
passed to the returned function are added to the arguments originally passed
### timesSeries(n, callback)
The same as [`times`](#times), only the iterator is applied to each item in `arr` in
-series. The next `iterator` is only called once the current one has completed.
+series. The next `iterator` is only called once the current one has completed.
The results array will be in the same order as the original.
};
return q;
};
-
+
async.priorityQueue = function (worker, concurrency) {
-
+
function _compareTasks(a, b){
return a.priority - b.priority;
};
-
+
function _binarySearch(sequence, item, compare) {
var beg = -1,
end = sequence.length - 1;
}
return beg;
}
-
+
function _insert(q, data, priority, callback) {
if (!q.started){
q.started = true;
priority: priority,
callback: typeof callback === 'function' ? callback : null
};
-
+
q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
if (q.saturated && q.tasks.length === q.concurrency) {
async.setImmediate(q.process);
});
}
-
+
// Start with a normal queue
var q = async.queue(worker, concurrency);
-
+
// Override push to accept second parameter representing priority
q.push = function (data, priority, callback) {
_insert(q, data, priority, callback);
};
-
+
// Remove unshift function
delete q.unshift;
/* @preserve
* The MIT License (MIT)
- *
+ *
* Copyright (c) 2014 Petka Antonov
- *
+ *
* 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:</p>
- *
+ *
* 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
* 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.
- *
+ *
*/
/**
* bluebird build version 2.9.24
}
}
-Promise.prototype.asCallback =
+Promise.prototype.asCallback =
Promise.prototype.nodeify = function (nodeback, options) {
if (typeof nodeback == "function") {
var adapter = successAdapter;
_dereq_('./each.js')(Promise, INTERNAL);
_dereq_('./timers.js')(Promise, INTERNAL);
_dereq_('./filter.js')(Promise, INTERNAL);
-
- util.toFastProperties(Promise);
- util.toFastProperties(Promise.prototype);
- function fillTypes(value) {
- var p = new Promise(INTERNAL);
- p._fulfillmentHandler0 = value;
- p._rejectionHandler0 = value;
- p._progressHandler0 = value;
- p._promise0 = value;
- p._receiver0 = value;
- p._settledValue = value;
- }
- // Complete slack tracking, opt out of field-type tracking and
- // stabilize map
- fillTypes({a: 1});
- fillTypes({b: 2});
- fillTypes({c: 3});
- fillTypes(1);
- fillTypes(function(){});
- fillTypes(undefined);
- fillTypes(false);
- fillTypes(new Promise(INTERNAL));
- CapturedTrace.setBounds(async.firstLineError, util.lastLineError);
- return Promise;
+
+ util.toFastProperties(Promise);
+ util.toFastProperties(Promise.prototype);
+ function fillTypes(value) {
+ var p = new Promise(INTERNAL);
+ p._fulfillmentHandler0 = value;
+ p._rejectionHandler0 = value;
+ p._progressHandler0 = value;
+ p._promise0 = value;
+ p._receiver0 = value;
+ p._settledValue = value;
+ }
+ // Complete slack tracking, opt out of field-type tracking and
+ // stabilize map
+ fillTypes({a: 1});
+ fillTypes({b: 2});
+ fillTypes({c: 3});
+ fillTypes(1);
+ fillTypes(function(){});
+ fillTypes(undefined);
+ fillTypes(false);
+ fillTypes(new Promise(INTERNAL));
+ CapturedTrace.setBounds(async.firstLineError, util.lastLineError);
+ return Promise;
};
/* @preserve
* The MIT License (MIT)
- *
+ *
* Copyright (c) 2014 Petka Antonov
- *
+ *
* 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:</p>
- *
+ *
* 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
* 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.
- *
+ *
*/
/**
* bluebird build version 2.9.24
}
}
-Promise.prototype.asCallback =
+Promise.prototype.asCallback =
Promise.prototype.nodeify = function (nodeback, options) {
if (typeof nodeback == "function") {
var adapter = successAdapter;
require('./each.js')(Promise, INTERNAL);
require('./timers.js')(Promise, INTERNAL);
require('./filter.js')(Promise, INTERNAL);
-
- util.toFastProperties(Promise);
- util.toFastProperties(Promise.prototype);
- function fillTypes(value) {
- var p = new Promise(INTERNAL);
- p._fulfillmentHandler0 = value;
- p._rejectionHandler0 = value;
- p._progressHandler0 = value;
- p._promise0 = value;
- p._receiver0 = value;
- p._settledValue = value;
- }
- // Complete slack tracking, opt out of field-type tracking and
- // stabilize map
- fillTypes({a: 1});
- fillTypes({b: 2});
- fillTypes({c: 3});
- fillTypes(1);
- fillTypes(function(){});
- fillTypes(undefined);
- fillTypes(false);
- fillTypes(new Promise(INTERNAL));
- CapturedTrace.setBounds(async.firstLineError, util.lastLineError);
- return Promise;
+
+ util.toFastProperties(Promise);
+ util.toFastProperties(Promise.prototype);
+ function fillTypes(value) {
+ var p = new Promise(INTERNAL);
+ p._fulfillmentHandler0 = value;
+ p._rejectionHandler0 = value;
+ p._progressHandler0 = value;
+ p._promise0 = value;
+ p._receiver0 = value;
+ p._settledValue = value;
+ }
+ // Complete slack tracking, opt out of field-type tracking and
+ // stabilize map
+ fillTypes({a: 1});
+ fillTypes({b: 2});
+ fillTypes({c: 3});
+ fillTypes(1);
+ fillTypes(function(){});
+ fillTypes(undefined);
+ fillTypes(false);
+ fillTypes(new Promise(INTERNAL));
+ CapturedTrace.setBounds(async.firstLineError, util.lastLineError);
+ return Promise;
};
return promisifyAll(target, suffix, filter, promisifier);
};
};
+
[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://www.npmjs.org/package/commander)
[![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
- The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/tj/commander).
+ The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/tj/commander).
[API documentation](http://tj.github.com/commander.js/)
.option('-s --size <size>', 'Pizza size', /^(large|medium|small)$/i, 'medium')
.option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i)
.parse(process.argv);
-
+
console.log(' size: %j', program.size);
console.log(' drink: %j', program.drink);
```
.parse(process.argv);
```
-When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools.
+When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools.
The commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`.
If the program is designed to installed globally, make sure the executables have proper modes, like `755`.
The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:
-```
+```
$ ./examples/pizza --help
Usage: pizza [options]
## License
MIT
+
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.
+
validate('for (var %s = %d; %s < %s.length; %s++) {', i, node.items.length, i, name, i)
visit(name+'['+i+']', node.additionalItems, reporter, filter)
validate('}')
- }
+ }
}
if (node.format && fmts[node.format]) {
node.anyOf.forEach(function(sch, i) {
if (i === 0) {
validate('var %s = errors', prev)
- } else {
+ } else {
validate('if (errors !== %s) {', prev)
('errors = %s', prev)
}
if (node.maxProperties !== undefined) {
if (type !== 'object') validate('if (%s) {', types.object(name))
-
+
validate('if (Object.keys(%s).length > %d) {', name, node.maxProperties)
error('has more properties than allowed')
validate('}')
if (node.minProperties !== undefined) {
if (type !== 'object') validate('if (%s) {', types.object(name))
-
+
validate('if (Object.keys(%s).length < %d) {', name, node.minProperties)
error('has less properties than allowed')
validate('}')
if (node.maxItems !== undefined) {
if (type !== 'array') validate('if (%s) {', types.array(name))
-
+
validate('if (%s.length > %d) {', name, node.maxItems)
error('has more items than allowed')
validate('}')
if (node.minItems !== undefined) {
if (type !== 'array') validate('if (%s) {', types.array(name))
-
+
validate('if (%s.length < %d) {', name, node.minItems)
error('has less items than allowed')
validate('}')
-------
npm install is-property
-
+
### `require("is-property")(str)`
Checks if str is a property
"description": "forbidden property",
"schema": {
"properties": {
- "foo": {
+ "foo": {
"not": {}
}
}
} else if (typeof define === 'function' && define.amd) {
// Publish as AMD module
define(function() {return uuid;});
-
+
} else {
// Publish as global (in browsers)
-The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node.
+The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node.
Install with `npm install rimraf`, or just drop rimraf.js somewhere.
This only works with directories, it does not work with individual files.
The optional `properties` object are used to set properties in the tar
-'Global Extended Header'.
+'Global Extended Header'. If the `fromBase` property is set to true,
+the tar will contain files relative to the path passed, and not with
+the path included.
### tar.Extract([options])
Extract.prototype._streamEnd = function () {
var me = this
- if (!me._ended) me.error("unexpected eof")
+ if (!me._ended || me._entry) me.error("unexpected eof")
me._fst.end()
// my .end() is coming later.
}
// in the tarball to use. That way we can skip a lot of extra
// work when resolving symlinks for bundled dependencies in npm.
- var root = path.dirname((entry.root || entry).path)
+ var root = path.dirname((entry.root || entry).path);
+ if (me._global && me._global.fromBase && entry.root && entry.root.path) {
+ // user set 'fromBase: true' indicating tar root should be directory itself
+ root = entry.root.path;
+ }
+
var wprops = {}
Object.keys(entry.props || {}).forEach(function (k) {
// emitting "end"
Parse.prototype._streamEnd = function () {
var me = this
- if (!me._ended) me.error("unexpected eof")
+ if (!me._ended || me._entry) me.error("unexpected eof")
me.emit("end")
}
},
"name": "tar",
"description": "tar for node",
- "version": "2.0.1",
+ "version": "2.1.0",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-tar.git"
"mkdirp": "^0.5.0"
},
"license": "BSD",
- "gitHead": "ce405d0b96f0fe186dd4cc68d666fabb0c59818d",
+ "readme": "# node-tar\n\nTar for Node.js.\n\n[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/)\n\n## API\n\nSee `examples/` for usage examples.\n\n### var tar = require('tar')\n\nReturns an object with `.Pack`, `.Extract` and `.Parse` methods.\n\n### tar.Pack([properties])\n\nReturns a through stream. Use\n[fstream](https://npmjs.org/package/fstream) to write files into the\npack stream and you will receive tar archive data from the pack\nstream.\n\nThis only works with directories, it does not work with individual files.\n\nThe optional `properties` object are used to set properties in the tar\n'Global Extended Header'. If the `fromBase` property is set to true,\nthe tar will contain files relative to the path passed, and not with\nthe path included.\n\n### tar.Extract([options])\n\nReturns a through stream. Write tar data to the stream and the files\nin the tarball will be extracted onto the filesystem.\n\n`options` can be:\n\n```js\n{\n path: '/path/to/extract/tar/into',\n strip: 0, // how many path segments to strip from the root when extracting\n}\n```\n\n`options` also get passed to the `fstream.Writer` instance that `tar`\nuses internally.\n\n### tar.Parse()\n\nReturns a writable stream. Write tar data to it and it will emit\n`entry` events for each entry parsed from the tarball. This is used by\n`tar.Extract`.\n",
+ "readmeFilename": "README.md",
+ "gitHead": "b4c03a8e922fa522a3ddadaf2764bc1ab38d484e",
"bugs": {
"url": "https://github.com/isaacs/node-tar/issues"
},
- "homepage": "https://github.com/isaacs/node-tar",
- "_id": "tar@2.0.1",
- "_shasum": "a1537ab0d1ce61462ce87b4eed1cd263fba5fc17",
- "_from": "tar@>=2.0.1 <2.1.0",
- "_npmVersion": "2.7.6",
- "_nodeVersion": "1.4.2",
- "_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- "maintainers": [
- {
- "name": "isaacs",
- "email": "i@izs.me"
- },
- {
- "name": "othiym23",
- "email": "ogd@aoaioxxysz.net"
- }
- ],
- "dist": {
- "shasum": "a1537ab0d1ce61462ce87b4eed1cd263fba5fc17",
- "tarball": "http://registry.npmjs.org/tar/-/tar-2.0.1.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/tar/-/tar-2.0.1.tgz"
+ "homepage": "https://github.com/isaacs/node-tar#readme",
+ "_id": "tar@2.1.0",
+ "_shasum": "d287aad12e947c766e319ac364f3c234900f65ec",
+ "_from": "tar@>=2.1.0 <2.2.0"
}
--- /dev/null
+var fs = require('fs')
+var path = require('path')
+var zlib = require('zlib')
+
+var tap = require('tap')
+
+var tar = require('../tar.js')
+
+var file = path.join(__dirname, 'cb-never-called-1.0.1.tgz')
+var target = path.join(__dirname, 'tmp/extract-test')
+
+tap.test('preclean', function (t) {
+ require('rimraf').sync(__dirname + '/tmp/extract-test')
+ t.pass('cleaned!')
+ t.end()
+})
+
+tap.test('extract test', function (t) {
+ var extract = tar.Extract(target)
+ var inp = fs.createReadStream(file)
+
+ inp.pipe(zlib.createGunzip()).pipe(extract)
+
+ extract.on('error', function (er) {
+ t.equal(er.message, 'unexpected eof', 'error noticed')
+ t.end()
+ })
+
+ extract.on('end', function () {
+ t.fail('shouldn\'t reach this point due to errors')
+ t.end()
+ })
+})
runTest(t, false)
})
+tap.test("with from base", { timeout: 10000 }, function (t) {
+ runTest(t, true, true)
+})
+
function alphasort (a, b) {
return a === b ? 0
: a.toLowerCase() > b.toLowerCase() ? 1
}
-function runTest (t, doGH) {
+function runTest (t, doGH, doFromBase) {
var reader = Reader({ path: input
, filter: function () {
return !this.path.match(/\.(tar|hex)$/)
, sort: alphasort
})
- var pack = Pack(doGH ? pkg : null)
+ var props = doGH ? pkg : {}
+ if(doFromBase) props.fromBase = true;
+
+ var pack = Pack(props)
var writer = Writer(target)
// skip the global header if we're not doing that.
}
t.equal(ev, wanted[0], "event type should be "+wanted[0])
+ if(doFromBase) {
+ if(wanted[1].path.indexOf('fixtures/') && wanted[1].path.length == 100)
+ wanted[1].path = wanted[1].path.replace('fixtures/', '') + 'ccccccccc'
+
+ if(wanted[1]) wanted[1].path = wanted[1].path.replace('fixtures/', '').replace('//', '/')
+ if(wanted[1].path == '') wanted[1].path = '/'
+ if(wanted[2] && wanted[2].path) wanted[2].path = wanted[2].path.replace('fixtures', '').replace(/^\//, '')
+
+ wanted[1].linkpath = wanted[1].linkpath.replace('fixtures/', '')
+ }
+
if (ev !== wanted[0] || e.path !== wanted[1].path) {
console.error("wanted", wanted)
console.error([ev, e.props])
{
- "version": "2.8.3",
+ "version": "2.9.0",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
"columnify": "~1.5.1",
"config-chain": "~1.1.8",
"dezalgo": "~1.0.1",
- "editor": "~0.1.0",
+ "editor": "~1.0.0",
"fs-vacuum": "~1.2.5",
"fs-write-stream-atomic": "~1.0.2",
"fstream": "~1.0.4",
"inflight": "~1.0.4",
"inherits": "~2.0.1",
"ini": "~1.3.3",
- "init-package-json": "~1.4.0",
+ "init-package-json": "~1.4.2",
"lockfile": "~1.0.0",
- "lru-cache": "~2.5.2",
+ "lru-cache": "~2.6.1",
"minimatch": "~2.0.4",
"mkdirp": "~0.5.0",
"node-gyp": "~1.0.3",
"npm-cache-filename": "~1.0.1",
"npm-install-checks": "~1.0.5",
"npm-package-arg": "~4.0.0",
- "npm-registry-client": "~6.3.2",
+ "npm-registry-client": "~6.3.3",
"npm-user-validate": "~0.1.1",
"npmlog": "~1.2.0",
"once": "~1.3.1",
"slide": "~1.1.6",
"sorted-object": "~1.0.0",
"strip-ansi": "~2.0.1",
- "tar": "~2.0.1",
+ "tar": "~2.1.0",
"text-table": "~0.2.0",
"uid-number": "0.0.6",
"umask": "~1.1.0",
--- /dev/null
+var fs = require('fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+var server
+
+var pkg = path.join(__dirname, 'install-noargs-dev')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var PACKAGE_JSON1 = {
+ name: 'install-noargs-dev',
+ version: '0.0.1',
+ devDependencies: {
+ 'underscore': '1.3.1'
+ }
+}
+
+var PACKAGE_JSON2 = {
+ name: 'install-noargs-dev',
+ version: '0.0.2',
+ devDependencies: {
+ 'underscore': '1.5.1'
+ }
+}
+
+test('setup', function (t) {
+ setup()
+ mr({ port: common.port }, function (er, s) {
+ t.ifError(er, 'started mock registry')
+ server = s
+ t.end()
+ })
+})
+
+test('install noargs installs devDependencies', function (t) {
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ 'install'
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifError(err, 'npm install ran without issue')
+ t.notOk(code, 'npm install exited with code 0')
+
+ var p = path.join(pkg, 'node_modules', 'underscore', 'package.json')
+ var pkgJson = JSON.parse(fs.readFileSync(p))
+
+ t.equal(pkgJson.version, '1.3.1')
+ t.end()
+ }
+ )
+})
+
+test('install noargs installs updated devDependencies', function (t) {
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(PACKAGE_JSON2, null, 2)
+ )
+
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ 'install'
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifError(err, 'npm install ran without issue')
+ t.notOk(code, 'npm install exited with code 0')
+
+ var p = path.join(pkg, 'node_modules', 'underscore', 'package.json')
+ var pkgJson = JSON.parse(fs.readFileSync(p))
+
+ t.equal(pkgJson.version, '1.5.1')
+ t.end()
+ }
+ )
+})
+
+test('cleanup', function (t) {
+ server.close()
+ cleanup()
+ t.end()
+})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
+
+function setup () {
+ cleanup()
+ mkdirp.sync(path.resolve(pkg, 'node_modules'))
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(PACKAGE_JSON1, null, 2)
+ )
+
+ process.chdir(pkg)
+}
--- /dev/null
+var common = require('../common-tap.js')
+var test = require('tap').test
+var npm = require('../../')
+var rimraf = require('rimraf')
+var path = require('path')
+var mr = require('npm-registry-mock')
+var osenv = require('osenv')
+var mkdirp = require('mkdirp')
+var fs = require('graceful-fs')
+
+var pkg = path.resolve(__dirname, 'outdated-local')
+var pkgLocal = path.resolve(pkg, 'local-module')
+var pkgScopedLocal = path.resolve(pkg, 'another-local-module')
+var pkgLocalUnderscore = path.resolve(pkg, 'underscore')
+var pkgLocalOptimist = path.resolve(pkg, 'optimist')
+
+function mocks (server) {
+ server.get('/local-module')
+ .reply(404)
+ server.get('/@scoped%2fanother-local-module')
+ .reply(404)
+}
+
+test('setup', function (t) {
+ bootstrap()
+ t.end()
+})
+
+test('outdated support local modules', function (t) {
+ t.plan(4)
+ process.chdir(pkg)
+ mr({ port: common.port, plugin: mocks }, function (err, s) {
+ t.ifError(err, 'mock registry started without problems')
+
+ function verify (actual, expected) {
+ for (var i = 0; i < expected.length; i++) {
+ var current = expected[i]
+
+ var found = false
+ for (var j = 0; j < actual.length; j++) {
+ var target = actual[j]
+
+ var k
+ for (k = 0; k < current.length; k++) {
+ if (current[k] !== target[k]) break
+ }
+ if (k === current.length) found = true
+ }
+
+ if (!found) return false
+ }
+
+ return true
+ }
+
+ npm.load(
+ {
+ loglevel: 'silent',
+ parseable: true,
+ registry: common.registry
+ },
+ function () {
+ npm.install('.', function (err) {
+ t.ifError(err, 'install success')
+ bumpLocalModules()
+ npm.outdated(function (er, d) {
+ t.ifError(er, 'outdated success')
+ t.ok(verify(d, [
+ [
+ path.resolve(__dirname, 'outdated-local'),
+ 'local-module',
+ '1.0.0',
+ '1.1.0',
+ '1.1.0',
+ 'file:local-module'
+ ],
+ [
+ path.resolve(__dirname, 'outdated-local'),
+ '@scoped/another-local-module',
+ '1.0.0',
+ '1.2.0',
+ '1.2.0',
+ 'file:another-local-module'
+ ],
+ [
+ path.resolve(__dirname, 'outdated-local'),
+ 'underscore',
+ '1.3.1',
+ '1.6.1',
+ '1.5.1',
+ 'file:underscore'
+ ],
+ [
+ path.resolve(__dirname, 'outdated-local'),
+ 'optimist',
+ '0.4.0',
+ '0.6.0',
+ '0.6.0',
+ 'optimist@0.6.0'
+ ]
+ ]), 'got expected outdated output')
+ s.close()
+ })
+ })
+ }
+ )
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+var pjParent = JSON.stringify({
+ name: 'outdated-local',
+ version: '1.0.0',
+ dependencies: {
+ 'local-module': 'file:local-module', // updated locally, not on repo
+ '@scoped/another-local-module': 'file:another-local-module', // updated locally, scoped, not on repo
+ 'underscore': 'file:underscore', // updated locally, updated but lesser version on repo
+ 'optimist': 'file:optimist' // updated locally, updated and greater version on repo
+ }
+}, null, 2) + '\n'
+
+var pjLocal = JSON.stringify({
+ name: 'local-module',
+ version: '1.0.0'
+}, null, 2) + '\n'
+
+var pjLocalBumped = JSON.stringify({
+ name: 'local-module',
+ version: '1.1.0'
+}, null, 2) + '\n'
+
+var pjScopedLocal = JSON.stringify({
+ name: '@scoped/another-local-module',
+ version: '1.0.0'
+}, null, 2) + '\n'
+
+var pjScopedLocalBumped = JSON.stringify({
+ name: '@scoped/another-local-module',
+ version: '1.2.0'
+}, null, 2) + '\n'
+
+var pjLocalUnderscore = JSON.stringify({
+ name: 'underscore',
+ version: '1.3.1'
+}, null, 2) + '\n'
+
+var pjLocalUnderscoreBumped = JSON.stringify({
+ name: 'underscore',
+ version: '1.6.1'
+}, null, 2) + '\n'
+
+var pjLocalOptimist = JSON.stringify({
+ name: 'optimist',
+ version: '0.4.0'
+}, null, 2) + '\n'
+
+var pjLocalOptimistBumped = JSON.stringify({
+ name: 'optimist',
+ version: '0.5.0'
+}, null, 2) + '\n'
+
+function bootstrap () {
+ mkdirp.sync(pkg)
+ fs.writeFileSync(path.resolve(pkg, 'package.json'), pjParent)
+
+ mkdirp.sync(pkgLocal)
+ fs.writeFileSync(path.resolve(pkgLocal, 'package.json'), pjLocal)
+
+ mkdirp.sync(pkgScopedLocal)
+ fs.writeFileSync(path.resolve(pkgScopedLocal, 'package.json'), pjScopedLocal)
+
+ mkdirp.sync(pkgLocalUnderscore)
+ fs.writeFileSync(path.resolve(pkgLocalUnderscore, 'package.json'), pjLocalUnderscore)
+
+ mkdirp.sync(pkgLocalOptimist)
+ fs.writeFileSync(path.resolve(pkgLocalOptimist, 'package.json'), pjLocalOptimist)
+}
+
+function bumpLocalModules () {
+ fs.writeFileSync(path.resolve(pkgLocal, 'package.json'), pjLocalBumped)
+ fs.writeFileSync(path.resolve(pkgScopedLocal, 'package.json'), pjScopedLocalBumped)
+ fs.writeFileSync(path.resolve(pkgLocalUnderscore, 'package.json'), pjLocalUnderscoreBumped)
+ fs.writeFileSync(path.resolve(pkgLocalOptimist, 'package.json'), pjLocalOptimistBumped)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
function () {
npm.install(".", function (err) {
t.ifError(err, "install success")
+ bumpLocalPrivate()
npm.outdated(function (er, d) {
t.ifError(er, "outdated success")
t.deepEqual(d, [[
path.resolve(__dirname, "outdated-private"),
"underscore",
"1.3.1",
- "1.3.1",
"1.5.1",
- "file:underscore"
+ "1.5.1",
+ "underscore@1.5.1"
]])
s.close()
})
private : true
}, null, 2) + "\n"
+var pjLocalPrivateBumped = JSON.stringify({
+ name : "local-private",
+ version : "1.1.0",
+ private : true
+}, null, 2) + "\n"
+
var pjScopedLocalPrivate = JSON.stringify({
name : "@scoped/another-local-private",
version : "1.0.0",
fs.writeFileSync(path.resolve(pkgLocalUnderscore, "package.json"), pjLocalUnderscore)
}
+function bumpLocalPrivate () {
+ fs.writeFileSync(path.resolve(pkgLocalPrivate, "package.json"), pjLocalPrivateBumped)
+}
+
function cleanup () {
process.chdir(osenv.tmpdir())
rimraf.sync(pkg)
--- /dev/null
+var common = require('../common-tap.js')
+var fs = require('fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var npm = require('../../lib/npm.js')
+
+var pkg = path.resolve(__dirname, 'version-message-config')
+var cache = path.resolve(pkg, 'cache')
+var npmrc = path.resolve(pkg, '.npmrc')
+var packagePath = path.resolve(pkg, 'package.json')
+
+var json = { name: 'blah', version: '0.1.2' }
+
+var configContents = 'sign-git-tag=false\nmessage=":bookmark: %s"\n'
+
+test('npm version <semver> with message config', function (t) {
+ setup()
+
+ npm.load({ prefix: pkg, userconfig: npmrc }, function () {
+ var git = require('../../lib/utils/git.js')
+
+ common.makeGitRepo({ path: pkg }, function (er) {
+ t.ifErr(er, 'git bootstrap ran without error')
+
+ common.npm([
+ 'config',
+ 'set',
+ 'tag-version-prefix',
+ 'q'
+ ], { cwd: pkg, env: { PATH: process.env.PATH } },
+ function (err, code, stdout, stderr) {
+ t.ifError(err, 'npm config ran without issue')
+ t.notOk(code, 'exited with a non-error code')
+ t.notOk(stderr, 'no error output')
+
+ common.npm(
+ [
+ 'version',
+ 'patch',
+ '--loglevel', 'silent'
+ // package config is picked up from env
+ ],
+ { cwd: pkg, env: { PATH: process.env.PATH } },
+ function (err, code, stdout, stderr) {
+ t.ifError(err, 'npm version ran without issue')
+ t.notOk(code, 'exited with a non-error code')
+ t.notOk(stderr, 'no error output')
+
+ git.whichAndExec(
+ ['tag'],
+ { cwd: pkg, env: process.env },
+ function (er, tags, stderr) {
+ t.ok(tags.match(/q0\.1\.3/g), 'tag was created by version' + tags)
+ t.end()
+ }
+ )
+ }
+ )
+ })
+ })
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function cleanup () {
+ // windows fix for locked files
+ process.chdir(osenv.tmpdir())
+
+ rimraf.sync(pkg)
+}
+
+function setup () {
+ cleanup()
+ mkdirp.sync(cache)
+ process.chdir(pkg)
+
+ fs.writeFileSync(packagePath, JSON.stringify(json), 'utf8')
+ fs.writeFileSync(npmrc, configContents, 'ascii')
+}
--- /dev/null
+var fs = require('graceful-fs')
+var http = require('http')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var pkg = path.join(__dirname, 'npm-test-unpublish-config')
+var fixturePath = path.join(pkg, 'fixture_npmrc')
+
+var common = require('../common-tap.js')
+
+var json = {
+ name: 'npm-test-unpublish-config',
+ version: '1.2.3',
+ publishConfig: { registry: common.registry }
+}
+
+test('setup', function (t) {
+ mkdirp.sync(pkg)
+
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json), 'utf8'
+ )
+ fs.writeFileSync(
+ fixturePath,
+ '//localhost:1337/:_authToken = beeeeeeeeeeeeef\n' +
+ 'registry = http://lvh.me:4321/registry/path\n'
+ )
+
+ t.end()
+})
+
+test('cursory test of unpublishing with config', function (t) {
+ var child
+ http.createServer(function (req, res) {
+ t.pass('got request on the fakey fake registry')
+ this.close()
+ res.statusCode = 500
+ res.end(JSON.stringify({
+ error: 'shh no tears, only dreams now'
+ }))
+ child.kill()
+ t.end()
+ }).listen(common.port, function () {
+ t.pass('server is listening')
+
+ child = common.npm(
+ [
+ '--userconfig', fixturePath,
+ '--loglevel', 'silent',
+ '--force',
+ 'unpublish'
+ ],
+ {
+ cwd: pkg,
+ stdio: 'inherit',
+ env: {
+ 'npm_config_cache_lock_stale': 1000,
+ 'npm_config_cache_lock_wait': 1000,
+ HOME: process.env.HOME,
+ Path: process.env.PATH,
+ PATH: process.env.PATH,
+ USERPROFILE: osenv.home()
+ }
+ },
+ function (err, code) {
+ t.ifError(err, 'publish command finished successfully')
+ t.notOk(code, 'npm install exited with code 0')
+ }
+ )
+ })
+})
+
+test('cleanup', function (t) {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+ t.end()
+})