Ra'Shaun Stovall <rashaunstovall@gmail.com>
Julien Meddah <julien.meddah@deveryware.com>
Michiel Sikma <michiel@wedemandhtml.com>
+Jakob Krigovsky <jakob.krigovsky@gmail.com>
+Charmander <~@charmander.me>
+erik wienhold <git@ewie.name>
+### v2.8.3 (2015-04-15):
+
+#### TWO SMALL GIT TWEAKS
+
+This is the last of a set of releases intended to ensure npm's git support is
+robust enough that we can stop working on it for a while. These fixes are
+small, but prevent a common crasher and clear up one of the more confusing
+error messages coming out of npm when working with repositories hosted on git.
+
+* [`387f889`](https://github.com/npm/npm/commit/387f889c0e8fb617d9cc9a42ed0a3ec49424ab5d)
+ [#7961](https://github.com/npm/npm/issues/7961) Ensure that hosted git SSH
+ URLs always have a valid protocol when stored in `resolved` fields in
+ `npm-shrinkwrap.json`. ([@othiym23](https://github.com/othiym23))
+* [`394c2f5`](https://github.com/npm/npm/commit/394c2f5a1227232c0baf42fbba1402aafe0d6ffb)
+ Switch the order in which hosted Git providers are checked to `git:`,
+ `git+https:`, then `git+ssh:` (from `git:`, `git+ssh:`, then `git+https:`) in
+ an effort to go from most to least likely to succeed, to make for less
+ confusing error message. ([@othiym23](https://github.com/othiym23))
+
+### v2.8.2 (2015-04-14):
+
+#### PEACE IN OUR TIME
+
+npm has been having an issue with CouchDB's web server since the release
+of io.js and Node.js 0.12.0 that has consumed a huge amount of my time
+to little visible effect. Sam Mikes picked up the thread from me, and
+after a [_lot_ of effort](https://github.com/npm/npm/issues/7699#issuecomment-93091111)
+figured out that ultimately there are probably a couple problems with
+the new HTTP Agent keep-alive handling in new versions of Node. In
+addition, `npm-registry-client` was gratuitously sending a body along
+with a GET request which was triggering the bugs. Sam removed about 10 bytes from
+one file in `npm-registry-client`, and this problem, which has been bugging us for months,
+completely went away.
+
+In conclusion, Sam Mikes is great, and anybody using a private registry
+hosted on CouchDB should thank him for his hard work. Also, thanks to
+the community at large for pitching in on this bug, which has been
+around for months now.
+
+* [`431c3bf`](https://github.com/npm/npm/commit/431c3bf6cdec50f9f0c735f478cb2f3f337d3313)
+ [#7699](https://github.com/npm/npm/issues/7699) `npm-registry-client@6.3.2`:
+ Don't send body with HTTP GET requests when logging in.
+ ([@smikes](https://github.com/smikes))
+
+### v2.8.1 (2015-04-12):
+
+#### CORRECTION: NPM'S GIT INTEGRATION IS DOING OKAY
+
+A [helpful bug report](https://github.com/npm/npm/issues/7872#issuecomment-91809553)
+led to another round of changes to
+[`hosted-git-info`](https://github.com/npm/hosted-git-info/commit/827163c74531b69985d1ede7abced4861e7b0cd4),
+some additional test-writing, and a bunch of hands-on testing against actual
+private repositories. While the complexity of npm's git dependency handling is
+nearly fractal (because npm is very complex, and git is even more complex),
+it's feeling way more solid than it has for a while. We think this is a
+substantial improvement over what we had before, so give `npm@2.8.1` a shot if
+you have particularly complex git use cases and
+[let us know](https://github.com/npm/npm/issues/new) how it goes.
+
+(NOTE: These changes mostly affect cloning and saving references to packages
+hosted in git repositories, and don't address some known issues with things
+like lifecycle scripts not being run on npm dependencies. Work continues on
+other issues that affect parity between git and npm registry packages.)
+
+* [`66377c6`](https://github.com/npm/npm/commit/66377c6ece2cf4d53d9a618b7d9824e1452bc293)
+ [#7872](https://github.com/npm/npm/issues/7872) `hosted-git-info@2.1.2`: Pass
+ through credentials embedded in SSH and HTTPs git URLs.
+ ([@othiym23](https://github.com/othiym23))
+* [`15efe12`](https://github.com/npm/npm/commit/15efe124753257728a0ddc64074fa5a4b9c2eb30)
+ [#7872](https://github.com/npm/npm/issues/7872) Use the new version of
+ `hosted-git-info` to pass along credentials embedded in git URLs. Test it.
+ Test it a lot. ([@othiym23](https://github.com/othiym23))
+
+#### SCOPED DEPENDENCIES AND PEER DEPENDENCIES: NOT QUITE REESE'S
+
+Big thanks to [@ewie](https://github.com/ewie) for identifying an issue with
+how npm was handling `peerDependencies` that were implicitly installed from the
+`package.json` files of scoped dependencies. This
+[will be a moot point](https://github.com/npm/npm/issues/6565#issuecomment-74971689)
+with the release of `npm@3`, but until then, it's important that
+`peerDependency` auto-installation work as expected.
+
+* [`b027319`](https://github.com/npm/npm/commit/b0273190c71eba14395ddfdd1d9f7ba625297523)
+ [#7920](https://github.com/npm/npm/issues/7920) Scoped packages with
+ `peerDependencies` were installing the `peerDependencies` into the wrong
+ directory. ([@ewie](https://github.com/ewie))
+* [`649e31a`](https://github.com/npm/npm/commit/649e31ae4fd02568bae5dc6b4ea783431ce3d63e)
+ [#7920](https://github.com/npm/npm/issues/7920) Test `peerDependency`
+ installs involving scoped packages using `npm-package-arg` instead of simple
+ path tests, for consistency. ([@othiym23](https://github.com/othiym23))
+
+#### MAKING IT EASIER TO WRITE NPM TESTS, VERSION 0.0.1
+
+[@iarna](https://github.com/iarna) and I
+([@othiym23](https://github.com/othiym23)) have been discussing a
+[candidate plan](https://github.com/npm/npm/wiki/rewriting-npm's-tests:-a-plan-maybe)
+for improving npm's test suite, with the goal of making it easier for new
+contributors to get involved with npm by reducing the learning curve
+necessary to be able to write good tests for proposed changes. This is the
+first substantial piece of that effort. Here's what the commit message for
+[`ed7e249`](https://github.com/npm/npm/commit/ed7e249d50444312cd266942ce3b89e1ca049bdf)
+had to say about this work:
+
+> It's too difficult for npm contributors to figure out what the conventional
+> style is for tests. Part of the problem is that the documentation in
+> CONTRIBUTING.md is inadequate, but another important factor is that the tests
+> themselves are written in a variety of styles. One of the most notable
+> examples of this is the fact that many tests use fixture directories to store
+> precooked test scenarios and package.json files.
+>
+> This had some negative consequences:
+>
+> * tests weren't idempotent
+> * subtle dependencies between tests existed
+> * new tests get written in this deprecated style because it's not
+> obvious that the style is out of favor
+> * it's hard to figure out why a lot of those directories existed,
+> because they served a variety of purposes, so it was difficult to
+> tell when it was safe to remove them
+>
+> All in all, the fixture directories were a major source of technical debt, and
+> cleaning them up, while time-consuming, makes the whole test suite much more
+> approachable, and makes it more likely that new tests written by outside
+> contributors will follow a conventional style. To support that, all of the
+> tests touched by this changed were cleaned up to pass the `standard` style
+> checker.
+
+And here's a little extra context from a comment I left on [#7929](https://github.com/npm/npm/issues/7929):
+
+> One of the other things that encouraged me was looking at this
+> [presentation on technical debt](http://www.slideshare.net/nnja/pycon-2015-technical-debt-the-monster-in-your-closet)
+> from Pycon 2015, especially slide 53, which I interpreted in terms of
+> difficulty getting new contributors to submit patches to an OSS project like
+> npm. npm has a long ways to go, but I feel good about this change.
+
+* [`ed7e249`](https://github.com/npm/npm/commit/ed7e249d50444312cd266942ce3b89e1ca049bdf)
+ [#7929](https://github.com/npm/npm/issues/7929) Eliminate fixture directories
+ from `test/tap`, leaving each test self-contained.
+ ([@othiym23](https://github.com/othiym23))
+* [`4928d30`](https://github.com/npm/npm/commit/4928d30140821c63e03fffed73f8d88ebdc43710)
+ [#7929](https://github.com/npm/npm/issues/7929) Move fixture files from
+ `test/tap/*` to `test/fixtures`. ([@othiym23](https://github.com/othiym23))
+* [`e925deb`](https://github.com/npm/npm/commit/e925debca91092a814c1a00933babc3a8cf975be)
+ [#7929](https://github.com/npm/npm/issues/7929) Tweak the run scripts to stop
+ slaughtering the CPU on doc rebuild.
+ ([@othiym23](https://github.com/othiym23))
+* [`65bf7cf`](https://github.com/npm/npm/commit/65bf7cffaf91c426b676c47529eee796f8b8b75c)
+ [#7923](https://github.com/npm/npm/issues/7923) Use an alias of scripts and
+ run-scripts in `npm run test-all` ([@watilde](https://github.com/watilde))
+* [`756a3fb`](https://github.com/npm/npm/commit/756a3fbb852a2469afe706635ed88d22c37743e5)
+ [#7923](https://github.com/npm/npm/issues/7923) Sync timeout time of `npm
+ run-script test-all` to be the same as `test` and `tap` scripts.
+ ([@watilde](https://github.com/watilde))
+* [`8299b5f`](https://github.com/npm/npm/commit/8299b5fb6373354a7fbaab6f333863758812ae90)
+ Set a timeout for tap tests for `npm run-script test-all`.
+ ([@othiym23](https://github.com/othiym23))
+
+#### THE EVER-BEATING DRUM OF DEPENDENCY UPDATES
+
+* [`d90d0b9`](https://github.com/npm/npm/commit/d90d0b992acbf62fd5d68debf9d1dbd6cfa20804)
+ [#7924](https://github.com/npm/npm/issues/7924) Remove `child-process-close`,
+ as it was included for Node 0.6 compatibility, and npm no longer supports
+ 0.6. ([@robertkowalski](https://github.com/robertkowalski))
+* [`16427c1`](https://github.com/npm/npm/commit/16427c1f3ea3d71ee753c62eb4c2663c7b32b84f)
+ `lru-cache@2.5.2`: More accurate updating of expiry times when `maxAge` is
+ set. ([@isaacs](https://github.com/isaacs))
+* [`03cce83`](https://github.com/npm/npm/commit/03cce83b64344a9e0fe036dce214f4d68cfcc9e7)
+ `nock@1.6.0`: Mocked network error handling.
+ ([@pgte](https://github.com/pgte))
+* [`f93b1f0`](https://github.com/npm/npm/commit/f93b1f0b7eb5d1b8a7967e837bbd756db1091d00)
+ `glob@5.0.5`: Use `path-is-absolute` polyfill, allowing newer Node.js and
+ io.js versions to use `path.isAbsolute()`.
+ ([@sindresorhus](https://github.com/sindresorhus))
+* [`a70d694`](https://github.com/npm/npm/commit/a70d69495a6e96997e64855d9e749d943ee6d64f)
+ `request@2.55.0`: Bug fixes and simplification.
+ ([@simov](https://github.com/simov))
+* [`2aecc6f`](https://github.com/npm/npm/commit/2aecc6f4083526feeb14615b4e5484edc66175b5)
+ `columnify@1.5.1`: Switch to using babel from 6to5.
+ ([@timoxley](https://github.com/timoxley))
+
+### v2.8.0 (2015-04-09):
+
+#### WE WILL NEVER BE DONE FIXING NPM'S GIT SUPPORT
+
+If you look at [the last release's release
+notes](https://github.com/npm/npm/blob/master/CHANGELOG.md#git-mean-git-tuff-git-all-the-way-away-from-my-stuff),
+you will note that they confidently assert that it's perfectly OK to force all
+GitHub URLs through the same `git:` -> `git+ssh:` fallback flow for cloning. It
+turns out that many users depend on `git+https:` URLs in their build
+environments because they use GitHub auth tokens instead of SSH keys. Also, in
+some cases you just want to be able to explicitly say how a given dependency
+should be cloned from GitHub.
+
+Because of the way we resolved the inconsistency in GitHub shorthand handling
+[before](https://github.com/npm/npm/blob/master/CHANGELOG.md#bug-fixes-1), this
+turned out to be difficult to work around. So instead of hacking around it, we
+completely redid how git is handled within npm and its attendant packages.
+Again. This time, we changed things so that `normalize-package-data` and
+`read-package-json` leave more of the git logic to npm itself, which makes
+handling shorthand syntax consistently much easier, and also allows users to
+resume using explicit, fully-qualified git URLs without npm messing with them.
+
+Here's a summary of what's changed:
+
+* Instead of converting the GitHub shorthand syntax to a `git+ssh:`, `git:`, or
+ `git+https:` URL and saving that, save the shorthand itself to
+ `package.json`.
+* If presented with shortcuts, try cloning via the git protocol, SSH, and HTTPS
+ (in that order).
+* No longer prompt for credentials -- it didn't work right with the spinner,
+ and wasn't guaranteed to work anyway. We may experiment with doing this a
+ better way in the future. Users can override this by setting `GIT_ASKPASS` in
+ their environment if they want to experiment with interactive cloning, but
+ should also set `--no-spin` on the npm command line (or run `npm config set
+ spin=false`).
+* **EXPERIMENTAL FEATURE**: Add support for `github:`, `gist:`, `bitbucket:`,
+ and `gitlab:` shorthand prefixes. GitHub shortcuts will continue to be
+ normalized to `org/repo` instead of being saved as `github:org/repo`, but
+ `gitlab:`, `gist:`, and `bitbucket:` prefixes will be used on the command
+ line and from `package.json`. BE CAREFUL WITH THIS. `package.json` files
+ published with the new shorthand syntax can _only_ be read by `npm@2.8.0` and
+ later, and this feature is mostly meant for playing around with it. If you
+ want to save git dependencies in a form that older versions of npm can read,
+ use `--save-exact`, which will save the git URL and resolved commit hash of
+ the head of the branch in a manner similar to the way that `--save-exact`
+ pins versions for registry dependencies. This is documented (so check `npm
+ help install` for details), but we're not going to make a lot of noise about
+ it until it has a chance to bake in a little more.
+
+It is [@othiym23](https://github.com/othiym23)'s sincere hope that this will
+resolve all of the inconsistencies users were seeing with GitHub and git-hosted
+packages, but given the level of change here, that may just be a fond wish.
+Extra testing of this change is requested.
+
+* [`6b0f588`](https://github.com/npm/npm/commit/6b0f58877f37df9904490ffbaaad33862bd36dce)
+ [#7867](https://github.com/npm/npm/issues/7867) Use git shorthand and git
+ URLs as presented by user. Support new `hosted-git-info` shortcut syntax.
+ Save shorthand in `package.json`. Try cloning via `git:`, `git+ssh:`, and
+ `git+https:`, in that order, when supported by the underlying hosting
+ provider. ([@othiym23](https://github.com/othiym23))
+* [`75d4267`](https://github.com/npm/npm/commit/75d426787869d54ca7400408f562f971b34649ef)
+ [#7867](https://github.com/npm/npm/issues/7867) Document new GitHub, GitHub
+ gist, Bitbucket, and GitLab shorthand syntax.
+ ([@othiym23](https://github.com/othiym23))
+* [`7d92c75`](https://github.com/npm/npm/commit/7d92c7592998d90ec883fa989ca74f04ec1b93de)
+ [#7867](https://github.com/npm/npm/issues/7867) When `--save-exact` is used
+ with git shorthand or URLs, save the fully-resolved URL, with branch name
+ resolved to the exact hash for the commit checked out.
+ ([@othiym23](https://github.com/othiym23))
+* [`9220e59`](https://github.com/npm/npm/commit/9220e59f8def8c82c6d331a39ba29ad4c44e3a9b)
+ [#7867](https://github.com/npm/npm/issues/7867) Ensure that non-prefixed and
+ non-normalized GitHub shortcuts are saved to `package.json`.
+ ([@othiym23](https://github.com/othiym23))
+* [`dd398e9`](https://github.com/npm/npm/commit/dd398e98a8eba27eeba84378200da3d078fdf980)
+ [#7867](https://github.com/npm/npm/issues/7867) `hosted-git-info@2.1.1`:
+ Ensure that `gist:` shorthand survives being round-tripped through
+ `package.json`. ([@othiym23](https://github.com/othiym23))
+* [`33d1420`](https://github.com/npm/npm/commit/33d1420bf2f629332fceb2ac7e174e63ac48f96a)
+ [#7867](https://github.com/npm/npm/issues/7867) `hosted-git-info@2.1.0`: Add
+ support for auth embedded directly in git URLs.
+ ([@othiym23](https://github.com/othiym23))
+* [`23a1d5a`](https://github.com/npm/npm/commit/23a1d5a540e8db27f5cd0245de7c3694e2bddad1)
+ [#7867](https://github.com/npm/npm/issues/7867) `hosted-git-info@2.0.2`: Make
+ it possible to determine in which form a hosted git URL was passed.
+ ([@iarna](https://github.com/iarna))
+* [`eaf75ac`](https://github.com/npm/npm/commit/eaf75acb718611ad5cfb360084ec86938d9c66c5)
+ [#7867](https://github.com/npm/npm/issues/7867)
+ `normalize-package-data@2.0.0`: Normalize GitHub specifiers so they pass
+ through shortcut syntax and preserve explicit URLs.
+ ([@iarna](https://github.com/iarna))
+* [`95e0535`](https://github.com/npm/npm/commit/95e0535e365e0aca49c634dd2061a0369b0475f1)
+ [#7867](https://github.com/npm/npm/issues/7867) `npm-package-arg@4.0.0`: Add
+ git URL and shortcut to hosted git spec and use `hosted-git-info@2.0.2`.
+ ([@iarna](https://github.com/iarna))
+* [`a808926`](https://github.com/npm/npm/commit/a8089268d5f3d57f42dbaba02ff6437da5121191)
+ [#7867](https://github.com/npm/npm/issues/7867)
+ `realize-package-specifier@3.0.0`: Use `npm-package-arg@4.0.0` and test
+ shortcut specifier behavior. ([@iarna](https://github.com/iarna))
+* [`6dd1e03`](https://github.com/npm/npm/commit/6dd1e039bddf8cf5383343f91d84bc5d78acd083)
+ [#7867](https://github.com/npm/npm/issues/7867) `init-package-json@1.4.0`:
+ Allow dependency on `read-package-json@2.0.0`.
+ ([@iarna](https://github.com/iarna))
+* [`63254bb`](https://github.com/npm/npm/commit/63254bb6358f66752aca6aa1a275271b3ae03f7c)
+ [#7867](https://github.com/npm/npm/issues/7867) `read-installed@4.0.0`: Use
+ `read-package-json@2.0.0`. ([@iarna](https://github.com/iarna))
+* [`254b887`](https://github.com/npm/npm/commit/254b8871f5a173bb464cc5b0ace460c7878b8097)
+ [#7867](https://github.com/npm/npm/issues/7867) `read-package-json@2.0.0`:
+ Use `normalize-package-data@2.0.0`. ([@iarna](https://github.com/iarna))
+* [`0b9f8be`](https://github.com/npm/npm/commit/0b9f8be62fe5252abe54d49e36a696f4816c2eca)
+ [#7867](https://github.com/npm/npm/issues/7867) `npm-registry-client@6.3.0`:
+ Mark compatibility with `normalize-package-data@2.0.0` and
+ `npm-package-arg@4.0.0`. ([@iarna](https://github.com/iarna))
+* [`f40ecaa`](https://github.com/npm/npm/commit/f40ecaad68f77abc50eb6f5b224e31dec3d250fc)
+ [#7867](https://github.com/npm/npm/issues/7867) Extract a common method to
+ use when cloning git repos for testing.
+ ([@othiym23](https://github.com/othiym23))
+
+#### TEST FIXES FOR NODE 0.8
+
+npm continues to [get closer](https://github.com/npm/npm/issues/7842) to being
+completely green on Travis for Node 0.8.
+
+* [`26d36e9`](https://github.com/npm/npm/commit/26d36e9cf0eca69fe1863d2ea536c28555b9e8de)
+ [#7842](https://github.com/npm/npm/issues/7842) When spawning child
+ processes, map exit code 127 to ENOENT so Node 0.8 handles child process
+ failures the same as later versions.
+ ([@SonicHedgehog](https://github.com/SonicHedgehog))
+* [`54cd895`](https://github.com/npm/npm/commit/54cd8956ea783f96749e46597d8c2cb9397c5d5f)
+ [#7842](https://github.com/npm/npm/issues/7842) Node 0.8 requires -e with -p
+ when evaluating snippets; fix test.
+ ([@SonicHedgehog](https://github.com/SonicHedgehog))
+
+#### SMALL FIX AND DOC TWEAK
+
+* [`20e9003`](https://github.com/npm/npm/commit/20e90031b847e9f7c7168f3dad8b1e526f9a2586)
+ `tar@2.0.1`: Fix regression where relative symbolic links within an
+ extraction root that pointed within an extraction root would get normalized
+ to absolute symbolic links. ([@isaacs](https://github.com/isaacs))
+* [`2ef8898`](https://github.com/npm/npm/commit/2ef88989c41bee1578570bb2172c90ede129dbd1)
+ [#7879](https://github.com/npm/npm/issues/7879) Better document that `npm
+ publish --tag=foo` will not set `latest` to that version.
+ ([@linclark](https://github.com/linclark))
+
### v2.7.6 (2015-04-02):
#### GIT MEAN, GIT TUFF, GIT ALL THE WAY AWAY FROM MY STUFF
This also applies to `npm dedupe`.
-Publishing a package always sets the "latest" tag to the published version.
+Publishing a package sets the "latest" tag to the published version unless the
+`--tag` option is used. For example, `npm publish --tag=beta`.
## PURPOSE
npm install mygithubuser/myproject
- To reference a package in a git repo that is not on GitHub, see git
- remote urls below.
+ To reference a package in a generic git repo (not on GitHub), see git remote
+ urls below.
+
+* `npm install github:<githubname>/<githubrepo>`:
+
+ The same as the above, but explicitly marked as a GitHub dependency.
+
+ Example:
+
+ npm install github:npm/npm
+
+* `npm install gist:[<githubname>/]<gistID>`:
+
+ Install the package at `https://gist.github.com/gistID` by attempting to
+ clone it using `git`. The GitHub username associated with the gist is
+ optional and will not be saved in `package.json` if `--save` is used.
+
+ Example:
+
+ npm install gist:101a11beef
+
+* `npm install bitbucket:<bitbucketname>/<bitbucketrepo>`:
+
+ Install the package at `https://bitbucket.org/bitbucketname/bitbucketrepo`
+ by attempting to clone it using `git`.
+
+ Example:
+
+ npm install bitbucket:mybitbucketuser/myproject
+
+* `npm install gitlab:<gitlabname>/<gitlabrepo>`:
+
+ Install the package at `https://gitlab.com/gitlabname/gitlabrepo`
+ by attempting to clone it using `git`.
+
+ Example:
+
+ npm install gitlab:mygitlabuser/myproject
* `npm install <git remote url>`:
Install a package by cloning a git remote url. The format of the git
url is:
- <protocol>://[<user>@]<hostname><separator><path>[#<commit-ish>]
+ <protocol>://[<user>[:<password>]@]<hostname><separator><path>[#<commit-ish>]
`<protocol>` is one of `git`, `git+ssh`, `git+http`, or
`git+https`. If no `<commit-ish>` is specified, then `master` is
directly to a VCS program without any modification. It should not be a url to an
html project page that you put in your browser. It's for computers.
-For GitHub repositories you can use the same shortcut syntax you use for `npm
-install`:
+For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same
+shortcut syntax you use for `npm install`:
"repository": "npm/npm"
+ "repository": "gist:11081aaa281"
+
+ "repository": "bitbucket:example/repo"
+
+ "repository": "gitlab:another/repo"
+
## scripts
The "scripts" property is a dictionary containing script commands that are run
<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.7.6</p>
+<p id="footer"><a href="../doc/README.html">README</a> — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-bin — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-bugs — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-cache — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-commands — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-config — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-deprecate — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-docs — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-edit — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-explore — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-help-search — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-init — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-install — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-link — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-load — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-ls — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-outdated — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-owner — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-pack — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-prefix — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-prune — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-publish — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-rebuild — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-repo — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-restart — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-root — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-run-script — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-search — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-shrinkwrap — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-start — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-stop — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-tag — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-test — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-uninstall — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-unpublish — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-update — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-version — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-view — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-whoami — npm@2.8.3</p>
npm.commands.install(["package"], cb)
})
</code></pre><h2 id="version">VERSION</h2>
-<p>2.7.6</p>
+<p>2.8.3</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.7.6</p>
+<p id="footer">npm — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-access — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-adduser — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-bin — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-bugs — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-build — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-bundle — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-cache — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-completion — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-config — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-dedupe — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-deprecate — npm@2.8.3</p>
</code></pre><p>When installing dependencies, a preferred tagged version may be specified:</p>
<pre><code>npm install --tag <tag>
</code></pre><p>This also applies to <code>npm dedupe</code>.</p>
-<p>Publishing a package always sets the "latest" tag to the published version.</p>
+<p>Publishing a package sets the "latest" tag to the published version unless the
+<code>--tag</code> option is used. For example, <code>npm publish --tag=beta</code>.</p>
<h2 id="purpose">PURPOSE</h2>
<p>Tags can be used to provide an alias instead of version numbers. For
example, <code>npm</code> currently uses the tag "next" to identify the upcoming
<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.7.6</p>
+<p id="footer">npm-dist-tag — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-docs — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-edit — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-explore — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-help-search — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-help — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-init — npm@2.8.3</p>
attempting to clone it using <code>git</code>.</p>
<p> Example:</p>
<pre><code> npm install mygithubuser/myproject
-</code></pre><p> To reference a package in a git repo that is not on GitHub, see git
- remote urls below.</p>
+</code></pre><p> To reference a package in a generic git repo (not on GitHub), see git remote
+ urls below.</p>
</li>
+<li><p><code>npm install github:<githubname>/<githubrepo></code>:</p>
+<p> The same as the above, but explicitly marked as a GitHub dependency.</p>
+<p> Example:</p>
+<pre><code> npm install github:npm/npm
+</code></pre></li>
+<li><p><code>npm install gist:[<githubname>/]<gistID></code>:</p>
+<p> Install the package at <code>https://gist.github.com/gistID</code> by attempting to
+ clone it using <code>git</code>. The GitHub username associated with the gist is
+ optional and will not be saved in <code>package.json</code> if <code>--save</code> is used.</p>
+<p> Example:</p>
+<pre><code> npm install gist:101a11beef
+</code></pre></li>
+<li><p><code>npm install bitbucket:<bitbucketname>/<bitbucketrepo></code>:</p>
+<p> Install the package at <code>https://bitbucket.org/bitbucketname/bitbucketrepo</code>
+ by attempting to clone it using <code>git</code>.</p>
+<p> Example:</p>
+<pre><code> npm install bitbucket:mybitbucketuser/myproject
+</code></pre></li>
+<li><p><code>npm install gitlab:<gitlabname>/<gitlabrepo></code>:</p>
+<p> Install the package at <code>https://gitlab.com/gitlabname/gitlabrepo</code>
+ by attempting to clone it using <code>git</code>.</p>
+<p> Example:</p>
+<pre><code> npm install gitlab:mygitlabuser/myproject
+</code></pre></li>
<li><p><code>npm install <git remote url></code>:</p>
<p> Install a package by cloning a git remote url. The format of the git
url is:</p>
-<pre><code> <protocol>://[<user>@]<hostname><separator><path>[#<commit-ish>]
+<pre><code> <protocol>://[<user>[:<password>]@]<hostname><separator><path>[#<commit-ish>]
</code></pre><p> <code><protocol></code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, or
<code>git+https</code>. If no <code><commit-ish></code> is specified, then <code>master</code> is
used.</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.7.6</p>
+<p id="footer">npm-install — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-link — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-logout — npm@2.8.3</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.7.6 /path/to/npm
+<pre><code>npm@2.8.3 /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.7.6</p>
+<p id="footer">npm-ls — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-outdated — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-owner — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-pack — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-prefix — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-prune — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-publish — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-rebuild — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-repo — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-restart — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-rm — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-root — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-run-script — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-search — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-shrinkwrap — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-star — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-stars — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-start — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-stop — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-tag — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-test — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-uninstall — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-unpublish — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-update — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-version — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-view — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-whoami — npm@2.8.3</p>
<h2 id="synopsis">SYNOPSIS</h2>
<pre><code>npm <command> [args]
</code></pre><h2 id="version">VERSION</h2>
-<p>2.7.6</p>
+<p>2.8.3</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.7.6</p>
+<p id="footer">npm — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-folders — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-global — npm@2.8.3</p>
</code></pre><p>The URL should be a publicly available (perhaps read-only) url that can be handed
directly to a VCS program without any modification. It should not be a url to an
html project page that you put in your browser. It's for computers.</p>
-<p>For GitHub repositories you can use the same shortcut syntax you use for <code>npm
-install</code>:</p>
+<p>For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same
+shortcut syntax you use for <code>npm install</code>:</p>
<pre><code>"repository": "npm/npm"
+
+"repository": "gist:11081aaa281"
+
+"repository": "bitbucket:example/repo"
+
+"repository": "gitlab:another/repo"
</code></pre><h2 id="scripts">scripts</h2>
<p>The "scripts" property is a dictionary containing script commands that are run
at various times in the lifecycle of your package. The key is the lifecycle
<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.7.6</p>
+<p id="footer">npm-json — npm@2.8.3</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.7.6</p>
+<p id="footer">npmrc — npm@2.8.3</p>
</code></pre><p>The URL should be a publicly available (perhaps read-only) url that can be handed
directly to a VCS program without any modification. It should not be a url to an
html project page that you put in your browser. It's for computers.</p>
-<p>For GitHub repositories you can use the same shortcut syntax you use for <code>npm
-install</code>:</p>
+<p>For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same
+shortcut syntax you use for <code>npm install</code>:</p>
<pre><code>"repository": "npm/npm"
+
+"repository": "gist:11081aaa281"
+
+"repository": "bitbucket:example/repo"
+
+"repository": "gitlab:another/repo"
</code></pre><h2 id="scripts">scripts</h2>
<p>The "scripts" property is a dictionary containing script commands that are run
at various times in the lifecycle of your package. The key is the lifecycle
<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.7.6</p>
+<p id="footer">package.json — npm@2.8.3</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.7.6</p>
+<p id="footer">index — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-coding-style — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-config — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-developers — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-disputes — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-faq — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-index — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-registry — npm@2.8.3</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-scope — npm@2.7.6</p>
+<p id="footer">npm-scope — npm@2.8.3</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.7.6</p>
+<p id="footer">npm-scripts — npm@2.8.3</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.7.6</p>
+<p id="footer">removing-npm — npm@2.8.3</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.7.6</p>
+<p id="footer">semver — npm@2.8.3</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.7.6</p>
+<p>2.8.3</p>
<h2 id="description">DESCRIPTION</h2>
<p>This is the API documentation for npm.
To find documentation of the command line
</code></pre><p>When installing dependencies, a preferred tagged version may be specified:</p>
<pre><code>npm install --tag <tag>
</code></pre><p>This also applies to <code>npm dedupe</code>.</p>
-<p>Publishing a package always sets the "latest" tag to the published version.</p>
+<p>Publishing a package sets the "latest" tag to the published version unless the
+<code>--tag</code> option is used. For example, <code>npm publish --tag=beta</code>.</p>
<h2 id="purpose">PURPOSE</h2>
<p>Tags can be used to provide an alias instead of version numbers. For
example, <code>npm</code> currently uses the tag "next" to identify the upcoming
attempting to clone it using <code>git</code>.</p>
<p> Example:</p>
<pre><code> npm install mygithubuser/myproject
-</code></pre><p> To reference a package in a git repo that is not on GitHub, see git
- remote urls below.</p>
+</code></pre><p> To reference a package in a generic git repo (not on GitHub), see git remote
+ urls below.</p>
</li>
+<li><p><code>npm install github:<githubname>/<githubrepo></code>:</p>
+<p> The same as the above, but explicitly marked as a GitHub dependency.</p>
+<p> Example:</p>
+<pre><code> npm install github:npm/npm
+</code></pre></li>
+<li><p><code>npm install gist:[<githubname>/]<gistID></code>:</p>
+<p> Install the package at <code>https://gist.github.com/gistID</code> by attempting to
+ clone it using <code>git</code>. The GitHub username associated with the gist is
+ optional and will not be saved in <code>package.json</code> if <code>--save</code> is used.</p>
+<p> Example:</p>
+<pre><code> npm install gist:101a11beef
+</code></pre></li>
+<li><p><code>npm install bitbucket:<bitbucketname>/<bitbucketrepo></code>:</p>
+<p> Install the package at <code>https://bitbucket.org/bitbucketname/bitbucketrepo</code>
+ by attempting to clone it using <code>git</code>.</p>
+<p> Example:</p>
+<pre><code> npm install bitbucket:mybitbucketuser/myproject
+</code></pre></li>
+<li><p><code>npm install gitlab:<gitlabname>/<gitlabrepo></code>:</p>
+<p> Install the package at <code>https://gitlab.com/gitlabname/gitlabrepo</code>
+ by attempting to clone it using <code>git</code>.</p>
+<p> Example:</p>
+<pre><code> npm install gitlab:mygitlabuser/myproject
+</code></pre></li>
<li><p><code>npm install <git remote url></code>:</p>
<p> Install a package by cloning a git remote url. The format of the git
url is:</p>
-<pre><code> <protocol>://[<user>@]<hostname><separator><path>[#<commit-ish>]
+<pre><code> <protocol>://[<user>[:<password>]@]<hostname><separator><path>[#<commit-ish>]
</code></pre><p> <code><protocol></code> is one of <code>git</code>, <code>git+ssh</code>, <code>git+http</code>, or
<code>git+https</code>. If no <code><commit-ish></code> is specified, then <code>master</code> is
used.</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.7.6 /path/to/npm
+<pre><code>npm@2.8.3 /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.7.6</p>
+<p>2.8.3</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>
</code></pre><p>The URL should be a publicly available (perhaps read-only) url that can be handed
directly to a VCS program without any modification. It should not be a url to an
html project page that you put in your browser. It's for computers.</p>
-<p>For GitHub repositories you can use the same shortcut syntax you use for <code>npm
-install</code>:</p>
+<p>For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same
+shortcut syntax you use for <code>npm install</code>:</p>
<pre><code>"repository": "npm/npm"
+
+"repository": "gist:11081aaa281"
+
+"repository": "bitbucket:example/repo"
+
+"repository": "gitlab:another/repo"
</code></pre><h2 id="scripts">scripts</h2>
<p>The "scripts" property is a dictionary containing script commands that are run
at various times in the lifecycle of your package. The key is the lifecycle
</code></pre><p>The URL should be a publicly available (perhaps read-only) url that can be handed
directly to a VCS program without any modification. It should not be a url to an
html project page that you put in your browser. It's for computers.</p>
-<p>For GitHub repositories you can use the same shortcut syntax you use for <code>npm
-install</code>:</p>
+<p>For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same
+shortcut syntax you use for <code>npm install</code>:</p>
<pre><code>"repository": "npm/npm"
+
+"repository": "gist:11081aaa281"
+
+"repository": "bitbucket:example/repo"
+
+"repository": "gitlab:another/repo"
</code></pre><h2 id="scripts">scripts</h2>
<p>The "scripts" property is a dictionary containing script commands that are run
at various times in the lifecycle of your package. The key is the lifecycle
<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>
, addLocal = require("./cache/add-local.js")
, addRemoteTarball = require("./cache/add-remote-tarball.js")
, addRemoteGit = require("./cache/add-remote-git.js")
- , maybeGithub = require("./cache/maybe-github.js")
, inflight = require("inflight")
, realizePackageSpecifier = require("realize-package-specifier")
, npa = require("npm-package-arg")
})
break
case "git":
- addRemoteGit(p.spec, false, cb)
- break
case "hosted":
- if (p.hosted.type === "github") {
- maybeGithub(p.rawSpec, cb)
- } else {
- addRemoteGit(p.spec, false, cb)
- }
+ addRemoteGit(p.rawSpec, cb)
break
default:
if (p.name) return addNamed(p.name, p.spec, null, cb)
-var mkdir = require('mkdirp')
var assert = require('assert')
-var git = require('../utils/git.js')
+var crypto = require('crypto')
var fs = require('graceful-fs')
-var log = require('npmlog')
var path = require('path')
var url = require('url')
+
var chownr = require('chownr')
-var crypto = require('crypto')
-var npm = require('../npm.js')
-var rm = require('../utils/gently-rm.js')
+var dezalgo = require('dezalgo')
+var hostedFromURL = require('hosted-git-info').fromUrl
var inflight = require('inflight')
-var getCacheStat = require('./get-stat.js')
-var addLocal = require('./add-local.js')
-var realizePackageSpecifier = require('realize-package-specifier')
+var log = require('npmlog')
+var mkdir = require('mkdirp')
var normalizeGitUrl = require('normalize-git-url')
-var randomBytes = require('crypto').pseudoRandomBytes // only need uniqueness
+var npa = require('npm-package-arg')
+var realizePackageSpecifier = require('realize-package-specifier')
+
+var addLocal = require('./add-local.js')
+var getCacheStat = require('./get-stat.js')
+var git = require('../utils/git.js')
+var npm = require('../npm.js')
+var rm = require('../utils/gently-rm.js')
var remotes = path.resolve(npm.config.get('cache'), '_git-remotes')
var templates = path.join(remotes, '_templates')
var VALID_VARIABLES = [
- 'GIT_SSH',
- 'GIT_SSL_NO_VERIFY',
+ 'GIT_ASKPASS',
'GIT_PROXY_COMMAND',
- 'GIT_SSL_CAINFO'
+ 'GIT_SSH',
+ 'GIT_SSL_CAINFO',
+ 'GIT_SSL_NO_VERIFY'
]
-module.exports = function addRemoteGit (uri, silent, cb) {
+module.exports = addRemoteGit
+function addRemoteGit (uri, _cb) {
assert(typeof uri === 'string', 'must have git URL')
- assert(typeof cb === 'function', 'must have callback')
+ assert(typeof _cb === 'function', 'must have callback')
+ var cb = dezalgo(_cb)
+
+ log.verbose('addRemoteGit', 'caching', uri)
+
+ // the URL comes in exactly as it was passed on the command line, or as
+ // normalized by normalize-package-data / read-package-json / read-installed,
+ // so figure out what to do with it using hosted-git-info
+ var parsed = hostedFromURL(uri)
+ if (parsed) {
+ // normalize GitHub syntax to org/repo (for now)
+ var from
+ if (parsed.type === 'github' && parsed.default === 'shortcut') {
+ from = parsed.path()
+ } else {
+ from = parsed.toString()
+ }
- // reconstruct the URL as it was passed in – realizePackageSpecifier
- // strips off `git+` and `maybeGithub` doesn't include it.
- var originalURL
- if (!/^git[+:]/.test(uri)) {
- originalURL = 'git+' + uri
+ log.verbose('addRemoteGit', from, 'is a repository hosted by', parsed.type)
+
+ // prefer explicit URLs to pushing everything through shortcuts
+ if (parsed.default !== 'shortcut') {
+ return tryClone(from, parsed.toString(), false, cb)
+ }
+
+ // try git:, then git+ssh:, then git+https: before failing
+ tryGitProto(from, parsed, cb)
} else {
- originalURL = uri
+ // verify that this is a Git URL before continuing
+ parsed = npa(uri)
+ if (parsed.type !== 'git') {
+ return cb(new Error(uri + 'is not a Git or GitHub URL'))
+ }
+
+ tryClone(parsed.rawSpec, uri, false, cb)
}
+}
+
+function tryGitProto (from, hostedInfo, cb) {
+ var gitURL = hostedInfo.git()
+ if (!gitURL) return trySSH(from, hostedInfo, cb)
+
+ log.silly('tryGitProto', 'attempting to clone', gitURL)
+ tryClone(from, gitURL, true, function (er) {
+ if (er) return tryHTTPS(from, hostedInfo, cb)
+
+ cb.apply(this, arguments)
+ })
+}
+
+function tryHTTPS (from, hostedInfo, cb) {
+ var httpsURL = hostedInfo.https()
+ if (!httpsURL) {
+ return cb(new Error(from + ' can not be cloned via Git, SSH, or HTTPS'))
+ }
+
+ log.silly('tryHTTPS', 'attempting to clone', httpsURL)
+ tryClone(from, httpsURL, true, function (er) {
+ if (er) return trySSH(from, hostedInfo, cb)
- // break apart the origin URL and the branch / tag / commitish
- var normalized = normalizeGitUrl(uri)
- var gitURL = normalized.url
+ cb.apply(this, arguments)
+ })
+}
+
+function trySSH (from, hostedInfo, cb) {
+ var sshURL = hostedInfo.ssh()
+ if (!sshURL) return tryHTTPS(from, hostedInfo, cb)
+
+ log.silly('trySSH', 'attempting to clone', sshURL)
+ tryClone(from, sshURL, false, cb)
+}
+
+function tryClone (from, combinedURL, silent, cb) {
+ log.silly('tryClone', 'cloning', from, 'via', combinedURL)
+
+ var normalized = normalizeGitUrl(combinedURL)
+ var cloneURL = normalized.url
var treeish = normalized.branch
// ensure that similarly-named remotes don't collide
- var repoID = gitURL.replace(/[^a-zA-Z0-9]+/g, '-') + '-' +
- crypto.createHash('sha1').update(gitURL).digest('hex').slice(0, 8)
+ var repoID = cloneURL.replace(/[^a-zA-Z0-9]+/g, '-') + '-' +
+ crypto.createHash('sha1').update(cloneURL).digest('hex').slice(0, 8)
var cachedRemote = path.join(remotes, repoID)
- // set later, as the callback flow proceeds
- var resolvedURL
- var resolvedTreeish
- var tmpdir
-
cb = inflight(repoID, cb)
if (!cb) {
- return log.verbose('addRemoteGit', repoID, 'already in flight; waiting')
+ return log.verbose('tryClone', repoID, 'already in flight; waiting')
}
- log.verbose('addRemoteGit', repoID, 'not in flight; caching')
+ log.verbose('tryClone', repoID, 'not in flight; caching')
// initialize the remotes cache with the correct perms
getGitDir(function (er) {
if (er) return cb(er)
fs.stat(cachedRemote, function (er, s) {
- if (er) return mirrorRemote(finish)
- if (!s.isDirectory()) return resetRemote(finish)
+ if (er) return mirrorRemote(from, cloneURL, treeish, cachedRemote, silent, finish)
+ if (!s.isDirectory()) return resetRemote(from, cloneURL, treeish, cachedRemote, finish)
- validateExistingRemote(finish)
+ validateExistingRemote(from, cloneURL, treeish, cachedRemote, finish)
})
// always set permissions on the cached remote
})
}
})
+}
- // don't try too hard to hold on to a remote
- function resetRemote (cb) {
- log.info('addRemoteGit', 'resetting', cachedRemote)
- rm(cachedRemote, function (er) {
- if (er) return cb(er)
- mirrorRemote(cb)
- })
- }
-
- // reuse a cached remote when possible, but nuke it if it's in an
- // inconsistent state
- function validateExistingRemote (cb) {
- git.whichAndExec(
- ['config', '--get', 'remote.origin.url'],
- { cwd: cachedRemote, env: gitEnv() },
- function (er, stdout, stderr) {
- var originURL
- if (stdout) {
- originURL = stdout.trim()
- log.verbose('addRemoteGit', 'remote.origin.url:', originURL)
- }
-
- if (stderr) stderr = stderr.trim()
- if (stderr || er) {
- log.warn('addRemoteGit', 'resetting remote', cachedRemote, 'because of error:', stderr || er)
- return resetRemote(cb)
- } else if (gitURL !== originURL) {
- log.warn(
- 'addRemoteGit',
- 'pre-existing cached repo', cachedRemote, 'points to', originURL, 'and not', gitURL
- )
- return resetRemote(cb)
- }
+// don't try too hard to hold on to a remote
+function resetRemote (from, cloneURL, treeish, cachedRemote, cb) {
+ log.info('resetRemote', 'resetting', cachedRemote, 'for', from)
+ rm(cachedRemote, function (er) {
+ if (er) return cb(er)
+ mirrorRemote(from, cloneURL, treeish, cachedRemote, false, cb)
+ })
+}
- log.verbose('addRemoteGit', 'updating existing cached remote', cachedRemote)
- updateRemote(cb)
+// reuse a cached remote when possible, but nuke it if it's in an
+// inconsistent state
+function validateExistingRemote (from, cloneURL, treeish, cachedRemote, cb) {
+ git.whichAndExec(
+ ['config', '--get', 'remote.origin.url'],
+ { cwd: cachedRemote, env: gitEnv() },
+ function (er, stdout, stderr) {
+ var originURL
+ if (stdout) {
+ originURL = stdout.trim()
+ log.silly('validateExistingRemote', from, 'remote.origin.url:', originURL)
}
- )
- }
-
- // make a complete bare mirror of the remote repo
- // NOTE: npm uses a blank template directory to prevent weird inconsistencies
- // https://github.com/npm/npm/issues/5867
- function mirrorRemote (cb) {
- mkdir(cachedRemote, function (er) {
- if (er) return cb(er)
-
- var args = [
- 'clone',
- '--template=' + templates,
- '--mirror',
- gitURL, cachedRemote
- ]
- git.whichAndExec(
- ['clone', '--template=' + templates, '--mirror', gitURL, cachedRemote],
- { cwd: cachedRemote, env: gitEnv() },
- function (er, stdout, stderr) {
- if (er) {
- var combined = (stdout + '\n' + stderr).trim()
- var command = 'git ' + args.join(' ') + ':'
- if (silent) {
- log.verbose(command, combined)
- } else {
- log.error(command, combined)
- }
- return cb(er)
- }
- log.verbose('addRemoteGit', 'git clone ' + gitURL, stdout.trim())
- setPermissions(cb)
- }
- )
- })
- }
- function setPermissions (cb) {
- if (process.platform === 'win32') {
- log.verbose('addRemoteGit', 'skipping chownr on Windows')
- resolveHead(cb)
- } else {
- getGitDir(function (er, cs) {
- if (er) {
- log.error('addRemoteGit', 'could not get cache stat')
- return cb(er)
- }
-
- chownr(cachedRemote, cs.uid, cs.gid, function (er) {
- if (er) {
- log.error(
- 'addRemoteGit',
- 'Failed to change folder ownership under npm cache for',
- cachedRemote
- )
- return cb(er)
- }
+ if (stderr) stderr = stderr.trim()
+ if (stderr || er) {
+ log.warn('addRemoteGit', from, 'resetting remote', cachedRemote, 'because of error:', stderr || er)
+ return resetRemote(from, cloneURL, treeish, cachedRemote, cb)
+ } else if (cloneURL !== originURL) {
+ log.warn(
+ 'addRemoteGit',
+ from,
+ 'pre-existing cached repo', cachedRemote, 'points to', originURL, 'and not', cloneURL
+ )
+ return resetRemote(from, cloneURL, treeish, cachedRemote, cb)
+ }
- log.verbose('addRemoteGit', 'set permissions on', cachedRemote)
- resolveHead(cb)
- })
- })
+ log.verbose('validateExistingRemote', from, 'is updating existing cached remote', cachedRemote)
+ updateRemote(from, cloneURL, treeish, cachedRemote, cb)
}
- }
+ )
+}
- // always fetch the origin, even right after mirroring, because this way
- // permissions will get set correctly
- function updateRemote (cb) {
+// make a complete bare mirror of the remote repo
+// NOTE: npm uses a blank template directory to prevent weird inconsistencies
+// https://github.com/npm/npm/issues/5867
+function mirrorRemote (from, cloneURL, treeish, cachedRemote, silent, cb) {
+ mkdir(cachedRemote, function (er) {
+ if (er) return cb(er)
+
+ var args = [
+ 'clone',
+ '--template=' + templates,
+ '--mirror',
+ cloneURL, cachedRemote
+ ]
git.whichAndExec(
- ['fetch', '-a', 'origin'],
+ ['clone', '--template=' + templates, '--mirror', cloneURL, cachedRemote],
{ cwd: cachedRemote, env: gitEnv() },
function (er, stdout, stderr) {
if (er) {
var combined = (stdout + '\n' + stderr).trim()
- log.error('git fetch -a origin (' + gitURL + ')', combined)
+ var command = 'git ' + args.join(' ') + ':'
+ if (silent) {
+ log.verbose(command, combined)
+ } else {
+ log.error(command, combined)
+ }
return cb(er)
}
- log.verbose('addRemoteGit', 'git fetch -a origin (' + gitURL + ')', stdout.trim())
-
- setPermissions(cb)
+ log.verbose('mirrorRemote', from, 'git clone ' + cloneURL, stdout.trim())
+ setPermissions(from, cloneURL, treeish, cachedRemote, cb)
}
)
- }
+ })
+}
- // branches and tags are both symbolic labels that can be attached to different
- // commits, so resolve the commitish to the current actual treeish the label
- // corresponds to
- //
- // important for shrinkwrap
- function resolveHead (cb) {
- log.verbose('addRemoteGit', 'original treeish:', treeish)
- var args = ['rev-list', '-n1', treeish]
- git.whichAndExec(
- args,
- { cwd: cachedRemote, env: gitEnv() },
- function (er, stdout, stderr) {
+function setPermissions (from, cloneURL, treeish, cachedRemote, cb) {
+ if (process.platform === 'win32') {
+ log.verbose('setPermissions', from, 'skipping chownr on Windows')
+ resolveHead(from, cloneURL, treeish, cachedRemote, cb)
+ } else {
+ getGitDir(function (er, cs) {
+ if (er) {
+ log.error('setPermissions', from, 'could not get cache stat')
+ return cb(er)
+ }
+
+ chownr(cachedRemote, cs.uid, cs.gid, function (er) {
if (er) {
- log.error('git ' + args.join(' ') + ':', stderr)
+ log.error(
+ 'setPermissions',
+ 'Failed to change git repository ownership under npm cache for',
+ cachedRemote
+ )
return cb(er)
}
- resolvedTreeish = stdout.trim()
- log.silly('addRemoteGit', 'resolved treeish:', resolvedTreeish)
+ log.verbose('setPermissions', from, 'set permissions on', cachedRemote)
+ resolveHead(from, cloneURL, treeish, cachedRemote, cb)
+ })
+ })
+ }
+}
+
+// always fetch the origin, even right after mirroring, because this way
+// permissions will get set correctly
+function updateRemote (from, cloneURL, treeish, cachedRemote, cb) {
+ git.whichAndExec(
+ ['fetch', '-a', 'origin'],
+ { cwd: cachedRemote, env: gitEnv() },
+ function (er, stdout, stderr) {
+ if (er) {
+ var combined = (stdout + '\n' + stderr).trim()
+ log.error('git fetch -a origin (' + cloneURL + ')', combined)
+ return cb(er)
+ }
+ log.verbose('updateRemote', 'git fetch -a origin (' + cloneURL + ')', stdout.trim())
- resolvedURL = getResolved(originalURL, resolvedTreeish)
- log.verbose('addRemoteGit', 'resolved Git URL:', resolvedURL)
+ setPermissions(from, cloneURL, treeish, cachedRemote, cb)
+ }
+ )
+}
- // generate a unique filename
- tmpdir = path.join(
- npm.tmp,
- 'git-cache-' + randomBytes(6).toString('hex'),
- resolvedTreeish
- )
- log.silly('addRemoteGit', 'Git working directory:', tmpdir)
+// branches and tags are both symbolic labels that can be attached to different
+// commits, so resolve the commitish to the current actual treeish the label
+// corresponds to
+//
+// important for shrinkwrap
+function resolveHead (from, cloneURL, treeish, cachedRemote, cb) {
+ log.verbose('resolveHead', from, 'original treeish:', treeish)
+ var args = ['rev-list', '-n1', treeish]
+ git.whichAndExec(
+ args,
+ { cwd: cachedRemote, env: gitEnv() },
+ function (er, stdout, stderr) {
+ if (er) {
+ log.error('git ' + args.join(' ') + ':', stderr)
+ return cb(er)
+ }
- mkdir(tmpdir, function (er) {
- if (er) return cb(er)
+ var resolvedTreeish = stdout.trim()
+ log.silly('resolveHead', from, 'resolved treeish:', resolvedTreeish)
- cloneResolved(cb)
- })
+ var resolvedURL = getResolved(cloneURL, resolvedTreeish)
+ if (!resolvedURL) {
+ return cb(new Error(
+ 'unable to clone ' + from + ' because git clone string ' +
+ cloneURL + ' is in a form npm can\'t handle'
+ ))
}
- )
- }
+ log.verbose('resolveHead', from, 'resolved Git URL:', resolvedURL)
- // make a clone from the mirrored cache so we have a temporary directory in
- // which we can check out the resolved treeish
- function cloneResolved (cb) {
- var args = ['clone', cachedRemote, tmpdir]
- git.whichAndExec(
- args,
- { cwd: cachedRemote, env: gitEnv() },
- function (er, stdout, stderr) {
- stdout = (stdout + '\n' + stderr).trim()
- if (er) {
- log.error('git ' + args.join(' ') + ':', stderr)
- return cb(er)
- }
- log.verbose('addRemoteGit', 'clone', stdout)
+ // generate a unique filename
+ var tmpdir = path.join(
+ npm.tmp,
+ 'git-cache-' + crypto.pseudoRandomBytes(6).toString('hex'),
+ resolvedTreeish
+ )
+ log.silly('resolveHead', 'Git working directory:', tmpdir)
- checkoutTreeish(cb)
+ mkdir(tmpdir, function (er) {
+ if (er) return cb(er)
+
+ cloneResolved(from, resolvedURL, resolvedTreeish, cachedRemote, tmpdir, cb)
+ })
+ }
+ )
+}
+
+// make a clone from the mirrored cache so we have a temporary directory in
+// which we can check out the resolved treeish
+function cloneResolved (from, resolvedURL, resolvedTreeish, cachedRemote, tmpdir, cb) {
+ var args = ['clone', cachedRemote, tmpdir]
+ git.whichAndExec(
+ args,
+ { cwd: cachedRemote, env: gitEnv() },
+ function (er, stdout, stderr) {
+ stdout = (stdout + '\n' + stderr).trim()
+ if (er) {
+ log.error('git ' + args.join(' ') + ':', stderr)
+ return cb(er)
}
- )
- }
+ log.verbose('cloneResolved', from, 'clone', stdout)
- // there is no safe way to do a one-step clone to a treeish that isn't
- // guaranteed to be a branch, so explicitly check out the treeish once it's
- // cloned
- function checkoutTreeish (cb) {
- var args = ['checkout', resolvedTreeish]
- git.whichAndExec(
- args,
- { cwd: tmpdir, env: gitEnv() },
- function (er, stdout, stderr) {
- stdout = (stdout + '\n' + stderr).trim()
+ checkoutTreeish(from, resolvedURL, resolvedTreeish, tmpdir, cb)
+ }
+ )
+}
+
+// there is no safe way to do a one-step clone to a treeish that isn't
+// guaranteed to be a branch, so explicitly check out the treeish once it's
+// cloned
+function checkoutTreeish (from, resolvedURL, resolvedTreeish, tmpdir, cb) {
+ var args = ['checkout', resolvedTreeish]
+ git.whichAndExec(
+ args,
+ { cwd: tmpdir, env: gitEnv() },
+ function (er, stdout, stderr) {
+ stdout = (stdout + '\n' + stderr).trim()
+ if (er) {
+ log.error('git ' + args.join(' ') + ':', stderr)
+ return cb(er)
+ }
+ log.verbose('checkoutTreeish', from, 'checkout', stdout)
+
+ // convince addLocal that the checkout is a local dependency
+ realizePackageSpecifier(tmpdir, function (er, spec) {
if (er) {
- log.error('git ' + args.join(' ') + ':', stderr)
+ log.error('addRemoteGit', 'Failed to map', tmpdir, 'to a package specifier')
return cb(er)
}
- log.verbose('addRemoteGit', 'checkout', stdout)
-
- // convince addLocal that the checkout is a local dependency
- realizePackageSpecifier(tmpdir, function (er, spec) {
- if (er) {
- log.error('addRemoteGit', 'Failed to map', tmpdir, 'to a package specifier')
- return cb(er)
- }
- // ensure pack logic is applied
- // https://github.com/npm/npm/issues/6400
- addLocal(spec, null, function (er, data) {
- if (data) {
- log.verbose('addRemoteGit', 'data._resolved:', resolvedURL)
- data._resolved = resolvedURL
-
- // the spec passed to addLocal is not what the user originally requested,
- // so remap
- // https://github.com/npm/npm/issues/7121
- if (!data._fromGitHub) {
- log.silly('addRemoteGit', 'data._from:', originalURL)
- data._from = originalURL
- } else {
- log.silly('addRemoteGit', 'data._from:', data._from, '(GitHub)')
- }
+ // ensure pack logic is applied
+ // https://github.com/npm/npm/issues/6400
+ addLocal(spec, null, function (er, data) {
+ if (data) {
+ if (npm.config.get('save-exact')) {
+ log.verbose('addRemoteGit', 'data._from:', resolvedURL, '(save-exact)')
+ data._from = resolvedURL
+ } else {
+ log.verbose('addRemoteGit', 'data._from:', from)
+ data._from = from
}
- cb(er, data)
- })
+ log.verbose('addRemoteGit', 'data._resolved:', resolvedURL)
+ data._resolved = resolvedURL
+ }
+
+ cb(er, data)
})
- }
- )
- }
+ })
+ }
+ )
}
function getGitDir (cb) {
// git responds to env vars in some weird ways in post-receive hooks
// so don't carry those along.
if (gitEnv_) return gitEnv_
- gitEnv_ = {}
+
+ // allow users to override npm's insistence on not prompting for
+ // passphrases, but default to just failing when credentials
+ // aren't available
+ gitEnv_ = { GIT_ASKPASS: 'echo' }
+
for (var k in process.env) {
if (!~VALID_VARIABLES.indexOf(k) && k.match(/^GIT/)) continue
gitEnv_[k] = process.env[k]
return gitEnv_
}
+addRemoteGit.getResolved = getResolved
function getResolved (uri, treeish) {
+ // normalize hosted-git-info clone URLs back into regular URLs
+ // this will only work on URLs that hosted-git-info recognizes
+ // https://github.com/npm/npm/issues/7961
+ var rehydrated = hostedFromURL(uri)
+ if (rehydrated) uri = rehydrated.toString()
+
var parsed = url.parse(uri)
+
+ // non-hosted SSH strings that are not URLs (git@whatever.com:foo.git) are
+ // no bueno
+ // https://github.com/npm/npm/issues/7961
+ if (!parsed.protocol) return
+
parsed.hash = treeish
if (!/^git[+:]/.test(parsed.protocol)) {
parsed.protocol = 'git+' + parsed.protocol
}
- var resolved = url.format(parsed)
// node incorrectly sticks a / at the start of the path We know that the host
// won't change, so split and detect this
// https://github.com/npm/npm/issues/3224
var spo = uri.split(parsed.host)
- var spr = resolved.split(parsed.host)
+ var spr = url.format(parsed).split(parsed.host)
if (spo[1] && spo[1].charAt(0) === ':' && spr[1] && spr[1].charAt(0) === '/') {
spr[1] = spr[1].slice(1)
}
+++ /dev/null
-var assert = require('assert')
-
-var hosted = require('hosted-git-info')
-var log = require('npmlog')
-
-var addRemoteGit = require('./add-remote-git.js')
-
-module.exports = function maybeGithub (p, cb) {
- assert(typeof p === 'string', 'must pass package name')
- assert(typeof cb === 'function', 'must pass callback')
-
- var parsed = hosted.fromUrl(p)
- log.info('maybeGithub', 'Attempting %s from %s', p, parsed.git())
-
- return addRemoteGit(parsed.git(), true, function (er, data) {
- if (er) {
- log.info('maybeGithub', "Couldn't clone %s", parsed.git())
- log.info('maybeGithub', 'Now attempting %s from %s', p, parsed.sshurl())
-
- return addRemoteGit(parsed.sshurl(), false, function (er, data) {
- if (er) return cb(er)
-
- success(parsed.sshurl(), data)
- })
- }
-
- success(parsed.git(), data)
- })
-
- function success (u, data) {
- data._from = u
- data._fromGithub = true
- return cb(null, data)
- }
-}
var saveTarget = path.resolve(where, "package.json")
asyncMap(Object.keys(tree), function (k, cb) {
- // if "what" was a url, then save that instead.
+ // if "from" is remote, git, or hosted, then save that instead.
var t = tree[k]
- , u = url.parse(t.from)
+ , f = npa(t.from)
, a = npa(t.what)
, w = [a.name, a.spec]
fs.stat(t.from, function (er){
if (!er) {
w[1] = "file:" + t.from
- } else if (u && u.protocol) {
+ } else if (['hosted', 'git', 'remote'].indexOf(f.type) !== -1) {
w[1] = t.from
}
cb(null, [w])
"in npm 3+. Your application will need to depend on it explicitly."
], pd+","+data.name)
})
- var pdTargetFolder = path.resolve(targetFolder, "..", "..")
+
+ // Package scopes cause an addditional tree level which needs to be
+ // considered when resolving a peerDependency's target folder.
+ var pdTargetFolder
+ if (npa(target.name).scope) {
+ pdTargetFolder = path.resolve(targetFolder, '../../..')
+ } else {
+ pdTargetFolder = path.resolve(targetFolder, '../..')
+ }
+
var pdContext = context
if (peerDeps.length > 0) {
actions.push(
}
-// monkey-patch support for 0.6 child processes
-require('child-process-close')
-
var EventEmitter = require("events").EventEmitter
, npm = module.exports = new EventEmitter()
, npmconf = require("./config/core.js")
er.file = cmd
cooked.emit("error", er)
}).on("close", function (code, signal) {
- cooked.emit("close", code, signal)
+ // Create ENOENT error because Node.js v0.8 will not emit
+ // an `error` event if the command could not be found.
+ if (code === 127) {
+ var er = new Error('spawn ENOENT')
+ er.code = 'ENOENT'
+ er.errno = 'ENOENT'
+ er.syscall = 'spawn'
+ er.file = cmd
+ cooked.emit('error', er)
+ } else {
+ cooked.emit("close", code, signal)
+ }
})
cooked.stdin = raw.stdin
.P
This also applies to \fBnpm dedupe\fR\|\.
.P
-Publishing a package always sets the "latest" tag to the published version\.
+Publishing a package sets the "latest" tag to the published version unless the
+\fB\-\-tag\fR option is used\. For example, \fBnpm publish \-\-tag=beta\fR\|\.
.SH PURPOSE
.P
Tags can be used to provide an alias instead of version numbers\. For
npm install mygithubuser/myproject
.fi
.RE
- To reference a package in a git repo that is not on GitHub, see git
- remote urls below\.
+ To reference a package in a generic git repo (not on GitHub), see git remote
+ urls below\.
+.IP \(bu 2
+\fBnpm install github:<githubname>/<githubrepo>\fR:
+ The same as the above, but explicitly marked as a GitHub dependency\.
+ Example:
+.P
+.RS 2
+.nf
+ npm install github:npm/npm
+.fi
+.RE
+.IP \(bu 2
+\fBnpm install gist:[<githubname>/]<gistID>\fR:
+ Install the package at \fBhttps://gist\.github\.com/gistID\fR by attempting to
+ clone it using \fBgit\fR\|\. The GitHub username associated with the gist is
+ optional and will not be saved in \fBpackage\.json\fR if \fB\-\-save\fR is used\.
+ Example:
+.P
+.RS 2
+.nf
+ npm install gist:101a11beef
+.fi
+.RE
+.IP \(bu 2
+\fBnpm install bitbucket:<bitbucketname>/<bitbucketrepo>\fR:
+ Install the package at \fBhttps://bitbucket\.org/bitbucketname/bitbucketrepo\fR
+ by attempting to clone it using \fBgit\fR\|\.
+ Example:
+.P
+.RS 2
+.nf
+ npm install bitbucket:mybitbucketuser/myproject
+.fi
+.RE
+.IP \(bu 2
+\fBnpm install gitlab:<gitlabname>/<gitlabrepo>\fR:
+ Install the package at \fBhttps://gitlab\.com/gitlabname/gitlabrepo\fR
+ by attempting to clone it using \fBgit\fR\|\.
+ Example:
+.P
+.RS 2
+.nf
+ npm install gitlab:mygitlabuser/myproject
+.fi
+.RE
.IP \(bu 2
\fBnpm install <git remote url>\fR:
Install a package by cloning a git remote url\. The format of the git
.P
.RS 2
.nf
- <protocol>://[<user>@]<hostname><separator><path>[#<commit\-ish>]
+ <protocol>://[<user>[:<password>]@]<hostname><separator><path>[#<commit\-ish>]
.fi
.RE
\fB<protocol>\fR is one of \fBgit\fR, \fBgit+ssh\fR, \fBgit+http\fR, or
.P
.RS 2
.nf
-npm@2.7.6 /path/to/npm
+npm@2.8.3 /path/to/npm
└─┬ init\-package\-json@0\.0\.4
└── promzard@0\.1\.5
.fi
.RE
.SH VERSION
.P
-2.7.6
+2.8.3
.SH DESCRIPTION
.P
npm is the package manager for the Node JavaScript platform\. It puts
.RE
.SH VERSION
.P
-2.7.6
+2.8.3
.SH DESCRIPTION
.P
This is the API documentation for npm\.
directly to a VCS program without any modification\. It should not be a url to an
html project page that you put in your browser\. It's for computers\.
.P
-For GitHub repositories you can use the same shortcut syntax you use for \fBnpm
-install\fR:
+For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same
+shortcut syntax you use for \fBnpm install\fR:
.P
.RS 2
.nf
"repository": "npm/npm"
+
+"repository": "gist:11081aaa281"
+
+"repository": "bitbucket:example/repo"
+
+"repository": "gitlab:another/repo"
.fi
.RE
.SH scripts
directly to a VCS program without any modification\. It should not be a url to an
html project page that you put in your browser\. It's for computers\.
.P
-For GitHub repositories you can use the same shortcut syntax you use for \fBnpm
-install\fR:
+For GitHub, GitHub gist, Bitbucket, or GitLab repositories you can use the same
+shortcut syntax you use for \fBnpm install\fR:
.P
.RS 2
.nf
"repository": "npm/npm"
+
+"repository": "gist:11081aaa281"
+
+"repository": "bitbucket:example/repo"
+
+"repository": "gitlab:another/repo"
.fi
.RE
.SH scripts
+++ /dev/null
-
-var child_process = require('child_process');
-
-// Re-export the child_process module.
-module.exports = child_process;
-
-// Only node versions up to v0.7.6 need this hook.
-if (!/^v0\.([0-6]\.|7\.[0-6](\D|$))/.test(process.version))
- return;
-
-// Do not add the hook if already hooked.
-if (child_process.hasOwnProperty('_exit_hook'))
- return;
-
-// Version the hook in case there is ever the need to release a 0.2.0.
-child_process._exit_hook = 1;
-
-
-function hook(name) {
- var orig = child_process[name];
-
- // Older node versions may not have all functions, e.g. fork().
- if (!orig)
- return;
-
- // Store the unhooked version.
- child_process['_original_' + name] = orig;
-
- // Do the actual hooking.
- child_process[name] = function() {
- var child = orig.apply(this, arguments);
-
- child.once('exit', function(code, signal) {
- process.nextTick(function() {
- child.emit('close', code, signal);
- });
- });
-
- return child;
- }
-}
-
-hook('spawn');
-hook('fork');
-hook('execFile');
-
-// Don't hook 'exec': it calls `exports.execFile` internally, so hooking it
-// would trigger the close event twice.
+++ /dev/null
-{
- "name": "child-process-close",
- "version": "0.1.1",
- "description": "Make child_process objects emit 'close' events in node v0.6 like they do in v0.8. This makes it easier to write code that works correctly on both version of node.",
- "main": "index.js",
- "scripts": {
- "test": "node test/test.js"
- },
- "repository": {
- "type": "git",
- "url": "git://github.com/piscisaureus/child-process-close.git"
- },
- "keywords": [
- "child_process",
- "spawn",
- "fork",
- "exec",
- "execFile",
- "close",
- "exit"
- ],
- "author": {
- "name": "Bert Belder"
- },
- "license": "MIT",
- "readme": "\n# child-process-close\n\nThis module makes child process objects, (created with `spawn`, `fork`, `exec`\nor `execFile`) emit the `close` event in node v0.6 like they do in node v0.8.\nThis makes it easier to write code that works correctly on both version of\nnode.\n\n\n## Usage\n\nJust make sure to `require('child-process-close')` anywhere. It will patch the `child_process` module.\n\n```js\nrequire('child-process-close');\nvar spawn = require('child_process').spawn;\n\nvar cp = spawn('foo');\ncp.on('close', function(exitCode, signal) {\n // This now works on all node versions.\n});\n```\n\n\n## License\n\nCopyright (C) 2012 Bert Belder\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies 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\nTHE SOFTWARE.\n",
- "readmeFilename": "README.md",
- "bugs": {
- "url": "https://github.com/piscisaureus/child-process-close/issues"
- },
- "_id": "child-process-close@0.1.1",
- "dist": {
- "shasum": "c1909c6c3bbcea623e3bd74493ddb1c94c47c500"
- },
- "_from": "child-process-close@",
- "_resolved": "https://registry.npmjs.org/child-process-close/-/child-process-close-0.1.1.tgz"
-}
+++ /dev/null
-
-require('../index');
-
-var assert = require('assert'),
- exec = require('child_process').exec;
-
-var cp = exec('echo hello', function(err) {
- assert(!err);
-});
-
-var stdoutData = '',
- stdoutEnd = false,
- gotExit = false,
- gotClose = false;
-
-cp.stdout.setEncoding('ascii');
-
-cp.stdout.on('data', function(data) {
- assert(!stdoutEnd);
- stdoutData += data;
-});
-
-cp.stdout.on('end', function() {
- assert(!stdoutEnd);
- assert(/^hello/.test(stdoutData));
- stdoutEnd = true;
-});
-
-cp.on('exit', function(code, signal) {
- assert.strictEqual(code, 0);
- assert(!signal);
- assert(!gotExit);
- assert(!gotClose);
- gotExit = true;
-});
-
-cp.on('close', function(code, signal) {
- assert.strictEqual(code, 0);
- assert(!signal);
- assert(gotExit);
- assert(stdoutEnd);
- assert(!gotClose);
- gotClose = true;
-});
-
-process.on('exit', function() {
- assert(stdoutEnd);
- assert(gotExit);
- assert(gotClose);
-});
+++ /dev/null
-
-require('../index');
-
-var assert = require('assert'),
- fork = require('child_process').fork;
-
-var cp = fork('worker-fork');
-
-var gotMessage = false,
- gotExit = false,
- gotClose = false;
-
-cp.on('message', function(msg) {
- assert.strictEqual(msg, 'hello');
- assert(!gotMessage);
- assert(!gotClose);
- gotMessage = true;
-});
-
-cp.on('exit', function(code, signal) {
- assert.strictEqual(code, 0);
- assert(!signal);
- assert(!gotExit);
- assert(!gotClose);
- gotExit = true;
-});
-
-cp.on('close', function(code, signal) {
- assert.strictEqual(code, 0);
- assert(!signal);
- assert(gotExit);
- assert(gotMessage);
- assert(!gotClose);
- gotClose = true;
-});
-
-process.on('exit', function() {
- assert(gotMessage);
- assert(gotExit);
- assert(gotClose);
-});
+++ /dev/null
-
-require('../index');
-
-var assert = require('assert'),
- spawn = require('child_process').spawn;
- execFile = require('child_process').execFile;
-
-
-var cp1 = spawn(process.execPath, ['worker-spawn']);
-check(cp1);
-
-var cp2 = execFile(process.execPath, ['worker-spawn'], function(err) {
- assert(!err);
-});
-check(cp2);
-
-
-function check(cp) {
- var gotExit = false,
- gotClose = false,
- stdoutData = '',
- stdoutEnd = false,
- stderrData = '',
- stderrEnd = false;
-
- cp.stdout.setEncoding('ascii');
-
- cp.stdout.on('data', function(data) {
- assert(!stdoutEnd);
- stdoutData += data;
- });
-
- cp.stdout.on('end', function(data) {
- assert(!stdoutEnd)
- assert.strictEqual(stdoutData.length, 100000);
- stdoutEnd = true;
- });
-
- cp.stderr.setEncoding('ascii');
-
- cp.stderr.on('data', function(data) {
- stderrData += data;
- });
-
- cp.stderr.on('end', function(data) {
- assert(!stderrEnd)
- assert.strictEqual(stderrData.length, 100000);
- stderrEnd = true;
- });
-
- cp.on('exit', function(code, signal) {
- assert.strictEqual(code, 0);
- assert(!signal);
- assert(!gotExit);
- assert(!gotClose);
- gotExit = true;
- });
-
- cp.on('close', function(code, signal) {
- assert.strictEqual(code, 0);
- assert(!signal);
- assert(!cp.stdout || stdoutEnd);
- assert(!cp.stderr || stderrEnd);
- assert(gotExit);
- assert(!gotClose);
- gotClose = true;
- });
-
- process.on('exit', function() {
- assert(gotExit);
- assert(gotClose);
- });
-}
+++ /dev/null
-
-var TESTS = [
- 'test-spawn-and-execfile',
- 'test-fork',
- 'test-exec',
-];
-
-var execFile = require('child_process').execFile;
-var passed = 0, failed = 0;
-
-function next() {
- var test = TESTS.shift();
- if (!test)
- done();
-
- console.log("Running test: %s", test);
- execFile(process.execPath, [test], { cwd: __dirname }, onExit);
-}
-
-function onExit(err, stdout, stderr) {
- if (err) {
- console.log("... failed:\n%s%s\n", stdout, stderr);
- failed++;
- } else {
- console.log("... pass");
- passed++;
- }
-
- next();
-}
-
-function done() {
- console.log("Tests run: %d. Passed: %d. Failed: %d",
- passed + failed,
- passed,
- failed);
-
- process.exit(+(failed > 0));
-}
-
-next();
+++ /dev/null
-
-process.send('hello');
-process.exit(0);
+++ /dev/null
-
-var out = new Array(100000).join('x');
-
-console.log(out);
-console.error(out);
prepublish: all
columnify.js: index.js package.json
- 6to5 index.js > columnify.js
+ babel index.js > columnify.js
.PHONY: all prepublish
# columnify
-[![Build Status](https://travis-ci.org/timoxley/columnify.png?branch=master)](https://travis-ci.org/timoxley/columnify)
+[![NPM](https://nodei.co/npm/columnify.png?downloads=true&downloadRank=true&stars=true&chrome)](https://nodei.co/npm-dl/columnify/)
+[![NPM](https://nodei.co/npm-dl/columnify.png?months=3&height=3&chrome)](https://nodei.co/npm/columnify/)
+
+[![Build Status](https://img.shields.io/travis/timoxley/columnify.svg?style=flat)](https://travis-ci.org/timoxley/columnify)
[![NPM Version](https://img.shields.io/npm/v/columnify.svg?style=flat)](https://npmjs.org/package/columnify)
[![License](http://img.shields.io/npm/l/columnify.svg?style=flat)](LICENSE)
[![Dependency Status](https://david-dm.org/timoxley/columnify.svg)](https://david-dm.org/timoxley/columnify)
})
```
+This also works well for hiding a single column header, like an `id` column:
+```javascript
+var columns = columnify(data, {
+ config: {
+ id: { showHeaders: false }
+ }
+})
+```
+
### Transforming Column Data and Headers
If you need to modify the presentation of column content or heading content there are two useful options for doing that: `dataTransform` and `headerTransform`. Both of these take a function and need to return a valid string.
-"use strict";
+'use strict';
-var _toArray = function (arr) { return Array.isArray(arr) ? arr : Array.from(arr); };
+var _toConsumableArray = function (arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } };
-var wcwidth = require("./width");
-var _require = require("./utils");
+var wcwidth = require('./width');
+
+var _require = require('./utils');
var padRight = _require.padRight;
var padCenter = _require.padCenter;
var splitLongWords = _require.splitLongWords;
var truncateString = _require.truncateString;
-
-var DEFAULT_HEADING_TRANSFORM = function (key) {
+var DEFAULT_HEADING_TRANSFORM = function DEFAULT_HEADING_TRANSFORM(key) {
return key.toUpperCase();
};
-var DEFAULT_DATA_TRANSFORM = function (cell, column, index) {
+var DEFAULT_DATA_TRANSFORM = function DEFAULT_DATA_TRANSFORM(cell, column, index) {
return cell;
};
var DEFAULTS = Object.freeze({
maxWidth: Infinity,
minWidth: 0,
- columnSplitter: " ",
+ columnSplitter: ' ',
truncate: false,
- truncateMarker: "…",
+ truncateMarker: '…',
preserveNewLines: false,
- paddingChr: " ",
+ paddingChr: ' ',
showHeaders: true,
headingTransform: DEFAULT_HEADING_TRANSFORM,
dataTransform: DEFAULT_DATA_TRANSFORM
module.exports = function (items) {
var options = arguments[1] === undefined ? {} : arguments[1];
-
var columnConfigs = options.config || {};
delete options.config; // remove config so doesn't appear on every column.
var maxLineWidth = options.maxLineWidth || Infinity;
- if (maxLineWidth === "auto") maxLineWidth = process.stdout.columns || Infinity;
+ if (maxLineWidth === 'auto') maxLineWidth = process.stdout.columns || Infinity;
delete options.maxLineWidth; // this is a line control option, don't pass it to column
// Option defaults inheritance:
options.config = options.config || Object.create(null);
- options.spacing = options.spacing || "\n"; // probably useless
+ options.spacing = options.spacing || '\n'; // probably useless
options.preserveNewLines = !!options.preserveNewLines;
options.showHeaders = !!options.showHeaders;
options.columns = options.columns || options.include; // alias include/columns, prefer columns if supplied
column.maxWidth = Math.ceil(column.maxWidth);
column.minWidth = Math.ceil(column.minWidth);
column.truncate = !!column.truncate;
- column.align = column.align || "left";
+ column.align = column.align || 'left';
});
// sanitize data
var result = Object.create(null);
columnNames.forEach(function (columnName) {
// null/undefined -> ''
- result[columnName] = item[columnName] != null ? item[columnName] : "";
+ result[columnName] = item[columnName] != null ? item[columnName] : '';
// toString everything
- result[columnName] = "" + result[columnName];
+ result[columnName] = '' + result[columnName];
if (columns[columnName].preserveNewLines) {
// merge non-newline whitespace chars
- result[columnName] = result[columnName].replace(/[^\S\n]/gmi, " ");
+ result[columnName] = result[columnName].replace(/[^\S\n]/gmi, ' ');
} else {
// merge all whitespace chars
- result[columnName] = result[columnName].replace(/\s/gmi, " ");
+ result[columnName] = result[columnName].replace(/\s/gmi, ' ');
}
});
return result;
var changedKeys = Object.keys(col);
// disable default heading transform if we wrote to column.name
- if (changedKeys.indexOf("name") !== -1) {
+ if (changedKeys.indexOf('name') !== -1) {
if (column.headingTransform !== DEFAULT_HEADING_TRANSFORM) return;
column.headingTransform = function (heading) {
return heading;
if (options.showHeaders) {
columnNames.forEach(function (columnName) {
var column = columns[columnName];
+
+ if (!column.showHeaders) {
+ headers[columnName] = '';
+ return;
+ }
+
headers[columnName] = column.headingTransform(column.name);
});
items.unshift(headers);
}, 0);
});
-
var rows = createRows(items, columns, columnNames, options.paddingChr); // merge lines into rows
// conceive output
return rows.reduce(function (output, row) {
columnNames.forEach(function (columnName) {
numLines = Math.max(numLines, item[columnName].length);
});
+
+ var _loop = function (i) {
+ row[i] = row[i] || [];
+ columnNames.forEach(function (columnName) {
+ var column = columns[columnName];
+ var val = item[columnName][i] || ''; // || '' ensures empty columns get padded
+ if (column.align === 'right') row[i].push(padLeft(val, column.width, paddingChr));else if (column.align === 'center' || column.align === 'centre') row[i].push(padCenter(val, column.width, paddingChr));else row[i].push(padRight(val, column.width, paddingChr));
+ });
+ };
+
// combine matching lines of each rows
for (var i = 0; i < numLines; i++) {
- (function (i) {
- row[i] = row[i] || [];
- columnNames.forEach(function (columnName) {
- var column = columns[columnName];
- var val = item[columnName][i] || ""; // || '' ensures empty columns get padded
- if (column.align === "right") row[i].push(padLeft(val, column.width, paddingChr));else if (column.align === "center" || column.align === "centre") row[i].push(padCenter(val, column.width, paddingChr));else row[i].push(padRight(val, column.width, paddingChr));
- });
- })(i);
+ _loop(i);
}
return row;
});
args[_key] = arguments[_key];
}
- if (Object.assign) return Object.assign.apply(Object, _toArray(args));
- return ObjectAssign.apply(undefined, _toArray(args));
+ if (Object.assign) {
+ return Object.assign.apply(Object, _toConsumableArray(args));
+ }return ObjectAssign.apply(undefined, _toConsumableArray(args));
}
function ObjectAssign(target, firstSource) {
- "use strict";
- if (target === undefined || target === null) throw new TypeError("Cannot convert first argument to object");
+ 'use strict';
+ if (target === undefined || target === null) throw new TypeError('Cannot convert first argument to object');
var to = Object(target);
return lastIndex !== -1 && lastIndex === position;
}
-
function toArray(items, columnNames) {
- if (Array.isArray(items)) return items;
- var rows = [];
+ if (Array.isArray(items)) {
+ return items;
+ }var rows = [];
for (var key in items) {
var item = {};
- item[columnNames[0] || "key"] = key;
- item[columnNames[1] || "value"] = items[key];
+ item[columnNames[0] || 'key'] = key;
+ item[columnNames[1] || 'value'] = items[key];
rows.push(item);
}
return rows;
if(options.showHeaders) {
columnNames.forEach(columnName => {
let column = columns[columnName]
+
+ if(!column.showHeaders){
+ headers[columnName] = '';
+ return;
+ }
+
headers[columnName] = column.headingTransform(column.name)
})
items.unshift(headers)
+The MIT License (MIT)
-# child-process-close
-
-This module makes child process objects, (created with `spawn`, `fork`, `exec`
-or `execFile`) emit the `close` event in node v0.6 like they do in node v0.8.
-This makes it easier to write code that works correctly on both version of
-node.
-
-
-## Usage
-
-Just make sure to `require('child-process-close')` anywhere. It will patch the `child_process` module.
-
-```js
-require('child-process-close');
-var spawn = require('child_process').spawn;
-
-var cp = spawn('foo');
-cp.on('close', function(exitCode, signal) {
- // This now works on all node versions.
-});
-```
-
-
-## License
-
-Copyright (C) 2012 Bert Belder
+Copyright (c) 2015 Elijah Insua
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
## license
-MIT
\ No newline at end of file
+[MIT](LICENSE)
"tarball": "http://registry.npmjs.org/clone/-/clone-0.1.19.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.19.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.19.tgz"
}
{
"name": "defaults",
- "version": "1.0.0",
+ "version": "1.0.2",
"description": "merge single level defaults over a config object",
"main": "index.js",
"scripts": {
"email": "tmpvar@gmail.com"
},
"license": "MIT",
- "readmeFilename": "README.md",
"dependencies": {
"clone": "~0.1.5"
},
"devDependencies": {
"tap": "~0.4.0"
},
- "readme": "# defaults\n\nA simple one level options merge utility\n\n## install\n\n`npm install defaults`\n\n## use\n\n```javascript\n\nvar defaults = require('defaults');\n\nvar handle = function(options, fn) {\n options = defaults(options, {\n timeout: 100\n });\n\n setTimeout(function() {\n fn(options);\n }, options.timeout);\n}\n\nhandle({ timeout: 1000 }, function() {\n // we're here 1000 ms later\n});\n\nhandle({ timeout: 10000 }, function() {\n // we're here 10s later\n});\n\n```\n\n## summary\n\nthis module exports a function that takes 2 arguments: `options` and `defaults`. When called, it overrides all of `undefined` properties in `options` with the clones of properties defined in `defaults`\n\nSidecases: if called with a falsy `options` value, options will be initialized to a new object before being merged onto.\n\n## license\n\nMIT",
- "_id": "defaults@1.0.0",
- "dist": {
- "shasum": "3ae25f44416c6c01f9809a25fcdd285912d2a6b1",
- "tarball": "http://registry.npmjs.org/defaults/-/defaults-1.0.0.tgz"
+ "gitHead": "22c57d1f87a2f03c1f9d21bd39c67db8553a0064",
+ "bugs": {
+ "url": "https://github.com/tmpvar/defaults/issues"
},
- "_npmVersion": "1.1.65",
+ "homepage": "https://github.com/tmpvar/defaults",
+ "_id": "defaults@1.0.2",
+ "_shasum": "6902e25aa047649a501e19ef9e98f3e8365c109a",
+ "_from": "defaults@>=1.0.0 <2.0.0",
+ "_npmVersion": "1.4.23",
"_npmUser": {
"name": "tmpvar",
"email": "tmpvar@gmail.com"
"email": "tmpvar@gmail.com"
}
],
- "directories": {},
- "_shasum": "3ae25f44416c6c01f9809a25fcdd285912d2a6b1",
- "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.0.tgz",
- "_from": "defaults@>=1.0.0 <2.0.0",
- "bugs": {
- "url": "https://github.com/tmpvar/defaults/issues"
+ "dist": {
+ "shasum": "6902e25aa047649a501e19ef9e98f3e8365c109a",
+ "tarball": "http://registry.npmjs.org/defaults/-/defaults-1.0.2.tgz"
},
- "homepage": "https://github.com/tmpvar/defaults"
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.2.tgz"
}
"shasum": "02d059ff7a8fc741e0f6b5da1e69b2b40daeca6f",
"tarball": "http://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz"
},
- "_resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz"
}
{
"name": "columnify",
- "version": "1.4.1",
+ "version": "1.5.1",
"description": "Render data in text columns. supports in-column text-wrap.",
"main": "columnify.js",
"scripts": {
},
"license": "MIT",
"devDependencies": {
- "6to5": "^3.0.9",
- "chalk": "^0.5.1",
- "tap-spec": "^2.1.1",
- "tape": "^3.0.3"
+ "babel": "^5.0.10",
+ "chalk": "^1.0.0",
+ "tap-spec": "^3.0.0",
+ "tape": "^4.0.0"
},
"repository": {
"type": "git",
},
"homepage": "https://github.com/timoxley/columnify",
"dependencies": {
- "strip-ansi": "^2.0.0",
+ "strip-ansi": "^2.0.1",
"wcwidth": "^1.0.0"
},
"directories": {
"test": "test"
},
- "gitHead": "24371e9c12287ce4d28f19d704a28059f3acd42b",
- "_id": "columnify@1.4.1",
- "_shasum": "30555796379865b016189c228cb0061764270ed0",
- "_from": "columnify@>=1.4.1 <1.5.0",
- "_npmVersion": "2.3.0",
- "_nodeVersion": "0.10.35",
+ "gitHead": "1e5f5ec9478d7dbd1e3d1d74343b552da7ae01ba",
+ "_id": "columnify@1.5.1",
+ "_shasum": "15fdda803a3875f87f9d302b3bc828932d664003",
+ "_from": "columnify@>=1.5.1 <1.6.0",
+ "_npmVersion": "2.7.6",
+ "_nodeVersion": "0.10.36",
"_npmUser": {
"name": "timoxley",
"email": "secoif@gmail.com"
}
],
"dist": {
- "shasum": "30555796379865b016189c228cb0061764270ed0",
- "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.4.1.tgz"
+ "shasum": "15fdda803a3875f87f9d302b3bc828932d664003",
+ "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.5.1.tgz"
},
- "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.4.1.tgz"
+ "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.1.tgz"
}
exports.alphasort = alphasort
exports.alphasorti = alphasorti
-exports.isAbsolute = process.platform === "win32" ? absWin : absUnix
exports.setopts = setopts
exports.ownProp = ownProp
exports.makeAbs = makeAbs
var path = require("path")
var minimatch = require("minimatch")
+var isAbsolute = require("path-is-absolute")
var Minimatch = minimatch.Minimatch
-function absWin (p) {
- if (absUnix(p)) return true
- // pull off the device/UNC bit from a windows path.
- // from node's lib/path.js
- var splitDeviceRe =
- /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/
- var result = splitDeviceRe.exec(p)
- var device = result[1] || ''
- var isUnc = device && device.charAt(1) !== ':'
- var isAbsolute = !!result[2] || isUnc // UNC paths are always absolute
-
- return isAbsolute
-}
-
-function absUnix (p) {
- return p.charAt(0) === "/" || p === ""
-}
-
function alphasorti (a, b) {
return a.toLowerCase().localeCompare(b.toLowerCase())
}
var abs = f
if (f.charAt(0) === '/') {
abs = path.join(self.root, f)
- } else if (exports.isAbsolute(f)) {
+ } else if (isAbsolute(f) || f === '') {
abs = f
} else if (self.changedCwd) {
abs = path.resolve(self.cwd, f)
var EE = require('events').EventEmitter
var path = require('path')
var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
var globSync = require('./sync.js')
var common = require('./common.js')
var alphasort = common.alphasort
var alphasorti = common.alphasorti
-var isAbsolute = common.isAbsolute
var setopts = common.setopts
var ownProp = common.ownProp
var inflight = require('inflight')
--- /dev/null
+'use strict';
+
+function posix(path) {
+ return path.charAt(0) === '/';
+};
+
+function win32(path) {
+ // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
+ var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
+ var result = splitDeviceRe.exec(path);
+ var device = result[1] || '';
+ var isUnc = !!device && device.charAt(1) !== ':';
+
+ // UNC paths are always absolute
+ return !!result[2] || isUnc;
+};
+
+module.exports = process.platform === 'win32' ? win32 : posix;
+module.exports.posix = posix;
+module.exports.win32 = win32;
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
--- /dev/null
+{
+ "name": "path-is-absolute",
+ "version": "1.0.0",
+ "description": "Node.js 0.12 path.isAbsolute() ponyfill",
+ "license": "MIT",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/sindresorhus/path-is-absolute"
+ },
+ "author": {
+ "name": "Sindre Sorhus",
+ "email": "sindresorhus@gmail.com",
+ "url": "sindresorhus.com"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "node test.js"
+ },
+ "files": [
+ "index.js"
+ ],
+ "keywords": [
+ "path",
+ "paths",
+ "file",
+ "dir",
+ "absolute",
+ "isabsolute",
+ "is-absolute",
+ "built-in",
+ "util",
+ "utils",
+ "core",
+ "ponyfill",
+ "polyfill",
+ "shim",
+ "is",
+ "detect",
+ "check"
+ ],
+ "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1",
+ "bugs": {
+ "url": "https://github.com/sindresorhus/path-is-absolute/issues"
+ },
+ "homepage": "https://github.com/sindresorhus/path-is-absolute",
+ "_id": "path-is-absolute@1.0.0",
+ "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+ "_from": "path-is-absolute@>=1.0.0 <2.0.0",
+ "_npmVersion": "2.5.1",
+ "_nodeVersion": "0.12.0",
+ "_npmUser": {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ },
+ "maintainers": [
+ {
+ "name": "sindresorhus",
+ "email": "sindresorhus@gmail.com"
+ }
+ ],
+ "dist": {
+ "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+ "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz"
+ },
+ "directories": {},
+ "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz"
+}
--- /dev/null
+# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)
+
+> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill
+
+> Ponyfill: A polyfill that doesn't overwrite the native method
+
+
+## Install
+
+```
+$ npm install --save path-is-absolute
+```
+
+
+## Usage
+
+```js
+var pathIsAbsolute = require('path-is-absolute');
+
+// Linux
+pathIsAbsolute('/home/foo');
+//=> true
+
+// Windows
+pathIsAbsolute('C:/Users/');
+//=> true
+
+// Any OS
+pathIsAbsolute.posix('/home/foo');
+//=> true
+```
+
+
+## API
+
+See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).
+
+### pathIsAbsolute(path)
+
+### pathIsAbsolute.posix(path)
+
+The Posix specific version.
+
+### pathIsAbsolute.win32(path)
+
+The Windows specific version.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
},
"name": "glob",
"description": "a little globber",
- "version": "5.0.3",
+ "version": "5.0.5",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-glob.git"
"inflight": "^1.0.4",
"inherits": "2",
"minimatch": "^2.0.1",
- "once": "^1.3.0"
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
},
"devDependencies": {
"mkdirp": "0",
"benchclean": "bash benchclean.sh"
},
"license": "ISC",
- "gitHead": "2f63d487885fbb51ec8fcb21229bebd0e515c3fb",
+ "gitHead": "9db1a83b44da0c60f5fdd31b28b1f9917ee6316d",
"bugs": {
"url": "https://github.com/isaacs/node-glob/issues"
},
"homepage": "https://github.com/isaacs/node-glob",
- "_id": "glob@5.0.3",
- "_shasum": "15528c1c727e474a8e7731541c00b00ec802952d",
- "_from": "glob@>=5.0.3 <5.1.0",
- "_npmVersion": "2.7.1",
+ "_id": "glob@5.0.5",
+ "_shasum": "784431e4e29a900ae0d47fba6aa1c7f16a8e7df7",
+ "_from": "glob@>=5.0.5 <5.1.0",
+ "_npmVersion": "2.7.6",
"_nodeVersion": "1.4.2",
"_npmUser": {
"name": "isaacs",
}
],
"dist": {
- "shasum": "15528c1c727e474a8e7731541c00b00ec802952d",
- "tarball": "http://registry.npmjs.org/glob/-/glob-5.0.3.tgz"
+ "shasum": "784431e4e29a900ae0d47fba6aa1c7f16a8e7df7",
+ "tarball": "http://registry.npmjs.org/glob/-/glob-5.0.5.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/glob/-/glob-5.0.3.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/glob/-/glob-5.0.5.tgz"
}
var util = require('util')
var path = require('path')
var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
var common = require('./common.js')
var alphasort = common.alphasort
var alphasorti = common.alphasorti
-var isAbsolute = common.isAbsolute
var setopts = common.setopts
var ownProp = common.ownProp
var childrenIgnored = common.childrenIgnored
* info.https()
-eg, `https://github.com/npm/hosted-git-info.git`
+eg, `git+https://github.com/npm/hosted-git-info.git`
* info.sshurl()
eg, `npm/hosted-git-info`
+* info.getDefaultRepresentation()
+
+Returns the default output type. The default output type is based on the
+string you passed in to be parsed
+
+* info.toString()
+
+Uses the getDefaultRepresentation to call one of the other methods to get a URL for
+this resource. As such `hostedGitInfo.fromUrl(url).toString()` will give
+you a normalized version of the URL that still uses the same protocol.
+
+Shortcuts will still be returned as shortcuts, but the special case github
+form of `org/project` will be normalized to `github:org/project`.
+
+SSH connect strings will be normalized into `git+ssh` URLs.
+
+
## Supported hosts
Currently this supports Github, Bitbucket and Gitlab. Pull requests for
--- /dev/null
+'use strict'
+
+var gitHosts = module.exports = {
+ github: {
+ // First two are insecure and generally shouldn't be used any more, but
+ // they are still supported.
+ 'protocols': [ 'git', 'http', 'git+ssh', 'git+https', 'ssh', 'https' ],
+ 'domain': 'github.com',
+ 'treepath': 'tree',
+ 'filetemplate': 'https://{auth@}raw.githubusercontent.com/{user}/{project}/{comittish}/{path}',
+ 'bugstemplate': 'https://{domain}/{user}/{project}/issues',
+ 'gittemplate': 'git://{auth@}{domain}/{user}/{project}.git{#comittish}'
+ },
+ bitbucket: {
+ 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ],
+ 'domain': 'bitbucket.org',
+ 'treepath': 'src'
+ },
+ gitlab: {
+ 'protocols': [ 'git+ssh', 'git+https', 'ssh', 'https' ],
+ 'domain': 'gitlab.com',
+ 'treepath': 'tree',
+ 'docstemplate': 'https://{domain}/{user}/{project}{/tree/comittish}#README',
+ 'bugstemplate': 'https://{domain}/{user}/{project}/issues'
+ },
+ gist: {
+ 'protocols': [ 'git', 'git+ssh', 'git+https', 'ssh', 'https' ],
+ 'domain': 'gist.github.com',
+ 'pathmatch': /^[/](?:([^/]+)[/])?([a-z0-9]+)(?:[.]git)?$/,
+ 'filetemplate': 'https://gist.githubusercontent.com/{user}/{project}/raw{/comittish}/{path}',
+ 'bugstemplate': 'https://{domain}/{project}',
+ 'gittemplate': 'git://{domain}/{project}.git{#comittish}',
+ 'sshtemplate': 'git@{domain}:/{project}.git{#comittish}',
+ 'sshurltemplate': 'git+ssh://git@{domain}/{project}.git{#comittish}',
+ 'browsetemplate': 'https://{domain}/{project}{/comittish}',
+ 'docstemplate': 'https://{domain}/{project}{/comittish}',
+ 'httpstemplate': 'git+https://{domain}/{project}.git{#comittish}',
+ 'shortcuttemplate': '{type}:{project}{#comittish}',
+ 'pathtemplate': '{project}{#comittish}'
+ }
+}
+
+var gitHostDefaults = {
+ 'sshtemplate': 'git@{domain}:{user}/{project}.git{#comittish}',
+ 'sshurltemplate': 'git+ssh://git@{domain}/{user}/{project}.git{#comittish}',
+ 'browsetemplate': 'https://{domain}/{user}/{project}{/tree/comittish}',
+ 'docstemplate': 'https://{domain}/{user}/{project}{/tree/comittish}#readme',
+ 'httpstemplate': 'git+https://{auth@}{domain}/{user}/{project}.git{#comittish}',
+ 'filetemplate': 'https://{domain}/{user}/{project}/raw/{comittish}/{path}',
+ 'shortcuttemplate': '{type}:{user}/{project}{#comittish}',
+ 'pathtemplate': '{user}/{project}{#comittish}',
+ 'pathmatch': /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/
+}
+
+Object.keys(gitHosts).forEach(function (name) {
+ Object.keys(gitHostDefaults).forEach(function (key) {
+ if (gitHosts[name][key]) return
+ gitHosts[name][key] = gitHostDefaults[key]
+ })
+ gitHosts[name].protocols_re = RegExp('^(' +
+ gitHosts[name].protocols.map(function (protocol) {
+ return protocol.replace(/([\\+*{}()\[\]$^|])/g, '\\$1')
+ }).join('|') + '):$')
+})
--- /dev/null
+'use strict'
+var gitHosts = require('./git-host-info.js')
+
+var GitHost = module.exports = function (type, user, auth, project, comittish, defaultRepresentation) {
+ var gitHostInfo = this
+ gitHostInfo.type = type
+ Object.keys(gitHosts[type]).forEach(function (key) {
+ gitHostInfo[key] = gitHosts[type][key]
+ })
+ gitHostInfo.user = user
+ gitHostInfo.auth = auth
+ gitHostInfo.project = project
+ gitHostInfo.comittish = comittish
+ gitHostInfo.default = defaultRepresentation
+}
+GitHost.prototype = {}
+
+GitHost.prototype.hash = function () {
+ return this.comittish ? '#' + this.comittish : ''
+}
+
+GitHost.prototype._fill = function (template, vars) {
+ if (!template) return
+ if (!vars) vars = {}
+ var self = this
+ Object.keys(this).forEach(function (key) {
+ if (self[key] != null && vars[key] == null) vars[key] = self[key]
+ })
+ var rawAuth = vars.auth
+ var rawComittish = vars.comittish
+ Object.keys(vars).forEach(function (key) {
+ vars[key] = encodeURIComponent(vars[key])
+ })
+ vars['auth@'] = rawAuth ? rawAuth + '@' : ''
+ vars['#comittish'] = rawComittish ? '#' + rawComittish : ''
+ vars['/tree/comittish'] = vars.comittish
+ ? '/' + vars.treepath + '/' + vars.comittish
+ : ''
+ vars['/comittish'] = vars.comittish ? '/' + vars.comittish : ''
+ vars.comittish = vars.comittish || 'master'
+ var res = template
+ Object.keys(vars).forEach(function (key) {
+ res = res.replace(new RegExp('[{]' + key + '[}]', 'g'), vars[key])
+ })
+ return res
+}
+
+GitHost.prototype.ssh = function () {
+ return this._fill(this.sshtemplate)
+}
+
+GitHost.prototype.sshurl = function () {
+ return this._fill(this.sshurltemplate)
+}
+
+GitHost.prototype.browse = function () {
+ return this._fill(this.browsetemplate)
+}
+
+GitHost.prototype.docs = function () {
+ return this._fill(this.docstemplate)
+}
+
+GitHost.prototype.bugs = function () {
+ return this._fill(this.bugstemplate)
+}
+
+GitHost.prototype.https = function () {
+ return this._fill(this.httpstemplate)
+}
+
+GitHost.prototype.git = function () {
+ return this._fill(this.gittemplate)
+}
+
+GitHost.prototype.shortcut = function () {
+ return this._fill(this.shortcuttemplate)
+}
+
+GitHost.prototype.path = function () {
+ return this._fill(this.pathtemplate)
+}
+
+GitHost.prototype.file = function (P) {
+ return this._fill(this.filetemplate, {
+ path: P.replace(/^[/]+/g, '')
+ })
+}
+
+GitHost.prototype.getDefaultRepresentation = function () {
+ return this.default
+}
+
+GitHost.prototype.toString = function () {
+ return (this[this.default] || this.sshurl).call(this)
+}
-"use strict"
-var url = require("url")
-
-var GitHost = exports = module.exports = function (type, user, project, comittish) {
- this.type = type
- this.domain = gitHosts[type].domain
- this.filetemplate = gitHosts[type].filetemplate
- this.sshtemplate = gitHosts[type].sshtemplate
- this.sshurltemplate = gitHosts[type].sshurltemplate
- this.browsetemplate = gitHosts[type].browsetemplate
- this.docstemplate = gitHosts[type].docstemplate
- this.bugstemplate = gitHosts[type].bugstemplate
- this.gittemplate = gitHosts[type].gittemplate
- this.httpstemplate = gitHosts[type].httpstemplate
- this.treepath = gitHosts[type].treepath
- this.user = user
- this.project = project
- this.comittish = comittish
-}
-GitHost.prototype = {}
-
-exports.fromUrl = function (giturl) {
- if (giturl == null || giturl == "") return
- var parsed = parseGitUrl(maybeGitHubShorthand(giturl) ? "github:" + giturl : giturl)
- var matches = Object.keys(gitHosts).map(function(V) {
- var gitHost = gitHosts[V]
+'use strict'
+var url = require('url')
+var gitHosts = require('./git-host-info.js')
+var GitHost = module.exports = require('./git-host.js')
+
+var protocolToRepresentationMap = {
+ 'git+ssh': 'sshurl',
+ 'git+https': 'https',
+ 'ssh': 'sshurl',
+ 'git': 'git'
+}
+
+function protocolToRepresentation (protocol) {
+ if (protocol.substr(-1) === ':') protocol = protocol.slice(0, -1)
+ return protocolToRepresentationMap[protocol] || protocol
+}
+
+var authProtocols = {
+ 'git:': true,
+ 'https:': true,
+ 'git+https:': true,
+ 'http:': true,
+ 'git+http:': true
+}
+
+module.exports.fromUrl = function (giturl) {
+ if (giturl == null || giturl === '') return
+ var url = fixupUnqualifiedGist(
+ isGitHubShorthand(giturl) ? 'github:' + giturl : giturl
+ )
+ var parsed = parseGitUrl(url)
+ var matches = Object.keys(gitHosts).map(function (gitHostName) {
+ var gitHostInfo = gitHosts[gitHostName]
+ var auth = null
+ if (parsed.auth && authProtocols[parsed.protocol]) {
+ auth = decodeURIComponent(parsed.auth)
+ }
var comittish = parsed.hash ? decodeURIComponent(parsed.hash.substr(1)) : null
- if (parsed.protocol == V + ":") {
- return new GitHost(V,
- decodeURIComponent(parsed.host), decodeURIComponent(parsed.path.replace(/^[/](.*?)(?:[.]git)?$/, "$1")), comittish)
+ var user = null
+ var project = null
+ var defaultRepresentation = null
+ if (parsed.protocol === gitHostName + ':') {
+ user = decodeURIComponent(parsed.host)
+ project = parsed.path && decodeURIComponent(parsed.path.replace(/^[/](.*?)(?:[.]git)?$/, '$1'))
+ defaultRepresentation = 'shortcut'
+ } else {
+ if (parsed.host !== gitHostInfo.domain) return
+ if (!gitHostInfo.protocols_re.test(parsed.protocol)) return
+ var pathmatch = gitHostInfo.pathmatch
+ var matched = parsed.path.match(pathmatch)
+ if (!matched) return
+ if (matched[1] != null) user = decodeURIComponent(matched[1])
+ if (matched[2] != null) project = decodeURIComponent(matched[2])
+ defaultRepresentation = protocolToRepresentation(parsed.protocol)
}
- if (parsed.host != gitHost.domain) return
- if (! gitHost.protocols_re.test(parsed.protocol)) return
- var matched = parsed.path.match(gitHost.pathmatch)
- if (! matched) return
- return new GitHost(
- V,
- matched[1]!=null && decodeURIComponent(matched[1]),
- matched[2]!=null && decodeURIComponent(matched[2]),
- comittish)
- }).filter(function(V){ return V })
- if (matches.length != 1) return
+ return new GitHost(gitHostName, user, auth, project, comittish, defaultRepresentation)
+ }).filter(function (gitHostInfo) { return gitHostInfo })
+ if (matches.length !== 1) return
return matches[0]
}
-function maybeGitHubShorthand(arg) {
+function isGitHubShorthand (arg) {
// Note: This does not fully test the git ref format.
// See https://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html
//
return /^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(arg)
}
-var parseGitUrl = function (giturl) {
- if (typeof giturl != "string") giturl = "" + giturl
+function fixupUnqualifiedGist (giturl) {
+ // necessary for round-tripping gists
+ var parsed = url.parse(giturl)
+ if (parsed.protocol === 'gist:' && parsed.host && !parsed.path) {
+ return parsed.protocol + '/' + parsed.host
+ } else {
+ return giturl
+ }
+}
+
+function parseGitUrl (giturl) {
+ if (typeof giturl !== 'string') giturl = '' + giturl
var matched = giturl.match(/^([^@]+)@([^:]+):[/]?((?:[^/]+[/])?[^/]+?)(?:[.]git)?(#.*)?$/)
- if (! matched) return url.parse(giturl)
+ if (!matched) return url.parse(giturl)
return {
- protocol: "git+ssh:",
+ protocol: 'git+ssh:',
slashes: true,
auth: matched[1],
host: matched[2],
hash: matched[4],
search: null,
query: null,
- pathname: "/" + matched[3],
- path: "/" + matched[3],
- href: "git+ssh://" + matched[1] + "@" + matched[2] + "/" + matched[3] + (matched[4]||"")
+ pathname: '/' + matched[3],
+ path: '/' + matched[3],
+ href: 'git+ssh://' + matched[1] + '@' + matched[2] +
+ '/' + matched[3] + (matched[4] || '')
}
}
-
-var gitHostDefaults = {
- "sshtemplate": "git@{domain}:{user}/{project}.git{#comittish}",
- "sshurltemplate": "git+ssh://git@{domain}/{user}/{project}.git{#comittish}",
- "browsetemplate": "https://{domain}/{user}/{project}{/tree/comittish}",
- "docstemplate": "https://{domain}/{user}/{project}{/tree/comittish}#readme",
- "httpstemplate": "https://{domain}/{user}/{project}.git{#comittish}",
- "filetemplate": "https://{domain}/{user}/{project}/raw/{comittish}/{path}"
-}
-var gitHosts = {
- github: {
- // First two are insecure and generally shouldn't be used any more, but
- // they are still supported.
- "protocols": [ "git", "http", "git+ssh", "git+https", "ssh", "https" ],
- "domain": "github.com",
- "pathmatch": /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/,
- "treepath": "tree",
- "filetemplate": "https://raw.githubusercontent.com/{user}/{project}/{comittish}/{path}",
- "bugstemplate": "https://{domain}/{user}/{project}/issues",
- "gittemplate": "git://{domain}/{user}/{project}.git{#comittish}"
- },
- bitbucket: {
- "protocols": [ "git+ssh", "git+https", "ssh", "https" ],
- "domain": "bitbucket.org",
- "pathmatch": /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/,
- "treepath": "src"
- },
- gitlab: {
- "protocols": [ "git+ssh", "git+https", "ssh", "https" ],
- "domain": "gitlab.com",
- "pathmatch": /^[/]([^/]+)[/]([^/]+?)(?:[.]git)?$/,
- "treepath": "tree",
- "docstemplate": "https://{domain}/{user}/{project}{/tree/comittish}#README",
- "bugstemplate": "https://{domain}/{user}/{project}/issues"
- },
- gist: {
- "protocols": [ "git", "git+ssh", "git+https", "ssh", "https" ],
- "domain": "gist.github.com",
- "pathmatch": /^[/](?:([^/]+)[/])?([a-z0-9]+)(?:[.]git)?$/,
- "filetemplate": "https://gist.githubusercontent.com/{user}/{project}/raw{/comittish}/{path}",
- "bugstemplate": "https://{domain}/{project}",
- "gittemplate": "git://{domain}/{project}.git{#comittish}",
- "sshtemplate": "git@{domain}:/{project}.git{#comittish}",
- "sshurltemplate": "git+ssh://git@{domain}/{project}.git{#comittish}",
- "browsetemplate": "https://{domain}/{project}{/comittish}",
- "docstemplate": "https://{domain}/{project}{/comittish}",
- "httpstemplate": "https://{domain}/{project}.git{#comittish}",
- },
-}
-
-Object.keys(gitHosts).forEach(function(host) {
- gitHosts[host].protocols_re = RegExp("^(" +
- gitHosts[host].protocols.map(function(P){
- return P.replace(/([\\+*{}()\[\]$^|])/g, "\\$1")
- }).join("|") + "):$")
-})
-
-GitHost.prototype.shortcut = function () {
- return this.type + ":" + this.path()
-}
-
-GitHost.prototype.hash = function () {
- return this.comittish ? "#" + this.comittish : ""
-}
-
-GitHost.prototype.path = function () {
- return this.user + "/" + this.project + this.hash()
-}
-
-GitHost.prototype._fill = function (template, vars) {
- if (!template) throw new Error("Tried to fill without template")
- if (!vars) vars = {}
- var self = this
- Object.keys(this).forEach(function(K){ if (self[K]!=null && vars[K]==null) vars[K] = self[K] })
- var rawComittish = vars.comittish
- Object.keys(vars).forEach(function(K){ (K[0]!='#') && (vars[K] = encodeURIComponent(vars[K])) })
- vars["#comittish"] = rawComittish ? "#" + rawComittish : ""
- vars["/tree/comittish"] = vars.comittish ? "/"+vars.treepath+"/" + vars.comittish : "",
- vars["/comittish"] = vars.comittish ? "/" + vars.comittish : ""
- vars.comittish = vars.comittish || "master"
- var res = template
- Object.keys(vars).forEach(function(K){
- res = res.replace(new RegExp("[{]" + K + "[}]", "g"), vars[K])
- })
- return res
-}
-
-GitHost.prototype.ssh = function () {
- var sshtemplate = this.sshtemplate || gitHostDefaults.sshtemplate
- return this._fill(sshtemplate)
-}
-
-GitHost.prototype.sshurl = function () {
- var sshurltemplate = this.sshurltemplate || gitHostDefaults.sshurltemplate
- return this._fill(sshurltemplate)
-}
-
-GitHost.prototype.browse = function () {
- var browsetemplate = this.browsetemplate || gitHostDefaults.browsetemplate
- return this._fill(browsetemplate)
-}
-
-GitHost.prototype.docs = function () {
- var docstemplate = this.docstemplate || gitHostDefaults.docstemplate
- return this._fill(docstemplate)
-}
-
-GitHost.prototype.bugs = function() {
- if (! this.bugstemplate) return
- return this._fill(this.bugstemplate)
-}
-
-GitHost.prototype.https = function () {
- var httpstemplate = this.httpstemplate || gitHostDefaults.httpstemplate
- return this._fill(httpstemplate)
-}
-
-GitHost.prototype.git = function () {
- if (! this.gittemplate) return
- return this._fill(this.gittemplate)
-}
-
-GitHost.prototype.file = function (P) {
- var filetemplate = this.filetemplate || gitHostDefaults.filetemplate
- return this._fill(filetemplate, {
- path: P.replace(/^[/]+/g, "")
- })
-}
-
-GitHost.prototype.toString = function () {
- return this[this.default||"sshurl"]()
-}
{
"name": "hosted-git-info",
- "version": "1.5.3",
+ "version": "2.1.2",
"description": "Provides metadata and conversions from repository urls for Github, Bitbucket and Gitlab",
"main": "index.js",
"repository": {
},
"homepage": "https://github.com/npm/hosted-git-info",
"scripts": {
- "test": "tap test/*.js"
+ "test": "standard && tap test/*.js"
},
"devDependencies": {
+ "standard": "^3.3.2",
"tap": "^0.4.13"
},
- "gitHead": "153325f997813ebf8a7ae07b322b4fa89aa25f7d",
- "_id": "hosted-git-info@1.5.3",
- "_shasum": "1f46e25e9c0e207852fb7a4b94422ed5f09a03f5",
- "_from": "hosted-git-info@>=1.5.3 <1.6.0",
- "_npmVersion": "2.4.0",
- "_nodeVersion": "0.10.33",
- "_npmUser": {
- "name": "iarna",
- "email": "me@re-becca.org"
- },
- "maintainers": [
- {
- "name": "iarna",
- "email": "me@re-becca.org"
- }
- ],
- "dist": {
- "shasum": "1f46e25e9c0e207852fb7a4b94422ed5f09a03f5",
- "tarball": "http://registry.npmjs.org/hosted-git-info/-/hosted-git-info-1.5.3.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-1.5.3.tgz",
- "readme": "ERROR: No README data found!"
+ "readme": "# hosted-git-info\n\nThis will let you identify and transform various git hosts URLs between\nprotocols. It also can tell you what the URL is for the raw path for\nparticular file for direct access without git.\n\n## Usage\n\n```javascript\nvar hostedGitInfo = require(\"hosted-git-info\")\nvar info = hostedGitInfo.fromUrl(\"git@github.com:npm/hosted-git-info.git\")\n/* info looks like:\n{\n type: \"github\",\n domain: \"github.com\",\n user: \"npm\",\n project: \"hosted-git-info\"\n}\n*/\n```\n\nIf the URL can't be matched with a git host, `null` will be returned. We\ncan match git, ssh and https urls. Additionally, we can match ssh connect\nstrings (`git@github.com:npm/hosted-git-info`) and shortcuts (eg,\n`github:npm/hosted-git-info`). Github specifically, is detected in the case\nof a third, unprefixed, form: `npm/hosted-git-info`.\n\nIf it does match, the returned object has properties of:\n\n* info.type -- The short name of the service\n* info.domain -- The domain for git protocol use\n* info.user -- The name of the user/org on the git host\n* info.project -- The name of the project on the git host\n\nAnd methods of:\n\n* info.file(path)\n\nGiven the path of a file relative to the repository, returns a URL for\ndirectly fetching it from the githost. If no comittish was set then\n`master` will be used as the default.\n\nFor example `hostedGitInfo.fromUrl(\"git@github.com:npm/hosted-git-info.git#v1.0.0\").file(\"package.json\")`\nwould return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json`\n\n* info.shortcut()\n\neg, `github:npm/hosted-git-info`\n\n* info.browse()\n\neg, `https://github.com/npm/hosted-git-info/tree/v1.2.0`\n\n* info.bugs()\n\neg, `https://github.com/npm/hosted-git-info/issues`\n\n* info.docs()\n\neg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme`\n\n* info.https()\n\neg, `git+https://github.com/npm/hosted-git-info.git`\n\n* info.sshurl()\n\neg, `git+ssh://git@github.com/npm/hosted-git-info.git`\n\n* info.ssh()\n\neg, `git@github.com:npm/hosted-git-info.git`\n\n* info.path()\n\neg, `npm/hosted-git-info`\n\n* info.getDefaultRepresentation()\n\nReturns the default output type. The default output type is based on the\nstring you passed in to be parsed\n\n* info.toString()\n\nUses the getDefaultRepresentation to call one of the other methods to get a URL for\nthis resource. As such `hostedGitInfo.fromUrl(url).toString()` will give\nyou a normalized version of the URL that still uses the same protocol.\n\nShortcuts will still be returned as shortcuts, but the special case github\nform of `org/project` will be normalized to `github:org/project`.\n\nSSH connect strings will be normalized into `git+ssh` URLs.\n\n\n## Supported hosts\n\nCurrently this supports Github, Bitbucket and Gitlab. Pull requests for\nadditional hosts welcome.\n\n",
+ "readmeFilename": "README.md",
+ "gitHead": "9f24fee147bb76595e234b7556ecc9d0448215fa",
+ "_id": "hosted-git-info@2.1.2",
+ "_shasum": "f947976852931851c33644bbce80d1e499795246",
+ "_from": "hosted-git-info@>=2.1.2 <2.2.0"
}
-"use strict"
-var HostedGit = require("../index")
-var test = require("tap").test
+'use strict'
+var HostedGit = require('../index')
+var test = require('tap').test
-test("basic", function (t) {
- t.is(HostedGit.fromUrl("https://google.com"), undefined, "null on failure")
-
- t.end()
+test('basic', function (t) {
+ t.is(HostedGit.fromUrl('https://google.com'), undefined, 'null on failure')
+ t.is(HostedGit.fromUrl('https://github.com/abc/def').getDefaultRepresentation(), 'https', 'match https urls')
+ t.is(HostedGit.fromUrl('ssh://git@github.com/abc/def').getDefaultRepresentation(), 'sshurl', 'match ssh urls')
+ t.is(HostedGit.fromUrl('git+ssh://git@github.com/abc/def').getDefaultRepresentation(), 'sshurl', 'match git+ssh urls')
+ t.is(HostedGit.fromUrl('git+https://github.com/abc/def').getDefaultRepresentation(), 'https', 'match git+https urls')
+ t.is(HostedGit.fromUrl('git@github.com:abc/def').getDefaultRepresentation(), 'sshurl', 'match ssh connect strings')
+ t.is(HostedGit.fromUrl('git://github.com/abc/def').getDefaultRepresentation(), 'git', 'match git urls')
+ t.is(HostedGit.fromUrl('github:abc/def').getDefaultRepresentation(), 'shortcut', 'match shortcuts')
+ t.end()
})
--- /dev/null
+'use strict'
+var HostedGit = require('../index')
+var test = require('tap').test
+
+test('Bitbucket HTTPS URLs with embedded auth', function (t) {
+ t.is(
+ HostedGit.fromUrl('https://user:pass@bitbucket.org/user/repo.git').toString(),
+ 'git+https://user:pass@bitbucket.org/user/repo.git',
+ 'credentials were included in URL'
+ )
+ t.is(
+ HostedGit.fromUrl('https://user:pass@bitbucket.org/user/repo').toString(),
+ 'git+https://user:pass@bitbucket.org/user/repo.git',
+ 'credentials were included in URL'
+ )
+ t.is(
+ HostedGit.fromUrl('git+https://user:pass@bitbucket.org/user/repo.git').toString(),
+ 'git+https://user:pass@bitbucket.org/user/repo.git',
+ 'credentials were included in URL'
+ )
+ t.is(
+ HostedGit.fromUrl('git+https://user:pass@bitbucket.org/user/repo').toString(),
+ 'git+https://user:pass@bitbucket.org/user/repo.git',
+ 'credentials were included in URL'
+ )
+ t.end()
+})
-"use strict"
-var HostedGit = require("../index")
-var test = require("tap").test
+'use strict'
+var HostedGit = require('../index')
+var test = require('tap').test
-test("fromUrl(bitbucket url)", function (t) {
- function verify(host, label, branch) {
+test('fromUrl(bitbucket url)', function (t) {
+ function verify (host, label, branch) {
var hostinfo = HostedGit.fromUrl(host)
- var hash = branch ? "#" + branch : ""
+ var hash = branch ? '#' + branch : ''
t.ok(hostinfo, label)
- if (! hostinfo) return
- t.is( hostinfo.https(), "https://bitbucket.org/111/222.git" + hash, label + " -> https" )
- t.is( hostinfo.browse(), "https://bitbucket.org/111/222" + (branch ? "/src/" + branch : ""), label + " -> browse" )
- t.is( hostinfo.docs(), "https://bitbucket.org/111/222" + (branch ? "/src/" + branch : "") + "#readme", label + " -> docs" )
- t.is( hostinfo.ssh(), "git@bitbucket.org:111/222.git" + hash, label + " -> ssh" )
- t.is( hostinfo.sshurl(), "git+ssh://git@bitbucket.org/111/222.git" + hash, label + " -> sshurl" )
- t.is( (""+hostinfo), "git+ssh://git@bitbucket.org/111/222.git" + hash, label + " -> stringify" )
- t.is( hostinfo.file("C"), "https://bitbucket.org/111/222/raw/"+(branch||"master")+"/C", label + " -> file" )
+ if (!hostinfo) return
+ t.is(hostinfo.https(), 'git+https://bitbucket.org/111/222.git' + hash, label + ' -> https')
+ t.is(hostinfo.browse(), 'https://bitbucket.org/111/222' + (branch ? '/src/' + branch : ''), label + ' -> browse')
+ t.is(hostinfo.docs(), 'https://bitbucket.org/111/222' + (branch ? '/src/' + branch : '') + '#readme', label + ' -> docs')
+ t.is(hostinfo.ssh(), 'git@bitbucket.org:111/222.git' + hash, label + ' -> ssh')
+ t.is(hostinfo.sshurl(), 'git+ssh://git@bitbucket.org/111/222.git' + hash, label + ' -> sshurl')
+ t.is(hostinfo.shortcut(), 'bitbucket:111/222' + hash, label + ' -> shortcut')
+ t.is(hostinfo.file('C'), 'https://bitbucket.org/111/222/raw/' + (branch || 'master') + '/C', label + ' -> file')
}
- require('./lib/standard-tests')(verify, "bitbucket.org", "bitbucket")
+ require('./lib/standard-tests')(verify, 'bitbucket.org', 'bitbucket')
t.end()
})
-"use strict"
-var HostedGit = require("../index")
-var test = require("tap").test
+'use strict'
+var HostedGit = require('../index')
+var test = require('tap').test
-
-test("fromUrl(gist url)", function (t) {
- function verify(host, label, branch) {
+test('fromUrl(gist url)', function (t) {
+ function verify (host, label, branch) {
var hostinfo = HostedGit.fromUrl(host)
- var hash = branch ? "#" + branch : ""
+ var hash = branch ? '#' + branch : ''
t.ok(hostinfo, label)
- if (! hostinfo) return
- t.is( hostinfo.https(), "https://gist.github.com/222.git" + hash, label + " -> https" )
- t.is( hostinfo.git(), "git://gist.github.com/222.git" + hash, label + " -> git" )
- t.is( hostinfo.browse(), "https://gist.github.com/222" + (branch ? "/" + branch : ""), label + " -> browse" )
- t.is( hostinfo.bugs(), "https://gist.github.com/222", label + " -> bugs" )
- t.is( hostinfo.docs(), "https://gist.github.com/222" + (branch ? "/" + branch : ""), label + " -> docs" )
- t.is( hostinfo.ssh(), "git@gist.github.com:/222.git" + hash, label + " -> ssh" )
- t.is( hostinfo.sshurl(), "git+ssh://git@gist.github.com/222.git" + hash, label + " -> sshurl" )
- t.is( (""+hostinfo), "git+ssh://git@gist.github.com/222.git" + hash, label + " -> stringify" )
+ if (!hostinfo) return
+ t.is(hostinfo.https(), 'git+https://gist.github.com/222.git' + hash, label + ' -> https')
+ t.is(hostinfo.git(), 'git://gist.github.com/222.git' + hash, label + ' -> git')
+ t.is(hostinfo.browse(), 'https://gist.github.com/222' + (branch ? '/' + branch : ''), label + ' -> browse')
+ t.is(hostinfo.bugs(), 'https://gist.github.com/222', label + ' -> bugs')
+ t.is(hostinfo.docs(), 'https://gist.github.com/222' + (branch ? '/' + branch : ''), label + ' -> docs')
+ t.is(hostinfo.ssh(), 'git@gist.github.com:/222.git' + hash, label + ' -> ssh')
+ t.is(hostinfo.sshurl(), 'git+ssh://git@gist.github.com/222.git' + hash, label + ' -> sshurl')
+ t.is(hostinfo.shortcut(), 'gist:222' + hash, label + ' -> shortcut')
if (hostinfo.user) {
- t.is( hostinfo.file("C"), "https://gist.githubusercontent.com/111/222/raw/"+(branch?branch+"/":"")+"C", label + " -> file" )
+ t.is(hostinfo.file('C'), 'https://gist.githubusercontent.com/111/222/raw/' + (branch ? branch + '/' : '') + 'C', label + ' -> file')
}
}
- verify("git@gist.github.com:222.git", "git@")
- var hostinfo = HostedGit.fromUrl("git@gist.github.com:/ef860c7z5e0de3179341.git")
- if (t.ok(hostinfo, "git@hex")) {
- t.is( hostinfo.https(), "https://gist.github.com/ef860c7z5e0de3179341.git", "git@hex -> https" )
+ verify('git@gist.github.com:222.git', 'git@')
+ var hostinfo = HostedGit.fromUrl('git@gist.github.com:/ef860c7z5e0de3179341.git')
+ if (t.ok(hostinfo, 'git@hex')) {
+ t.is(hostinfo.https(), 'git+https://gist.github.com/ef860c7z5e0de3179341.git', 'git@hex -> https')
}
- verify("git@gist.github.com:/222.git", "git@/")
- verify("git://gist.github.com/222", "git")
- verify("git://gist.github.com/222.git", "git.git")
- verify("git://gist.github.com/222#branch", "git#branch", "branch")
- verify("git://gist.github.com/222.git#branch", "git.git#branch", "branch")
+ verify('git@gist.github.com:/222.git', 'git@/')
+ verify('git://gist.github.com/222', 'git')
+ verify('git://gist.github.com/222.git', 'git.git')
+ verify('git://gist.github.com/222#branch', 'git#branch', 'branch')
+ verify('git://gist.github.com/222.git#branch', 'git.git#branch', 'branch')
+
+ require('./lib/standard-tests')(verify, 'gist.github.com', 'gist')
- require('./lib/standard-tests')(verify, "gist.github.com", "gist")
+ verify(HostedGit.fromUrl('gist:111/222').toString(), 'round-tripped shortcut')
+ verify('gist:222', 'shortened shortcut')
t.end()
})
-"use strict"
-var HostedGit = require("../index")
-var test = require("tap").test
+'use strict'
+var HostedGit = require('../index')
+var test = require('tap').test
-
-test("fromUrl(github url)", function (t) {
- function verify(host, label, branch) {
+test('fromUrl(github url)', function (t) {
+ function verify (host, label, branch) {
var hostinfo = HostedGit.fromUrl(host)
- var hash = branch ? "#" + branch : ""
+ var hash = branch ? '#' + branch : ''
t.ok(hostinfo, label)
- if (! hostinfo) return
- t.is( hostinfo.https(), "https://github.com/111/222.git" + hash, label + " -> https" )
- t.is( hostinfo.git(), "git://github.com/111/222.git" + hash, label + " -> git" )
- t.is( hostinfo.browse(), "https://github.com/111/222" + (branch ? "/tree/" + branch : ""), label + " -> browse" )
- t.is( hostinfo.bugs(), "https://github.com/111/222/issues", label + " -> bugs" )
- t.is( hostinfo.docs(), "https://github.com/111/222" + (branch ? "/tree/" + branch : "") + "#readme", label + " -> docs" )
- t.is( hostinfo.ssh(), "git@github.com:111/222.git" + hash, label + " -> ssh" )
- t.is( hostinfo.sshurl(), "git+ssh://git@github.com/111/222.git" + hash, label + " -> sshurl" )
- t.is( (""+hostinfo), "git+ssh://git@github.com/111/222.git" + hash, label + " -> stringify" )
- t.is( hostinfo.file("C"), "https://raw.githubusercontent.com/111/222/"+(branch||"master")+"/C", label + " -> file" )
+ if (!hostinfo) return
+ t.is(hostinfo.https(), 'git+https://github.com/111/222.git' + hash, label + ' -> https')
+ t.is(hostinfo.git(), 'git://github.com/111/222.git' + hash, label + ' -> git')
+ t.is(hostinfo.browse(), 'https://github.com/111/222' + (branch ? '/tree/' + branch : ''), label + ' -> browse')
+ t.is(hostinfo.bugs(), 'https://github.com/111/222/issues', label + ' -> bugs')
+ t.is(hostinfo.docs(), 'https://github.com/111/222' + (branch ? '/tree/' + branch : '') + '#readme', label + ' -> docs')
+ t.is(hostinfo.ssh(), 'git@github.com:111/222.git' + hash, label + ' -> ssh')
+ t.is(hostinfo.sshurl(), 'git+ssh://git@github.com/111/222.git' + hash, label + ' -> sshurl')
+ t.is(hostinfo.shortcut(), 'github:111/222' + hash, label + ' -> shortcut')
+ t.is(hostinfo.file('C'), 'https://raw.githubusercontent.com/111/222/' + (branch || 'master') + '/C', label + ' -> file')
}
// github shorturls
- verify("111/222", "github-short")
- verify("111/222#branch", "github-short#branch", "branch")
+ verify('111/222', 'github-short')
+ verify('111/222#branch', 'github-short#branch', 'branch')
// insecure protocols
- verify("git://github.com/111/222", "git")
- verify("git://github.com/111/222.git", "git.git")
- verify("git://github.com/111/222#branch", "git#branch", "branch")
- verify("git://github.com/111/222.git#branch", "git.git#branch", "branch")
+ verify('git://github.com/111/222', 'git')
+ verify('git://github.com/111/222.git', 'git.git')
+ verify('git://github.com/111/222#branch', 'git#branch', 'branch')
+ verify('git://github.com/111/222.git#branch', 'git.git#branch', 'branch')
- verify("http://github.com/111/222", "http")
- verify("http://github.com/111/222.git", "http.git")
- verify("http://github.com/111/222#branch", "http#branch", "branch")
- verify("http://github.com/111/222.git#branch", "http.git#branch", "branch")
+ verify('http://github.com/111/222', 'http')
+ verify('http://github.com/111/222.git', 'http.git')
+ verify('http://github.com/111/222#branch', 'http#branch', 'branch')
+ verify('http://github.com/111/222.git#branch', 'http.git#branch', 'branch')
- require('./lib/standard-tests')(verify, "github.com", "github")
+ require('./lib/standard-tests')(verify, 'github.com', 'github')
t.end()
})
-"use strict"
-var HostedGit = require("../index")
-var test = require("tap").test
+'use strict'
+var HostedGit = require('../index')
+var test = require('tap').test
-
-test("fromUrl(gitlab url)", function (t) {
- function verify(host, label, branch) {
+test('fromUrl(gitlab url)', function (t) {
+ function verify (host, label, branch) {
var hostinfo = HostedGit.fromUrl(host)
- var hash = branch ? "#" + branch : ""
+ var hash = branch ? '#' + branch : ''
t.ok(hostinfo, label)
- if (! hostinfo) return
- t.is( hostinfo.https(), "https://gitlab.com/111/222.git" + hash, label + " -> https" )
- t.is( hostinfo.browse(), "https://gitlab.com/111/222" + (branch ? "/tree/" + branch : ""), label + " -> browse" )
- t.is( hostinfo.docs(), "https://gitlab.com/111/222" + (branch ? "/tree/" + branch : "") + "#README", label + " -> docs" )
- t.is( hostinfo.ssh(), "git@gitlab.com:111/222.git" + hash, label + " -> ssh" )
- t.is( hostinfo.sshurl(), "git+ssh://git@gitlab.com/111/222.git" + hash, label + " -> sshurl" )
- t.is( (""+hostinfo), "git+ssh://git@gitlab.com/111/222.git" + hash, label + " -> stringify" )
- t.is( hostinfo.file("C"), "https://gitlab.com/111/222/raw/"+(branch||"master")+"/C", label + " -> file" )
+ if (!hostinfo) return
+ t.is(hostinfo.https(), 'git+https://gitlab.com/111/222.git' + hash, label + ' -> https')
+ t.is(hostinfo.browse(), 'https://gitlab.com/111/222' + (branch ? '/tree/' + branch : ''), label + ' -> browse')
+ t.is(hostinfo.docs(), 'https://gitlab.com/111/222' + (branch ? '/tree/' + branch : '') + '#README', label + ' -> docs')
+ t.is(hostinfo.ssh(), 'git@gitlab.com:111/222.git' + hash, label + ' -> ssh')
+ t.is(hostinfo.sshurl(), 'git+ssh://git@gitlab.com/111/222.git' + hash, label + ' -> sshurl')
+ t.is(hostinfo.shortcut(), 'gitlab:111/222' + hash, label + ' -> shortcut')
+ t.is(hostinfo.file('C'), 'https://gitlab.com/111/222/raw/' + (branch || 'master') + '/C', label + ' -> file')
}
- require('./lib/standard-tests')(verify, "gitlab.com", "gitlab")
+ require('./lib/standard-tests')(verify, 'gitlab.com', 'gitlab')
t.end()
})
--- /dev/null
+'use strict'
+var HostedGit = require('../index')
+var test = require('tap').test
+
+test('HTTPS GitHub URL with embedded auth -- generally not a good idea', function (t) {
+ function verify (host, label, branch) {
+ var hostinfo = HostedGit.fromUrl(host)
+ var hash = branch ? '#' + branch : ''
+ t.ok(hostinfo, label)
+ if (!hostinfo) return
+ t.is(hostinfo.https(), 'git+https://user:pass@github.com/111/222.git' + hash, label + ' -> https')
+ t.is(hostinfo.git(), 'git://user:pass@github.com/111/222.git' + hash, label + ' -> git')
+ t.is(hostinfo.browse(), 'https://github.com/111/222' + (branch ? '/tree/' + branch : ''), label + ' -> browse')
+ t.is(hostinfo.bugs(), 'https://github.com/111/222/issues', label + ' -> bugs')
+ t.is(hostinfo.docs(), 'https://github.com/111/222' + (branch ? '/tree/' + branch : '') + '#readme', label + ' -> docs')
+ t.is(hostinfo.ssh(), 'git@github.com:111/222.git' + hash, label + ' -> ssh')
+ t.is(hostinfo.sshurl(), 'git+ssh://git@github.com/111/222.git' + hash, label + ' -> sshurl')
+ t.is(hostinfo.shortcut(), 'github:111/222' + hash, label + ' -> shortcut')
+ t.is(hostinfo.file('C'), 'https://user:pass@raw.githubusercontent.com/111/222/' + (branch || 'master') + '/C', label + ' -> file')
+ }
+
+ // insecure protocols
+ verify('git://user:pass@github.com/111/222', 'git')
+ verify('git://user:pass@github.com/111/222.git', 'git.git')
+ verify('git://user:pass@github.com/111/222#branch', 'git#branch', 'branch')
+ verify('git://user:pass@github.com/111/222.git#branch', 'git.git#branch', 'branch')
+
+ verify('https://user:pass@github.com/111/222', 'https')
+ verify('https://user:pass@github.com/111/222.git', 'https.git')
+ verify('https://user:pass@github.com/111/222#branch', 'https#branch', 'branch')
+ verify('https://user:pass@github.com/111/222.git#branch', 'https.git#branch', 'branch')
+
+ verify('http://user:pass@github.com/111/222', 'http')
+ verify('http://user:pass@github.com/111/222.git', 'http.git')
+ verify('http://user:pass@github.com/111/222#branch', 'http#branch', 'branch')
+ verify('http://user:pass@github.com/111/222.git#branch', 'http.git#branch', 'branch')
+
+ t.end()
+})
-"use strict"
+'use strict'
module.exports = function (verify, domain, shortname) {
- verify("https://" + domain + "/111/222", "https")
- verify("https://" + domain + "/111/222.git", "https.git")
- verify("https://" + domain + "/111/222#branch", "https#branch", "branch")
- verify("https://" + domain + "/111/222.git#branch", "https.git#branch", "branch")
+ verify('https://' + domain + '/111/222', 'https')
+ verify('https://' + domain + '/111/222.git', 'https.git')
+ verify('https://' + domain + '/111/222#branch', 'https#branch', 'branch')
+ verify('https://' + domain + '/111/222.git#branch', 'https.git#branch', 'branch')
- verify("git+https://" + domain + "/111/222", "git+https")
- verify("git+https://" + domain + "/111/222.git", "git+https.git")
- verify("git+https://" + domain + "/111/222#branch", "git+https#branch", "branch")
- verify("git+https://" + domain + "/111/222.git#branch", "git+https.git#branch", "branch")
+ verify('git+https://' + domain + '/111/222', 'git+https')
+ verify('git+https://' + domain + '/111/222.git', 'git+https.git')
+ verify('git+https://' + domain + '/111/222#branch', 'git+https#branch', 'branch')
+ verify('git+https://' + domain + '/111/222.git#branch', 'git+https.git#branch', 'branch')
- verify("git@" + domain + ":111/222", "ssh")
- verify("git@" + domain + ":111/222.git", "ssh.git")
- verify("git@" + domain + ":111/222#branch", "ssh", "branch")
- verify("git@" + domain + ":111/222.git#branch", "ssh.git", "branch")
+ verify('git@' + domain + ':111/222', 'ssh')
+ verify('git@' + domain + ':111/222.git', 'ssh.git')
+ verify('git@' + domain + ':111/222#branch', 'ssh', 'branch')
+ verify('git@' + domain + ':111/222.git#branch', 'ssh.git', 'branch')
+ verify('git+ssh://git@' + domain + '/111/222', 'ssh url')
+ verify('git+ssh://git@' + domain + '/111/222.git', 'ssh url.git')
+ verify('git+ssh://git@' + domain + '/111/222#branch', 'ssh url#branch', 'branch')
+ verify('git+ssh://git@' + domain + '/111/222.git#branch', 'ssh url.git#branch', 'branch')
- verify("git+ssh://git@" + domain + "/111/222", "ssh url")
- verify("git+ssh://git@" + domain + "/111/222.git", "ssh url.git")
- verify("git+ssh://git@" + domain + "/111/222#branch", "ssh url#branch", "branch")
- verify("git+ssh://git@" + domain + "/111/222.git#branch", "ssh url.git#branch", "branch")
-
- verify(shortname + ":111/222", "shortcut")
- verify(shortname + ":111/222.git", "shortcut.git")
- verify(shortname + ":111/222#branch", "shortcut#branch", "branch")
- verify(shortname + ":111/222.git#branch", "shortcut.git#branch", "branch")
+ verify(shortname + ':111/222', 'shortcut')
+ verify(shortname + ':111/222.git', 'shortcut.git')
+ verify(shortname + ':111/222#branch', 'shortcut#branch', 'branch')
+ verify(shortname + ':111/222.git#branch', 'shortcut.git#branch', 'branch')
}
{
"name": "init-package-json",
- "version": "1.3.2",
+ "version": "1.4.0",
"main": "init-package-json.js",
"scripts": {
"test": "tap test/*.js"
"glob": "^5.0.3",
"promzard": "^0.3.0",
"read": "~1.0.1",
- "read-package-json": "1",
+ "read-package-json": "1 || 2",
"semver": "2.x || 3.x || 4",
"validate-npm-package-name": "^2.0.1"
},
"prompt",
"start"
],
- "readme": "# init-package-json\n\nA node module to get your node module started.\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": "4aaccb745ecba65676ae4bf105039928e697d65c",
+ "gitHead": "c422f6b38ab02d0859d757ec381e473657d4d195",
"bugs": {
"url": "https://github.com/isaacs/init-package-json/issues"
},
"homepage": "https://github.com/isaacs/init-package-json",
- "_id": "init-package-json@1.3.2",
- "_shasum": "9ad3038b52e50838d78739f16b4dfb1418909d18",
- "_from": "init-package-json@>=1.3.2 <1.4.0"
+ "_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"
}
function use (self, hit) {
shiftLU(self, hit)
hit.lu = self._mru ++
+ if (self._maxAge) hit.now = Date.now()
self._lruList[hit.lu] = hit
}
{
"name": "lru-cache",
"description": "A cache object that deletes the least-recently-used items.",
- "version": "2.5.0",
+ "version": "2.5.2",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me"
"url": "git://github.com/isaacs/node-lru-cache.git"
},
"devDependencies": {
- "tap": "",
+ "tap": "^0.7.1",
"weak": ""
},
"license": {
"type": "MIT",
"url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE"
},
- "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `n`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n",
- "readmeFilename": "README.md",
+ "gitHead": "ec01cc48ac06ee07b2b56a219d5aa931f899b21b",
"bugs": {
"url": "https://github.com/isaacs/node-lru-cache/issues"
},
"homepage": "https://github.com/isaacs/node-lru-cache",
- "_id": "lru-cache@2.5.0",
- "_from": "lru-cache@latest"
+ "_id": "lru-cache@2.5.2",
+ "_shasum": "1fddad938aae1263ce138680be1b3f591c0ab41c",
+ "_from": "lru-cache@>=2.5.2 <2.6.0",
+ "_npmVersion": "2.7.6",
+ "_nodeVersion": "1.4.2",
+ "_npmUser": {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "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!"
}
--- /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 );
cache.set("c", "C")
// timed out
t.notOk(cache.get("a"))
- }, 60)
+ }, 60 + 25)
setTimeout(function () {
t.notOk(cache.get("b"))
--- /dev/null
+var test = require("tap").test
+var LRU = require("../")
+
+var cache = LRU( {
+ max: 1,
+ maxAge: 500
+} );
+
+test('set the key', function (t) {
+ cache.set( "1234", 1 );
+ t.end()
+})
+
+for (var i = 0; i < 10; i ++) {
+ test('get after ' + i + '00ms', function (t) {
+ setTimeout(function () {
+ t.equal(cache.get('1234'), 1)
+ t.end()
+ }, 100)
+ })
+}
{
'target_defaults': {
'type': 'loadable_module',
- 'win_delay_load_hook': 'false',
'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)
+++ /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
-# normalize-package-data [![Build Status](https://travis-ci.org/meryn/normalize-package-data.png?branch=master)](https://travis-ci.org/meryn/normalize-package-data)
+# normalize-package-data [![Build Status](https://travis-ci.org/npm/normalize-package-data.png?branch=master)](https://travis-ci.org/npm/normalize-package-data)
normalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.
* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`.
* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs.
* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched.
+* As of v2: Dependencies that point at known hosted git providers (currently: github, bitbucket, gitlab) will have their URLs canonicalized, but protocols will be preserved.
+* As of v2: Dependencies that use shortcuts for hosted git providers (`org/proj`, `github:org/proj`, `bitbucket:org/proj`, `gitlab:org/proj`, `gist:docid`) will have the shortcut left in place. (In the case of github, the `org/proj` form will be expanded to `github:org/proj`.) THIS MARKS A BREAKING CHANGE FROM V1, where the shorcut was previously expanded to a URL.
* If `description` field does not exist, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`.
* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `"git"`.
-* If `repository.url` is not a valid url, but in the style of "[owner-name]/[repo-name]", `repository.url` will be set to git://github.com/[owner-name]/[repo-name]
+* If `repository.url` is not a valid url, but in the style of "[owner-name]/[repo-name]", `repository.url` will be set to https://github.com/[owner-name]/[repo-name]
* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value.
* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.
* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed.
var semver = require("semver")
-var parseGitHubURL = require("github-url-from-git")
+var hostedGitInfo = require("hosted-git-info")
var depTypes = ["dependencies","devDependencies","optionalDependencies"]
var extractDescription = require("./extract_description")
var url = require("url")
var typos = require("./typos")
var coreModuleNames = require("./core_module_names")
-var githubUserRepo = require("github-url-from-username-repo")
var fixer = module.exports = {
// default warning function
}
var r = data.repository.url || ""
if (r) {
- var ghurl = parseGitHubURL(r)
- if (ghurl) {
- r = ghurl.replace(/^https?:\/\//, 'git://')
- } else if (githubUserRepo(r)) {
- // repo has 'user/reponame' filled in as repo
- data.repository.url = githubUserRepo(r)
+ var hosted = hostedGitInfo.fromUrl(r)
+ if (hosted) {
+ r = data.repository.url
+ = hosted.getDefaultRepresentation() == "shortcut" ? hosted.https() : hosted.toString()
}
}
if (typeof data.scripts[k] !== "string") {
this.warn("nonStringScript")
delete data.scripts[k]
- } else if (typos.script[k]) {
+ } else if (typos.script[k] && !data.scripts[typos.script[k]]) {
this.warn("typo", k, typos.script[k], "scripts")
}
}, this)
this.warn("nonStringDependency", d, JSON.stringify(r))
delete data[deps][d]
}
- // "/" is not allowed as packagename for publishing, but for git-urls
- // normalize shorthand-urls
- if (githubUserRepo(data[deps][d])) {
- data[deps][d] = 'git+' + githubUserRepo(data[deps][d])
- }
+ var hosted = hostedGitInfo.fromUrl(data[deps][d])
+ if (hosted) data[deps][d] = hosted.toString()
}, this)
}, this)
}
, fixBugsField: function(data) {
if (!data.bugs && data.repository && data.repository.url) {
- var gh = parseGitHubURL(data.repository.url)
- if(gh) {
- if(gh.match(/^https:\/\/github.com\//))
- data.bugs = {url: gh + "/issues"}
- else // gist url
- data.bugs = {url: gh}
+ var hosted = hostedGitInfo.fromUrl(data.repository.url)
+ if(hosted && hosted.bugs()) {
+ data.bugs = {url: hosted.bugs()}
}
}
else if(data.bugs) {
, fixHomepageField: function(data) {
if (!data.homepage && data.repository && data.repository.url) {
- var gh = parseGitHubURL(data.repository.url)
- if (gh)
- data.homepage = gh
- else
- return true
- } else if (!data.homepage)
- return true
+ var hosted = hostedGitInfo.fromUrl(data.repository.url)
+ if (hosted && hosted.docs()) data.homepage = hosted.docs()
+ }
+ if (!data.homepage) return
if(typeof data.homepage !== "string") {
this.warn("nonUrlHomepage")
{
"name": "normalize-package-data",
- "version": "1.0.3",
+ "version": "2.0.0",
"author": {
"name": "Meryn Stol",
"email": "merynstol@gmail.com"
"description": "Normalizes data that can be found in package.json files.",
"repository": {
"type": "git",
- "url": "git://github.com/meryn/normalize-package-data.git"
+ "url": "git://github.com/npm/normalize-package-data.git"
},
"main": "lib/normalize.js",
"scripts": {
"test": "tap test/*.js"
},
"dependencies": {
- "github-url-from-git": "^1.3.0",
- "github-url-from-username-repo": "^1.0.0",
+ "hosted-git-info": "^2.0.2",
"semver": "2 || 3 || 4"
},
"devDependencies": {
"email": "rok@kowalski.gd"
}
],
- "gitHead": "8c30091c83b1a41e113757148c4543ef61ff863d",
+ "gitHead": "ea0b959633e4803685bae2283d3d79a0115e6f8a",
"bugs": {
- "url": "https://github.com/meryn/normalize-package-data/issues"
+ "url": "https://github.com/npm/normalize-package-data/issues"
},
- "homepage": "https://github.com/meryn/normalize-package-data",
- "_id": "normalize-package-data@1.0.3",
- "_shasum": "8be955b8907af975f1a4584ea8bb9b41492312f5",
- "_from": "normalize-package-data@>=1.0.3 <1.1.0",
- "_npmVersion": "2.1.0",
- "_nodeVersion": "0.10.31",
+ "homepage": "https://github.com/npm/normalize-package-data",
+ "_id": "normalize-package-data@2.0.0",
+ "_shasum": "8795d0d5c70c0e9ca36f419548aac0abf1f638bc",
+ "_from": "normalize-package-data@>=2.0.0 <2.1.0",
+ "_npmVersion": "2.7.5",
+ "_nodeVersion": "1.6.2",
"_npmUser": {
- "name": "isaacs",
- "email": "i@izs.me"
+ "name": "iarna",
+ "email": "me@re-becca.org"
},
"maintainers": [
{
{
"name": "othiym23",
"email": "ogd@aoaioxxysz.net"
+ },
+ {
+ "name": "iarna",
+ "email": "me@re-becca.org"
}
],
"dist": {
- "shasum": "8be955b8907af975f1a4584ea8bb9b41492312f5",
- "tarball": "http://registry.npmjs.org/normalize-package-data/-/normalize-package-data-1.0.3.tgz"
+ "shasum": "8795d0d5c70c0e9ca36f419548aac0abf1f638bc",
+ "tarball": "http://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.0.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-1.0.3.tgz"
+ "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.0.0.tgz",
+ "readme": "ERROR: No README data found!"
}
var safeFormat = require("../lib/safe_format")
var rpjPath = path.resolve(__dirname,"./fixtures/read-package-json.json")
+
tap.test("normalize some package data", function(t) {
var packageData = require(rpjPath)
var warnings = []
repository: "git@gist.github.com:123456.git"
}
normalize(d)
- t.same(d.repository, { type: 'git', url: 'git@gist.github.com:123456.git' })
+ t.same(d.repository, { type: 'git', url: 'git+ssh://git@gist.github.com/123456.git' })
t.same(d.bugs, { url: 'https://gist.github.com/123456' })
t.end();
});
tap.test("singularize repositories", function(t) {
var d = {repositories:["git@gist.github.com:123456.git"]}
normalize(d)
- t.same(d.repository, { type: 'git', url: 'git@gist.github.com:123456.git' })
+ t.same(d.repository, { type: 'git', url: 'git+ssh://git@gist.github.com/123456.git' })
t.end()
});
tap.test("treat visionmedia/express as github repo", function(t) {
var d = {repository: {type: "git", url: "visionmedia/express"}}
normalize(d)
- t.same(d.repository, { type: "git", url: "https://github.com/visionmedia/express" })
+ t.same(d.repository, { type: "git", url: "https://github.com/visionmedia/express.git" })
t.end()
});
tap.test("treat isaacs/node-graceful-fs as github repo", function(t) {
var d = {repository: {type: "git", url: "isaacs/node-graceful-fs"}}
normalize(d)
- t.same(d.repository, { type: "git", url: "https://github.com/isaacs/node-graceful-fs" })
+ t.same(d.repository, { type: "git", url: "https://github.com/isaacs/node-graceful-fs.git" })
t.end()
});
normalize(a={
repository: { type: "git", url: "https://github.com/isaacs/node-graceful-fs" }
})
- t.same(a.homepage, 'https://github.com/isaacs/node-graceful-fs')
+ t.same(a.homepage, 'https://github.com/isaacs/node-graceful-fs#readme')
t.end()
})
normalize(a={
repository: { type: "git", url: "sindresorhus/chalk" }
})
- t.same(a.homepage, 'https://github.com/sindresorhus/chalk')
+ t.same(a.homepage, 'https://github.com/sindresorhus/chalk#readme')
t.end()
})
-tap.test("treat isaacs/node-graceful-fs as github repo in dependencies", function(t) {
+tap.test("don't mangle github shortcuts in dependencies", function(t) {
var d = {dependencies: {"node-graceful-fs": "isaacs/node-graceful-fs"}}
normalize(d)
- t.same(d.dependencies, {"node-graceful-fs": "git+https://github.com/isaacs/node-graceful-fs" })
+ t.same(d.dependencies, {"node-graceful-fs": "github:isaacs/node-graceful-fs" })
t.end()
});
t.same(warnings, expect)
warnings.length = 0
+ expect =
+ [ warningMessages.missingDescription,
+ warningMessages.missingRepository,
+ warningMessages.missingReadme ]
+
+ normalize({name:"name"
+ ,version:"1.2.5"
+ ,scripts:{server:"start",tests:"test"
+ ,start:"start",test:"test"}}, warn)
+
+ t.same(warnings, expect)
+
+ warnings.length = 0
expect = []
normalize({private: true
ssh: gitHost.ssh(),
sshUrl: gitHost.sshurl(),
httpsUrl: gitHost.https(),
+ gitUrl: gitHost.git(),
+ shortcut: gitHost.shortcut(),
directUrl: gitHost.file("package.json")
}
return res
{
"name": "npm-package-arg",
- "version": "3.1.1",
+ "version": "4.0.0",
"description": "Parse the things that can be arguments to `npm install`",
"main": "npa.js",
"directories": {
"test": "test"
},
"dependencies": {
- "hosted-git-info": "^1.5.3",
+ "hosted-git-info": "^2.0.2",
"semver": "4"
},
"devDependencies": {
"url": "https://github.com/npm/npm-package-arg/issues"
},
"homepage": "https://github.com/npm/npm-package-arg",
- "gitHead": "1dc802d4b449f1599c7275bb948c6ecd265c23a8",
- "_id": "npm-package-arg@3.1.1",
- "_shasum": "c9e5f7587f8484d1372a9b386fbf8b2443fc1bdb",
- "_from": "npm-package-arg@>=3.1.1 <3.2.0",
- "_npmVersion": "2.6.1",
- "_nodeVersion": "1.1.0",
- "_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": "c9e5f7587f8484d1372a9b386fbf8b2443fc1bdb",
- "tarball": "http://registry.npmjs.org/npm-package-arg/-/npm-package-arg-3.1.1.tgz"
- },
- "_resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-3.1.1.tgz",
- "readme": "ERROR: No README data found!"
+ "gitHead": "25ac404d9f3b77b14be9b05a7dafd9cb99557fdc",
+ "readme": "# npm-package-arg\n\nParse package name and specifier passed to commands like `npm install` or\n`npm cache add`. This just parses the text given-- it's worth noting that\n`npm` has further logic it applies by looking at your disk to figure out\nwhat ambiguous specifiers are. If you want that logic, please see\n[realize-package-specifier].\n\n[realize-package-specifier]: https://www.npmjs.org/package/realize-package-specifier\n\nArguments look like: `foo@1.2`, `@bar/foo@1.2`, `foo@user/foo`, `http://x.com/foo.tgz`,\n`git+https://github.com/user/foo`, `bitbucket:user/foo`, `foo.tar.gz` or `bar`\n\n## EXAMPLES\n\n```javascript\nvar assert = require(\"assert\")\nvar npa = require(\"npm-package-arg\")\n\n// Pass in the descriptor, and it'll return an object\nvar parsed = npa(\"@bar/foo@1.2\")\n\n// Returns an object like:\n{\n raw: '@bar/foo@1.2', // what was passed in\n name: \"@bar/foo\", // the name of the package\n scope: \"@bar\", // the private scope of the package, or null\n type: \"range\", // the type of specifier this is\n spec: \">=1.2.0 <1.3.0\" // the expanded specifier\n rawSpec: \"1.2\" // the specifier as passed in\n }\n\n// Parsing urls pointing at hosted git services produces a variation:\nvar parsed = npa(\"git+https://github.com/user/foo\")\n\n// Returns an object like:\n{\n raw: 'git+https://github.com/user/foo',\n scope: null,\n name: null,\n rawSpec: 'git+https://github.com/user/foo',\n spec: 'user/foo',\n type: 'hosted',\n hosted: {\n type: 'github',\n ssh: 'git@github.com:user/foo.git',\n sshurl: 'git+ssh://git@github.com/user/foo.git',\n https: 'https://github.com/user/foo.git',\n directUrl: 'https://raw.githubusercontent.com/user/foo/master/package.json'\n }\n}\n\n// Completely unreasonable invalid garbage throws an error\n// Make sure you wrap this in a try/catch if you have not\n// already sanitized the inputs!\nassert.throws(function() {\n npa(\"this is not \\0 a valid package name or url\")\n})\n```\n\n## USING\n\n`var npa = require('npm-package-arg')`\n\n* var result = npa(*arg*)\n\nParses *arg* and returns a result object detailing what *arg* is.\n\n*arg* -- a package descriptor, like: `foo@1.2`, or `foo@user/foo`, or\n`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`\n\n## RESULT OBJECT\n\nThe objects that are returned by npm-package-arg contain the following\nkeys:\n\n* `name` - If known, the `name` field expected in the resulting pkg.\n* `type` - One of the following strings:\n * `git` - A git repo\n * `hosted` - A hosted project, from github, bitbucket or gitlab. Originally\n either a full url pointing at one of these services or a shorthand like\n `user/project` or `github:user/project` for github or `bitbucket:user/project`\n for bitbucket.\n * `tag` - A tagged version, like `\"foo@latest\"`\n * `version` - A specific version number, like `\"foo@1.2.3\"`\n * `range` - A version range, like `\"foo@2.x\"`\n * `local` - A local file or folder path\n * `remote` - An http url (presumably to a tgz)\n* `spec` - The \"thing\". URL, the range, git repo, etc.\n* `hosted` - If type=hosted this will be an object with the following keys:\n * `type` - github, bitbucket or gitlab\n * `ssh` - The ssh path for this git repo\n * `sshUrl` - The ssh URL for this git repo\n * `httpsUrl` - The HTTPS URL for this git repo\n * `directUrl` - The URL for the package.json in this git repo\n* `raw` - The original un-modified string that was provided.\n* `rawSpec` - The part after the `name@...`, as it was originally\n provided.\n* `scope` - If a name is something like `@org/module` then the `scope`\n field will be set to `org`. If it doesn't have a scoped name, then\n scope is `null`.\n",
+ "readmeFilename": "README.md",
+ "_id": "npm-package-arg@4.0.0",
+ "_shasum": "04766dc98dbc19f6d627a5817075f4ce13d64a5d",
+ "_from": "npm-package-arg@>=4.0.0 <5.0.0"
}
name: null,
type: "hosted",
hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user/foo-js.git",
+ spec: "bitbucket:user/foo-js",
raw: "bitbucket:user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user/foo-js.git#bar/baz",
+ spec: "bitbucket:user/foo-js#bar/baz",
raw: "bitbucket:user/foo-js#bar/baz"
},
name: null,
type: "hosted",
hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user..blerg--/..foo-js.git# . . . . . some . tags / / /",
+ spec: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /",
raw: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /"
},
name: null,
type: "hosted",
hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user/foo-js.git#bar/baz/bin",
+ spec: "bitbucket:user/foo-js#bar/baz/bin",
raw: "bitbucket:user/foo-js#bar/baz/bin"
},
name: "foo",
type: "hosted",
hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user/foo-js.git",
+ spec: "bitbucket:user/foo-js",
raw: "foo@bitbucket:user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user/foo.git",
+ spec: "https://bitbucket.org/user/foo.git",
raw: "https://bitbucket.org/user/foo.git"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo-js.git",
+ spec: "github:user/foo-js",
raw: "user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo-js.git#bar/baz",
+ spec: "github:user/foo-js#bar/baz",
raw: "user/foo-js#bar/baz"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user..blerg--/..foo-js.git# . . . . . some . tags / / /",
+ spec: "github:user..blerg--/..foo-js# . . . . . some . tags / / /",
raw: "user..blerg--/..foo-js# . . . . . some . tags / / /"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo-js.git#bar/baz/bin",
+ raw: "github:user/foo-js#bar/baz/bin",
raw: "user/foo-js#bar/baz/bin"
},
name: "foo",
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo-js.git",
+ spec: "github:user/foo-js",
raw: "foo@user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo-js.git",
+ spec: "github:user/foo-js",
raw: "github:user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo.git",
+ spec: "git://github.com/user/foo.git",
raw: "git://github.com/user/foo"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo.git",
+ spec: "https://github.com/user/foo.git",
raw: "https://github.com/user/foo.git"
},
"foo@bar/foo": {
name: "foo",
type: "hosted",
- hosted: { type: "github" },
- spec: "git+ssh://git@github.com/bar/foo.git",
+ hosted: { type: "github" },
+ spec: "github:bar/foo",
raw: "foo@bar/foo"
}
}
name: null,
type: "hosted",
hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user/foo-js.git",
+ raw: "gitlab:user/foo-js",
raw: "gitlab:user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user/foo-js.git#bar/baz",
+ raw: "gitlab:user/foo-js#bar/baz",
raw: "gitlab:user/foo-js#bar/baz"
},
name: null,
type: "hosted",
hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user..blerg--/..foo-js.git# . . . . . some . tags / / /",
+ spec: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /",
raw: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /"
},
name: null,
type: "hosted",
hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user/foo-js.git#bar/baz/bin",
+ spec: "gitlab:user/foo-js#bar/baz/bin",
raw: "gitlab:user/foo-js#bar/baz/bin"
},
name: "foo",
type: "hosted",
hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user/foo-js.git",
+ spec: "gitlab:user/foo-js",
raw: "foo@gitlab:user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user/foo.git",
+ spec: "https://gitlab.com/user/foo.git",
raw: "https://gitlab.com/user/foo.git"
},
client.log.verbose('adduser', 'update existing user')
return client.request(
uri + '?write=true',
- { body: userobj, auth: auth },
+ { auth: auth },
function (er, data, json, response) {
if (er || data.error) {
return cb(er, data, json, response)
var Writable = require('readable-stream').Writable
var inherits = require('inherits')
-var TA = require('typedarray')
-var U8 = typeof Uint8Array !== 'undefined' ? Uint8Array : TA.Uint8Array
+
+if (typeof Uint8Array === 'undefined') {
+ var U8 = require('typedarray').Uint8Array
+} else {
+ var U8 = Uint8Array
+}
function ConcatStream(opts, cb) {
if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb)
"main": "lib/util.js",
"repository": {
"type": "git",
- "url": "git://github.com/isaacs/core-util-is"
+ "url": "git://github.com/isaacs/core-util-is.git"
},
"keywords": [
"util",
],
"directories": {},
"_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538",
- "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz",
- "scripts": {}
+ "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
}
},
"repository": {
"type": "git",
- "url": "git://github.com/isaacs/readable-stream"
+ "url": "git://github.com/isaacs/readable-stream.git"
},
"keywords": [
"readable",
{
"name": "concat-stream",
- "version": "1.4.7",
+ "version": "1.4.8",
"description": "writable stream that concatenates strings or binary data and calls a callback with the result",
"tags": [
"stream",
},
"repository": {
"type": "git",
- "url": "http://github.com/maxogden/concat-stream.git"
+ "url": "git+ssh://git@github.com/maxogden/concat-stream.git"
},
"bugs": {
"url": "http://github.com/maxogden/concat-stream/issues"
"android-browser/4.2..latest"
]
},
- "gitHead": "41edc57536490dce9f015131c29a6470c9412b27",
+ "gitHead": "1f4ea1a7791b9366a133cab033eb0f3564cb0d92",
"homepage": "https://github.com/maxogden/concat-stream",
- "_id": "concat-stream@1.4.7",
- "_shasum": "0ceaa47b87a581d2a7a782b92b81d5020c3f9925",
+ "_id": "concat-stream@1.4.8",
+ "_shasum": "e8325bb89e55000e52b626d97466fde1a28cfe5d",
"_from": "concat-stream@>=1.4.6 <2.0.0",
- "_npmVersion": "2.1.8",
- "_nodeVersion": "0.10.28",
+ "_npmVersion": "2.7.0",
+ "_nodeVersion": "1.5.1",
"_npmUser": {
"name": "maxogden",
"email": "max@maxogden.com"
}
],
"dist": {
- "shasum": "0ceaa47b87a581d2a7a782b92b81d5020c3f9925",
- "tarball": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.4.7.tgz"
+ "shasum": "e8325bb89e55000e52b626d97466fde1a28cfe5d",
+ "tarball": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.4.8.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.7.tgz",
+ "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.4.8.tgz",
"readme": "ERROR: No README data found!"
}
* `uint8array`, `u8`, `uint8` - get back a Uint8Array
* `object`, get back an array of Objects
-If you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't int he list above), it will try to convert concat them into a `Buffer`.
+If you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't in the list above), it will try to convert concat them into a `Buffer`.
# error handling
},
"name": "npm-registry-client",
"description": "Client for the npm registry",
- "version": "6.1.2",
+ "version": "6.3.2",
"repository": {
- "url": "git://github.com/isaacs/npm-registry-client"
+ "url": "git://github.com/isaacs/npm-registry-client.git"
},
"main": "index.js",
"scripts": {
"concat-stream": "^1.4.6",
"graceful-fs": "^3.0.0",
"mkdirp": "^0.5.0",
- "normalize-package-data": "~1.0.1",
- "npm-package-arg": "^3.0.0",
+ "normalize-package-data": "~1.0.1 || ^2.0.0",
+ "npm-package-arg": "^3.0.0 || ^4.0.0",
"once": "^1.3.0",
"request": "^2.47.0",
"retry": "^0.6.1",
"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",
"readmeFilename": "README.md",
- "gitHead": "93606bb3d6c23971ff5d43763dfa10aada5775da",
+ "gitHead": "dd4029904febd6e0c30371b2addad5715526cd68",
"bugs": {
"url": "https://github.com/isaacs/npm-registry-client/issues"
},
- "homepage": "https://github.com/isaacs/npm-registry-client",
- "_id": "npm-registry-client@6.1.2",
- "_shasum": "b74ba7efa9bfbbce46a1bd15fa97dc7d784099cb",
- "_from": "npm-registry-client@>=6.1.2 <7.0.0"
+ "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"
}
--- /dev/null
+{"_id":"@npm%2fnpm-registry-client","_rev":"213-0a1049cf56172b7d9a1184742c6477b9","name":"@npm/npm-registry-client","description":"Client for the npm registry","dist-tags":{"latest":"2.0.4","v2.0":"2.0.3"},"versions":{"0.0.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_id":"@npm%2fnpm-registry-client@0.0.1","_engineSupported":true,"_npmVersion":"1.1.24","_nodeVersion":"v0.7.10-pre","_defaultsLoaded":true,"dist":{"shasum":"693a08f6d2faea22bbd2bf412508a63d3e6229a7","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.1.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.2":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.2","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_id":"@npm%2fnpm-registry-client@0.0.2","_engineSupported":true,"_npmVersion":"1.1.24","_nodeVersion":"v0.7.10-pre","_defaultsLoaded":true,"dist":{"shasum":"b48c0ec5563c6a6fdc253454fc56d2c60c5a26f4","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.2.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.3":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.3","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_id":"@npm%2fnpm-registry-client@0.0.3","_engineSupported":true,"_npmVersion":"1.1.24","_nodeVersion":"v0.7.10-pre","_defaultsLoaded":true,"dist":{"shasum":"ccc0254c2d59e3ea9b9050e2b16edef78df1a1e8","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.3.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.4":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.4","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"_id":"@npm%2fnpm-registry-client@0.0.4","_engineSupported":true,"_npmVersion":"1.1.25","_nodeVersion":"v0.7.10-pre","_defaultsLoaded":true,"dist":{"shasum":"faabd25ef477521c74ac21e0f4cf3a2f66d18fb3","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.4.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.5":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.5","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_id":"@npm%2fnpm-registry-client@0.0.5","dist":{"shasum":"85219810c9d89ae8d28ea766e7cf74efbd9f1e52","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.5.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.6":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"The code that npm uses to talk to the registry","version":"0.0.6","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_id":"@npm%2fnpm-registry-client@0.0.6","dist":{"shasum":"cc6533b3b41df65e6e9db2601fbbf1a509a7e94c","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.6.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.7":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"The code that npm uses to talk to the registry","version":"0.0.7","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"engines":{"node":"*"},"_id":"@npm%2fnpm-registry-client@0.0.7","dist":{"shasum":"0cee1d1c61f1c8e483774fe1f7bbb81c4f394a3a","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.7.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.8":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.8","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.0.8","dist":{"shasum":"1b7411c3f7310ec2a96b055b00e7ca606e47bd07","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.8.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.9":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.9","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.0.9","dist":{"shasum":"6d5bfde431559ac9e2e52a7db85f5839b874f022","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.9.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.10":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.10","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.0.10","dist":{"shasum":"0c8b6a4615bce82aa6cc04a0d1f7dc89921f7a38","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.10.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.0.11":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.0.11","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.0.11","dist":{"shasum":"afab40be5bed1faa946d8e1827844698f2ec1db7","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.0.11.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.1.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.1.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.1.0","dist":{"shasum":"1077d6bbb5e432450239dc6622a59474953ffbea","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.1.0.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.1.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.1.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.1.1","dist":{"shasum":"759765361d09b715270f59cf50f10908e4e9c5fc","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.1.1.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.1.2":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.1.2","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.1.2","dist":{"shasum":"541ce93abb3d35f5c325545c718dd3bbeaaa9ff0","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.1.2.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.1.3":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.1.3","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.1.3","dist":{"shasum":"e9a40d7031e8f809af5fd85aa9aac979e17efc97","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.1.3.tgz"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.1.4":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.1.4","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.1.4","dist":{"shasum":"b211485b046191a1085362376530316f0cab0420","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.1.4.tgz"},"_npmVersion":"1.1.48","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.0","dist":{"shasum":"6508a4b4d96f31057d5200ca5779531bafd2b840","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.0.tgz"},"_npmVersion":"1.1.49","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"node-uuid":"~1.3.3","request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.1","dist":{"shasum":"1bc8c4576c368cd88253d8a52daf40c55b89bb1a","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.1.tgz"},"_npmVersion":"1.1.49","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.5":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.5","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.5","dist":{"shasum":"2f55d675dfb977403b1ad0d96874c1d30e8058d7","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.5.tgz"},"_npmVersion":"1.1.51","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.6":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.6","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.6","dist":{"shasum":"f05df6695360360ad220e6e13a6a7bace7165fbe","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.6.tgz"},"_npmVersion":"1.1.56","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.7":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.7","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.0.14","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.7","dist":{"shasum":"867bad8854cae82ed89ee3b7f1d391af59491671","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.7.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.8":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.8","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.6","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.8","dist":{"shasum":"ef194cdb70f1ea03a576cff2c97392fa96e36563","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.8.tgz"},"_npmVersion":"1.1.62","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.9":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.9","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.9","dist":{"shasum":"3cec10431dfed1594adaf99c50f482ee56ecf9e4","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.9.tgz"},"_npmVersion":"1.1.59","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.10":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.10","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2.0.1","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.10","dist":{"shasum":"1e69726dae0944e78562fd77243f839c6a2ced1e","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.10.tgz"},"_npmVersion":"1.1.64","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.11":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.11","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.11","dist":{"shasum":"d92f33c297eb1bbd57fd597c3d8f5f7e9340a0b5","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.11.tgz"},"_npmVersion":"1.1.70","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.12":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.12","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.1.8","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.12","dist":{"shasum":"3bfb6fc0e4b131d665580cd1481c341fe521bfd3","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.12.tgz"},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.13":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.13","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.13","dist":{"shasum":"e03f2a4340065511b7184a3e2862cd5d459ef027","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.13.tgz"},"_from":".","_npmVersion":"1.2.4","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.14":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.14","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.14","dist":{"shasum":"186874a7790417a340d582b1cd4a7c338087ee12","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.14.tgz"},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.15":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.15","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.15","dist":{"shasum":"f71f32b7185855f1f8b7a5ef49e49d2357c2c552","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.15.tgz"},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.16":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.16","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.16","dist":{"shasum":"3331323b5050fc5afdf77c3a35913c16f3e43964","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.16.tgz"},"_from":".","_npmVersion":"1.2.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.17":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.17","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.17","dist":{"shasum":"1df2bbecac6751f5d9600fb43722aef96d956773","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.17.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.18":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.18","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.9.202","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.18","dist":{"shasum":"198c8d15ed9b1ed546faf6e431eb63a6b18193ad","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.18.tgz"},"_from":".","_npmVersion":"1.2.13","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.19":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.19","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.16","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.19","dist":{"shasum":"106da826f0d2007f6e081f2b68fb6f26fa951b20","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.19.tgz"},"_from":".","_npmVersion":"1.2.14","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.20":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.20","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.16","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","_id":"@npm%2fnpm-registry-client@0.2.20","dist":{"shasum":"3fff194331e26660be2cf8ebf45ddf7d36add5f6","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.20.tgz"},"_from":".","_npmVersion":"1.2.15","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.21":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.21","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.16","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.21","dist":{"shasum":"d85dd32525f193925c46ff9eb0e0f529dfd1b254","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.21.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.22":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.22","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"~2.20.0","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.22","dist":{"shasum":"caa22ff40a1ccd632a660b8b80c333c8f92d5a17","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.22.tgz"},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.23":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.23","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.20.0","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.23","dist":{"shasum":"a320ab2b1d048b4f7b88e40bd86974ca322b4c24","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.23.tgz"},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.24":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.24","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.20.0","graceful-fs":"~1.2.0","semver":"~1.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.24","dist":{"shasum":"e12f644338619319ee7f233363a1714a87f3c72d","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.24.tgz"},"_from":".","_npmVersion":"1.2.22","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.25":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.25","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.20.0","graceful-fs":"~1.2.0","semver":"~2.0.5","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.25","dist":{"shasum":"c2caeb1dcf937d6fcc4a187765d401f5e2f54027","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.25.tgz"},"_from":".","_npmVersion":"1.2.32","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.26":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.26","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.20.0","graceful-fs":"~1.2.0","semver":"~2.0.5","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.26","dist":{"shasum":"4c5a2b3de946e383032f10fa497d0c15ee5f4c60","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.26.tgz"},"_from":".","_npmVersion":"1.3.1","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.27":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.27","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.20.0","graceful-fs":"~2.0.0","semver":"~2.0.5","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.15","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.27","dist":{"shasum":"8f338189d32769267886a07ad7b7fd2267446adf","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.27.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.28":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.28","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"~2.1.0","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"_id":"@npm%2fnpm-registry-client@0.2.28","dist":{"shasum":"959141fc0180d7b1ad089e87015a8a2142a8bffc","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.28.tgz"},"_from":".","_npmVersion":"1.3.6","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.29":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.29","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.2.29","dist":{"shasum":"66ff2766f0c61d41e8a6139d3692d8833002c686","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.29.tgz"},"_from":".","_npmVersion":"1.3.12","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.30":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.30","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.2.30","dist":{"shasum":"f01cae5c51aa0a1c5dc2516cbad3ebde068d3eaa","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.30.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.2.31":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.2.31","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.2.31","dist":{"shasum":"24a23e24e43246677cb485f8391829e9536563d4","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.2.31.tgz"},"_from":".","_npmVersion":"1.3.17","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.0","dist":{"shasum":"66eab02a69be67f232ac14023eddfb8308c2eccd","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.0.tgz"},"_from":".","_npmVersion":"1.3.18","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.1","dist":{"shasum":"16dba07cc304442edcece378218672d0a1258ef8","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.1.tgz"},"_from":".","_npmVersion":"1.3.18","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.2":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.2","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.2","dist":{"shasum":"ea3060bd0a87fb1d97b87433b50f38f7272b1686","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.2.tgz"},"_from":".","_npmVersion":"1.3.20","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.3":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.3","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.3","dist":{"shasum":"da08bb681fb24aa5c988ca71f8c10f27f09daf4a","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.3.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.4":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.4","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.4","dist":{"shasum":"25d771771590b1ca39277aea4506af234c5f4342","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.4.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.5":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.5","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","couch-login":"~0.1.18","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.5","dist":{"shasum":"98ba1ac851a3939a3fb9917c28fa8da522dc635f","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.5.tgz"},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.3.6":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.3.6","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.3.6","dist":{"shasum":"c48a2a03643769acc49672860f7920ec6bffac6e","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.3.6.tgz"},"_from":".","_npmVersion":"1.3.26","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.0","dist":{"shasum":"30d0c178b7f2e54183a6a3fc9fe4071eb10290bf","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.0.tgz"},"_from":".","_npmVersion":"1.3.26","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.1","dist":{"shasum":"9c49b3e44558e2072158fb085be8a083c5f83537","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.1.tgz"},"_from":".","_npmVersion":"1.4.0","_npmUser":{"name":"npm-www","email":"npm@npmjs.com"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.2":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.2","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.2","dist":{"shasum":"d9568a9413bee14951201ce73f3b3992ec6658c0","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.2.tgz"},"_from":".","_npmVersion":"1.4.1","_npmUser":{"name":"npm-www","email":"npm@npmjs.com"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.3":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.3","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.3","dist":{"shasum":"aa188fc5067158e991a57f4697c54994108f5389","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.3.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.4":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.4","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.4","dist":{"shasum":"f9dbc383a49069d8c7f67755a3ff6e424aff584f","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.4.tgz"},"_from":".","_npmVersion":"1.4.2","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.5":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.5","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.5","dist":{"shasum":"7d6fdca46139470715f9477ddb5ad3e770d4de7b","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.5.tgz"},"_from":".","_npmVersion":"1.4.4","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.6":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.6","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.6","_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"657f69a79543fc4cc264c3b2de958bd15f7140fe","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.6.tgz"},"directories":{}},"0.4.7":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.7","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.7","dist":{"shasum":"f4369b59890da7882527eb7c427dd95d43707afb","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.7.tgz"},"_from":".","_npmVersion":"1.4.6","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"directories":{}},"0.4.8":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.8","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.8","_shasum":"a6685a161033101be6064b7af887ab440e8695d0","_from":".","_npmVersion":"1.4.8","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"a6685a161033101be6064b7af887ab440e8695d0","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.8.tgz"},"directories":{}},"0.4.9":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.9","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.9","_shasum":"304d3d4726a58e33d8cc965afdc9ed70b996580c","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"304d3d4726a58e33d8cc965afdc9ed70b996580c","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.9.tgz"},"directories":{}},"0.4.10":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.10","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"^2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.10","_shasum":"ab7bf1be3ba07d769eaf74dee3c9347e02283116","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"ab7bf1be3ba07d769eaf74dee3c9347e02283116","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.10.tgz"},"directories":{}},"0.4.11":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.11","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"2 >=2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.11","_shasum":"032e9b6b050ed052ee9441841a945a184ea6bc33","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"032e9b6b050ed052ee9441841a945a184ea6bc33","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.11.tgz"},"directories":{}},"0.4.12":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"0.4.12","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"request":"2 >=2.25.0","graceful-fs":"~2.0.0","semver":"2 >=2.2.1","slide":"~1.1.3","chownr":"0","mkdirp":"~0.3.3","rimraf":"~2","retry":"0.6.0","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@0.4.12","_shasum":"34303422f6a3da93ca3a387a2650d707c8595b99","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"34303422f6a3da93ca3a387a2650d707c8595b99","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-0.4.12.tgz"},"directories":{}},"1.0.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"1.0.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"~2.0.0","mkdirp":"~0.3.3","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@1.0.0","_shasum":"2a6f9dfdce5f8ebf4b9af4dbfd738384d25014e5","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"2a6f9dfdce5f8ebf4b9af4dbfd738384d25014e5","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-1.0.0.tgz"},"directories":{}},"1.0.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"1.0.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"~2.0.0","mkdirp":"~0.3.3","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"98b1278c230cf6c159f189e2f8c69daffa727ab8","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@1.0.1","_shasum":"c5f6a87d285f2005a35d3f67d9c724bce551b0f1","_from":".","_npmVersion":"1.4.13","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"c5f6a87d285f2005a35d3f67d9c724bce551b0f1","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-1.0.1.tgz"},"directories":{}},"2.0.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"2.0.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"~2.0.0","mkdirp":"~0.3.3","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"47a98069b6a34e751cbd5b84ce92858cae5abe70","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@2.0.0","_shasum":"88810dac2d534c0df1d905c79e723392fcfc791a","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"dist":{"shasum":"88810dac2d534c0df1d905c79e723392fcfc791a","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-2.0.0.tgz"},"directories":{}},"2.0.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"2.0.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"123e40131f83f7265f66ecd2a558cce44a3aea86","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@2.0.1","_shasum":"611c7cb7c8f7ff22be2ebc6398423b5de10db0e2","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"611c7cb7c8f7ff22be2ebc6398423b5de10db0e2","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-2.0.1.tgz"},"directories":{}},"2.0.2":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"2.0.2","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"6ecc311c9dd4890f2d9b6bae60447070a3321e12","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@2.0.2","_shasum":"a82b000354c7f830114fb18444764bc477d5740f","_from":".","_npmVersion":"1.4.15","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"a82b000354c7f830114fb18444764bc477d5740f","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-2.0.2.tgz"},"directories":{}},"3.0.0":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.0","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","normalize-package-data":"^0.4.0","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"6bb1aec1e85fa82ee075bd997d6fb9f2dbb7f643","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.0","_shasum":"4febc5cdb274e9fa06bc3008910e3fa1ec007994","_from":".","_npmVersion":"1.5.0-pre","_npmUser":{"name":"othiym23","email":"ogd@aoaioxxysz.net"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"4febc5cdb274e9fa06bc3008910e3fa1ec007994","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.0.tgz"},"directories":{}},"3.0.1":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.1","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","normalize-package-data":"^0.4.0","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"fe8382dde609ea1e3580fcdc5bc3d0bba119cfc6","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.1","_shasum":"5f3ee362ce5c237cfb798fce22c77875fc1a63c2","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"othiym23","email":"ogd@aoaioxxysz.net"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"5f3ee362ce5c237cfb798fce22c77875fc1a63c2","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.1.tgz"},"directories":{}},"2.0.3":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"2.0.3","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"2578fb9a807d77417554ba235ba8fac39405e832","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@2.0.3","_shasum":"93dad3d9a162c99404badb71739c622c0f3b9a72","_from":".","_npmVersion":"1.5.0-alpha-1","_npmUser":{"name":"othiym23","email":"ogd@aoaioxxysz.net"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"93dad3d9a162c99404badb71739c622c0f3b9a72","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-2.0.3.tgz"},"directories":{}},"3.0.2":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.2","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","normalize-package-data":"^0.4.0","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"15343019160ace0b9874cf0ec186b3425dbc7301","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.2","_shasum":"5dd0910157ce55f4286a1871d39f9a2128cd3c99","_from":".","_npmVersion":"1.5.0-alpha-2","_npmUser":{"name":"othiym23","email":"ogd@aoaioxxysz.net"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"5dd0910157ce55f4286a1871d39f9a2128cd3c99","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.2.tgz"},"directories":{}},"3.0.3":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.3","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.3.3","normalize-package-data":"^0.4.0","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1 || 3.x","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"b18a780d1185f27c06c27812147b83aba0d4a2f5","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.3","_shasum":"2377dc1cf69b4d374b3a95fb7feba8c804d8cb30","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"2377dc1cf69b4d374b3a95fb7feba8c804d8cb30","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.3.tgz"},"directories":{}},"3.0.4":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.4","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"~0.5.0","normalize-package-data":"^0.4.0","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1 || 3.x","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"54900fe4b2eb5b99ee6dfe173f145732fdfae80e","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.4","_shasum":"d4a177d1f25615cfaef9b6844fa366ffbf5f578a","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"d4a177d1f25615cfaef9b6844fa366ffbf5f578a","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.4.tgz"},"directories":{}},"3.0.5":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.5","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"0.5","normalize-package-data":"0.4","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"2","semver":"2 >=2.2.1 || 3.x","slide":"^1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"BSD","gitHead":"635db1654346bc86473df7b39626601425f46177","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.5","_shasum":"cdabaefa399b81ac8a86a48718aefd80e7b19ff3","_from":".","_npmVersion":"2.0.0-alpha-5","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"cdabaefa399b81ac8a86a48718aefd80e7b19ff3","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.5.tgz"},"directories":{}},"3.0.6":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"3.0.6","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"^0.5.0","normalize-package-data":"0.4","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"2","semver":"2 >=2.2.1 || 3.x","slide":"^1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"ISC","gitHead":"eba30fadd724ed5cad1aec95ac3ee907a59b7317","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@3.0.6","_shasum":"14a17d9a60ed2a80b04edcbc596dbce0d96540ee","_from":".","_npmVersion":"1.4.22","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"14a17d9a60ed2a80b04edcbc596dbce0d96540ee","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-3.0.6.tgz"},"directories":{}},"2.0.4":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"name":"@npm/npm-registry-client","description":"Client for the npm registry","version":"2.0.4","repository":{"url":"git://github.com/isaacs/npm-registry-client"},"main":"index.js","scripts":{"test":"tap test/*.js"},"dependencies":{"chownr":"0","graceful-fs":"^3.0.0","mkdirp":"^0.5.0","npm-cache-filename":"^1.0.0","request":"2 >=2.25.0","retry":"0.6.0","rimraf":"~2","semver":"2 >=2.2.1","slide":"~1.1.3","npmlog":""},"devDependencies":{"tap":""},"optionalDependencies":{"npmlog":""},"license":"ISC","gitHead":"a10f621d9cdc813b9d3092a14b661f65bfa6d40d","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"homepage":"https://github.com/isaacs/npm-registry-client","_id":"@npm%2fnpm-registry-client@2.0.4","_shasum":"528e08900d7655c12096d1637d1c3a7a5b451019","_from":".","_npmVersion":"1.4.22","_npmUser":{"name":"isaacs","email":"i@izs.me"},"maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"dist":{"shasum":"528e08900d7655c12096d1637d1c3a7a5b451019","tarball":"http://registry.npmjs.org/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-2.0.4.tgz"},"directories":{}}},"readme":"# npm-registry-client\u000a\u000aThe code that npm uses to talk to the registry.\u000a\u000aIt handles all the caching and HTTP calls.\u000a\u000a## Usage\u000a\u000a```javascript\u000avar RegClient = require('npm-registry-client')\u000avar client = new RegClient(config)\u000avar uri = \"npm://registry.npmjs.org/npm\"\u000avar options = {timeout: 1000}\u000a\u000aclient.get(uri, options, function (error, data, raw, res) {\u000a // error is an error if there was a problem.\u000a // data is the parsed data object\u000a // raw is the json string\u000a // res is the response from couch\u000a})\u000a```\u000a\u000a# Registry URLs\u000a\u000aThe registry calls take either a full URL pointing to a resource in the\u000aregistry, or a base URL for the registry as a whole (for the base URL, any path\u000awill be ignored). In addition to `http` and `https`, `npm` URLs are allowed.\u000a`npm` URLs are `https` URLs with the additional restrictions that they will\u000aalways include authorization credentials, and the response is always registry\u000ametadata (and not tarballs or other attachments).\u000a\u000a# Configuration\u000a\u000aThis program is designed to work with\u000a[npmconf](https://npmjs.org/package/npmconf), but you can also pass in\u000aa plain-jane object with the appropriate configs, and it'll shim it\u000afor you. Any configuration thingie that has get/set/del methods will\u000aalso be accepted.\u000a\u000a* `cache` **Required** {String} Path to the cache folder\u000a* `always-auth` {Boolean} Auth even for GET requests.\u000a* `auth` {String} A base64-encoded `username:password`\u000a* `email` {String} User's email address\u000a* `tag` {String} The default tag to use when publishing new packages.\u000a Default = `\"latest\"`\u000a* `ca` {String} Cerficate signing authority certificates to trust.\u000a* `cert` {String} Client certificate (PEM encoded). Enable access\u000a to servers that require client certificates\u000a* `key` {String} Private key (PEM encoded) for client certificate 'cert'\u000a* `strict-ssl` {Boolean} Whether or not to be strict with SSL\u000a certificates. Default = `true`\u000a* `user-agent` {String} User agent header to send. Default =\u000a `\"node/{process.version} {process.platform} {process.arch}\"`\u000a* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\u000a that works, otherwise logs are disabled.\u000a* `fetch-retries` {Number} Number of times to retry on GET failures.\u000a Default=2\u000a* `fetch-retry-factor` {Number} `factor` setting for `node-retry`. Default=10\u000a* `fetch-retry-mintimeout` {Number} `minTimeout` setting for `node-retry`.\u000a Default=10000 (10 seconds)\u000a* `fetch-retry-maxtimeout` {Number} `maxTimeout` setting for `node-retry`.\u000a Default=60000 (60 seconds)\u000a* `proxy` {URL} The url to proxy requests through.\u000a* `https-proxy` {URL} The url to proxy https requests through.\u000a Defaults to be the same as `proxy` if unset.\u000a* `_auth` {String} The base64-encoded authorization header.\u000a* `username` `_password` {String} Username/password to use to generate\u000a `_auth` if not supplied.\u000a* `_token` {Object} A token for use with\u000a [couch-login](https://npmjs.org/package/couch-login)\u000a\u000a# client.request(method, uri, options, cb)\u000a\u000a* `method` {String} HTTP method\u000a* `uri` {String} URI pointing to the resource to request\u000a* `options` {Object} Object containing optional per-request properties.\u000a * `what` {Stream | Buffer | String | Object} The request body. Objects\u000a that are not Buffers or Streams are encoded as JSON.\u000a * `etag` {String} The cached ETag\u000a * `follow` {Boolean} Follow 302/301 responses (defaults to true)\u000a* `cb` {Function}\u000a * `error` {Error | null}\u000a * `data` {Object} the parsed data object\u000a * `raw` {String} the json\u000a * `res` {Response Object} response from couch\u000a\u000aMake a request to the registry. All the other methods are wrappers around\u000a`request`.\u000a\u000a# client.adduser(base, username, password, email, cb)\u000a\u000a* `base` {String} Base registry URL\u000a* `username` {String}\u000a* `password` {String}\u000a* `email` {String}\u000a* `cb` {Function}\u000a\u000aAdd a user account to the registry, or verify the credentials.\u000a\u000a# client.deprecate(uri, version, message, cb)\u000a\u000a* `uri` {String} Full registry URI for the deprecated package\u000a* `version` {String} Semver version range\u000a* `message` {String} The message to use as a deprecation warning\u000a* `cb` {Function}\u000a\u000aDeprecate a version of a package in the registry.\u000a\u000a# client.bugs(uri, cb)\u000a\u000a* `uri` {String} Full registry URI for the package\u000a* `cb` {Function}\u000a\u000aGet the url for bugs of a package\u000a\u000a# client.get(uri, options, cb)\u000a\u000a* `uri` {String} The complete registry URI to fetch\u000a* `options` {Object} Object containing optional per-request properties.\u000a * `timeout` {Number} Duration before the request times out.\u000a * `follow` {Boolean} Follow 302/301 responses (defaults to true)\u000a * `staleOk` {Boolean} If there's cached data available, then return that\u000a to the callback quickly, and update the cache the background.\u000a\u000aFetches data from the registry via a GET request, saving it in the cache folder\u000awith the ETag.\u000a\u000a# client.publish(uri, data, tarball, cb)\u000a\u000a* `uri` {String} The registry URI to publish to\u000a* `data` {Object} Package data\u000a* `tarball` {String | Stream} Filename or stream of the package tarball\u000a* `cb` {Function}\u000a\u000aPublish a package to the registry.\u000a\u000aNote that this does not create the tarball from a folder. However, it can\u000aaccept a gzipped tar stream or a filename to a tarball.\u000a\u000a# client.star(uri, starred, cb)\u000a\u000a* `uri` {String} The complete registry URI to star\u000a* `starred` {Boolean} True to star the package, false to unstar it.\u000a* `cb` {Function}\u000a\u000aStar or unstar a package.\u000a\u000aNote that the user does not have to be the package owner to star or unstar a\u000apackage, though other writes do require that the user be the package owner.\u000a\u000a# client.stars(base, username, cb)\u000a\u000a* `base` {String} The base URL for the registry\u000a* `username` {String} Name of user to fetch starred packages for.\u000a* `cb` {Function}\u000a\u000aView your own or another user's starred packages.\u000a\u000a# client.tag(uri, version, tag, cb)\u000a\u000a* `uri` {String} The complete registry URI to tag\u000a* `version` {String} Version to tag\u000a* `tag` {String} Tag name to apply\u000a* `cb` {Function}\u000a\u000aMark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the\u000aspecified version.\u000a\u000a# client.unpublish(uri, [ver], cb)\u000a\u000a* `uri` {String} The complete registry URI to unpublish\u000a* `ver` {String} version to unpublish. Leave blank to unpublish all\u000a versions.\u000a* `cb` {Function}\u000a\u000aRemove a version of a package (or all versions) from the registry. When the\u000alast version us unpublished, the entire document is removed from the database.\u000a\u000a# client.upload(uri, file, [etag], [nofollow], cb)\u000a\u000a* `uri` {String} The complete registry URI to upload to\u000a* `file` {String | Stream} Either the filename or a readable stream\u000a* `etag` {String} Cache ETag\u000a* `nofollow` {Boolean} Do not follow 301/302 responses\u000a* `cb` {Function}\u000a\u000aUpload an attachment. Mostly used by `client.publish()`.\u000a","maintainers":[{"name":"isaacs","email":"i@izs.me"},{"name":"othiym23","email":"ogd@aoaioxxysz.net"}],"time":{"modified":"2014-07-31T21:59:52.896Z","created":"2012-06-07T04:43:36.581Z","0.0.1":"2012-06-07T04:43:38.123Z","0.0.2":"2012-06-07T05:35:05.937Z","0.0.3":"2012-06-09T00:55:25.861Z","0.0.4":"2012-06-11T03:53:26.548Z","0.0.5":"2012-06-11T23:48:11.235Z","0.0.6":"2012-06-17T06:23:27.320Z","0.0.7":"2012-06-18T19:19:38.315Z","0.0.8":"2012-06-28T20:40:20.563Z","0.0.9":"2012-07-10T03:28:04.651Z","0.0.10":"2012-07-11T17:03:45.151Z","0.0.11":"2012-07-17T14:06:37.489Z","0.1.0":"2012-07-23T18:17:38.007Z","0.1.1":"2012-07-23T21:21:28.196Z","0.1.2":"2012-07-24T06:14:12.831Z","0.1.3":"2012-08-07T02:02:20.564Z","0.1.4":"2012-08-15T03:04:52.822Z","0.1.5":"2012-08-17T21:59:33.310Z","0.2.0":"2012-08-17T22:00:18.081Z","0.2.1":"2012-08-17T22:07:28.827Z","0.2.2":"2012-08-17T22:37:24.352Z","0.2.3":"2012-08-19T19:16:44.808Z","0.2.4":"2012-08-19T19:18:51.792Z","0.2.5":"2012-08-20T16:54:50.794Z","0.2.6":"2012-08-22T00:25:04.766Z","0.2.7":"2012-08-27T19:07:34.829Z","0.2.8":"2012-10-02T19:53:50.661Z","0.2.9":"2012-10-03T22:09:50.766Z","0.2.10":"2012-10-25T14:55:54.216Z","0.2.11":"2012-12-21T16:26:38.094Z","0.2.12":"2013-01-18T22:22:41.668Z","0.2.13":"2013-02-06T00:16:35.939Z","0.2.14":"2013-02-10T02:44:02.764Z","0.2.15":"2013-02-11T19:18:55.678Z","0.2.16":"2013-02-15T17:09:03.249Z","0.2.17":"2013-02-16T03:47:13.898Z","0.2.18":"2013-03-06T22:09:23.536Z","0.2.19":"2013-03-20T06:27:39.128Z","0.2.20":"2013-03-28T00:43:07.558Z","0.2.21":"2013-04-29T15:46:54.094Z","0.2.22":"2013-04-29T15:51:02.178Z","0.2.23":"2013-05-11T00:28:14.198Z","0.2.24":"2013-05-24T21:27:50.693Z","0.2.25":"2013-06-20T15:36:46.277Z","0.2.26":"2013-07-06T17:12:54.670Z","0.2.27":"2013-07-11T07:14:45.740Z","0.2.28":"2013-08-02T20:27:41.732Z","0.2.29":"2013-10-28T18:23:24.477Z","0.2.30":"2013-11-18T23:12:00.540Z","0.2.31":"2013-12-16T08:36:43.044Z","0.3.0":"2013-12-17T07:03:10.699Z","0.3.1":"2013-12-17T16:53:27.867Z","0.3.2":"2013-12-17T22:25:14.882Z","0.3.3":"2013-12-21T16:07:06.773Z","0.3.4":"2014-01-29T15:24:05.163Z","0.3.5":"2014-01-31T01:53:19.656Z","0.3.6":"2014-02-07T00:17:21.362Z","0.4.0":"2014-02-13T01:17:18.973Z","0.4.1":"2014-02-13T23:47:37.892Z","0.4.2":"2014-02-14T00:29:13.086Z","0.4.3":"2014-02-16T03:40:54.640Z","0.4.4":"2014-02-16T03:41:48.856Z","0.4.5":"2014-03-12T05:09:17.474Z","0.4.6":"2014-03-29T19:44:15.041Z","0.4.7":"2014-04-02T19:41:07.149Z","0.4.8":"2014-05-01T22:24:54.980Z","0.4.9":"2014-05-12T21:52:55.127Z","0.4.10":"2014-05-13T16:44:29.801Z","0.4.11":"2014-05-13T20:33:04.738Z","0.4.12":"2014-05-14T06:14:22.842Z","1.0.0":"2014-05-14T23:04:37.188Z","1.0.1":"2014-06-03T00:55:54.448Z","2.0.0":"2014-06-06T04:23:46.579Z","2.0.1":"2014-06-06T06:25:14.419Z","2.0.2":"2014-06-14T00:33:10.205Z","3.0.0":"2014-07-02T00:30:29.154Z","3.0.1":"2014-07-14T23:29:05.057Z","2.0.3":"2014-07-15T00:09:36.043Z","3.0.2":"2014-07-17T06:30:02.659Z","3.0.3":"2014-07-23T21:20:42.406Z","3.0.4":"2014-07-25T00:27:26.007Z","3.0.5":"2014-07-25T00:28:48.007Z","3.0.6":"2014-07-31T21:57:49.043Z","2.0.4":"2014-07-31T21:59:52.896Z"},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me/"},"repository":{"url":"git://github.com/isaacs/npm-registry-client"},"users":{"fgribreau":true,"fengmk2":true},"readmeFilename":"README.md","homepage":"https://github.com/isaacs/npm-registry-client","bugs":{"url":"https://github.com/isaacs/npm-registry-client/issues"},"license":"ISC","_attachments":{}}
--- /dev/null
+{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.3.3","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.3.3","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"47ac53683daf832bfa952e1774417da47817ae42","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.3.3.tgz"},"readme":" __ \n /\\ \\ __ \n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____ \n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\ \n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/ \n \\ \\____/ \n \\/___/\n \nUnderscore.js is a utility-belt library for JavaScript that provides \nsupport for the usual functional suspects (each, map, reduce, filter...) \nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://documentcloud.github.com/underscore/\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n","maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}}
\ No newline at end of file
--- /dev/null
+{"_id":"underscore","_rev":"72-47f2986bfd8e8b55068b204588bbf484","name":"underscore","description":"JavaScript's functional programming helper library.","dist-tags":{"latest":"1.3.3","stable":"1.3.3"},"versions":{"1.0.3":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore","version":"1.0.3","_id":"underscore@1.0.3","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/underscore/-/underscore-1.0.3.tgz"},"directories":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.0.4":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore","version":"1.0.4","_id":"underscore@1.0.4","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/underscore/-/underscore-1.0.4.tgz"},"directories":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.0":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore","version":"1.1.0","_id":"underscore@1.1.0","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.0.tgz"},"directories":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.1":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore","version":"1.1.1","_id":"underscore@1.1.1","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.1.tgz"},"directories":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.2":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore","version":"1.1.2","_id":"underscore@1.1.2","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.2.tgz"},"directories":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.3":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore","version":"1.1.3","_id":"underscore@1.1.3","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.8-1","_nodeVersion":"v0.2.5","dist":{"tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.3.tgz"},"directories":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.4":{"name":"underscore","description":"Functional programming aid for JavaScript. Works well with jQuery.","url":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"lib":".","main":"underscore.js","version":"1.1.4","_id":"underscore@1.1.4","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.9","_nodeVersion":"v0.5.0-pre","dist":{"shasum":"9e82274902865625b3a6d4c315a38ffd80047dae","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.4.tgz"},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.1.5":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.1.5","_id":"underscore@1.1.5","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.16","_nodeVersion":"v0.4.2","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"23601d62c75619998b2f0db24938102793336a56","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.5.tgz"},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.6":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.1.6","_id":"underscore@1.1.6","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"0.3.18","_nodeVersion":"v0.4.2","directories":{},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"6868da1bdd72d75285be0b4e50f228e70d001a2c","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.6.tgz"},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}]},"1.1.7":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.1.7","devDependencies":{},"_id":"underscore@1.1.7","engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.3","_nodeVersion":"v0.4.7","_defaultsLoaded":true,"dist":{"shasum":"40bab84bad19d230096e8d6ef628bff055d83db0","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.1.7.tgz"},"scripts":{},"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.2.0":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.2.0","_npmJsonOpts":{"file":"/Users/jashkenas/.npm/underscore/1.2.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"underscore@1.2.0","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.22","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"b32ce32c8c118caa8031c10b54c7f65ab3b557fd","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.2.0.tgz"},"scripts":{},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"directories":{}},"1.2.1":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.2.1","_npmJsonOpts":{"file":"/Users/jashkenas/.npm/underscore/1.2.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"underscore@1.2.1","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.22","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"fc5c6b0765673d92a2d4ac8b4dc0aa88702e2bd4","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.2.1.tgz"},"scripts":{},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"directories":{}},"1.2.2":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.2.2","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.2.2","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"74dd40e9face84e724eb2edae945b8aedc233ba3","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.2.2.tgz"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.2.3":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"dependencies":{},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.2.3","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.2.3","devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"11b874da70f4683d7d48bba2b44be1e600d2f6cf","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.2.3.tgz"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.2.4":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.2.4","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.2.4","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"e8da6241aa06f64df2473bb2590b8c17c84c3c7e","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.2.4.tgz"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.3.0":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"contributors":[],"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.3.0","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.3.0","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"253b2d79b7bb67943ced0fc744eb18267963ede8","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.3.0.tgz"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.3.1":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.3.1","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.3.1","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.6","_defaultsLoaded":true,"dist":{"shasum":"6cb8aad0e77eb5dbbfb54b22bcd8697309cf9641","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.3.1.tgz"},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.3.2":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.3.2","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.3.2","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"1b4e455089ab1d1d38ab6794ffe6cf08f764394a","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.3.2.tgz"},"readme":" __ \n /\\ \\ __ \n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____ \n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\ \n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/ \n \\ \\____/ \n \\/___/\n \nUnderscore.js is a utility-belt library for JavaScript that provides \nsupport for the usual functional suspects (each, map, reduce, filter...) \nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://documentcloud.github.com/underscore/\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n","maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}},"1.3.3":{"name":"underscore","description":"JavaScript's functional programming helper library.","homepage":"http://documentcloud.github.com/underscore/","keywords":["util","functional","server","client","browser"],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"main":"underscore.js","version":"1.3.3","_npmUser":{"name":"jashkenas","email":"jashkenas@gmail.com"},"_id":"underscore@1.3.3","dependencies":{},"devDependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.1","_nodeVersion":"v0.6.11","_defaultsLoaded":true,"dist":{"shasum":"47ac53683daf832bfa952e1774417da47817ae42","tarball":"http://registry.npmjs.org/underscore/-/underscore-1.3.3.tgz"},"readme":" __ \n /\\ \\ __ \n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____ \n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\ \n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/ \n \\ \\____/ \n \\/___/\n \nUnderscore.js is a utility-belt library for JavaScript that provides \nsupport for the usual functional suspects (each, map, reduce, filter...) \nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://documentcloud.github.com/underscore/\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n","maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"directories":{}}},"maintainers":[{"name":"documentcloud","email":"jeremy@documentcloud.org"},{"name":"jashkenas","email":"jashkenas@gmail.com"}],"author":{"name":"Jeremy Ashkenas","email":"jeremy@documentcloud.org"},"time":{"1.0.3":"2011-12-07T15:12:18.045Z","1.0.4":"2011-12-07T15:12:18.045Z","1.1.0":"2011-12-07T15:12:18.045Z","1.1.1":"2011-12-07T15:12:18.045Z","1.1.2":"2011-12-07T15:12:18.045Z","1.1.3":"2011-12-07T15:12:18.045Z","1.1.4":"2011-12-07T15:12:18.045Z","1.1.5":"2011-12-07T15:12:18.045Z","1.1.6":"2011-12-07T15:12:18.045Z","1.1.7":"2011-12-07T15:12:18.045Z","1.2.0":"2011-12-07T15:12:18.045Z","1.2.1":"2011-12-07T15:12:18.045Z","1.2.2":"2011-11-14T20:28:47.115Z","1.2.3":"2011-12-07T15:12:18.045Z","1.2.4":"2012-01-09T17:23:14.818Z","1.3.0":"2012-01-11T16:41:38.459Z","1.3.1":"2012-01-23T22:57:36.474Z","1.3.2":"2012-04-09T18:38:14.345Z","1.3.3":"2012-04-10T14:43:48.089Z"},"repository":{"type":"git","url":"git://github.com/documentcloud/underscore.git"},"users":{"vesln":true,"mvolkmann":true,"lancehunt":true,"mikl":true,"linus":true,"vasc":true,"bat":true,"dmalam":true,"mbrevoort":true,"danielr":true,"rsimoes":true,"thlorenz":true}}
\ No newline at end of file
--- /dev/null
+gauge
+=====
+
+A nearly stateless terminal based horizontal guage / progress bar.
+
+```javascript
+var Gauge = require("gauge")
+
+var gauge = new Gauge()
+
+gauge.show("test", 0.20)
+
+gauge.pulse("this")
+
+gauge.hide()
+```
+
+![](example.png)
+
+
+### `var gauge = new Gauge([options], [ansiStream])`
+
+* **options** – *(optional)* An option object. (See [below] for details.)
+* **ansiStream** – *(optional)* A stream that's been blessed by the [ansi]
+ module to include various commands for controlling the cursor in a terminal.
+
+[ansi]: https://www.npmjs.com/package/ansi
+[below]: #theme-objects
+
+Constructs a new gauge. Gauges are drawn on a single line, and are not drawn
+if the current terminal isn't a tty.
+
+The **options** object can have the following properties, all of which are
+optional:
+
+* maxUpdateFrequency: defaults to 50 msec, the gauge will not be drawn more
+ than once in this period of time. This applies to `show` and `pulse`
+ calls, but if you `hide` and then `show` the gauge it will draw it
+ regardless of time since last draw.
+* theme: defaults to Gauge.unicode` if the terminal supports
+ unicode according to [has-unicode], otherwise it defaults to `Gauge.ascii`.
+ Details on the [theme object](#theme-objects) are documented elsewhere.
+* template: see [documentation elsewhere](#template-objects) for
+ defaults and details.
+
+[has-unicode]: https://www.npmjs.com/package/has-unicode
+
+If **ansiStream** isn't passed in, then one will be constructed from stderr
+with `ansi(process.stderr)`.
+
+### `gauge.show([name, [completed]])`
+
+* **name** – *(optional)* The name of the current thing contributing to progress. Defaults to the last value used, or "".
+* **completed** – *(optional)* The portion completed as a value between 0 and 1. Defaults to the last value used, or 0.
+
+If `process.stdout.isTTY` is false then this does nothing. If completed is 0
+and `gauge.pulse` has never been called, then similarly nothing will be printed.
+
+If `maxUpdateFrequency` msec haven't passed since the last call to `show` or
+`pulse` then similarly, nothing will be printed. (Actually, the update is
+deferred until `maxUpdateFrequency` msec have passed and if nothing else has
+happened, the gauge update will happen.)
+
+### `gauge.hide()`
+
+Removes the gauge from the terminal.
+
+### `gauge.pulse([name])`
+
+* **name** – *(optional)* The specific thing that triggered this pulse
+
+Spins the spinner in the gauge to show output. If **name** is included then
+it will be combined with the last name passed to `gauge.show` using the
+subsection property of the theme (typically a right facing arrow).
+
+### `gauge.disable()`
+
+Hides the gauge and ignores further calls to `show` or `pulse`.
+
+### `gauge.enable()`
+
+Shows the gauge and resumes updating when `show` or `pulse` is called.
+
+### Theme Objects
+
+There are two theme objects available as a part of the module, `Gauge.unicode` and `Gauge.ascii`.
+Theme objects have the follow properties:
+
+| Property | Unicode | ASCII |
+| ---------- | ------- | ----- |
+| startgroup | ╢ | \| |
+| endgroup | ╟ | \| |
+| complete | █ | # |
+| incomplete | ░ | - |
+| spinner | ▀▐▄▌ | -\\\|/ |
+| subsection | → | -> |
+
+*startgroup*, *endgroup* and *subsection* can be as many characters as you want.
+
+*complete* and *incomplete* should be a single character width each.
+
+*spinner* is a list of characters to use in turn when displaying an activity
+spinner. The Gauge will spin as many characters as you give here.
+
+### Template Objects
+
+A template is an array of objects and strings that, after being evaluated,
+will be turned into the gauge line. The default template is:
+
+```javascript
+[
+ {type: "name", separated: true, maxLength: 25, minWidth: 25, align: "left"},
+ {type: "spinner", separated: true},
+ {type: "startgroup"},
+ {type: "completionbar"},
+ {type: "endgroup"}
+]
+```
+
+The various template elements can either be **plain strings**, in which case they will
+be be included verbatum in the output.
+
+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
+ `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
+ from the spinner property of the theme.
+ * `startgroup` – The `startgroup` property from the theme.
+ * `completionbar` – This progress bar itself
+ * `endgroup` – The `endgroup` property from the theme.
+* *separated* – If true, the element will be separated with spaces from things on
+ either side (and margins count as space, so it won't be indented), but only
+ if its included.
+* *maxLength* – The maximum length for this element. If its value is longer it
+ will be truncated.
+* *minLength* – The minimum length for this element. If its value is shorter it
+ 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* and *minLength or *maxLength* are specifed then the latter take precedence.
+
+### Tracking Completion
+
+If you have more than one thing going on that you want to track completion
+of, you may find the related [are-we-there-yet] helpful. It's `change`
+event can be wired up to the `show` method to get a more traditional
+progress bar interface.
+
+[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet
--- /dev/null
+has-unicode
+===========
+
+Try to guess if your terminal supports unicode
"url": "https://github.com/npm/readdir-scoped-modules/issues"
},
"homepage": "https://github.com/npm/readdir-scoped-modules",
- "readme": "# readdir-scoped-modules\n\nLike `fs.readdir` but handling `@org/module` dirs as if they were\na single entry.\n\nUsed by npm.\n\n## USAGE\n\n```javascript\nvar readdir = require('readdir-scoped-modules')\n\nreaddir('node_modules', function (er, entries) {\n // entries will be something like\n // ['a', '@org/foo', '@org/bar']\n})\n```\n",
- "readmeFilename": "README.md",
"gitHead": "451d38946c5b6b6c0db33a890f33536a11ed79f7",
"_id": "readdir-scoped-modules@1.0.1",
"_shasum": "5c2a77f3e08250a8fddf53fa58cdc17900b808b9",
- "_from": "readdir-scoped-modules@>=1.0.0 <2.0.0"
+ "_from": "readdir-scoped-modules@>=1.0.0 <2.0.0",
+ "_npmVersion": "2.1.9",
+ "_nodeVersion": "0.10.33",
+ "_npmUser": {
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
+ },
+ "maintainers": [
+ {
+ "name": "isaacs",
+ "email": "i@izs.me"
+ },
+ {
+ "name": "othiym23",
+ "email": "ogd@aoaioxxysz.net"
+ }
+ ],
+ "dist": {
+ "shasum": "5c2a77f3e08250a8fddf53fa58cdc17900b808b9",
+ "tarball": "http://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.1.tgz"
+ },
+ "_resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.1.tgz",
+ "readme": "ERROR: No README data found!"
}
{
"name": "read-installed",
"description": "Read all the installed packages in a folder, and return a tree structure with all the data.",
- "version": "3.1.5",
+ "version": "4.0.0",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/read-installed"
},
"dependencies": {
"debuglog": "^1.0.1",
- "read-package-json": "1",
+ "read-package-json": "^2.0.0",
"readdir-scoped-modules": "^1.0.0",
"semver": "2 || 3 || 4",
"slide": "~1.1.3",
},
"readme": "# read-installed\n\nRead all the installed packages in a folder, and return a tree\nstructure with all the data.\n\nnpm uses this.\n\n## 2.0.0\n\nBreaking changes in `2.0.0`:\n\nThe second argument is now an `Object` that contains the following keys:\n\n * `depth` optional, defaults to Infinity\n * `log` optional log Function\n * `dev` optional, default false, set to true to include devDependencies\n\n## Usage\n\n```javascript\nvar readInstalled = require(\"read-installed\")\n// optional options\nvar options = { dev: false, log: fn, depth: 2 }\nreadInstalled(folder, options, function (er, data) {\n ...\n})\n```\n",
"readmeFilename": "README.md",
- "gitHead": "577c3f3f4f1e435f9bd944b8f99ce3f7552709ef",
+ "gitHead": "c1dea4823e2219a79d6184621917ee27d4283bc0",
"bugs": {
"url": "https://github.com/isaacs/read-installed/issues"
},
"homepage": "https://github.com/isaacs/read-installed",
- "_id": "read-installed@3.1.5",
- "_shasum": "4ae36081afd3e2204dc2e279807aaa52c30c8c0c",
- "_from": "read-installed@>=3.1.5 <3.2.0"
+ "_id": "read-installed@4.0.0",
+ "_shasum": "dbca08d6bd83e2a3b93c962053ba4d839e0769ba",
+ "_from": "read-installed@>=4.0.0 <4.1.0"
}
{
"name": "read-package-json",
- "version": "1.3.3",
+ "version": "2.0.0",
"author": {
"name": "Isaac Z. Schlueter",
"email": "i@izs.me",
"dependencies": {
"glob": "^5.0.3",
"json-parse-helpfulerror": "^1.0.2",
- "normalize-package-data": "^1.0.0",
+ "normalize-package-data": "^2.0.0",
"graceful-fs": "2 || 3"
},
"devDependencies": {
"graceful-fs": "2 || 3"
},
"license": "ISC",
+ "gitHead": "1a0476fef4ed8a70b48bfdc90070d897b8ad5469",
"readme": "# read-package-json\n\nThis is the thing that npm uses to read package.json files. It\nvalidates some stuff, and loads some default things.\n\nIt keeps a cache of the files you've read, so that you don't end\nup reading the same package.json file multiple times.\n\nNote that if you just want to see what's literally in the package.json\nfile, you can usually do `var data = require('some-module/package.json')`.\n\nThis module is basically only needed by npm, but it's handy to see what\nnpm will see when it looks at your package.\n\n## Usage\n\n```javascript\nvar readJson = require('read-package-json')\n\n// readJson(filename, [logFunction=noop], [strict=false], cb)\nreadJson('/path/to/package.json', console.error, false, function (er, data) {\n if (er) {\n console.error(\"There was an error reading the file\")\n return\n }\n\n console.error('the package data is', data)\n});\n```\n\n## readJson(file, [logFn = noop], [strict = false], cb)\n\n* `file` {String} The path to the package.json file\n* `logFn` {Function} Function to handle logging. Defaults to a noop.\n* `strict` {Boolean} True to enforce SemVer 2.0 version strings, and\n other strict requirements.\n* `cb` {Function} Gets called with `(er, data)`, as is The Node Way.\n\nReads the JSON file and does the things.\n\n## `package.json` Fields\n\nSee `man 5 package.json` or `npm help json`.\n\n## readJson.log\n\nBy default this is a reference to the `npmlog` module. But if that\nmodule can't be found, then it'll be set to just a dummy thing that does\nnothing.\n\nReplace with your own `{log,warn,error}` object for fun loggy time.\n\n## readJson.extras(file, data, cb)\n\nRun all the extra stuff relative to the file, with the parsed data.\n\nModifies the data as it does stuff. Calls the cb when it's done.\n\n## readJson.extraSet = [fn, fn, ...]\n\nArray of functions that are called by `extras`. Each one receives the\narguments `fn(file, data, cb)` and is expected to call `cb(er, data)`\nwhen done or when an error occurs.\n\nOrder is indeterminate, so each function should be completely\nindependent.\n\nMix and match!\n\n## readJson.cache\n\nThe `lru-cache` object that readJson uses to not read the same file over\nand over again. See\n[lru-cache](https://github.com/isaacs/node-lru-cache) for details.\n\n## Other Relevant Files Besides `package.json`\n\nSome other files have an effect on the resulting data object, in the\nfollowing ways:\n\n### `README?(.*)`\n\nIf there is a `README` or `README.*` file present, then npm will attach\na `readme` field to the data with the contents of this file.\n\nOwing to the fact that roughly 100% of existing node modules have\nMarkdown README files, it will generally be assumed to be Markdown,\nregardless of the extension. Please plan accordingly.\n\n### `server.js`\n\nIf there is a `server.js` file, and there is not already a\n`scripts.start` field, then `scripts.start` will be set to `node\nserver.js`.\n\n### `AUTHORS`\n\nIf there is not already a `contributors` field, then the `contributors`\nfield will be set to the contents of the `AUTHORS` file, split by lines,\nand parsed.\n\n### `bindings.gyp`\n\nIf a bindings.gyp file exists, and there is not already a\n`scripts.install` field, then the `scripts.install` field will be set to\n`node-gyp rebuild`.\n\n### `wscript`\n\nIf a wscript file exists, and there is not already a `scripts.install`\nfield, then the `scripts.install` field will be set to `node-waf clean ;\nnode-waf configure build`.\n\nNote that the `bindings.gyp` file supercedes this, since node-waf has\nbeen deprecated in favor of node-gyp.\n\n### `index.js`\n\nIf the json file does not exist, but there is a `index.js` file\npresent instead, and that file has a package comment, then it will try\nto parse the package comment, and use that as the data instead.\n\nA package comment looks like this:\n\n```javascript\n/**package\n * { \"name\": \"my-bare-module\"\n * , \"version\": \"1.2.3\"\n * , \"description\": \"etc....\" }\n **/\n\n// or...\n\n/**package\n{ \"name\": \"my-bare-module\"\n, \"version\": \"1.2.3\"\n, \"description\": \"etc....\" }\n**/\n```\n\nThe important thing is that it starts with `/**package`, and ends with\n`**/`. If the package.json file exists, then the index.js is not\nparsed.\n\n### `{directories.man}/*.[0-9]`\n\nIf there is not already a `man` field defined as an array of files or a\nsingle file, and\nthere is a `directories.man` field defined, then that directory will\nbe searched for manpages.\n\nAny valid manpages found in that directory will be assigned to the `man`\narray, and installed in the appropriate man directory at package install\ntime, when installed globally on a Unix system.\n\n### `{directories.bin}/*`\n\nIf there is not already a `bin` field defined as a string filename or a\nhash of `<name> : <filename>` pairs, then the `directories.bin`\ndirectory will be searched and all the files within it will be linked as\nexecutables at install time.\n\nWhen installing locally, npm links bins into `node_modules/.bin`, which\nis in the `PATH` environ when npm runs scripts. When\ninstalling globally, they are linked into `{prefix}/bin`, which is\npresumably in the `PATH` environment variable.\n",
"readmeFilename": "README.md",
- "gitHead": "74cdfd00c828b01cbd3bc85178448707b45cee3a",
"bugs": {
"url": "https://github.com/isaacs/read-package-json/issues"
},
"homepage": "https://github.com/isaacs/read-package-json",
- "_id": "read-package-json@1.3.3",
- "_shasum": "ef79dfda46e165376ee8a57efbfedd4d1b029ba4",
- "_from": "read-package-json@>=1.3.3 <1.4.0"
+ "_id": "read-package-json@2.0.0",
+ "_shasum": "ca7543298275028d27064b9118e6e501c9b3ae41",
+ "_from": "read-package-json@>=2.0.0 <2.1.0"
}
'graceful-fs': '~1.1.8'
},
devDependencies: { tap: '~0.2.5' },
- homepage: 'https://github.com/isaacs/read-package-json',
+ homepage: 'https://github.com/isaacs/read-package-json#readme',
optionalDependencies: { npmlog: '0', 'graceful-fs': '~1.1.8' },
_id: 'read-package-json@0.1.1',
readme: 'ERROR: No README data found!'
{
"name": "realize-package-specifier",
- "version": "2.2.0",
+ "version": "3.0.0",
"description": "Like npm-package-arg, but more so, producing full file paths and differentiating local tar and directory sources.",
"main": "index.js",
"scripts": {
"homepage": "https://github.com/npm/realize-package-specifier",
"dependencies": {
"dezalgo": "^1.0.1",
- "npm-package-arg": "^3.1.0"
+ "npm-package-arg": "^4.0.0"
},
"devDependencies": {
"require-inject": "^1.1.0",
"tap": "^0.4.12"
},
- "gitHead": "8810720d191647f06a505fc5da8d0634a21526b8",
+ "readme": "realize-package-specifier\n-------------------------\n\nParse a package specifier, peeking at the disk to differentiate between\nlocal tarballs, directories and named modules. This implements the logic\nused by `npm install` and `npm cache` to determine where to get packages\nfrom.\n\n```javascript\nvar realizePackageSpecifier = require(\"realize-package-specifier\")\nrealizePackageSpecifier(\"foo.tar.gz\", \".\", function (err, package) {\n …\n})\n```\n\n## Using\n\n* realizePackageSpecifier(*spec*, [*where*,] *callback*)\n\nParses *spec* using `npm-package-arg` and then uses stat to check to see if\nit refers to a local tarball or package directory. Stats are done relative\nto *where*. If it does then the local module is loaded. If it doesn't then\ntarget is left as a remote package specifier. Package directories are\nrecognized by the presence of a package.json in them.\n\n*spec* -- a package specifier, like: `foo@1.2`, or `foo@user/foo`, or\n`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`\n\n*where* (optional, default: .) -- The directory in which we should look for\nlocal tarballs or package directories.\n\n*callback* function(*err*, *result*) -- Called once we've determined what\nkind of specifier this is. The *result* object will be very like the one\nreturned by `npm-package-arg` except with three differences: 1) There's a\nnew type of `directory`. 2) The `local` type only refers to tarballs. 2)\nFor all `local` and `directory` type results spec will contain the full path of\nthe local package.\n\n## Result Object\n\nThe full definition of the result object is:\n\n* `name` - If known, the `name` field expected in the resulting pkg.\n* `type` - One of the following strings:\n * `git` - A git repo\n * `hosted` - A hosted project, from github, bitbucket or gitlab. Originally\n either a full url pointing at one of these services or a shorthand like\n `user/project` or `github:user/project` for github or `bitbucket:user/project`\n for bitbucket.\n * `tag` - A tagged version, like `\"foo@latest\"`\n * `version` - A specific version number, like `\"foo@1.2.3\"`\n * `range` - A version range, like `\"foo@2.x\"`\n * `local` - A local file path\n * `directory` - A local package directory\n * `remote` - An http url (presumably to a tgz)\n* `spec` - The \"thing\". URL, the range, git repo, etc.\n* `hosted` - If type=hosted this will be an object with the following keys:\n * `type` - github, bitbucket or gitlab\n * `ssh` - The ssh path for this git repo\n * `sshurl` - The ssh URL for this git repo\n * `https` - The HTTPS URL for this git repo\n * `directUrl` - The URL for the package.json in this git repo\n* `raw` - The original un-modified string that was provided.\n* `rawSpec` - The part after the `name@...`, as it was originally\n provided.\n* `scope` - If a name is something like `@org/module` then the `scope`\n field will be set to `org`. If it doesn't have a scoped name, then\n scope is `null`.\n\n",
+ "readmeFilename": "README.md",
+ "gitHead": "2a465b11a70b288d0fb56312dcb45ba8de45b320",
"bugs": {
"url": "https://github.com/npm/realize-package-specifier/issues"
},
- "_id": "realize-package-specifier@2.2.0",
- "_shasum": "95278b6021a39158f284e15756e827fc2998ed9c",
- "_from": "realize-package-specifier@>=2.2.0 <2.3.0",
- "_npmVersion": "2.4.1",
- "_nodeVersion": "1.0.4",
- "_npmUser": {
- "name": "iarna",
- "email": "me@re-becca.org"
- },
- "maintainers": [
- {
- "name": "iarna",
- "email": "me@re-becca.org"
- }
- ],
- "dist": {
- "shasum": "95278b6021a39158f284e15756e827fc2998ed9c",
- "tarball": "http://registry.npmjs.org/realize-package-specifier/-/realize-package-specifier-2.2.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/realize-package-specifier/-/realize-package-specifier-2.2.0.tgz",
- "readme": "ERROR: No README data found!"
+ "_id": "realize-package-specifier@3.0.0",
+ "_shasum": "38224d63f546d4972f0a68cb6e91f6cf73ac67fa",
+ "_from": "realize-package-specifier@>=3.0.0 <4.0.0"
}
name: null,
type: "hosted",
hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user/foo-js.git",
+ spec: "bitbucket:user/foo-js",
raw: "bitbucket:user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user/foo-js.git#bar/baz",
+ spec: "bitbucket:user/foo-js#bar/baz",
raw: "bitbucket:user/foo-js#bar/baz"
},
name: null,
type: "hosted",
hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user..blerg--/..foo-js.git# . . . . . some . tags / / /",
+ spec: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /",
raw: "bitbucket:user..blerg--/..foo-js# . . . . . some . tags / / /"
},
name: null,
type: "hosted",
hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user/foo-js.git#bar/baz/bin",
+ spec: "bitbucket:user/foo-js#bar/baz/bin",
raw: "bitbucket:user/foo-js#bar/baz/bin"
},
name: "foo",
type: "hosted",
hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user/foo-js.git",
+ spec: "bitbucket:user/foo-js",
raw: "foo@bitbucket:user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "bitbucket" },
- spec: "git+ssh://git@bitbucket.org/user/foo.git",
+ spec: "https://bitbucket.org/user/foo.git",
raw: "https://bitbucket.org/user/foo.git"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo-js.git",
+ spec: "github:user/foo-js",
raw: "user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo-js.git#bar/baz",
+ spec: "github:user/foo-js#bar/baz",
raw: "user/foo-js#bar/baz"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user..blerg--/..foo-js.git# . . . . . some . tags / / /",
+ spec: "github:user..blerg--/..foo-js# . . . . . some . tags / / /",
raw: "user..blerg--/..foo-js# . . . . . some . tags / / /"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo-js.git#bar/baz/bin",
+ spec: "github:user/foo-js#bar/baz/bin",
raw: "user/foo-js#bar/baz/bin"
},
name: "foo",
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo-js.git",
+ spec: "github:user/foo-js",
raw: "foo@user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo-js.git",
+ spec: "github:user/foo-js",
raw: "github:user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo.git",
+ spec: "git://github.com/user/foo.git",
raw: "git://github.com/user/foo"
},
name: null,
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/user/foo.git",
+ spec: "https://github.com/user/foo.git",
raw: "https://github.com/user/foo.git"
},
name: "foo",
type: "hosted",
hosted: { type: "github" },
- spec: "git+ssh://git@github.com/bar/foo.git",
+ spec: "github:bar/foo",
raw: "foo@bar/foo"
}
}
name: null,
type: "hosted",
hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user/foo-js.git",
+ spec: "gitlab:user/foo-js",
raw: "gitlab:user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user/foo-js.git#bar/baz",
+ spec: "gitlab:user/foo-js#bar/baz",
raw: "gitlab:user/foo-js#bar/baz"
},
name: null,
type: "hosted",
hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user..blerg--/..foo-js.git# . . . . . some . tags / / /",
+ spec: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /",
raw: "gitlab:user..blerg--/..foo-js# . . . . . some . tags / / /"
},
name: null,
type: "hosted",
hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user/foo-js.git#bar/baz/bin",
+ spec: "gitlab:user/foo-js#bar/baz/bin",
raw: "gitlab:user/foo-js#bar/baz/bin"
},
name: "foo",
type: "hosted",
hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user/foo-js.git",
+ spec: "gitlab:user/foo-js",
raw: "foo@gitlab:user/foo-js"
},
name: null,
type: "hosted",
hosted: { type: "gitlab" },
- spec: "git+ssh://git@gitlab.com/user/foo.git",
+ spec: "https://gitlab.com/user/foo.git",
raw: "https://gitlab.com/user/foo.git"
},
--- /dev/null
+{
+ "env": {
+ "node": true
+ },
+ "rules": {
+ // 2-space indentation
+ "indent": [2, 2],
+ // Disallow semi-colons, unless needed to disambiguate statement
+ "semi": [2, "never"],
+ // Require strings to use single quotes
+ "quotes": [2, "single"],
+ // Require curly braces for all control statements
+ "curly": 2,
+ // Disallow using variables and functions before they've been defined
+ "no-use-before-define": 2,
+ // Allow any case for variable naming
+ "camelcase": 0,
+ // Disallow unused variables, except as function arguments
+ "no-unused-vars": [2, {"args":"none"}],
+ // Allow leading underscores for method names
+ // REASON: we use underscores to denote private methods
+ "no-underscore-dangle": 0,
+ // Allow multi spaces around operators since they are
+ // used for alignment. This is not consistent in the
+ // code.
+ "no-multi-spaces": 0,
+ // Style rule is: most objects use { beforeColon: false, afterColon: true }, unless aligning which uses:
+ //
+ // {
+ // beforeColon : true,
+ // afterColon : true
+ // }
+ //
+ // eslint can't handle this, so the check is disabled.
+ "key-spacing": 0,
+ // Allow shadowing vars in outer scope (needs discussion)
+ "no-shadow": 0
+ }
+}
## Change Log
+### v2.55.0 (2015/04/05)
+- [#1520](https://github.com/request/request/pull/1520) Refactor defaults (@simov)
+- [#1525](https://github.com/request/request/pull/1525) Delete request headers with undefined value. (@froatsnook)
+- [#1521](https://github.com/request/request/pull/1521) Add promise tests (@simov)
+- [#1518](https://github.com/request/request/pull/1518) Fix defaults (@simov)
+- [#1515](https://github.com/request/request/pull/1515) Allow static invoking of convenience methods (@simov)
+- [#1505](https://github.com/request/request/pull/1505) Fix multipart boundary extraction regexp (@simov)
+- [#1510](https://github.com/request/request/pull/1510) Fix basic auth form data (@simov)
+
### v2.54.0 (2015/03/24)
- [#1501](https://github.com/request/request/pull/1501) HTTP Archive 1.2 support (@ahmadnassri)
- [#1486](https://github.com/request/request/pull/1486) Add a test for the forever agent (@akshayp)
, helpers = require('./lib/helpers')
var isFunction = helpers.isFunction
- , constructObject = helpers.constructObject
- , filterForCallback = helpers.filterForCallback
- , constructOptionsFrom = helpers.constructOptionsFrom
, paramsHaveRequestBody = helpers.paramsHaveRequestBody
// organize params for patch, post, put, head, del
function initParams(uri, options, callback) {
- callback = filterForCallback([options, callback])
- options = constructOptionsFrom(uri, options)
-
- return constructObject()
- .extend({callback: callback})
- .extend({options: options})
- .extend({uri: options.uri})
- .done()
+ if (typeof options === 'function') {
+ callback = options
+ }
+
+ var params = {}
+ if (typeof options === 'object') {
+ params = extend({}, options)
+ params = extend(params, {uri: uri})
+ } else if (typeof uri === 'string') {
+ params = extend({}, {uri: uri})
+ } else {
+ params = extend({}, uri)
+ }
+
+ params.callback = callback
+ return params
}
function request (uri, options, callback) {
}
var params = initParams(uri, options, callback)
- options = params.options
- options.callback = params.callback
- options.uri = params.uri
- if (params.options.method === 'HEAD' && paramsHaveRequestBody(params)) {
+ if (params.method === 'HEAD' && paramsHaveRequestBody(params)) {
throw new Error('HTTP HEAD requests MUST NOT include a request body.')
}
- return new request.Request(options)
+ return new request.Request(params)
}
var verbs = ['get', 'head', 'post', 'put', 'patch', 'del']
-verbs.forEach(function(verb){
+verbs.forEach(function(verb) {
var method = verb === 'del' ? 'DELETE' : verb.toUpperCase()
- request[verb] = function(uri, options, callback){
+ request[verb] = function (uri, options, callback) {
var params = initParams(uri, options, callback)
- params.options.method = method
- return this(params.uri || null, params.options, params.callback)
+ params.method = method
+ return request(params, params.callback)
}
})
return cookies.parse(str)
}
-request.defaults = function (options, requester) {
+function wrapRequestMethod (method, options, requester) {
- if (typeof options === 'function') {
- requester = options
- options = {}
- }
+ return function (uri, opts, callback) {
+ var params = initParams(uri, opts, callback)
- var self = this
- var wrap = function (method) {
- var headerlessOptions = function (options) {
- options = extend({}, options)
- delete options.headers
- return options
+ var headerlessOptions = extend({}, options)
+ delete headerlessOptions.headers
+ params = extend(headerlessOptions, params)
+
+ if (options.headers) {
+ var headers = extend({}, options.headers)
+ params.headers = extend(headers, params.headers)
}
- var getHeaders = function (params, options) {
- return constructObject()
- .extend(options.headers)
- .extend(params.options.headers)
- .done()
+ if (typeof method === 'string') {
+ params.method = (method === 'del' ? 'DELETE' : method.toUpperCase())
+ method = request[method]
}
- return function (uri, opts, callback) {
- var params = initParams(uri, opts, callback)
- params.options = extend(headerlessOptions(options), params.options)
+ if (isFunction(requester)) {
+ method = requester
+ }
- if (options.headers) {
- params.options.headers = getHeaders(params, options)
- }
+ return method(params, params.callback)
+ }
+}
- if (isFunction(requester)) {
- method = requester
- }
+request.defaults = function (options, requester) {
+ var self = this
- return method(params.options, params.callback)
- }
+ if (typeof options === 'function') {
+ requester = options
+ options = {}
}
- var defaults = wrap(self)
- defaults.get = self.get
- defaults.patch = self.patch
- defaults.post = self.post
- defaults.put = self.put
- defaults.head = self.head
- defaults.del = self.del
- defaults.cookie = self.cookie
+ var defaults = wrapRequestMethod(self, options, requester)
+
+ var verbs = ['get', 'head', 'post', 'put', 'patch', 'del']
+ verbs.forEach(function(verb) {
+ defaults[verb] = wrapRequestMethod(verb, options, requester)
+ })
+
+ defaults.cookie = wrapRequestMethod(self.cookie, options, requester)
defaults.jar = self.jar
defaults.defaults = self.defaults
return defaults
}
request.forever = function (agentOptions, optionsArg) {
- var options = constructObject()
+ var options = {}
if (optionsArg) {
- options.extend(optionsArg)
+ options = extend({}, optionsArg)
}
if (agentOptions) {
options.agentOptions = agentOptions
}
- options.extend({forever: true})
- return request.defaults(options.done())
+ options.forever = true
+ return request.defaults(options)
}
// Exports
'use strict'
-var extend = require('util')._extend
- , jsonSafeStringify = require('json-stringify-safe')
+var jsonSafeStringify = require('json-stringify-safe')
, crypto = require('crypto')
function deferMethod() {
return setImmediate
}
-function constructObject(initialObject) {
- initialObject = initialObject || {}
-
- return {
- extend: function (object) {
- return constructObject(extend(initialObject, object))
- },
- done: function () {
- return initialObject
- }
- }
-}
-
-function constructOptionsFrom(uri, options) {
- var params = constructObject()
- if (typeof options === 'object') {
- params.extend(options).extend({uri: uri})
- } else if (typeof uri === 'string') {
- params.extend({uri: uri})
- } else {
- params.extend(uri)
- }
- return params.done()
-}
-
function isFunction(value) {
return typeof value === 'function'
}
-function filterForCallback(values) {
- var callbacks = values.filter(isFunction)
- return callbacks[0]
-}
-
function paramsHaveRequestBody(params) {
return (
- params.options.body ||
- params.options.requestBodyStream ||
- (params.options.json && typeof params.options.json !== 'boolean') ||
- params.options.multipart
+ params.body ||
+ params.requestBodyStream ||
+ (params.json && typeof params.json !== 'boolean') ||
+ params.multipart
)
}
}
exports.isFunction = isFunction
-exports.constructObject = constructObject
-exports.constructOptionsFrom = constructOptionsFrom
-exports.filterForCallback = filterForCallback
exports.paramsHaveRequestBody = paramsHaveRequestBody
exports.safeStringify = safeStringify
exports.md5 = md5
self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary)
} else {
if (header.indexOf('boundary') !== -1) {
- self.boundary = header.replace(/.*boundary=([^\s;])+.*/, '$1')
+ self.boundary = header.replace(/.*boundary=([^\s;]+).*/, '$1')
} else {
self.request.setHeader('content-type', header + '; boundary=' + self.boundary)
}
--- /dev/null
+{
+ "predef": [ ]
+ , "bitwise": false
+ , "camelcase": false
+ , "curly": false
+ , "eqeqeq": false
+ , "forin": false
+ , "immed": false
+ , "latedef": false
+ , "noarg": true
+ , "noempty": true
+ , "nonew": true
+ , "plusplus": false
+ , "quotmark": true
+ , "regexp": false
+ , "undef": true
+ , "unused": true
+ , "strict": false
+ , "trailing": true
+ , "maxlen": 120
+ , "asi": true
+ , "boss": true
+ , "debug": true
+ , "eqnull": true
+ , "esnext": true
+ , "evil": true
+ , "expr": true
+ , "funcscope": false
+ , "globalstrict": false
+ , "iterator": false
+ , "lastsemic": true
+ , "laxbreak": true
+ , "laxcomma": true
+ , "loopfunc": true
+ , "multistr": false
+ , "onecase": false
+ , "proto": false
+ , "regexdash": false
+ , "scripturl": true
+ , "smarttabs": false
+ , "shadow": false
+ , "sub": true
+ , "supernew": false
+ , "validthis": true
+ , "browser": true
+ , "couch": false
+ , "devel": false
+ , "dojo": false
+ , "mootools": false
+ , "node": true
+ , "nonstandard": true
+ , "prototypejs": false
+ , "rhino": false
+ , "worker": true
+ , "wsh": false
+ , "nomen": false
+ , "onevar": false
+ , "passfail": false
+}
\ No newline at end of file
, tls = require('tls')
, AgentSSL = require('https').Agent
+function getConnectionName(host, port) {
+ var name = ''
+ if (typeof host === 'string') {
+ name = host + ':' + port
+ } else {
+ // For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name.
+ name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':')
+ }
+ return name
+}
+
function ForeverAgent(options) {
var self = this
self.options = options || {}
self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets
self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets
self.on('free', function(socket, host, port) {
- var name = host + ':' + port
+ var name = getConnectionName(host, port)
+
if (self.requests[name] && self.requests[name].length) {
self.requests[name].shift().onSocket(socket)
} else if (self.sockets[name].length < self.minSockets) {
ForeverAgent.prototype.createConnection = net.createConnection
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
host = options.host
}
- var name = host + ':' + port
if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {
var idleSocket = this.freeSockets[name].pop()
idleSocket.removeListener('error', idleSocket._onIdleError)
},
"name": "forever-agent",
"description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.",
- "version": "0.6.0",
+ "version": "0.6.1",
"license": "Apache-2.0",
"repository": {
"url": "https://github.com/mikeal/forever-agent"
"engines": {
"node": "*"
},
- "gitHead": "e45a6772c58c5b14f8d9b85b1b1a2094075b7161",
+ "gitHead": "1b3b6163f2b3c2c4122bbfa288c1325c0df9871d",
"bugs": {
"url": "https://github.com/mikeal/forever-agent/issues"
},
"homepage": "https://github.com/mikeal/forever-agent",
- "_id": "forever-agent@0.6.0",
+ "_id": "forever-agent@0.6.1",
"scripts": {},
- "_shasum": "1f9b9aff11eddb1c789c751f974ba7b15454ac5d",
+ "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91",
"_from": "forever-agent@>=0.6.0 <0.7.0",
- "_npmVersion": "1.4.14",
+ "_npmVersion": "1.4.28",
"_npmUser": {
- "name": "nylen",
- "email": "jnylen@gmail.com"
+ "name": "simov",
+ "email": "simeonvelichkov@gmail.com"
},
"maintainers": [
{
}
],
"dist": {
- "shasum": "1f9b9aff11eddb1c789c751f974ba7b15454ac5d",
- "tarball": "http://registry.npmjs.org/forever-agent/-/forever-agent-0.6.0.tgz"
+ "shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91",
+ "tarball": "http://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.0.tgz"
+ "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"
}
"shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7",
"tarball": "http://registry.npmjs.org/async/-/async-0.9.0.tgz"
},
- "_from": "async@0.9.0",
+ "_from": "async@>=0.9.0 <0.10.0",
"_npmVersion": "1.4.3",
"_npmUser": {
"name": "caolan",
],
"directories": {},
"_shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7",
- "_resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz"
}
Returns `true` or `false`.
- **data**: `Object` *(Required)*
- a [log](http://www.softwareishard.com/blog/har-12-spec/#log) object
+ a full [HAR](http://www.softwareishard.com/blog/har-12-spec/) object
- **callback**: `Function`
gets two arguments (err, valid)
});
```
+### Validate.log(data [, callback])
+
+Returns `true` or `false`.
+
+- **data**: `Object` *(Required)*
+ a [log](http://www.softwareishard.com/blog/har-12-spec/#log) object
+
+- **callback**: `Function`
+ gets two arguments (err, valid)
+
+```js
+var validate = require('har-validator');
+
+validate.log(data, function (e, valid) {
+ if (e) console.log(e.errors)
+});
+```
+
### Validate.cache(data [, callback])
Returns `true` or `false`.
}
if (!cmd.schema) {
- cmd.schema = 'log'
+ cmd.schema = 'har'
}
cmd.args.map(function (fileName) {
Finally, Bluebird also supports predicate-based filters. If you pass a
predicate function instead of an error type, the predicate will receive
-the error as an argument. The return result will be used determine whether
+the error as an argument. The return result will be used to determine whether
the error handler should be called.
Predicates should allow for very fine grained control over caught errors:
+## 2.9.24 (2015-04-02)
+
+Bugfixes:
+
+ - Fix not being able to load multiple bluebird copies introduced in 2.9.22 ([#559](.), [#561](.), [#560](.)).
+
+## 2.9.23 (2015-04-02)
+
+Bugfixes:
+
+ - Fix node.js domain propagation ([#521](.)).
+
+## 2.9.22 (2015-04-02)
+
+ - Fix `.promisify` crashing in phantom JS ([#556](.))
+
+## 2.9.21 (2015-03-30)
+
+ - Fix error object's `'stack'`' overwriting causing an error when its defined to be a setter that throws an error ([#552](.)).
+
+## 2.9.20 (2015-03-29)
+
+Bugfixes:
+
+ - Fix regression where there is a long delay between calling `.cancel()` and promise actually getting cancelled in Chrome when long stack traces are enabled
+
+## 2.9.19 (2015-03-29)
+
+Bugfixes:
+
+ - Fix crashing in Chrome when long stack traces are disabled
+
+## 2.9.18 (2015-03-29)
+
+Bugfixes:
+
+ - Fix settlePromises using trampoline
+
+## 2.9.17 (2015-03-29)
+
+
+Bugfixes:
+
+ - Fix Chrome DevTools async stack traceability ([#542](.)).
+
+## 2.9.16 (2015-03-28)
+
+Features:
+
+ - Use setImmediate if available
+
## 2.9.15 (2015-03-26)
Features:
*
*/
/**
- * bluebird build version 2.9.15
+ * bluebird build version 2.9.24
* Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, cancel, using, filter, any, each, timers
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
try {throw new Error(); } catch (e) {firstLineError = e;}
var schedule = _dereq_("./schedule.js");
var Queue = _dereq_("./queue.js");
-var _process = typeof process !== "undefined" ? process : undefined;
+var util = _dereq_("./util.js");
function Async() {
this._isTickUsed = false;
this._lateQueue = new Queue(16);
this._normalQueue = new Queue(16);
+ this._trampolineEnabled = true;
var self = this;
this.drainQueues = function () {
self._drainQueues();
schedule.isStatic ? schedule(this.drainQueues) : schedule;
}
-Async.prototype.haveItemsQueued = function () {
- return this._normalQueue.length() > 0;
+Async.prototype.disableTrampolineIfNecessary = function() {
+ if (util.hasDevTools) {
+ this._trampolineEnabled = false;
+ }
};
-Async.prototype._withDomain = function(fn) {
- if (_process !== undefined &&
- _process.domain != null &&
- !fn.domain) {
- fn = _process.domain.bind(fn);
+Async.prototype.enableTrampoline = function() {
+ if (!this._trampolineEnabled) {
+ this._trampolineEnabled = true;
+ this._schedule = function(fn) {
+ setTimeout(fn, 0);
+ };
}
- return fn;
+};
+
+Async.prototype.haveItemsQueued = function () {
+ return this._normalQueue.length() > 0;
};
Async.prototype.throwLater = function(fn, arg) {
arg = fn;
fn = function () { throw arg; };
}
- fn = this._withDomain(fn);
+ var domain = this._getDomain();
+ if (domain !== undefined) fn = domain.bind(fn);
if (typeof setTimeout !== "undefined") {
setTimeout(function() {
fn(arg);
}
};
-Async.prototype.invokeLater = function (fn, receiver, arg) {
- fn = this._withDomain(fn);
+Async.prototype._getDomain = function() {};
+
+if (util.isNode) {
+ var EventsModule = _dereq_("events");
+
+ var domainGetter = function() {
+ var domain = process.domain;
+ if (domain === null) return undefined;
+ return domain;
+ };
+
+ if (EventsModule.usingDomains) {
+ Async.prototype._getDomain = domainGetter;
+ } else {
+ var descriptor =
+ Object.getOwnPropertyDescriptor(EventsModule, "usingDomains");
+
+ if (!descriptor.configurable) {
+ process.on("domainsActivated", function() {
+ Async.prototype._getDomain = domainGetter;
+ });
+ } else {
+ var usingDomains = false;
+ Object.defineProperty(EventsModule, "usingDomains", {
+ configurable: false,
+ enumerable: true,
+ get: function() {
+ return usingDomains;
+ },
+ set: function(value) {
+ if (usingDomains || !value) return;
+ usingDomains = true;
+ Async.prototype._getDomain = domainGetter;
+ util.toFastProperties(process);
+ process.emit("domainsActivated");
+ }
+ });
+ }
+
+
+ }
+}
+
+function AsyncInvokeLater(fn, receiver, arg) {
+ var domain = this._getDomain();
+ if (domain !== undefined) fn = domain.bind(fn);
this._lateQueue.push(fn, receiver, arg);
this._queueTick();
-};
+}
-Async.prototype.invokeFirst = function (fn, receiver, arg) {
- fn = this._withDomain(fn);
- this._normalQueue.unshift(fn, receiver, arg);
+function AsyncInvoke(fn, receiver, arg) {
+ var domain = this._getDomain();
+ if (domain !== undefined) fn = domain.bind(fn);
+ this._normalQueue.push(fn, receiver, arg);
this._queueTick();
-};
+}
-Async.prototype.invoke = function (fn, receiver, arg) {
- fn = this._withDomain(fn);
- this._normalQueue.push(fn, receiver, arg);
+function AsyncSettlePromises(promise) {
+ var domain = this._getDomain();
+ if (domain !== undefined) {
+ var fn = domain.bind(promise._settlePromises);
+ this._normalQueue.push(fn, promise, undefined);
+ } else {
+ this._normalQueue._pushOne(promise);
+ }
this._queueTick();
-};
+}
+
+if (!util.hasDevTools) {
+ Async.prototype.invokeLater = AsyncInvokeLater;
+ Async.prototype.invoke = AsyncInvoke;
+ Async.prototype.settlePromises = AsyncSettlePromises;
+} else {
+ Async.prototype.invokeLater = function (fn, receiver, arg) {
+ if (this._trampolineEnabled) {
+ AsyncInvokeLater.call(this, fn, receiver, arg);
+ } else {
+ setTimeout(function() {
+ fn.call(receiver, arg);
+ }, 100);
+ }
+ };
+
+ Async.prototype.invoke = function (fn, receiver, arg) {
+ if (this._trampolineEnabled) {
+ AsyncInvoke.call(this, fn, receiver, arg);
+ } else {
+ setTimeout(function() {
+ fn.call(receiver, arg);
+ }, 0);
+ }
+ };
+
+ Async.prototype.settlePromises = function(promise) {
+ if (this._trampolineEnabled) {
+ AsyncSettlePromises.call(this, promise);
+ } else {
+ setTimeout(function() {
+ promise._settlePromises();
+ }, 0);
+ }
+ };
+}
-Async.prototype.settlePromises = function(promise) {
- this._normalQueue._pushOne(promise);
+Async.prototype.invokeFirst = function (fn, receiver, arg) {
+ var domain = this._getDomain();
+ if (domain !== undefined) fn = domain.bind(fn);
+ this._normalQueue.unshift(fn, receiver, arg);
this._queueTick();
};
module.exports = new Async();
module.exports.firstLineError = firstLineError;
-},{"./queue.js":28,"./schedule.js":31}],3:[function(_dereq_,module,exports){
+},{"./queue.js":28,"./schedule.js":31,"./util.js":38,"events":39}],3:[function(_dereq_,module,exports){
"use strict";
module.exports = function(Promise, INTERNAL, tryConvertToPromise) {
var rejectThis = function(_, e) {
Promise.prototype.cancellable = function () {
if (this._cancellable()) return this;
+ async.enableTrampoline();
this._setCancellable();
this._cancellationParent = undefined;
return this;
}
removeCommonRoots(stacks);
removeDuplicateOrEmptyJumps(stacks);
- error.stack = reconstructStack(message, stacks);
+ util.notEnumerableProp(error, "stack", reconstructStack(message, stacks));
util.notEnumerableProp(error, "__stackCleaned__", true);
};
(!!process.env["BLUEBIRD_DEBUG"] ||
process.env["NODE_ENV"] === "development"));
+if (debugging) {
+ async.disableTrampolineIfNecessary();
+}
+
Promise.prototype._ensurePossibleRejectionHandled = function () {
this._setRejectionIsUnhandled();
async.invokeLater(this._notifyUnhandledRejection, this, undefined);
trace.attachExtraTrace(error);
} else if (!error.__stackCleaned__) {
var parsed = CapturedTrace.parseStackAndMessage(error);
- error.stack = parsed.message + "\n" + parsed.stack.join("\n");
+ util.notEnumerableProp(error, "stack",
+ parsed.message + "\n" + parsed.stack.join("\n"));
util.notEnumerableProp(error, "__stackCleaned__", true);
}
}
throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/DT1qyG\u000a");
}
debugging = CapturedTrace.isSupported();
+ if (debugging) {
+ async.disableTrampolineIfNecessary();
+ }
};
Promise.hasLongStackTraces = function () {
var defaultSuffix = "Async";
var defaultPromisified = {__isPromisified__: true};
var noCopyPropsPattern =
- /^(?:length|name|arguments|caller|prototype|__isPromisified__)$/;
+ /^(?:length|name|arguments|caller|callee|prototype|__isPromisified__)$/;
var defaultFilter = function(name, func) {
return util.isIdentifier(name) &&
name.charAt(0) !== "_" &&
return function() { div.classList.toggle("foo"); };
};
schedule.isStatic = true;
+} else if (typeof setImmediate !== "undefined") {
+ schedule = function (fn) {
+ setImmediate(fn);
+ };
} else if (typeof setTimeout !== "undefined") {
schedule = function (fn) {
setTimeout(fn, 0);
}
function toFastProperties(obj) {
- /*jshint -W027*/
+ /*jshint -W027,-W055,-W031*/
function f() {}
f.prototype = obj;
- return f;
+ var l = 8;
+ while (l--) new f();
+ return obj;
eval(obj);
}
markAsOriginatingFromRejection: markAsOriginatingFromRejection,
classString: classString,
copyDescriptors: copyDescriptors,
+ hasDevTools: typeof chrome !== "undefined" && chrome &&
+ typeof chrome.loadTimes === "function",
isNode: typeof process !== "undefined" &&
classString(process).toLowerCase() === "[object process]"
};
try {throw new Error(); } catch (e) {ret.lastLineError = e;}
module.exports = ret;
-},{"./es5.js":14}]},{},[4])(4)
+},{"./es5.js":14}],39:[function(_dereq_,module,exports){
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+function EventEmitter() {
+ this._events = this._events || {};
+ this._maxListeners = this._maxListeners || undefined;
+}
+module.exports = EventEmitter;
+
+// Backwards-compat with node 0.10.x
+EventEmitter.EventEmitter = EventEmitter;
+
+EventEmitter.prototype._events = undefined;
+EventEmitter.prototype._maxListeners = undefined;
+
+// By default EventEmitters will print a warning if more than 10 listeners are
+// added to it. This is a useful default which helps finding memory leaks.
+EventEmitter.defaultMaxListeners = 10;
+
+// Obviously not all Emitters should be limited to 10. This function allows
+// that to be increased. Set to zero for unlimited.
+EventEmitter.prototype.setMaxListeners = function(n) {
+ if (!isNumber(n) || n < 0 || isNaN(n))
+ throw TypeError('n must be a positive number');
+ this._maxListeners = n;
+ return this;
+};
+
+EventEmitter.prototype.emit = function(type) {
+ var er, handler, len, args, i, listeners;
+
+ if (!this._events)
+ this._events = {};
+
+ // If there is no 'error' event listener then throw.
+ if (type === 'error') {
+ if (!this._events.error ||
+ (isObject(this._events.error) && !this._events.error.length)) {
+ er = arguments[1];
+ if (er instanceof Error) {
+ throw er; // Unhandled 'error' event
+ }
+ throw TypeError('Uncaught, unspecified "error" event.');
+ }
+ }
+
+ handler = this._events[type];
+
+ if (isUndefined(handler))
+ return false;
+
+ if (isFunction(handler)) {
+ switch (arguments.length) {
+ // fast cases
+ case 1:
+ handler.call(this);
+ break;
+ case 2:
+ handler.call(this, arguments[1]);
+ break;
+ case 3:
+ handler.call(this, arguments[1], arguments[2]);
+ break;
+ // slower
+ default:
+ len = arguments.length;
+ args = new Array(len - 1);
+ for (i = 1; i < len; i++)
+ args[i - 1] = arguments[i];
+ handler.apply(this, args);
+ }
+ } else if (isObject(handler)) {
+ len = arguments.length;
+ args = new Array(len - 1);
+ for (i = 1; i < len; i++)
+ args[i - 1] = arguments[i];
+
+ listeners = handler.slice();
+ len = listeners.length;
+ for (i = 0; i < len; i++)
+ listeners[i].apply(this, args);
+ }
+
+ return true;
+};
+
+EventEmitter.prototype.addListener = function(type, listener) {
+ var m;
+
+ if (!isFunction(listener))
+ throw TypeError('listener must be a function');
+
+ if (!this._events)
+ this._events = {};
+
+ // To avoid recursion in the case that type === "newListener"! Before
+ // adding it to the listeners, first emit "newListener".
+ if (this._events.newListener)
+ this.emit('newListener', type,
+ isFunction(listener.listener) ?
+ listener.listener : listener);
+
+ if (!this._events[type])
+ // Optimize the case of one listener. Don't need the extra array object.
+ this._events[type] = listener;
+ else if (isObject(this._events[type]))
+ // If we've already got an array, just append.
+ this._events[type].push(listener);
+ else
+ // Adding the second element, need to change to array.
+ this._events[type] = [this._events[type], listener];
+
+ // Check for listener leak
+ if (isObject(this._events[type]) && !this._events[type].warned) {
+ var m;
+ if (!isUndefined(this._maxListeners)) {
+ m = this._maxListeners;
+ } else {
+ m = EventEmitter.defaultMaxListeners;
+ }
+
+ if (m && m > 0 && this._events[type].length > m) {
+ this._events[type].warned = true;
+ console.error('(node) warning: possible EventEmitter memory ' +
+ 'leak detected. %d listeners added. ' +
+ 'Use emitter.setMaxListeners() to increase limit.',
+ this._events[type].length);
+ if (typeof console.trace === 'function') {
+ // not supported in IE 10
+ console.trace();
+ }
+ }
+ }
+
+ return this;
+};
+
+EventEmitter.prototype.on = EventEmitter.prototype.addListener;
+
+EventEmitter.prototype.once = function(type, listener) {
+ if (!isFunction(listener))
+ throw TypeError('listener must be a function');
+
+ var fired = false;
+
+ function g() {
+ this.removeListener(type, g);
+
+ if (!fired) {
+ fired = true;
+ listener.apply(this, arguments);
+ }
+ }
+
+ g.listener = listener;
+ this.on(type, g);
+
+ return this;
+};
+
+// emits a 'removeListener' event iff the listener was removed
+EventEmitter.prototype.removeListener = function(type, listener) {
+ var list, position, length, i;
+
+ if (!isFunction(listener))
+ throw TypeError('listener must be a function');
+
+ if (!this._events || !this._events[type])
+ return this;
+
+ list = this._events[type];
+ length = list.length;
+ position = -1;
+
+ if (list === listener ||
+ (isFunction(list.listener) && list.listener === listener)) {
+ delete this._events[type];
+ if (this._events.removeListener)
+ this.emit('removeListener', type, listener);
+
+ } else if (isObject(list)) {
+ for (i = length; i-- > 0;) {
+ if (list[i] === listener ||
+ (list[i].listener && list[i].listener === listener)) {
+ position = i;
+ break;
+ }
+ }
+
+ if (position < 0)
+ return this;
+
+ if (list.length === 1) {
+ list.length = 0;
+ delete this._events[type];
+ } else {
+ list.splice(position, 1);
+ }
+
+ if (this._events.removeListener)
+ this.emit('removeListener', type, listener);
+ }
+
+ return this;
+};
+
+EventEmitter.prototype.removeAllListeners = function(type) {
+ var key, listeners;
+
+ if (!this._events)
+ return this;
+
+ // not listening for removeListener, no need to emit
+ if (!this._events.removeListener) {
+ if (arguments.length === 0)
+ this._events = {};
+ else if (this._events[type])
+ delete this._events[type];
+ return this;
+ }
+
+ // emit removeListener for all listeners on all events
+ if (arguments.length === 0) {
+ for (key in this._events) {
+ if (key === 'removeListener') continue;
+ this.removeAllListeners(key);
+ }
+ this.removeAllListeners('removeListener');
+ this._events = {};
+ return this;
+ }
+
+ listeners = this._events[type];
+
+ if (isFunction(listeners)) {
+ this.removeListener(type, listeners);
+ } else {
+ // LIFO order
+ while (listeners.length)
+ this.removeListener(type, listeners[listeners.length - 1]);
+ }
+ delete this._events[type];
+
+ return this;
+};
+
+EventEmitter.prototype.listeners = function(type) {
+ var ret;
+ if (!this._events || !this._events[type])
+ ret = [];
+ else if (isFunction(this._events[type]))
+ ret = [this._events[type]];
+ else
+ ret = this._events[type].slice();
+ return ret;
+};
+
+EventEmitter.listenerCount = function(emitter, type) {
+ var ret;
+ if (!emitter._events || !emitter._events[type])
+ ret = 0;
+ else if (isFunction(emitter._events[type]))
+ ret = 1;
+ else
+ ret = emitter._events[type].length;
+ return ret;
+};
+
+function isFunction(arg) {
+ return typeof arg === 'function';
+}
+
+function isNumber(arg) {
+ return typeof arg === 'number';
+}
+
+function isObject(arg) {
+ return typeof arg === 'object' && arg !== null;
+}
+
+function isUndefined(arg) {
+ return arg === void 0;
+}
+
+},{}]},{},[4])(4)
}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; }
\ No newline at end of file
*
*/
/**
- * bluebird build version 2.9.15
+ * bluebird build version 2.9.24
* Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, cancel, using, filter, any, each, timers
*/
-!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,r;return function n(t,e,r){function i(s,a){if(!e[s]){if(!t[s]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,n,t,e,r)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e){"use strict";e.exports=function(t){function e(t){var e=new r(t),n=e.promise();return e.setHowMany(1),e.setUnwrap(),e.init(),n}var r=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},{}],2:[function(t,e){"use strict";function r(){this._isTickUsed=!1,this._lateQueue=new s(16),this._normalQueue=new s(16);var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=o.isStatic?o(this.drainQueues):o}var n;try{throw new Error}catch(i){n=i}var o=t("./schedule.js"),s=t("./queue.js"),a="undefined"!=typeof process?process:void 0;r.prototype.haveItemsQueued=function(){return this._normalQueue.length()>0},r.prototype._withDomain=function(t){return void 0===a||null==a.domain||t.domain||(t=a.domain.bind(t)),t},r.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),t=this._withDomain(t),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(r){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},r.prototype.invokeLater=function(t,e,r){t=this._withDomain(t),this._lateQueue.push(t,e,r),this._queueTick()},r.prototype.invokeFirst=function(t,e,r){t=this._withDomain(t),this._normalQueue.unshift(t,e,r),this._queueTick()},r.prototype.invoke=function(t,e,r){t=this._withDomain(t),this._normalQueue.push(t,e,r),this._queueTick()},r.prototype.settlePromises=function(t){this._normalQueue._pushOne(t),this._queueTick()},r.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=new r,e.exports.firstLineError=n},{"./queue.js":28,"./schedule.js":31}],3:[function(t,e){"use strict";e.exports=function(t,e,r){var n=function(t,e){this._reject(e)},i=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(n,n,null,this,t)},o=function(t,e){this._setBoundTo(t),this._isPending()&&this._resolveCallback(e.target)},s=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(n){var a=r(n),u=new t(e);u._propagateFrom(this,1);var c=this._target();if(a instanceof t){var l={promiseRejectionQueued:!1,promise:u,target:c,bindingPromise:a};c._then(e,i,u._progress,u,l),a._then(o,s,u._progress,u,l)}else u._setBoundTo(n),u._resolveCallback(c);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=131072|this._bitField,this._boundTo=t):this._bitField=-131073&this._bitField},t.prototype._isBound=function(){return 131072===(131072&this._bitField)},t.bind=function(n,i){var o=r(n),s=new t(e);return o instanceof t?o._then(function(t){s._setBoundTo(t),s._resolveCallback(i)},s._reject,s._progress,s,null):(s._setBoundTo(n),s._resolveCallback(i)),s}}},{}],4:[function(t,e){"use strict";function r(){try{Promise===i&&(Promise=n)}catch(t){}return i}var n;"undefined"!=typeof Promise&&(n=Promise);var i=t("./promise.js")();i.noConflict=r,e.exports=i},{"./promise.js":23}],5:[function(t,e){"use strict";var r=Object.create;if(r){var n=r(null),i=r(null);n[" size"]=i[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+a.classString(t)+" has no method '"+a.toString(r)+"'";throw new e.TypeError(i)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}{var s,a=t("./util.js"),u=a.canEvaluate;a.isIdentifier}e.prototype.call=function(t){for(var e=arguments.length,r=new Array(e-1),i=1;e>i;++i)r[i-1]=arguments[i];return r.push(t),this._then(n,void 0,void 0,r,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=o;else if(u){var n=s(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util.js":38}],6:[function(t,e){"use strict";e.exports=function(e){var r=t("./errors.js"),n=t("./async.js"),i=r.CancellationError;e.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,r=this;void 0!==(e=r._cancellationParent)&&e.isCancellable();)r=e;this._unsetCancellable(),r._target()._rejectCallback(t,!1,!0)},e.prototype.cancel=function(t){return this.isCancellable()?(void 0===t&&(t=new i),n.invokeLater(this._cancel,this,t),this):this},e.prototype.cancellable=function(){return this._cancellable()?this:(this._setCancellable(),this._cancellationParent=void 0,this)},e.prototype.uncancellable=function(){var t=this.then();return t._unsetCancellable(),t},e.prototype.fork=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);return n._setCancellable(),n._cancellationParent=void 0,n}}},{"./async.js":2,"./errors.js":13}],7:[function(t,e){"use strict";e.exports=function(){function e(t){this._parent=t;var r=this._length=1+(void 0===t?0:t._length);j(this,e),r>32&&this.uncycle()}function r(t,e){for(var r=0;r<e.length-1;++r)e[r].push("From previous event:"),e[r]=e[r].join("\n");return r<e.length&&(e[r]=e[r].join("\n")),t+"\n"+e.join("\n")}function n(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}function i(t){for(var e=t[0],r=1;r<t.length;++r){for(var n=t[r],i=e.length-1,o=e[i],s=-1,a=n.length-1;a>=0;--a)if(n[a]===o){s=a;break}for(var a=s;a>=0;--a){var u=n[a];if(e[i]!==u)break;e.pop(),i--}e=n}}function o(t){for(var e=[],r=0;r<t.length;++r){var n=t[r],i=_.test(n)||" (No stack trace)"===n,o=i&&y(n);i&&!o&&(v&&" "!==n.charAt(0)&&(n=" "+n),e.push(n))}return e}function s(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r<e.length;++r){var n=e[r];if(" (No stack trace)"===n||_.test(n))break}return r>0&&(e=e.slice(r)),e}function a(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t.toString();var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+u(e)+">, no stack trace)"}function u(t){var e=41;return t.length<e?t:t.substr(0,e-3)+"..."}function c(t){var e=t.match(g);return e?{fileName:e[1],line:parseInt(e[2],10)}:void 0}var l,h=t("./async.js"),p=t("./util.js"),f=/[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/,_=null,d=null,v=!1;p.inherits(e,Error),e.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;t>n;++n){var s=e[n].stack,a=r[s];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;t-1>a?(u._parent=e[a+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var c=u._length+1,l=n-2;l>=0;--l)e[l]._length=c,c++;return}}}},e.prototype.parent=function(){return this._parent},e.prototype.hasParent=function(){return void 0!==this._parent},e.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var s=e.parseStackAndMessage(t),a=s.message,u=[s.stack],c=this;void 0!==c;)u.push(o(c.stack.split("\n"))),c=c._parent;i(u),n(u),t.stack=r(a,u),p.notEnumerableProp(t,"__stackCleaned__",!0)}},e.parseStackAndMessage=function(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?s(t):[" (No stack trace)"],{message:r,stack:o(e)}},e.formatAndLogError=function(t,e){if("undefined"!=typeof console){var r;if("object"==typeof t||"function"==typeof t){var n=t.stack;r=e+d(n,t)}else r=e+String(t);"function"==typeof l?l(r):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}},e.unhandledRejection=function(t){e.formatAndLogError(t,"^--- With additional stack trace: ")},e.isSupported=function(){return"function"==typeof j},e.fireRejectionEvent=function(t,r,n,i){var o=!1;try{"function"==typeof r&&(o=!0,"rejectionHandled"===t?r(i):r(n,i))}catch(s){h.throwLater(s)}var a=!1;try{a=b(t,n,i)}catch(s){a=!0,h.throwLater(s)}var u=!1;if(m)try{u=m(t.toLowerCase(),{reason:n,promise:i})}catch(s){u=!0,h.throwLater(s)}a||o||u||"unhandledRejection"!==t||e.formatAndLogError(n,"Unhandled rejection ")};var y=function(){return!1},g=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;e.setBounds=function(t,r){if(e.isSupported()){for(var n,i,o=t.stack.split("\n"),s=r.stack.split("\n"),a=-1,u=-1,l=0;l<o.length;++l){var h=c(o[l]);if(h){n=h.fileName,a=h.line;break}}for(var l=0;l<s.length;++l){var h=c(s[l]);if(h){i=h.fileName,u=h.line;break}}0>a||0>u||!n||!i||n!==i||a>=u||(y=function(t){if(f.test(t))return!0;var e=c(t);return e&&e.fileName===n&&a<=e.line&&e.line<=u?!0:!1})}};var m,j=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():a(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,_=t,d=e;var r=Error.captureStackTrace;return y=function(t){return f.test(t)},function(t,e){Error.stackTraceLimit=Error.stackTraceLimit+6,r(t,e),Error.stackTraceLimit=Error.stackTraceLimit-6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return _=/@/,d=e,v=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in n||!i?(d=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?a(e):e.toString()},null):(_=t,d=e,function(t){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}([]),b=function(){if(p.isNode)return function(t,e,r){return"rejectionHandled"===t?process.emit(t,r):process.emit(t,e,r)};var t=!1,e=!0;try{var r=new self.CustomEvent("test");t=r instanceof CustomEvent}catch(n){}if(!t)try{var i=document.createEvent("CustomEvent");i.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(i)}catch(n){e=!1}e&&(m=function(e,r){var n;return t?n=new self.CustomEvent(e,{detail:r,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!1,!0,r)),n?!self.dispatchEvent(n):!1});var o={};return o.unhandledRejection="onunhandledRejection".toLowerCase(),o.rejectionHandled="onrejectionHandled".toLowerCase(),function(t,e,r){var n=o[t],i=self[n];return i?("rejectionHandled"===t?i.call(self,r):i.call(self,e,r),!0):!1}}();return"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(l=function(t){console.warn(t)},p.isNode&&process.stderr.isTTY?l=function(t){process.stderr.write("\e[31m"+t+"\e[39m\n")}:p.isNode||"string"!=typeof(new Error).stack||(l=function(t){console.warn("%c"+t,"color: red")})),e}},{"./async.js":2,"./util.js":38}],8:[function(t,e){"use strict";e.exports=function(e){function r(t,e,r){this._instances=t,this._callback=e,this._promise=r}function n(t,e){var r={},n=s(t).call(r,e);if(n===a)return n;var i=u(r);return i.length?(a.e=new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),a):n}var i=t("./util.js"),o=t("./errors.js"),s=i.tryCatch,a=i.errorObj,u=t("./es5.js").keys,c=o.TypeError;return r.prototype.doFilter=function(t){for(var r=this._callback,i=this._promise,o=i._boundTo,u=0,c=this._instances.length;c>u;++u){var l=this._instances[u],h=l===Error||null!=l&&l.prototype instanceof Error;if(h&&t instanceof l){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}if("function"==typeof l&&!h){var f=n(l,t);if(f===a){t=a.e;break}if(f){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}}}return e.e=t,e},r}},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(t,e){"use strict";e.exports=function(t,e,r){function n(){this._trace=new e(o())}function i(){return r()?new n:void 0}function o(){var t=s.length-1;return t>=0?s[t]:void 0}var s=[];return n.prototype._pushContext=function(){r()&&void 0!==this._trace&&s.push(this._trace)},n.prototype._popContext=function(){r()&&void 0!==this._trace&&s.pop()},t.prototype._peekContext=o,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,i}},{}],10:[function(t,e){"use strict";e.exports=function(e,r){var n,i,o=t("./async.js"),s=t("./errors.js").Warning,a=t("./util.js"),u=a.canAttachTrace,c=!1||a.isNode&&(!!process.env.BLUEBIRD_DEBUG||"development"===process.env.NODE_ENV);return e.prototype._ensurePossibleRejectionHandled=function(){this._setRejectionIsUnhandled(),o.invokeLater(this._notifyUnhandledRejection,this,void 0)},e.prototype._notifyUnhandledRejectionIsHandled=function(){r.fireRejectionEvent("rejectionHandled",n,void 0,this)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),r.fireRejectionEvent("unhandledRejection",i,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},e.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},e.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},e.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},e.prototype._captureStackTrace=function(){return c&&(this._trace=new r(this._peekContext())),this},e.prototype._attachExtraTrace=function(t,e){if(c&&u(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=r.parseStackAndMessage(t);t.stack=i.message+"\n"+i.stack.join("\n"),a.notEnumerableProp(t,"__stackCleaned__",!0)}}},e.prototype._warn=function(t){var e=new s(t),n=this._peekContext();if(n)n.attachExtraTrace(e);else{var i=r.parseStackAndMessage(e);e.stack=i.message+"\n"+i.stack.join("\n")}r.formatAndLogError(e,"")},e.onPossiblyUnhandledRejection=function(t){i="function"==typeof t?t:void 0},e.onUnhandledRejectionHandled=function(t){n="function"==typeof t?t:void 0},e.longStackTraces=function(){if(o.haveItemsQueued()&&c===!1)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");c=r.isSupported()},e.hasLongStackTraces=function(){return c&&r.isSupported()},r.isSupported()||(e.longStackTraces=function(){},c=!1),function(){return c}}},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(t,e){"use strict";var r=t("./util.js"),n=r.isPrimitive,i=r.wrapsPrimitiveReceiver;e.exports=function(t){var e=function(){return this},r=function(){throw this},o=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype["return"]=t.prototype.thenReturn=function(t){return i&&n(t)?this._then(o(t,2),void 0,void 0,void 0,void 0):this._then(e,void 0,void 0,t,void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return i&&n(t)?this._then(o(t,1),void 0,void 0,void 0,void 0):this._then(r,void 0,void 0,t,void 0)}}},{"./util.js":38}],12:[function(t,e){"use strict";e.exports=function(t,e){var r=t.reduce;t.prototype.each=function(t){return r(this,t,null,e)},t.each=function(t,n){return r(t,n,null,e)}}},{}],13:[function(t,e){"use strict";function r(t,e){function r(n){return this instanceof r?(l(this,"message","string"==typeof n?n:e),l(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return c(r,Error),r}function n(t){return this instanceof n?(l(this,"name","OperationalError"),l(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(l(this,"message",t.message),l(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new n(t)}var i,o,s=t("./es5.js"),a=s.freeze,u=t("./util.js"),c=u.inherits,l=u.notEnumerableProp,h=r("Warning","warning"),p=r("CancellationError","cancellation error"),f=r("TimeoutError","timeout error"),_=r("AggregateError","aggregate error");try{i=TypeError,o=RangeError}catch(d){i=r("TypeError","type error"),o=r("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;y<v.length;++y)"function"==typeof Array.prototype[v[y]]&&(_.prototype[v[y]]=Array.prototype[v[y]]);s.defineProperty(_.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),_.prototype.isOperational=!0;var g=0;_.prototype.toString=function(){var t=Array(4*g+1).join(" "),e="\n"+t+"AggregateError of:\n";g++,t=Array(4*g+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",i=n.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];n=i.join("\n"),e+=n+"\n"}return g--,e},c(n,Error);var m=Error.__BluebirdErrorTypes__;m||(m=a({CancellationError:p,TimeoutError:f,OperationalError:n,RejectionError:n,AggregateError:_}),l(Error,"__BluebirdErrorTypes__",m)),e.exports={Error:Error,TypeError:i,RangeError:o,CancellationError:m.CancellationError,OperationalError:m.OperationalError,TimeoutError:m.TimeoutError,AggregateError:m.AggregateError,Warning:h}},{"./es5.js":14,"./util.js":38}],14:[function(t,e){var r=function(){"use strict";return void 0===this}();if(r)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(t,e){var r=Object.getOwnPropertyDescriptor(t,e);return!(r&&!r.writable&&!r.set)}};else{var n={}.hasOwnProperty,i={}.toString,o={}.constructor.prototype,s=function(t){var e=[];for(var r in t)n.call(t,r)&&e.push(r);return e},a=function(t,e){return{value:t[e]}},u=function(t,e,r){return t[e]=r.value,t},c=function(t){return t},l=function(t){try{return Object(t).constructor.prototype}catch(e){return o}},h=function(t){try{return"[object Array]"===i.call(t)}catch(e){return!1}};e.exports={isArray:h,keys:s,names:s,defineProperty:u,getDescriptor:a,freeze:c,getPrototypeOf:l,isES5:r,propertyIsWritable:function(){return!0}}}},{}],15:[function(t,e){"use strict";e.exports=function(t,e){var r=t.map;t.prototype.filter=function(t,n){return r(this,t,n,e)},t.filter=function(t,n,i){return r(t,n,i,e)}}},{}],16:[function(t,e){"use strict";e.exports=function(e,r,n){function i(){return this}function o(){throw this}function s(t){return function(){return t}}function a(t){return function(){throw t}}function u(t,e,r){var n;return n=p&&f(e)?r?s(e):a(e):r?i:o,t._then(n,_,void 0,e,void 0)}function c(t){var i=this.promise,o=this.handler,s=i._isBound()?o.call(i._boundTo):o();if(void 0!==s){var a=n(s,i);if(a instanceof e)return a=a._target(),u(a,t,i.isFulfilled())}return i.isRejected()?(r.e=t,r):t}function l(t){var r=this.promise,i=this.handler,o=r._isBound()?i.call(r._boundTo,t):i(t);if(void 0!==o){var s=n(o,r);if(s instanceof e)return s=s._target(),u(s,t,!0)}return t}var h=t("./util.js"),p=h.wrapsPrimitiveReceiver,f=h.isPrimitive,_=h.thrower;e.prototype._passThroughHandler=function(t,e){if("function"!=typeof t)return this.then();var r={promise:this,handler:t};return this._then(e?c:l,e?c:void 0,void 0,r,void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThroughHandler(t,!0)},e.prototype.tap=function(t){return this._passThroughHandler(t,!1)}}},{"./util.js":38}],17:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t,r,n){for(var o=0;o<r.length;++o){n._pushContext();var s=h(r[o])(t);if(n._popContext(),s===l){n._pushContext();var a=e.reject(l.e);return n._popContext(),a}var u=i(s,n);if(u instanceof e)return u}return null}function s(t,r,i,o){var s=this._promise=new e(n);s._captureStackTrace(),this._stack=o,this._generatorFunction=t,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(p):p}var a=t("./errors.js"),u=a.TypeError,c=t("./util.js"),l=c.errorObj,h=c.tryCatch,p=[];s.prototype.promise=function(){return this._promise},s.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._next(void 0)},s.prototype._continue=function(t){if(t===l)return this._promise._rejectCallback(t.e,!1,!0);var r=t.value;if(t.done===!0)this._promise._resolveCallback(r);else{var n=i(r,this._promise);if(!(n instanceof e)&&(n=o(n,this._yieldHandlers,this._promise),null===n))return void this._throw(new u("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/4Y4pDk\n\n".replace("%s",r)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));n._then(this._next,this._throw,void 0,this,null)}},s.prototype._throw=function(t){this._promise._attachExtraTrace(t),this._promise._pushContext();var e=h(this._generator["throw"]).call(this._generator,t);this._promise._popContext(),this._continue(e)},s.prototype._next=function(t){this._promise._pushContext();var e=h(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},e.coroutine=function(t,e){if("function"!=typeof t)throw new u("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var r=Object(e).yieldHandler,n=s,i=(new Error).stack;return function(){var e=t.apply(this,arguments),o=new n(void 0,void 0,r,i);return o._generator=e,o._next(void 0),o.promise()}},e.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new u("fn must be a function\n\n See http://goo.gl/916lJJ\n");p.push(t)},e.spawn=function(t){if("function"!=typeof t)return r("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var n=new s(t,this),i=n.promise();return n._run(e.spawn),i}}},{"./errors.js":13,"./util.js":38}],18:[function(t,e){"use strict";e.exports=function(e,r,n,i){{var o=t("./util.js");o.canEvaluate,o.tryCatch,o.errorObj}e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var n}for(var i=arguments.length,o=new Array(i),s=0;i>s;++s)o[s]=arguments[s];t&&o.pop();var n=new r(o).promise();return void 0!==t?n.spread(t):n}}},{"./util.js":38}],19:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace(),this._callback=e,this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=r>=1?[]:_,c.invoke(a,this,void 0)}function a(){this._init$(void 0,-2)}function u(t,e,r,n){var i="object"==typeof r&&null!==r?r.concurrency:0;return i="number"==typeof i&&isFinite(i)&&i>=1?i:0,new s(t,e,i,n)}var c=t("./async.js"),l=t("./util.js"),h=l.tryCatch,p=l.errorObj,f={},_=[];l.inherits(s,r),s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,a=this._limit;if(n[r]===f){if(n[r]=t,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return n[r]=t,void this._queue.push(r);null!==s&&(s[r]=t);var u=this._callback,c=this._promise._boundTo;this._promise._pushContext();var l=h(u).call(c,t,r,o);if(this._promise._popContext(),l===p)return this._reject(l.e);var _=i(l,this._promise);if(_ instanceof e){if(_=_._target(),_._isPending())return a>=1&&this._inFlight++,n[r]=f,_._proxyPromiseArray(this,r);if(!_._isFulfilled())return this._reject(_._reason());l=_._value()}n[r]=l}var d=++this._totalResolved;d>=o&&(null!==s?this._filter(n,s):this._resolve(n))},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var n=t.pop();this._promiseFulfilled(r[n],n)}},s.prototype._filter=function(t,e){for(var r=e.length,n=new Array(r),i=0,o=0;r>o;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},s.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(this,t,e,null).promise()},e.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(t,e,r,i).promise()}}},{"./async.js":2,"./util.js":38}],20:[function(t,e){"use strict";e.exports=function(e,r,n,i){var o=t("./util.js"),s=o.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var n=new e(r);n._captureStackTrace(),n._pushContext();var i=s(t).apply(this,arguments);return n._popContext(),n._resolveFromSyncValue(i),n}},e.attempt=e["try"]=function(t,n,a){if("function"!=typeof t)return i("fn must be a function\n\n See http://goo.gl/916lJJ\n");var u=new e(r);u._captureStackTrace(),u._pushContext();var c=o.isArray(n)?s(t).apply(a,n):s(t).call(a,n);return u._popContext(),u._resolveFromSyncValue(c),u},e.prototype._resolveFromSyncValue=function(t){t===o.errorObj?this._rejectCallback(t.e,!1,!0):this._resolveCallback(t,!0)}}},{"./util.js":38}],21:[function(t,e){"use strict";e.exports=function(e){function r(t,e){var r=this;if(!o.isArray(t))return n.call(r,t,e);var i=a(e).apply(r._boundTo,[null].concat(t));i===u&&s.throwLater(i.e)}function n(t,e){var r=this,n=r._boundTo,i=void 0===t?a(e).call(n,null):a(e).call(n,null,t);i===u&&s.throwLater(i.e)}function i(t,e){var r=this;if(!t){var n=r._target(),i=n._getCarriedStackTrace();i.cause=t,t=i}var o=a(e).call(r._boundTo,t);o===u&&s.throwLater(o.e)}var o=t("./util.js"),s=t("./async.js"),a=o.tryCatch,u=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=n;void 0!==e&&Object(e).spread&&(o=r),this._then(o,i,void 0,this,t)}return this}}},{"./async.js":2,"./util.js":38}],22:[function(t,e){"use strict";e.exports=function(e,r){var n=t("./util.js"),i=t("./async.js"),o=n.tryCatch,s=n.errorObj;e.prototype.progressed=function(t){return this._then(void 0,void 0,t,void 0,void 0)},e.prototype._progress=function(t){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(t)},e.prototype._progressHandlerAt=function(t){return 0===t?this._progressHandler0:this[(t<<2)+t-5+2]},e.prototype._doProgressWith=function(t){var r=t.value,i=t.handler,a=t.promise,u=t.receiver,c=o(i).call(u,r);if(c===s){if(null!=c.e&&"StopProgressPropagation"!==c.e.name){var l=n.canAttachTrace(c.e)?c.e:new Error(n.toString(c.e));a._attachExtraTrace(l),a._progress(c.e)}}else c instanceof e?c._then(a._progress,null,null,a,void 0):a._progress(c)},e.prototype._progressUnchecked=function(t){for(var n=this._length(),o=this._progress,s=0;n>s;s++){var a=this._progressHandlerAt(s),u=this._promiseAt(s);if(u instanceof e)"function"==typeof a?i.invoke(this._doProgressWith,this,{handler:a,promise:u,receiver:this._receiverAt(s),value:t}):i.invoke(o,u,t);else{var c=this._receiverAt(s);"function"==typeof a?a.call(c,t,u):c instanceof r&&!c._isResolved()&&c._promiseProgressed(t,u)}}}}},{"./async.js":2,"./util.js":38}],23:[function(t,e){"use strict";e.exports=function(){function e(t){if("function"!=typeof t)throw new c("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==e)throw new c("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,t!==l&&this._resolveFromResolver(t)}function r(t){var r=new e(l);r._fulfillmentHandler0=t,r._rejectionHandler0=t,r._progressHandler0=t,r._promise0=t,r._receiver0=t,r._settledValue=t}var n=function(){return new c("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},i=function(){return new e.PromiseInspection(this._target())},o=function(t){return e.reject(new c(t))},s=t("./util.js"),a=t("./async.js"),u=t("./errors.js"),c=e.TypeError=u.TypeError;e.RangeError=u.RangeError,e.CancellationError=u.CancellationError,e.TimeoutError=u.TimeoutError,e.OperationalError=u.OperationalError,e.RejectionError=u.OperationalError,e.AggregateError=u.AggregateError;var l=function(){},h={},p={e:null},f=t("./thenables.js")(e,l),_=t("./promise_array.js")(e,l,f,o),d=t("./captured_trace.js")(),v=t("./debuggability.js")(e,d),y=t("./context.js")(e,d,v),g=t("./catch_filter.js")(p),m=t("./promise_resolver.js"),j=m._nodebackForPromise,b=s.errorObj,w=s.tryCatch;return e.prototype.toString=function(){return"[object Promise]"},e.prototype.caught=e.prototype["catch"]=function(t){var r=arguments.length;if(r>1){var n,i=new Array(r-1),o=0;for(n=0;r-1>n;++n){var s=arguments[n];if("function"!=typeof s)return e.reject(new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));i[o++]=s}i.length=o,t=arguments[n];var a=new g(i,t,this);return this._then(void 0,a.doFilter,void 0,a,void 0)}return this._then(void 0,t,void 0,void 0,void 0)},e.prototype.reflect=function(){return this._then(i,i,void 0,this,void 0)},e.prototype.then=function(t,e,r){if(v()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+s.classString(t);arguments.length>1&&(n+=", "+s.classString(e)),this._warn(n)}return this._then(t,e,r,void 0,void 0)},e.prototype.done=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);n._setIsFinal()},e.prototype.spread=function(t,e){return this.all()._then(t,e,void 0,h,void 0)},e.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},e.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},e.prototype.all=function(){return new _(this).promise()},e.prototype.error=function(t){return this.caught(s.originatesFromRejection,t)},e.is=function(t){return t instanceof e},e.fromNode=function(t){var r=new e(l),n=w(t)(j(r));return n===b&&r._rejectCallback(n.e,!0,!0),r},e.all=function(t){return new _(t).promise()},e.defer=e.pending=function(){var t=new e(l);return new m(t)},e.cast=function(t){var r=f(t);if(!(r instanceof e)){var n=r;r=new e(l),r._fulfillUnchecked(n)}return r},e.resolve=e.fulfilled=e.cast,e.reject=e.rejected=function(t){var r=new e(l);return r._captureStackTrace(),r._rejectCallback(t,!0),r},e.setScheduler=function(t){if("function"!=typeof t)throw new c("fn must be a function\n\n See http://goo.gl/916lJJ\n");
-var e=a._schedule;return a._schedule=t,e},e.prototype._then=function(t,r,n,i,o){var s=void 0!==o,u=s?o:new e(l);s||(u._propagateFrom(this,5),u._captureStackTrace());var c=this._target();c!==this&&(void 0===i&&(i=this._boundTo),s||u._setIsMigrated());var h=c._addCallbacks(t,r,n,u,i);return c._isResolved()&&!c._isSettlePromisesQueued()&&a.invoke(c._settlePromiseAtPostResolution,c,h),u},e.prototype._settlePromiseAtPostResolution=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(t)},e.prototype._length=function(){return 131071&this._bitField},e.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},e.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},e.prototype._setLength=function(t){this._bitField=-131072&this._bitField|131071&t},e.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},e.prototype._setRejected=function(){this._bitField=134217728|this._bitField},e.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},e.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},e.prototype._isFinal=function(){return(33554432&this._bitField)>0},e.prototype._cancellable=function(){return(67108864&this._bitField)>0},e.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},e.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},e.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},e.prototype._unsetIsMigrated=function(){this._bitField=-4194305&this._bitField},e.prototype._isMigrated=function(){return(4194304&this._bitField)>0},e.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[5*t-5+4];return void 0===e&&this._isBound()?this._boundTo:e},e.prototype._promiseAt=function(t){return 0===t?this._promise0:this[5*t-5+3]},e.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[5*t-5+0]},e.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[5*t-5+1]},e.prototype._migrateCallbacks=function(t,r){var n=t._fulfillmentHandlerAt(r),i=t._rejectionHandlerAt(r),o=t._progressHandlerAt(r),s=t._promiseAt(r),a=t._receiverAt(r);s instanceof e&&s._setIsMigrated(),this._addCallbacks(n,i,o,s,a)},e.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=131066&&(o=0,this._setLength(0)),0===o)this._promise0=n,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=t),"function"==typeof e&&(this._rejectionHandler0=e),"function"==typeof r&&(this._progressHandler0=r);else{var s=5*o-5;this[s+3]=n,this[s+4]=i,"function"==typeof t&&(this[s+0]=t),"function"==typeof e&&(this[s+1]=e),"function"==typeof r&&(this[s+2]=r)}return this._setLength(o+1),o},e.prototype._setProxyHandlers=function(t,e){var r=this._length();if(r>=131066&&(r=0,this._setLength(0)),0===r)this._promise0=e,this._receiver0=t;else{var n=5*r-5;this[n+3]=e,this[n+4]=t}this._setLength(r+1)},e.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},e.prototype._resolveCallback=function(t,r){if(!this._isFollowingOrFulfilledOrRejected()){if(t===this)return this._rejectCallback(n(),!1,!0);var i=f(t,this);if(!(i instanceof e))return this._fulfill(t);var o=1|(r?4:0);this._propagateFrom(i,o);var s=i._target();if(s._isPending()){for(var a=this._length(),u=0;a>u;++u)s._migrateCallbacks(this,u);this._setFollowing(),this._setLength(0),this._setFollowee(s)}else s._isFulfilled()?this._fulfillUnchecked(s._value()):this._rejectUnchecked(s._reason(),s._getCarriedStackTrace())}},e.prototype._rejectCallback=function(t,e,r){r||s.markAsOriginatingFromRejection(t);var n=s.ensureErrorObject(t),i=n===t;this._attachExtraTrace(n,e?i:!1),this._reject(t,i?void 0:n)},e.prototype._resolveFromResolver=function(t){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=w(t)(function(t){null!==e&&(e._resolveCallback(t),e=null)},function(t){null!==e&&(e._rejectCallback(t,r),e=null)});r=!1,this._popContext(),void 0!==n&&n===b&&null!==e&&(e._rejectCallback(n.e,!0,!0),e=null)},e.prototype._settlePromiseFromHandler=function(t,e,r,i){if(!i._isRejected()){i._pushContext();var o;if(o=e!==h||this._isRejected()?w(t).call(e,r):w(t).apply(this._boundTo,r),i._popContext(),o===b||o===i||o===p){var s=o===i?n():o.e;i._rejectCallback(s,!1,!0)}else i._resolveCallback(o)}},e.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},e.prototype._followee=function(){return this._rejectionHandler0},e.prototype._setFollowee=function(t){this._rejectionHandler0=t},e.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},e.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&t._isBound()&&this._setBoundTo(t._boundTo)},e.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},e.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},e.prototype._settlePromiseAt=function(t){var r=this._promiseAt(t),n=r instanceof e;if(n&&r._isMigrated())return r._unsetIsMigrated(),a.invoke(this._settlePromiseAt,this,t);var i=this._isFulfilled()?this._fulfillmentHandlerAt(t):this._rejectionHandlerAt(t),o=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,s=this._settledValue,u=this._receiverAt(t);this._clearCallbackDataAtIndex(t),"function"==typeof i?n?this._settlePromiseFromHandler(i,u,s,r):i.call(u,s,r):u instanceof _?u._isResolved()||(this._isFulfilled()?u._promiseFulfilled(s,r):u._promiseRejected(s,r)):n&&(this._isFulfilled()?r._fulfill(s):r._reject(s,o)),t>=4&&4===(31&t)&&a.invokeLater(this._setLength,this,0)},e.prototype._clearCallbackDataAtIndex=function(t){if(0===t)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var e=5*t-5;this[e+3]=this[e+4]=this[e+0]=this[e+1]=this[e+2]=void 0}},e.prototype._isSettlePromisesQueued=function(){return-1073741824===(-1073741824&this._bitField)},e.prototype._setSettlePromisesQueued=function(){this._bitField=-1073741824|this._bitField},e.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},e.prototype._queueSettlePromises=function(){a.settlePromises(this),this._setSettlePromisesQueued()},e.prototype._fulfillUnchecked=function(t){if(t===this){var e=n();return this._attachExtraTrace(e),this._rejectUnchecked(e,void 0)}this._setFulfilled(),this._settledValue=t,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},e.prototype._rejectUncheckedCheckError=function(t){var e=s.ensureErrorObject(t);this._rejectUnchecked(t,e===t?void 0:e)},e.prototype._rejectUnchecked=function(t,e){if(t===this){var r=n();return this._attachExtraTrace(r),this._rejectUnchecked(r)}return this._setRejected(),this._settledValue=t,this._cleanValues(),this._isFinal()?void a.throwLater(function(t){throw"stack"in t&&a.invokeFirst(d.unhandledRejection,void 0,t),t},void 0===e?t:e):(void 0!==e&&e!==t&&this._setCarriedStackTrace(e),void(this._length()>0?this._queueSettlePromises():this._ensurePossibleRejectionHandled()))},e.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();for(var t=this._length(),e=0;t>e;e++)this._settlePromiseAt(e)},e._makeSelfResolutionError=n,t("./progress.js")(e,_),t("./method.js")(e,l,f,o),t("./bind.js")(e,l,f),t("./finally.js")(e,p,f),t("./direct_resolve.js")(e),t("./synchronous_inspection.js")(e),t("./join.js")(e,_,f,l),e.Promise=e,t("./map.js")(e,_,o,f,l),t("./cancel.js")(e),t("./using.js")(e,o,f,y),t("./generators.js")(e,o,l,f),t("./nodeify.js")(e),t("./call_get.js")(e),t("./props.js")(e,_,f,o),t("./race.js")(e,l,f,o),t("./reduce.js")(e,_,o,f,l),t("./settle.js")(e,_),t("./some.js")(e,_,o),t("./promisify.js")(e,l),t("./any.js")(e),t("./each.js")(e,l),t("./timers.js")(e,l),t("./filter.js")(e,l),s.toFastProperties(e),s.toFastProperties(e.prototype),r({a:1}),r({b:2}),r({c:3}),r(1),r(function(){}),r(void 0),r(!1),r(new e(l)),d.setBounds(a.firstLineError,s.lastLineError),e}},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n,i=this._promise=new e(r);t instanceof e&&(n=t,i._propagateFrom(n,5)),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var a=t("./util.js"),u=a.isArray;return s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function c(t,r){var s=n(this._values,this._promise);if(s instanceof e){if(s=s._target(),this._values=s,!s._isFulfilled())return s._isPending()?void s._then(c,this._reject,void 0,this,r):void this._reject(s._reason());if(s=s._value(),!u(s)){var a=new e.TypeError("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");return void this.__hardReject__(a)}}else if(!u(s))return void this._promise._reject(i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n")._reason());if(0===s.length)return void(-5===r?this._resolveEmptyArray():this._resolve(o(r)));var l=this.getActualLength(s.length);this._length=l,this._values=this.shouldCopyValues()?new Array(l):this._values;for(var h=this._promise,p=0;l>p;++p){var f=this._isResolved(),_=n(s[p],h);_ instanceof e?(_=_._target(),f?_._unsetRejectionIsUnhandled():_._isPending()?_._proxyPromiseArray(this,p):_._isFulfilled()?this._promiseFulfilled(_._value(),p):this._promiseRejected(_._reason(),p)):f||this._promiseFulfilled(_,p)}},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype.__hardReject__=s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1,!0)},s.prototype._promiseProgressed=function(t,e){this._promise._progress({index:e,value:t})},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},s.prototype._promiseRejected=function(t){this._totalResolved++,this._reject(t)},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){return t},s}},{"./util.js":38}],25:[function(t,e){"use strict";function r(t){return t instanceof Error&&p.getPrototypeOf(t)===Error.prototype}function n(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=p.keys(t),i=0;i<n.length;++i){var o=n[i];f.test(o)||(e[o]=t[o])}return e}return s.markAsOriginatingFromRejection(t),t}function i(t){return function(e,r){if(null!==t){if(e){var i=n(a(e));t._attachExtraTrace(i),t._reject(i)}else if(arguments.length>2){for(var o=arguments.length,s=new Array(o-1),u=1;o>u;++u)s[u-1]=arguments[u];t._fulfill(s)}else t._fulfill(r);t=null}}}var o,s=t("./util.js"),a=s.maybeWrapAsError,u=t("./errors.js"),c=u.TimeoutError,l=u.OperationalError,h=s.haveGetters,p=t("./es5.js"),f=/^(?:name|message|stack|cause)$/;if(o=h?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=i(t),this.callback=this.asCallback},h){var _={get:function(){return i(this.promise)}};p.defineProperty(o.prototype,"asCallback",_),p.defineProperty(o.prototype,"callback",_)}o._nodebackForPromise=i,o.prototype.toString=function(){return"[object PromiseResolver]"},o.prototype.resolve=o.prototype.fulfill=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(t)},o.prototype.reject=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(t)},o.prototype.progress=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(t)},o.prototype.cancel=function(t){this.promise.cancel(t)},o.prototype.timeout=function(){this.reject(new c("timeout"))},o.prototype.isResolved=function(){return this.promise.isResolved()},o.prototype.toJSON=function(){return this.promise.toJSON()},e.exports=o},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(t,e){"use strict";e.exports=function(e,r){function n(t){return!b.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,r){var n=f.getDataPropertyOrDefault(t,e+r,j);return n?i(n):!1}function s(t,e,r){for(var n=0;n<t.length;n+=2){var i=t[n];if(r.test(i))for(var o=i.replace(r,""),s=0;s<t.length;s+=2)if(t[s]===o)throw new g("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/iWrZbw\n".replace("%s",e))}}function a(t,e,r,n){for(var a=f.inheritedDataKeys(t),u=[],c=0;c<a.length;++c){var l=a[c],h=t[l],p=n===w?!0:w(l,h,t);"function"!=typeof h||i(h)||o(t,l,e)||!n(l,h,t,p)||u.push(l,h)}return s(u,e,r),u}function u(t,n,i,o){function s(){var i=n;n===p&&(i=this);var o=new e(r);o._captureStackTrace();var s="string"==typeof u&&this!==a?this[u]:t,c=_(o);try{s.apply(i,d(arguments,c))}catch(l){o._rejectCallback(v(l),!0,!0)}return o}var a=function(){return this}(),u=t;return"string"==typeof u&&(t=o),s.__isPromisified__=!0,s}function c(t,e,r,n){for(var i=new RegExp(k(e)+"$"),o=a(t,e,i,r),s=0,u=o.length;u>s;s+=2){var c=o[s],l=o[s+1],h=c+e;t[h]=n===E?E(c,p,c,l,e):n(l,function(){return E(c,p,c,l,e)})}return f.toFastProperties(t),t}function l(t,e){return E(t,e,void 0,t)}var h,p={},f=t("./util.js"),_=t("./promise_resolver.js")._nodebackForPromise,d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,g=t("./errors").TypeError,m="Async",j={__isPromisified__:!0},b=/^(?:length|name|arguments|caller|prototype|__isPromisified__)$/,w=function(t,e){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&!f.isClass(e)},k=function(t){return t.replace(/([$])/,"\\$")},E=y?h:u;e.promisify=function(t,e){if("function"!=typeof t)throw new g("fn must be a function\n\n See http://goo.gl/916lJJ\n");if(i(t))return t;var r=l(t,arguments.length<2?p:e);return f.copyDescriptors(t,r,n),r},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");e=Object(e);var r=e.suffix;"string"!=typeof r&&(r=m);var n=e.filter;"function"!=typeof n&&(n=w);var i=e.promisifier;if("function"!=typeof i&&(i=E),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n");for(var o=f.inheritedDataKeys(t),s=0;s<o.length;++s){var a=t[o[s]];"constructor"!==o[s]&&f.isClass(a)&&(c(a.prototype,r,n,i),c(a,r,n,i))}return c(t,r,n,i)}}},{"./errors":13,"./promise_resolver.js":25,"./util.js":38}],27:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){for(var e=c.keys(t),r=e.length,n=new Array(2*r),i=0;r>i;++i){var o=e[i];n[i]=t[o],n[i+r]=o}this.constructor$(n)}function s(t){var r,s=n(t);return u(s)?(r=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&r._propagateFrom(s,4),r):i("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}var a=t("./util.js"),u=a.isObject,c=t("./es5.js");a.inherits(o,r),o.prototype._init=function(){this._init$(void 0,-3)},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;if(r>=this._length){for(var n={},i=this.length(),o=0,s=this.length();s>o;++o)n[this._values[o+i]]=this._values[o];this._resolve(n)}},o.prototype._promiseProgressed=function(t,e){this._promise._progress({key:this._values[e+this.length()],value:t})},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5.js":14,"./util.js":38}],28:[function(t,e){"use strict";function r(t,e,r,n,i){for(var o=0;i>o;++o)r[o+n]=t[o+e],t[o+e]=void 0}function n(t){this._capacity=t,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(t){return this._capacity<t},n.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1);var r=this._front+e&this._capacity-1;this[r]=t,this._length=e+1},n.prototype._unshiftOne=function(t){var e=this._capacity;this._checkCapacity(this.length()+1);var r=this._front,n=(r-1&e-1^e)-e;this[n]=t,this._front=n,this._length=this.length()+1},n.prototype.unshift=function(t,e,r){this._unshiftOne(r),this._unshiftOne(e),this._unshiftOne(t)},n.prototype.push=function(t,e,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(t),this._pushOne(e),void this._pushOne(r);var i=this._front+n-3;this._checkCapacity(n);var o=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=r,this._length=n},n.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},n.prototype.length=function(){return this._length},n.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},n.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t;var n=this._front,i=this._length,o=n+i&e-1;r(this,0,this,e,o)},e.exports=n},{}],29:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t,o){var u=n(t);if(u instanceof e)return a(u);if(!s(t))return i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");var c=new e(r);void 0!==o&&c._propagateFrom(o,5);for(var l=c._fulfill,h=c._reject,p=0,f=t.length;f>p;++p){var _=t[p];(void 0!==_||p in t)&&e.cast(_)._then(l,h,void 0,c,null)}return c}var s=t("./util.js").isArray,a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util.js":38}],30:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,r,n,s){this.constructor$(t),this._promise._captureStackTrace(),this._preservedValues=s===o?[]:null,this._zerothIsAccum=void 0===n,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var u=i(n,this._promise),l=!1,h=u instanceof e;h&&(u=u._target(),u._isPending()?u._proxyPromiseArray(this,-1):u._isFulfilled()?(n=u._value(),this._gotAccum=!0):(this._reject(u._reason()),l=!0)),h||this._zerothIsAccum||(this._gotAccum=!0),this._callback=r,this._accum=n,l||c.invoke(a,this,void 0)}function a(){this._init$(void 0,-5)}function u(t,e,r,i){if("function"!=typeof e)return n("fn must be a function\n\n See http://goo.gl/916lJJ\n");var o=new s(t,e,r,i);return o.promise()}var c=t("./async.js"),l=t("./util.js"),h=l.tryCatch,p=l.errorObj;l.inherits(s,r),s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},s.prototype._promiseFulfilled=function(t,r){var n=this._values;n[r]=t;var o,s=this.length(),a=this._preservedValues,u=null!==a,c=this._gotAccum,l=this._valuesPhase;if(!l)for(l=this._valuesPhase=new Array(s),o=0;s>o;++o)l[o]=0;if(o=l[r],0===r&&this._zerothIsAccum?(this._accum=t,this._gotAccum=c=!0,l[r]=0===o?1:2):-1===r?(this._accum=t,this._gotAccum=c=!0):0===o?l[r]=1:(l[r]=2,this._accum=t),c){for(var f,_=this._callback,d=this._promise._boundTo,v=this._reducingIndex;s>v;++v)if(o=l[v],2!==o){if(1!==o)return;if(t=n[v],this._promise._pushContext(),u?(a.push(t),f=h(_).call(d,t,v,s)):f=h(_).call(d,this._accum,t,v,s),this._promise._popContext(),f===p)return this._reject(f.e);var y=i(f,this._promise);if(y instanceof e){if(y=y._target(),y._isPending())return l[v]=4,y._proxyPromiseArray(this,v);if(!y._isFulfilled())return this._reject(y._reason());f=y._value()}this._reducingIndex=v+1,this._accum=f}else this._reducingIndex=v+1;this._resolve(u?a:this._accum)}},e.prototype.reduce=function(t,e){return u(this,t,e,null)},e.reduce=function(t,e,r,n){return u(t,e,r,n)}}},{"./async.js":2,"./util.js":38}],31:[function(t,e){"use strict";var r,n=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")};if(t("./util.js").isNode){var i=process.versions.node.split(".").map(Number);r=0===i[0]&&i[1]>10||i[0]>0?global.setImmediate:process.nextTick,r||(r="undefined"!=typeof setImmediate?setImmediate:"undefined"!=typeof setTimeout?setTimeout:n)}else"undefined"!=typeof MutationObserver?(r=function(t){var e=document.createElement("div"),r=new MutationObserver(t);return r.observe(e,{attributes:!0}),function(){e.classList.toggle("foo")}},r.isStatic=!0):r="undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:n;e.exports=r},{"./util.js":38}],32:[function(t,e){"use strict";e.exports=function(e,r){function n(t){this.constructor$(t)}var i=e.PromiseInspection,o=t("./util.js");o.inherits(n,r),n.prototype._promiseResolved=function(t,e){this._values[t]=e;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},n.prototype._promiseFulfilled=function(t,e){var r=new i;r._bitField=268435456,r._settledValue=t,this._promiseResolved(e,r)},n.prototype._promiseRejected=function(t,e){var r=new i;r._bitField=134217728,r._settledValue=t,this._promiseResolved(e,r)},e.settle=function(t){return new n(t).promise()},e.prototype.settle=function(){return new n(this).promise()}}},{"./util.js":38}],33:[function(t,e){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return n("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var r=new i(t),o=r.promise();return r.setHowMany(e),r.init(),o}var s=t("./util.js"),a=t("./errors.js").RangeError,u=t("./errors.js").AggregateError,c=s.isArray;s.inherits(i,r),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),this._resolve(1===this.howMany()&&this._unwrap?this._values[0]:this._values))},i.prototype._promiseRejected=function(t){if(this._addRejected(t),this.howMany()>this._canPossiblyFulfill()){for(var e=new u,r=this.length();r<this._values.length;++r)e.push(this._values[r]);this._reject(e)}},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors.js":13,"./util.js":38}],34:[function(t,e){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValue=t._settledValue):(this._bitField=0,this._settledValue=void 0)}e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return this._settledValue},e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return this._settledValue},e.prototype.isFulfilled=t.prototype._isFulfilled=function(){return(268435456&this._bitField)>0},e.prototype.isRejected=t.prototype._isRejected=function(){return(134217728&this._bitField)>0},e.prototype.isPending=t.prototype._isPending=function(){return 0===(402653184&this._bitField)},e.prototype.isResolved=t.prototype._isResolved=function(){return(402653184&this._bitField)>0},t.prototype.isPending=function(){return this._target()._isPending()},t.prototype.isRejected=function(){return this._target()._isRejected()},t.prototype.isFulfilled=function(){return this._target()._isFulfilled()},t.prototype.isResolved=function(){return this._target()._isResolved()},t.prototype._value=function(){return this._settledValue},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue},t.prototype.value=function(){var t=this._target();if(!t.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return t._settledValue},t.prototype.reason=function(){var t=this._target();if(!t.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return t._unsetRejectionIsUnhandled(),t._settledValue},t.PromiseInspection=e}},{}],35:[function(t,e){"use strict";e.exports=function(e,r){function n(t,n){if(c(t)){if(t instanceof e)return t;if(o(t)){var l=new e(r);return t._then(l._fulfillUnchecked,l._rejectUncheckedCheckError,l._progressUnchecked,l,null),l}var h=a.tryCatch(i)(t);if(h===u){n&&n._pushContext();var l=e.reject(h.e);return n&&n._popContext(),l}if("function"==typeof h)return s(t,h,n)}return t}function i(t){return t.then}function o(t){return l.call(t,"_promise0")}function s(t,n,i){function o(r){l&&(t===r?l._rejectCallback(e._makeSelfResolutionError(),!1,!0):l._resolveCallback(r),l=null)}function s(t){l&&(l._rejectCallback(t,p,!0),l=null)}function c(t){l&&"function"==typeof l._progress&&l._progress(t)}var l=new e(r),h=l;i&&i._pushContext(),l._captureStackTrace(),i&&i._popContext();var p=!0,f=a.tryCatch(n).call(t,o,s,c);return p=!1,l&&f===u&&(l._rejectCallback(f.e,!0,!0),l=null),h}var a=t("./util.js"),u=a.errorObj,c=a.isObject,l={}.hasOwnProperty;return n}},{"./util.js":38}],36:[function(t,e){"use strict";e.exports=function(e,r){function n(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function i(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}var o=t("./util.js"),s=e.TimeoutError,a=function(t,e){if(t.isPending()){"string"!=typeof e&&(e="operation timed out");var r=new s(e);o.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._cancel(r)}},u=function(t){return c(+this).thenReturn(t)},c=e.delay=function(t,n){if(void 0===n){n=t,t=void 0;var i=new e(r);return setTimeout(function(){i._fulfill()},n),i}return n=+n,e.resolve(t)._then(u,null,null,n,void 0)};e.prototype.delay=function(t){return c(this,t)},e.prototype.timeout=function(t,e){t=+t;var r=this.then().cancellable();r._cancellationParent=this;var o=setTimeout(function(){a(r,e)},t);return r._then(n,i,void 0,o,void 0)}}},{"./util.js":38}],37:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){for(var r=t.length,n=0;r>n;++n){var i=t[n];if(i.isRejected())return e.reject(i.error());t[n]=i._settledValue}return t}function s(t){setTimeout(function(){throw t},0)}function a(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function u(t,r){function i(){if(o>=u)return c.resolve();var l=a(t[o++]);if(l instanceof e&&l._isDisposable()){try{l=n(l._getDisposer().tryDispose(r),t.promise)}catch(h){return s(h)}if(l instanceof e)return l._then(i,s,null,null,null)}i()}var o=0,u=t.length,c=e.defer();return i(),c.promise}function c(t){var e=new v;return e._settledValue=t,e._bitField=268435456,u(this,e).thenReturn(t)}function l(t){var e=new v;return e._settledValue=t,e._bitField=134217728,u(this,e).thenThrow(t)}function h(t,e,r){this._data=t,this._promise=e,this._context=r}function p(t,e,r){this.constructor$(t,e,r)}function f(t){return h.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}var _=t("./errors.js").TypeError,d=t("./util.js").inherits,v=e.PromiseInspection;h.prototype.data=function(){return this._data},h.prototype.promise=function(){return this._promise},h.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},h.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=null!==e?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},h.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},d(p,h),p.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},e.using=function(){var t=arguments.length;if(2>t)return r("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return r("fn must be a function\n\n See http://goo.gl/916lJJ\n");t--;for(var s=new Array(t),a=0;t>a;++a){var u=arguments[a];if(h.isDisposer(u)){var p=u;u=u.promise(),u._setDisposable(p)}else{var _=n(u);_ instanceof e&&(u=_._then(f,null,null,{resources:s,index:a},void 0))}s[a]=u}var d=e.settle(s).then(o).then(function(t){d._pushContext();var e;try{e=i.apply(void 0,t)}finally{d._popContext()}return e})._then(c,l,void 0,s,void 0);return s.promise=d,d},e.prototype._setDisposable=function(t){this._bitField=262144|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(262144&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new _}}},{"./errors.js":13,"./util.js":38}],38:[function(t,e,r){"use strict";function n(){try{return C.apply(this,arguments)}catch(t){return F.e=t,F}}function i(t){return C=t,n}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return!o(t)}function a(t){return o(t)?new Error(v(t)):t}function u(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;n>r;++r)i[r]=t[r];return i[r]=e,i}function c(t,e,r){if(!w.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function l(t,e,r){if(o(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return w.defineProperty(t,e,n),t}function h(t){throw t}function p(t){try{if("function"==typeof t){var e=w.names(t.prototype);return w.isES5?e.length>1:e.length>0&&!(1===e.length&&"constructor"===e[0])}return!1}catch(r){return!1}}function f(t){function e(){}return e.prototype=t,e}function _(t){return R.test(t)}function d(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=e+i+r;return n}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){try{l(t,"isOperational",!0)
-}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function m(t){return t instanceof Error&&w.propertyIsWritable(t,"stack")}function j(t){return{}.toString.call(t)}function b(t,e,r){for(var n=w.names(t),i=0;i<n.length;++i){var o=n[i];r(o)&&w.defineProperty(e,o,w.getDescriptor(t,o))}}var w=t("./es5.js"),k="undefined"==typeof navigator,E=function(){try{var t={};return w.defineProperty(t,"f",{get:function(){return 3}}),3===t.f}catch(e){return!1}}(),F={e:{}},C,T=function(t,e){function r(){this.constructor=t,this.constructor$=e;for(var r in e.prototype)n.call(e.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=e.prototype[r])}var n={}.hasOwnProperty;return r.prototype=e.prototype,t.prototype=new r,t.prototype},x=function(){return"string"!==this}.call("string"),P=function(){if(w.isES5){var t=Object.prototype,e=Object.getOwnPropertyNames;return function(r){for(var n=[],i=Object.create(null);null!=r&&r!==t;){var o;try{o=e(r)}catch(s){return n}for(var a=0;a<o.length;++a){var u=o[a];if(!i[u]){i[u]=!0;var c=Object.getOwnPropertyDescriptor(r,u);null!=c&&null==c.get&&null==c.set&&n.push(u)}}r=w.getPrototypeOf(r)}return n}}return function(t){var e=[];for(var r in t)e.push(r);return e}}(),R=/^[a-z$_][a-z$_0-9]*$/i,S=function(){return"stack"in new Error?function(t){return m(t)?t:new Error(v(t))}:function(t){if(m(t))return t;try{throw new Error(v(t))}catch(e){return e}}}(),A={isClass:p,isIdentifier:_,inheritedDataKeys:P,getDataPropertyOrDefault:c,thrower:h,isArray:w.isArray,haveGetters:E,notEnumerableProp:l,isPrimitive:o,isObject:s,canEvaluate:k,errorObj:F,tryCatch:i,inherits:T,withAppended:u,maybeWrapAsError:a,wrapsPrimitiveReceiver:x,toFastProperties:f,filledRange:d,toString:v,canAttachTrace:m,ensureErrorObject:S,originatesFromRejection:g,markAsOriginatingFromRejection:y,classString:j,copyDescriptors:b,isNode:"undefined"!=typeof process&&"[object process]"===j(process).toLowerCase()};try{throw new Error}catch(O){A.lastLineError=O}e.exports=A},{"./es5.js":14}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise);
\ No newline at end of file
+!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,r;return function n(t,e,r){function i(s,a){if(!e[s]){if(!t[s]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,n,t,e,r)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(t,e){"use strict";e.exports=function(t){function e(t){var e=new r(t),n=e.promise();return e.setHowMany(1),e.setUnwrap(),e.init(),n}var r=t._SomePromiseArray;t.any=function(t){return e(t)},t.prototype.any=function(){return e(this)}}},{}],2:[function(t,e){"use strict";function r(){this._isTickUsed=!1,this._lateQueue=new c(16),this._normalQueue=new c(16),this._trampolineEnabled=!0;var t=this;this.drainQueues=function(){t._drainQueues()},this._schedule=u.isStatic?u(this.drainQueues):u}function n(t,e,r){var n=this._getDomain();void 0!==n&&(t=n.bind(t)),this._lateQueue.push(t,e,r),this._queueTick()}function i(t,e,r){var n=this._getDomain();void 0!==n&&(t=n.bind(t)),this._normalQueue.push(t,e,r),this._queueTick()}function o(t){var e=this._getDomain();if(void 0!==e){var r=e.bind(t._settlePromises);this._normalQueue.push(r,t,void 0)}else this._normalQueue._pushOne(t);this._queueTick()}var s;try{throw new Error}catch(a){s=a}var u=t("./schedule.js"),c=t("./queue.js"),l=t("./util.js");if(r.prototype.disableTrampolineIfNecessary=function(){l.hasDevTools&&(this._trampolineEnabled=!1)},r.prototype.enableTrampoline=function(){this._trampolineEnabled||(this._trampolineEnabled=!0,this._schedule=function(t){setTimeout(t,0)})},r.prototype.haveItemsQueued=function(){return this._normalQueue.length()>0},r.prototype.throwLater=function(t,e){1===arguments.length&&(e=t,t=function(){throw e});var r=this._getDomain();if(void 0!==r&&(t=r.bind(t)),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(n){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},r.prototype._getDomain=function(){},l.isNode){var h=t("events"),p=function(){var t=process.domain;return null===t?void 0:t};if(h.usingDomains)r.prototype._getDomain=p;else{var f=Object.getOwnPropertyDescriptor(h,"usingDomains");if(f.configurable){var _=!1;Object.defineProperty(h,"usingDomains",{configurable:!1,enumerable:!0,get:function(){return _},set:function(t){!_&&t&&(_=!0,r.prototype._getDomain=p,l.toFastProperties(process),process.emit("domainsActivated"))}})}else process.on("domainsActivated",function(){r.prototype._getDomain=p})}}l.hasDevTools?(r.prototype.invokeLater=function(t,e,r){this._trampolineEnabled?n.call(this,t,e,r):setTimeout(function(){t.call(e,r)},100)},r.prototype.invoke=function(t,e,r){this._trampolineEnabled?i.call(this,t,e,r):setTimeout(function(){t.call(e,r)},0)},r.prototype.settlePromises=function(t){this._trampolineEnabled?o.call(this,t):setTimeout(function(){t._settlePromises()},0)}):(r.prototype.invokeLater=n,r.prototype.invoke=i,r.prototype.settlePromises=o),r.prototype.invokeFirst=function(t,e,r){var n=this._getDomain();void 0!==n&&(t=n.bind(t)),this._normalQueue.unshift(t,e,r),this._queueTick()},r.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=new r,e.exports.firstLineError=s},{"./queue.js":28,"./schedule.js":31,"./util.js":38,events:39}],3:[function(t,e){"use strict";e.exports=function(t,e,r){var n=function(t,e){this._reject(e)},i=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(n,n,null,this,t)},o=function(t,e){this._setBoundTo(t),this._isPending()&&this._resolveCallback(e.target)},s=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(n){var a=r(n),u=new t(e);u._propagateFrom(this,1);var c=this._target();if(a instanceof t){var l={promiseRejectionQueued:!1,promise:u,target:c,bindingPromise:a};c._then(e,i,u._progress,u,l),a._then(o,s,u._progress,u,l)}else u._setBoundTo(n),u._resolveCallback(c);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=131072|this._bitField,this._boundTo=t):this._bitField=-131073&this._bitField},t.prototype._isBound=function(){return 131072===(131072&this._bitField)},t.bind=function(n,i){var o=r(n),s=new t(e);return o instanceof t?o._then(function(t){s._setBoundTo(t),s._resolveCallback(i)},s._reject,s._progress,s,null):(s._setBoundTo(n),s._resolveCallback(i)),s}}},{}],4:[function(t,e){"use strict";function r(){try{Promise===i&&(Promise=n)}catch(t){}return i}var n;"undefined"!=typeof Promise&&(n=Promise);var i=t("./promise.js")();i.noConflict=r,e.exports=i},{"./promise.js":23}],5:[function(t,e){"use strict";var r=Object.create;if(r){var n=r(null),i=r(null);n[" size"]=i[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+a.classString(t)+" has no method '"+a.toString(r)+"'";throw new e.TypeError(i)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}{var s,a=t("./util.js"),u=a.canEvaluate;a.isIdentifier}e.prototype.call=function(t){for(var e=arguments.length,r=new Array(e-1),i=1;e>i;++i)r[i-1]=arguments[i];return r.push(t),this._then(n,void 0,void 0,r,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=o;else if(u){var n=s(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util.js":38}],6:[function(t,e){"use strict";e.exports=function(e){var r=t("./errors.js"),n=t("./async.js"),i=r.CancellationError;e.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,r=this;void 0!==(e=r._cancellationParent)&&e.isCancellable();)r=e;this._unsetCancellable(),r._target()._rejectCallback(t,!1,!0)},e.prototype.cancel=function(t){return this.isCancellable()?(void 0===t&&(t=new i),n.invokeLater(this._cancel,this,t),this):this},e.prototype.cancellable=function(){return this._cancellable()?this:(n.enableTrampoline(),this._setCancellable(),this._cancellationParent=void 0,this)},e.prototype.uncancellable=function(){var t=this.then();return t._unsetCancellable(),t},e.prototype.fork=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);return n._setCancellable(),n._cancellationParent=void 0,n}}},{"./async.js":2,"./errors.js":13}],7:[function(t,e){"use strict";e.exports=function(){function e(t){this._parent=t;var r=this._length=1+(void 0===t?0:t._length);j(this,e),r>32&&this.uncycle()}function r(t,e){for(var r=0;r<e.length-1;++r)e[r].push("From previous event:"),e[r]=e[r].join("\n");return r<e.length&&(e[r]=e[r].join("\n")),t+"\n"+e.join("\n")}function n(t){for(var e=0;e<t.length;++e)(0===t[e].length||e+1<t.length&&t[e][0]===t[e+1][0])&&(t.splice(e,1),e--)}function i(t){for(var e=t[0],r=1;r<t.length;++r){for(var n=t[r],i=e.length-1,o=e[i],s=-1,a=n.length-1;a>=0;--a)if(n[a]===o){s=a;break}for(var a=s;a>=0;--a){var u=n[a];if(e[i]!==u)break;e.pop(),i--}e=n}}function o(t){for(var e=[],r=0;r<t.length;++r){var n=t[r],i=_.test(n)||" (No stack trace)"===n,o=i&&y(n);i&&!o&&(v&&" "!==n.charAt(0)&&(n=" "+n),e.push(n))}return e}function s(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),r=0;r<e.length;++r){var n=e[r];if(" (No stack trace)"===n||_.test(n))break}return r>0&&(e=e.slice(r)),e}function a(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t.toString();var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+u(e)+">, no stack trace)"}function u(t){var e=41;return t.length<e?t:t.substr(0,e-3)+"..."}function c(t){var e=t.match(g);return e?{fileName:e[1],line:parseInt(e[2],10)}:void 0}var l,h=t("./async.js"),p=t("./util.js"),f=/[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/,_=null,d=null,v=!1;p.inherits(e,Error),e.prototype.uncycle=function(){var t=this._length;if(!(2>t)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;t>n;++n){var s=e[n].stack,a=r[s];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;t-1>a?(u._parent=e[a+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var c=u._length+1,l=n-2;l>=0;--l)e[l]._length=c,c++;return}}}},e.prototype.parent=function(){return this._parent},e.prototype.hasParent=function(){return void 0!==this._parent},e.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var s=e.parseStackAndMessage(t),a=s.message,u=[s.stack],c=this;void 0!==c;)u.push(o(c.stack.split("\n"))),c=c._parent;i(u),n(u),p.notEnumerableProp(t,"stack",r(a,u)),p.notEnumerableProp(t,"__stackCleaned__",!0)}},e.parseStackAndMessage=function(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?s(t):[" (No stack trace)"],{message:r,stack:o(e)}},e.formatAndLogError=function(t,e){if("undefined"!=typeof console){var r;if("object"==typeof t||"function"==typeof t){var n=t.stack;r=e+d(n,t)}else r=e+String(t);"function"==typeof l?l(r):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}},e.unhandledRejection=function(t){e.formatAndLogError(t,"^--- With additional stack trace: ")},e.isSupported=function(){return"function"==typeof j},e.fireRejectionEvent=function(t,r,n,i){var o=!1;try{"function"==typeof r&&(o=!0,"rejectionHandled"===t?r(i):r(n,i))}catch(s){h.throwLater(s)}var a=!1;try{a=b(t,n,i)}catch(s){a=!0,h.throwLater(s)}var u=!1;if(m)try{u=m(t.toLowerCase(),{reason:n,promise:i})}catch(s){u=!0,h.throwLater(s)}a||o||u||"unhandledRejection"!==t||e.formatAndLogError(n,"Unhandled rejection ")};var y=function(){return!1},g=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;e.setBounds=function(t,r){if(e.isSupported()){for(var n,i,o=t.stack.split("\n"),s=r.stack.split("\n"),a=-1,u=-1,l=0;l<o.length;++l){var h=c(o[l]);if(h){n=h.fileName,a=h.line;break}}for(var l=0;l<s.length;++l){var h=c(s[l]);if(h){i=h.fileName,u=h.line;break}}0>a||0>u||!n||!i||n!==i||a>=u||(y=function(t){if(f.test(t))return!0;var e=c(t);return e&&e.fileName===n&&a<=e.line&&e.line<=u?!0:!1})}};var m,j=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():a(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,_=t,d=e;var r=Error.captureStackTrace;return y=function(t){return f.test(t)},function(t,e){Error.stackTraceLimit=Error.stackTraceLimit+6,r(t,e),Error.stackTraceLimit=Error.stackTraceLimit-6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return _=/@/,d=e,v=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in n||!i?(d=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?a(e):e.toString()},null):(_=t,d=e,function(t){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}([]),b=function(){if(p.isNode)return function(t,e,r){return"rejectionHandled"===t?process.emit(t,r):process.emit(t,e,r)};var t=!1,e=!0;try{var r=new self.CustomEvent("test");t=r instanceof CustomEvent}catch(n){}if(!t)try{var i=document.createEvent("CustomEvent");i.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(i)}catch(n){e=!1}e&&(m=function(e,r){var n;return t?n=new self.CustomEvent(e,{detail:r,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!1,!0,r)),n?!self.dispatchEvent(n):!1});var o={};return o.unhandledRejection="onunhandledRejection".toLowerCase(),o.rejectionHandled="onrejectionHandled".toLowerCase(),function(t,e,r){var n=o[t],i=self[n];return i?("rejectionHandled"===t?i.call(self,r):i.call(self,e,r),!0):!1}}();return"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(l=function(t){console.warn(t)},p.isNode&&process.stderr.isTTY?l=function(t){process.stderr.write("\e[31m"+t+"\e[39m\n")}:p.isNode||"string"!=typeof(new Error).stack||(l=function(t){console.warn("%c"+t,"color: red")})),e}},{"./async.js":2,"./util.js":38}],8:[function(t,e){"use strict";e.exports=function(e){function r(t,e,r){this._instances=t,this._callback=e,this._promise=r}function n(t,e){var r={},n=s(t).call(r,e);if(n===a)return n;var i=u(r);return i.length?(a.e=new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),a):n}var i=t("./util.js"),o=t("./errors.js"),s=i.tryCatch,a=i.errorObj,u=t("./es5.js").keys,c=o.TypeError;return r.prototype.doFilter=function(t){for(var r=this._callback,i=this._promise,o=i._boundTo,u=0,c=this._instances.length;c>u;++u){var l=this._instances[u],h=l===Error||null!=l&&l.prototype instanceof Error;if(h&&t instanceof l){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}if("function"==typeof l&&!h){var f=n(l,t);if(f===a){t=a.e;break}if(f){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}}}return e.e=t,e},r}},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(t,e){"use strict";e.exports=function(t,e,r){function n(){this._trace=new e(o())}function i(){return r()?new n:void 0}function o(){var t=s.length-1;return t>=0?s[t]:void 0}var s=[];return n.prototype._pushContext=function(){r()&&void 0!==this._trace&&s.push(this._trace)},n.prototype._popContext=function(){r()&&void 0!==this._trace&&s.pop()},t.prototype._peekContext=o,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,i}},{}],10:[function(t,e){"use strict";e.exports=function(e,r){var n,i,o=t("./async.js"),s=t("./errors.js").Warning,a=t("./util.js"),u=a.canAttachTrace,c=!1||a.isNode&&(!!process.env.BLUEBIRD_DEBUG||"development"===process.env.NODE_ENV);return c&&o.disableTrampolineIfNecessary(),e.prototype._ensurePossibleRejectionHandled=function(){this._setRejectionIsUnhandled(),o.invokeLater(this._notifyUnhandledRejection,this,void 0)},e.prototype._notifyUnhandledRejectionIsHandled=function(){r.fireRejectionEvent("rejectionHandled",n,void 0,this)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),r.fireRejectionEvent("unhandledRejection",i,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},e.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},e.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},e.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},e.prototype._captureStackTrace=function(){return c&&(this._trace=new r(this._peekContext())),this},e.prototype._attachExtraTrace=function(t,e){if(c&&u(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=r.parseStackAndMessage(t);a.notEnumerableProp(t,"stack",i.message+"\n"+i.stack.join("\n")),a.notEnumerableProp(t,"__stackCleaned__",!0)}}},e.prototype._warn=function(t){var e=new s(t),n=this._peekContext();if(n)n.attachExtraTrace(e);else{var i=r.parseStackAndMessage(e);e.stack=i.message+"\n"+i.stack.join("\n")}r.formatAndLogError(e,"")},e.onPossiblyUnhandledRejection=function(t){i="function"==typeof t?t:void 0},e.onUnhandledRejectionHandled=function(t){n="function"==typeof t?t:void 0},e.longStackTraces=function(){if(o.haveItemsQueued()&&c===!1)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");c=r.isSupported(),c&&o.disableTrampolineIfNecessary()},e.hasLongStackTraces=function(){return c&&r.isSupported()},r.isSupported()||(e.longStackTraces=function(){},c=!1),function(){return c}}},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(t,e){"use strict";var r=t("./util.js"),n=r.isPrimitive,i=r.wrapsPrimitiveReceiver;e.exports=function(t){var e=function(){return this},r=function(){throw this},o=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype["return"]=t.prototype.thenReturn=function(t){return i&&n(t)?this._then(o(t,2),void 0,void 0,void 0,void 0):this._then(e,void 0,void 0,t,void 0)},t.prototype["throw"]=t.prototype.thenThrow=function(t){return i&&n(t)?this._then(o(t,1),void 0,void 0,void 0,void 0):this._then(r,void 0,void 0,t,void 0)}}},{"./util.js":38}],12:[function(t,e){"use strict";e.exports=function(t,e){var r=t.reduce;t.prototype.each=function(t){return r(this,t,null,e)},t.each=function(t,n){return r(t,n,null,e)}}},{}],13:[function(t,e){"use strict";function r(t,e){function r(n){return this instanceof r?(l(this,"message","string"==typeof n?n:e),l(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return c(r,Error),r}function n(t){return this instanceof n?(l(this,"name","OperationalError"),l(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(l(this,"message",t.message),l(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new n(t)}var i,o,s=t("./es5.js"),a=s.freeze,u=t("./util.js"),c=u.inherits,l=u.notEnumerableProp,h=r("Warning","warning"),p=r("CancellationError","cancellation error"),f=r("TimeoutError","timeout error"),_=r("AggregateError","aggregate error");try{i=TypeError,o=RangeError}catch(d){i=r("TypeError","type error"),o=r("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;y<v.length;++y)"function"==typeof Array.prototype[v[y]]&&(_.prototype[v[y]]=Array.prototype[v[y]]);s.defineProperty(_.prototype,"length",{value:0,configurable:!1,writable:!0,enumerable:!0}),_.prototype.isOperational=!0;var g=0;_.prototype.toString=function(){var t=Array(4*g+1).join(" "),e="\n"+t+"AggregateError of:\n";g++,t=Array(4*g+1).join(" ");for(var r=0;r<this.length;++r){for(var n=this[r]===this?"[Circular AggregateError]":this[r]+"",i=n.split("\n"),o=0;o<i.length;++o)i[o]=t+i[o];n=i.join("\n"),e+=n+"\n"}return g--,e},c(n,Error);var m=Error.__BluebirdErrorTypes__;m||(m=a({CancellationError:p,TimeoutError:f,OperationalError:n,RejectionError:n,AggregateError:_}),l(Error,"__BluebirdErrorTypes__",m)),e.exports={Error:Error,TypeError:i,RangeError:o,CancellationError:m.CancellationError,OperationalError:m.OperationalError,TimeoutError:m.TimeoutError,AggregateError:m.AggregateError,Warning:h}},{"./es5.js":14,"./util.js":38}],14:[function(t,e){var r=function(){"use strict";return void 0===this}();if(r)e.exports={freeze:Object.freeze,defineProperty:Object.defineProperty,getDescriptor:Object.getOwnPropertyDescriptor,keys:Object.keys,names:Object.getOwnPropertyNames,getPrototypeOf:Object.getPrototypeOf,isArray:Array.isArray,isES5:r,propertyIsWritable:function(t,e){var r=Object.getOwnPropertyDescriptor(t,e);return!(r&&!r.writable&&!r.set)}};else{var n={}.hasOwnProperty,i={}.toString,o={}.constructor.prototype,s=function(t){var e=[];for(var r in t)n.call(t,r)&&e.push(r);return e},a=function(t,e){return{value:t[e]}},u=function(t,e,r){return t[e]=r.value,t},c=function(t){return t},l=function(t){try{return Object(t).constructor.prototype}catch(e){return o}},h=function(t){try{return"[object Array]"===i.call(t)}catch(e){return!1}};e.exports={isArray:h,keys:s,names:s,defineProperty:u,getDescriptor:a,freeze:c,getPrototypeOf:l,isES5:r,propertyIsWritable:function(){return!0}}}},{}],15:[function(t,e){"use strict";e.exports=function(t,e){var r=t.map;t.prototype.filter=function(t,n){return r(this,t,n,e)},t.filter=function(t,n,i){return r(t,n,i,e)}}},{}],16:[function(t,e){"use strict";e.exports=function(e,r,n){function i(){return this}function o(){throw this}function s(t){return function(){return t}}function a(t){return function(){throw t}}function u(t,e,r){var n;return n=p&&f(e)?r?s(e):a(e):r?i:o,t._then(n,_,void 0,e,void 0)}function c(t){var i=this.promise,o=this.handler,s=i._isBound()?o.call(i._boundTo):o();if(void 0!==s){var a=n(s,i);if(a instanceof e)return a=a._target(),u(a,t,i.isFulfilled())}return i.isRejected()?(r.e=t,r):t}function l(t){var r=this.promise,i=this.handler,o=r._isBound()?i.call(r._boundTo,t):i(t);if(void 0!==o){var s=n(o,r);if(s instanceof e)return s=s._target(),u(s,t,!0)}return t}var h=t("./util.js"),p=h.wrapsPrimitiveReceiver,f=h.isPrimitive,_=h.thrower;e.prototype._passThroughHandler=function(t,e){if("function"!=typeof t)return this.then();var r={promise:this,handler:t};return this._then(e?c:l,e?c:void 0,void 0,r,void 0)},e.prototype.lastly=e.prototype["finally"]=function(t){return this._passThroughHandler(t,!0)},e.prototype.tap=function(t){return this._passThroughHandler(t,!1)}}},{"./util.js":38}],17:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t,r,n){for(var o=0;o<r.length;++o){n._pushContext();var s=h(r[o])(t);if(n._popContext(),s===l){n._pushContext();var a=e.reject(l.e);return n._popContext(),a}var u=i(s,n);if(u instanceof e)return u}return null}function s(t,r,i,o){var s=this._promise=new e(n);s._captureStackTrace(),this._stack=o,this._generatorFunction=t,this._receiver=r,this._generator=void 0,this._yieldHandlers="function"==typeof i?[i].concat(p):p}var a=t("./errors.js"),u=a.TypeError,c=t("./util.js"),l=c.errorObj,h=c.tryCatch,p=[];s.prototype.promise=function(){return this._promise},s.prototype._run=function(){this._generator=this._generatorFunction.call(this._receiver),this._receiver=this._generatorFunction=void 0,this._next(void 0)},s.prototype._continue=function(t){if(t===l)return this._promise._rejectCallback(t.e,!1,!0);var r=t.value;if(t.done===!0)this._promise._resolveCallback(r);else{var n=i(r,this._promise);if(!(n instanceof e)&&(n=o(n,this._yieldHandlers,this._promise),null===n))return void this._throw(new u("A value %s was yielded that could not be treated as a promise\n\n See http://goo.gl/4Y4pDk\n\n".replace("%s",r)+"From coroutine:\n"+this._stack.split("\n").slice(1,-7).join("\n")));n._then(this._next,this._throw,void 0,this,null)}},s.prototype._throw=function(t){this._promise._attachExtraTrace(t),this._promise._pushContext();var e=h(this._generator["throw"]).call(this._generator,t);this._promise._popContext(),this._continue(e)},s.prototype._next=function(t){this._promise._pushContext();var e=h(this._generator.next).call(this._generator,t);this._promise._popContext(),this._continue(e)},e.coroutine=function(t,e){if("function"!=typeof t)throw new u("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var r=Object(e).yieldHandler,n=s,i=(new Error).stack;return function(){var e=t.apply(this,arguments),o=new n(void 0,void 0,r,i);return o._generator=e,o._next(void 0),o.promise()}},e.coroutine.addYieldHandler=function(t){if("function"!=typeof t)throw new u("fn must be a function\n\n See http://goo.gl/916lJJ\n");p.push(t)},e.spawn=function(t){if("function"!=typeof t)return r("generatorFunction must be a function\n\n See http://goo.gl/6Vqhm0\n");var n=new s(t,this),i=n.promise();return n._run(e.spawn),i}}},{"./errors.js":13,"./util.js":38}],18:[function(t,e){"use strict";e.exports=function(e,r,n,i){{var o=t("./util.js");o.canEvaluate,o.tryCatch,o.errorObj}e.join=function(){var t,e=arguments.length-1;if(e>0&&"function"==typeof arguments[e]){t=arguments[e];var n}for(var i=arguments.length,o=new Array(i),s=0;i>s;++s)o[s]=arguments[s];t&&o.pop();var n=new r(o).promise();return void 0!==t?n.spread(t):n}}},{"./util.js":38}],19:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace(),this._callback=e,this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=r>=1?[]:_,c.invoke(a,this,void 0)}function a(){this._init$(void 0,-2)}function u(t,e,r,n){var i="object"==typeof r&&null!==r?r.concurrency:0;return i="number"==typeof i&&isFinite(i)&&i>=1?i:0,new s(t,e,i,n)}var c=t("./async.js"),l=t("./util.js"),h=l.tryCatch,p=l.errorObj,f={},_=[];l.inherits(s,r),s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,a=this._limit;if(n[r]===f){if(n[r]=t,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return n[r]=t,void this._queue.push(r);null!==s&&(s[r]=t);var u=this._callback,c=this._promise._boundTo;this._promise._pushContext();var l=h(u).call(c,t,r,o);if(this._promise._popContext(),l===p)return this._reject(l.e);var _=i(l,this._promise);if(_ instanceof e){if(_=_._target(),_._isPending())return a>=1&&this._inFlight++,n[r]=f,_._proxyPromiseArray(this,r);if(!_._isFulfilled())return this._reject(_._reason());l=_._value()}n[r]=l}var d=++this._totalResolved;d>=o&&(null!==s?this._filter(n,s):this._resolve(n))},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight<e;){if(this._isResolved())return;var n=t.pop();this._promiseFulfilled(r[n],n)}},s.prototype._filter=function(t,e){for(var r=e.length,n=new Array(r),i=0,o=0;r>o;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},s.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(this,t,e,null).promise()},e.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(t,e,r,i).promise()}}},{"./async.js":2,"./util.js":38}],20:[function(t,e){"use strict";e.exports=function(e,r,n,i){var o=t("./util.js"),s=o.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var n=new e(r);n._captureStackTrace(),n._pushContext();var i=s(t).apply(this,arguments);return n._popContext(),n._resolveFromSyncValue(i),n}},e.attempt=e["try"]=function(t,n,a){if("function"!=typeof t)return i("fn must be a function\n\n See http://goo.gl/916lJJ\n");var u=new e(r);u._captureStackTrace(),u._pushContext();var c=o.isArray(n)?s(t).apply(a,n):s(t).call(a,n);return u._popContext(),u._resolveFromSyncValue(c),u},e.prototype._resolveFromSyncValue=function(t){t===o.errorObj?this._rejectCallback(t.e,!1,!0):this._resolveCallback(t,!0)}}},{"./util.js":38}],21:[function(t,e){"use strict";e.exports=function(e){function r(t,e){var r=this;if(!o.isArray(t))return n.call(r,t,e);var i=a(e).apply(r._boundTo,[null].concat(t));i===u&&s.throwLater(i.e)}function n(t,e){var r=this,n=r._boundTo,i=void 0===t?a(e).call(n,null):a(e).call(n,null,t);i===u&&s.throwLater(i.e)}function i(t,e){var r=this;if(!t){var n=r._target(),i=n._getCarriedStackTrace();i.cause=t,t=i}var o=a(e).call(r._boundTo,t);o===u&&s.throwLater(o.e)}var o=t("./util.js"),s=t("./async.js"),a=o.tryCatch,u=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=n;void 0!==e&&Object(e).spread&&(o=r),this._then(o,i,void 0,this,t)}return this}}},{"./async.js":2,"./util.js":38}],22:[function(t,e){"use strict";e.exports=function(e,r){var n=t("./util.js"),i=t("./async.js"),o=n.tryCatch,s=n.errorObj;e.prototype.progressed=function(t){return this._then(void 0,void 0,t,void 0,void 0)},e.prototype._progress=function(t){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(t)},e.prototype._progressHandlerAt=function(t){return 0===t?this._progressHandler0:this[(t<<2)+t-5+2]},e.prototype._doProgressWith=function(t){var r=t.value,i=t.handler,a=t.promise,u=t.receiver,c=o(i).call(u,r);if(c===s){if(null!=c.e&&"StopProgressPropagation"!==c.e.name){var l=n.canAttachTrace(c.e)?c.e:new Error(n.toString(c.e));a._attachExtraTrace(l),a._progress(c.e)}}else c instanceof e?c._then(a._progress,null,null,a,void 0):a._progress(c)},e.prototype._progressUnchecked=function(t){for(var n=this._length(),o=this._progress,s=0;n>s;s++){var a=this._progressHandlerAt(s),u=this._promiseAt(s);if(u instanceof e)"function"==typeof a?i.invoke(this._doProgressWith,this,{handler:a,promise:u,receiver:this._receiverAt(s),value:t}):i.invoke(o,u,t);else{var c=this._receiverAt(s);"function"==typeof a?a.call(c,t,u):c instanceof r&&!c._isResolved()&&c._promiseProgressed(t,u)}}}}},{"./async.js":2,"./util.js":38}],23:[function(t,e){"use strict";e.exports=function(){function e(t){if("function"!=typeof t)throw new c("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==e)throw new c("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,t!==l&&this._resolveFromResolver(t)}function r(t){var r=new e(l);r._fulfillmentHandler0=t,r._rejectionHandler0=t,r._progressHandler0=t,r._promise0=t,r._receiver0=t,r._settledValue=t}var n=function(){return new c("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},i=function(){return new e.PromiseInspection(this._target())},o=function(t){return e.reject(new c(t))},s=t("./util.js"),a=t("./async.js"),u=t("./errors.js"),c=e.TypeError=u.TypeError;e.RangeError=u.RangeError,e.CancellationError=u.CancellationError,e.TimeoutError=u.TimeoutError,e.OperationalError=u.OperationalError,e.RejectionError=u.OperationalError,e.AggregateError=u.AggregateError;var l=function(){},h={},p={e:null},f=t("./thenables.js")(e,l),_=t("./promise_array.js")(e,l,f,o),d=t("./captured_trace.js")(),v=t("./debuggability.js")(e,d),y=t("./context.js")(e,d,v),g=t("./catch_filter.js")(p),m=t("./promise_resolver.js"),j=m._nodebackForPromise,b=s.errorObj,w=s.tryCatch;return e.prototype.toString=function(){return"[object Promise]"},e.prototype.caught=e.prototype["catch"]=function(t){var r=arguments.length;if(r>1){var n,i=new Array(r-1),o=0;for(n=0;r-1>n;++n){var s=arguments[n];if("function"!=typeof s)return e.reject(new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));i[o++]=s}i.length=o,t=arguments[n];var a=new g(i,t,this);return this._then(void 0,a.doFilter,void 0,a,void 0)}return this._then(void 0,t,void 0,void 0,void 0)},e.prototype.reflect=function(){return this._then(i,i,void 0,this,void 0)},e.prototype.then=function(t,e,r){if(v()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+s.classString(t);
+arguments.length>1&&(n+=", "+s.classString(e)),this._warn(n)}return this._then(t,e,r,void 0,void 0)},e.prototype.done=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);n._setIsFinal()},e.prototype.spread=function(t,e){return this.all()._then(t,e,void 0,h,void 0)},e.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},e.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},e.prototype.all=function(){return new _(this).promise()},e.prototype.error=function(t){return this.caught(s.originatesFromRejection,t)},e.is=function(t){return t instanceof e},e.fromNode=function(t){var r=new e(l),n=w(t)(j(r));return n===b&&r._rejectCallback(n.e,!0,!0),r},e.all=function(t){return new _(t).promise()},e.defer=e.pending=function(){var t=new e(l);return new m(t)},e.cast=function(t){var r=f(t);if(!(r instanceof e)){var n=r;r=new e(l),r._fulfillUnchecked(n)}return r},e.resolve=e.fulfilled=e.cast,e.reject=e.rejected=function(t){var r=new e(l);return r._captureStackTrace(),r._rejectCallback(t,!0),r},e.setScheduler=function(t){if("function"!=typeof t)throw new c("fn must be a function\n\n See http://goo.gl/916lJJ\n");var e=a._schedule;return a._schedule=t,e},e.prototype._then=function(t,r,n,i,o){var s=void 0!==o,u=s?o:new e(l);s||(u._propagateFrom(this,5),u._captureStackTrace());var c=this._target();c!==this&&(void 0===i&&(i=this._boundTo),s||u._setIsMigrated());var h=c._addCallbacks(t,r,n,u,i);return c._isResolved()&&!c._isSettlePromisesQueued()&&a.invoke(c._settlePromiseAtPostResolution,c,h),u},e.prototype._settlePromiseAtPostResolution=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(t)},e.prototype._length=function(){return 131071&this._bitField},e.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},e.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},e.prototype._setLength=function(t){this._bitField=-131072&this._bitField|131071&t},e.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},e.prototype._setRejected=function(){this._bitField=134217728|this._bitField},e.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},e.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},e.prototype._isFinal=function(){return(33554432&this._bitField)>0},e.prototype._cancellable=function(){return(67108864&this._bitField)>0},e.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},e.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},e.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},e.prototype._unsetIsMigrated=function(){this._bitField=-4194305&this._bitField},e.prototype._isMigrated=function(){return(4194304&this._bitField)>0},e.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[5*t-5+4];return void 0===e&&this._isBound()?this._boundTo:e},e.prototype._promiseAt=function(t){return 0===t?this._promise0:this[5*t-5+3]},e.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[5*t-5+0]},e.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[5*t-5+1]},e.prototype._migrateCallbacks=function(t,r){var n=t._fulfillmentHandlerAt(r),i=t._rejectionHandlerAt(r),o=t._progressHandlerAt(r),s=t._promiseAt(r),a=t._receiverAt(r);s instanceof e&&s._setIsMigrated(),this._addCallbacks(n,i,o,s,a)},e.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=131066&&(o=0,this._setLength(0)),0===o)this._promise0=n,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=t),"function"==typeof e&&(this._rejectionHandler0=e),"function"==typeof r&&(this._progressHandler0=r);else{var s=5*o-5;this[s+3]=n,this[s+4]=i,"function"==typeof t&&(this[s+0]=t),"function"==typeof e&&(this[s+1]=e),"function"==typeof r&&(this[s+2]=r)}return this._setLength(o+1),o},e.prototype._setProxyHandlers=function(t,e){var r=this._length();if(r>=131066&&(r=0,this._setLength(0)),0===r)this._promise0=e,this._receiver0=t;else{var n=5*r-5;this[n+3]=e,this[n+4]=t}this._setLength(r+1)},e.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},e.prototype._resolveCallback=function(t,r){if(!this._isFollowingOrFulfilledOrRejected()){if(t===this)return this._rejectCallback(n(),!1,!0);var i=f(t,this);if(!(i instanceof e))return this._fulfill(t);var o=1|(r?4:0);this._propagateFrom(i,o);var s=i._target();if(s._isPending()){for(var a=this._length(),u=0;a>u;++u)s._migrateCallbacks(this,u);this._setFollowing(),this._setLength(0),this._setFollowee(s)}else s._isFulfilled()?this._fulfillUnchecked(s._value()):this._rejectUnchecked(s._reason(),s._getCarriedStackTrace())}},e.prototype._rejectCallback=function(t,e,r){r||s.markAsOriginatingFromRejection(t);var n=s.ensureErrorObject(t),i=n===t;this._attachExtraTrace(n,e?i:!1),this._reject(t,i?void 0:n)},e.prototype._resolveFromResolver=function(t){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=w(t)(function(t){null!==e&&(e._resolveCallback(t),e=null)},function(t){null!==e&&(e._rejectCallback(t,r),e=null)});r=!1,this._popContext(),void 0!==n&&n===b&&null!==e&&(e._rejectCallback(n.e,!0,!0),e=null)},e.prototype._settlePromiseFromHandler=function(t,e,r,i){if(!i._isRejected()){i._pushContext();var o;if(o=e!==h||this._isRejected()?w(t).call(e,r):w(t).apply(this._boundTo,r),i._popContext(),o===b||o===i||o===p){var s=o===i?n():o.e;i._rejectCallback(s,!1,!0)}else i._resolveCallback(o)}},e.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},e.prototype._followee=function(){return this._rejectionHandler0},e.prototype._setFollowee=function(t){this._rejectionHandler0=t},e.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},e.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&t._isBound()&&this._setBoundTo(t._boundTo)},e.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},e.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},e.prototype._settlePromiseAt=function(t){var r=this._promiseAt(t),n=r instanceof e;if(n&&r._isMigrated())return r._unsetIsMigrated(),a.invoke(this._settlePromiseAt,this,t);var i=this._isFulfilled()?this._fulfillmentHandlerAt(t):this._rejectionHandlerAt(t),o=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,s=this._settledValue,u=this._receiverAt(t);this._clearCallbackDataAtIndex(t),"function"==typeof i?n?this._settlePromiseFromHandler(i,u,s,r):i.call(u,s,r):u instanceof _?u._isResolved()||(this._isFulfilled()?u._promiseFulfilled(s,r):u._promiseRejected(s,r)):n&&(this._isFulfilled()?r._fulfill(s):r._reject(s,o)),t>=4&&4===(31&t)&&a.invokeLater(this._setLength,this,0)},e.prototype._clearCallbackDataAtIndex=function(t){if(0===t)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var e=5*t-5;this[e+3]=this[e+4]=this[e+0]=this[e+1]=this[e+2]=void 0}},e.prototype._isSettlePromisesQueued=function(){return-1073741824===(-1073741824&this._bitField)},e.prototype._setSettlePromisesQueued=function(){this._bitField=-1073741824|this._bitField},e.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},e.prototype._queueSettlePromises=function(){a.settlePromises(this),this._setSettlePromisesQueued()},e.prototype._fulfillUnchecked=function(t){if(t===this){var e=n();return this._attachExtraTrace(e),this._rejectUnchecked(e,void 0)}this._setFulfilled(),this._settledValue=t,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},e.prototype._rejectUncheckedCheckError=function(t){var e=s.ensureErrorObject(t);this._rejectUnchecked(t,e===t?void 0:e)},e.prototype._rejectUnchecked=function(t,e){if(t===this){var r=n();return this._attachExtraTrace(r),this._rejectUnchecked(r)}return this._setRejected(),this._settledValue=t,this._cleanValues(),this._isFinal()?void a.throwLater(function(t){throw"stack"in t&&a.invokeFirst(d.unhandledRejection,void 0,t),t},void 0===e?t:e):(void 0!==e&&e!==t&&this._setCarriedStackTrace(e),void(this._length()>0?this._queueSettlePromises():this._ensurePossibleRejectionHandled()))},e.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();for(var t=this._length(),e=0;t>e;e++)this._settlePromiseAt(e)},e._makeSelfResolutionError=n,t("./progress.js")(e,_),t("./method.js")(e,l,f,o),t("./bind.js")(e,l,f),t("./finally.js")(e,p,f),t("./direct_resolve.js")(e),t("./synchronous_inspection.js")(e),t("./join.js")(e,_,f,l),e.Promise=e,t("./map.js")(e,_,o,f,l),t("./cancel.js")(e),t("./using.js")(e,o,f,y),t("./generators.js")(e,o,l,f),t("./nodeify.js")(e),t("./call_get.js")(e),t("./props.js")(e,_,f,o),t("./race.js")(e,l,f,o),t("./reduce.js")(e,_,o,f,l),t("./settle.js")(e,_),t("./some.js")(e,_,o),t("./promisify.js")(e,l),t("./any.js")(e),t("./each.js")(e,l),t("./timers.js")(e,l),t("./filter.js")(e,l),s.toFastProperties(e),s.toFastProperties(e.prototype),r({a:1}),r({b:2}),r({c:3}),r(1),r(function(){}),r(void 0),r(!1),r(new e(l)),d.setBounds(a.firstLineError,s.lastLineError),e}},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n,i=this._promise=new e(r);t instanceof e&&(n=t,i._propagateFrom(n,5)),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var a=t("./util.js"),u=a.isArray;return s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function c(t,r){var s=n(this._values,this._promise);if(s instanceof e){if(s=s._target(),this._values=s,!s._isFulfilled())return s._isPending()?void s._then(c,this._reject,void 0,this,r):void this._reject(s._reason());if(s=s._value(),!u(s)){var a=new e.TypeError("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");return void this.__hardReject__(a)}}else if(!u(s))return void this._promise._reject(i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n")._reason());if(0===s.length)return void(-5===r?this._resolveEmptyArray():this._resolve(o(r)));var l=this.getActualLength(s.length);this._length=l,this._values=this.shouldCopyValues()?new Array(l):this._values;for(var h=this._promise,p=0;l>p;++p){var f=this._isResolved(),_=n(s[p],h);_ instanceof e?(_=_._target(),f?_._unsetRejectionIsUnhandled():_._isPending()?_._proxyPromiseArray(this,p):_._isFulfilled()?this._promiseFulfilled(_._value(),p):this._promiseRejected(_._reason(),p)):f||this._promiseFulfilled(_,p)}},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype.__hardReject__=s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1,!0)},s.prototype._promiseProgressed=function(t,e){this._promise._progress({index:e,value:t})},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},s.prototype._promiseRejected=function(t){this._totalResolved++,this._reject(t)},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){return t},s}},{"./util.js":38}],25:[function(t,e){"use strict";function r(t){return t instanceof Error&&p.getPrototypeOf(t)===Error.prototype}function n(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=p.keys(t),i=0;i<n.length;++i){var o=n[i];f.test(o)||(e[o]=t[o])}return e}return s.markAsOriginatingFromRejection(t),t}function i(t){return function(e,r){if(null!==t){if(e){var i=n(a(e));t._attachExtraTrace(i),t._reject(i)}else if(arguments.length>2){for(var o=arguments.length,s=new Array(o-1),u=1;o>u;++u)s[u-1]=arguments[u];t._fulfill(s)}else t._fulfill(r);t=null}}}var o,s=t("./util.js"),a=s.maybeWrapAsError,u=t("./errors.js"),c=u.TimeoutError,l=u.OperationalError,h=s.haveGetters,p=t("./es5.js"),f=/^(?:name|message|stack|cause)$/;if(o=h?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=i(t),this.callback=this.asCallback},h){var _={get:function(){return i(this.promise)}};p.defineProperty(o.prototype,"asCallback",_),p.defineProperty(o.prototype,"callback",_)}o._nodebackForPromise=i,o.prototype.toString=function(){return"[object PromiseResolver]"},o.prototype.resolve=o.prototype.fulfill=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(t)},o.prototype.reject=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(t)},o.prototype.progress=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(t)},o.prototype.cancel=function(t){this.promise.cancel(t)},o.prototype.timeout=function(){this.reject(new c("timeout"))},o.prototype.isResolved=function(){return this.promise.isResolved()},o.prototype.toJSON=function(){return this.promise.toJSON()},e.exports=o},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(t,e){"use strict";e.exports=function(e,r){function n(t){return!b.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,r){var n=f.getDataPropertyOrDefault(t,e+r,j);return n?i(n):!1}function s(t,e,r){for(var n=0;n<t.length;n+=2){var i=t[n];if(r.test(i))for(var o=i.replace(r,""),s=0;s<t.length;s+=2)if(t[s]===o)throw new g("Cannot promisify an API that has normal methods with '%s'-suffix\n\n See http://goo.gl/iWrZbw\n".replace("%s",e))}}function a(t,e,r,n){for(var a=f.inheritedDataKeys(t),u=[],c=0;c<a.length;++c){var l=a[c],h=t[l],p=n===w?!0:w(l,h,t);"function"!=typeof h||i(h)||o(t,l,e)||!n(l,h,t,p)||u.push(l,h)}return s(u,e,r),u}function u(t,n,i,o){function s(){var i=n;n===p&&(i=this);var o=new e(r);o._captureStackTrace();var s="string"==typeof u&&this!==a?this[u]:t,c=_(o);try{s.apply(i,d(arguments,c))}catch(l){o._rejectCallback(v(l),!0,!0)}return o}var a=function(){return this}(),u=t;return"string"==typeof u&&(t=o),s.__isPromisified__=!0,s}function c(t,e,r,n){for(var i=new RegExp(k(e)+"$"),o=a(t,e,i,r),s=0,u=o.length;u>s;s+=2){var c=o[s],l=o[s+1],h=c+e;t[h]=n===E?E(c,p,c,l,e):n(l,function(){return E(c,p,c,l,e)})}return f.toFastProperties(t),t}function l(t,e){return E(t,e,void 0,t)}var h,p={},f=t("./util.js"),_=t("./promise_resolver.js")._nodebackForPromise,d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,g=t("./errors").TypeError,m="Async",j={__isPromisified__:!0},b=/^(?:length|name|arguments|caller|callee|prototype|__isPromisified__)$/,w=function(t,e){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&!f.isClass(e)},k=function(t){return t.replace(/([$])/,"\\$")},E=y?h:u;e.promisify=function(t,e){if("function"!=typeof t)throw new g("fn must be a function\n\n See http://goo.gl/916lJJ\n");if(i(t))return t;var r=l(t,arguments.length<2?p:e);return f.copyDescriptors(t,r,n),r},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");e=Object(e);var r=e.suffix;"string"!=typeof r&&(r=m);var n=e.filter;"function"!=typeof n&&(n=w);var i=e.promisifier;if("function"!=typeof i&&(i=E),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n");for(var o=f.inheritedDataKeys(t),s=0;s<o.length;++s){var a=t[o[s]];"constructor"!==o[s]&&f.isClass(a)&&(c(a.prototype,r,n,i),c(a,r,n,i))}return c(t,r,n,i)}}},{"./errors":13,"./promise_resolver.js":25,"./util.js":38}],27:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){for(var e=c.keys(t),r=e.length,n=new Array(2*r),i=0;r>i;++i){var o=e[i];n[i]=t[o],n[i+r]=o}this.constructor$(n)}function s(t){var r,s=n(t);return u(s)?(r=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&r._propagateFrom(s,4),r):i("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}var a=t("./util.js"),u=a.isObject,c=t("./es5.js");a.inherits(o,r),o.prototype._init=function(){this._init$(void 0,-3)},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;if(r>=this._length){for(var n={},i=this.length(),o=0,s=this.length();s>o;++o)n[this._values[o+i]]=this._values[o];this._resolve(n)}},o.prototype._promiseProgressed=function(t,e){this._promise._progress({key:this._values[e+this.length()],value:t})},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5.js":14,"./util.js":38}],28:[function(t,e){"use strict";function r(t,e,r,n,i){for(var o=0;i>o;++o)r[o+n]=t[o+e],t[o+e]=void 0}function n(t){this._capacity=t,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(t){return this._capacity<t},n.prototype._pushOne=function(t){var e=this.length();this._checkCapacity(e+1);var r=this._front+e&this._capacity-1;this[r]=t,this._length=e+1},n.prototype._unshiftOne=function(t){var e=this._capacity;this._checkCapacity(this.length()+1);var r=this._front,n=(r-1&e-1^e)-e;this[n]=t,this._front=n,this._length=this.length()+1},n.prototype.unshift=function(t,e,r){this._unshiftOne(r),this._unshiftOne(e),this._unshiftOne(t)},n.prototype.push=function(t,e,r){var n=this.length()+3;if(this._willBeOverCapacity(n))return this._pushOne(t),this._pushOne(e),void this._pushOne(r);var i=this._front+n-3;this._checkCapacity(n);var o=this._capacity-1;this[i+0&o]=t,this[i+1&o]=e,this[i+2&o]=r,this._length=n},n.prototype.shift=function(){var t=this._front,e=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length--,e},n.prototype.length=function(){return this._length},n.prototype._checkCapacity=function(t){this._capacity<t&&this._resizeTo(this._capacity<<1)},n.prototype._resizeTo=function(t){var e=this._capacity;this._capacity=t;var n=this._front,i=this._length,o=n+i&e-1;r(this,0,this,e,o)},e.exports=n},{}],29:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t,o){var u=n(t);if(u instanceof e)return a(u);if(!s(t))return i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");var c=new e(r);void 0!==o&&c._propagateFrom(o,5);for(var l=c._fulfill,h=c._reject,p=0,f=t.length;f>p;++p){var _=t[p];(void 0!==_||p in t)&&e.cast(_)._then(l,h,void 0,c,null)}return c}var s=t("./util.js").isArray,a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util.js":38}],30:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,r,n,s){this.constructor$(t),this._promise._captureStackTrace(),this._preservedValues=s===o?[]:null,this._zerothIsAccum=void 0===n,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var u=i(n,this._promise),l=!1,h=u instanceof e;h&&(u=u._target(),u._isPending()?u._proxyPromiseArray(this,-1):u._isFulfilled()?(n=u._value(),this._gotAccum=!0):(this._reject(u._reason()),l=!0)),h||this._zerothIsAccum||(this._gotAccum=!0),this._callback=r,this._accum=n,l||c.invoke(a,this,void 0)}function a(){this._init$(void 0,-5)}function u(t,e,r,i){if("function"!=typeof e)return n("fn must be a function\n\n See http://goo.gl/916lJJ\n");var o=new s(t,e,r,i);return o.promise()}var c=t("./async.js"),l=t("./util.js"),h=l.tryCatch,p=l.errorObj;l.inherits(s,r),s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},s.prototype._promiseFulfilled=function(t,r){var n=this._values;n[r]=t;var o,s=this.length(),a=this._preservedValues,u=null!==a,c=this._gotAccum,l=this._valuesPhase;if(!l)for(l=this._valuesPhase=new Array(s),o=0;s>o;++o)l[o]=0;if(o=l[r],0===r&&this._zerothIsAccum?(this._accum=t,this._gotAccum=c=!0,l[r]=0===o?1:2):-1===r?(this._accum=t,this._gotAccum=c=!0):0===o?l[r]=1:(l[r]=2,this._accum=t),c){for(var f,_=this._callback,d=this._promise._boundTo,v=this._reducingIndex;s>v;++v)if(o=l[v],2!==o){if(1!==o)return;if(t=n[v],this._promise._pushContext(),u?(a.push(t),f=h(_).call(d,t,v,s)):f=h(_).call(d,this._accum,t,v,s),this._promise._popContext(),f===p)return this._reject(f.e);var y=i(f,this._promise);if(y instanceof e){if(y=y._target(),y._isPending())return l[v]=4,y._proxyPromiseArray(this,v);if(!y._isFulfilled())return this._reject(y._reason());f=y._value()}this._reducingIndex=v+1,this._accum=f}else this._reducingIndex=v+1;this._resolve(u?a:this._accum)}},e.prototype.reduce=function(t,e){return u(this,t,e,null)},e.reduce=function(t,e,r,n){return u(t,e,r,n)}}},{"./async.js":2,"./util.js":38}],31:[function(t,e){"use strict";var r,n=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")};if(t("./util.js").isNode){var i=process.versions.node.split(".").map(Number);r=0===i[0]&&i[1]>10||i[0]>0?global.setImmediate:process.nextTick,r||(r="undefined"!=typeof setImmediate?setImmediate:"undefined"!=typeof setTimeout?setTimeout:n)}else"undefined"!=typeof MutationObserver?(r=function(t){var e=document.createElement("div"),r=new MutationObserver(t);return r.observe(e,{attributes:!0}),function(){e.classList.toggle("foo")}},r.isStatic=!0):r="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:n;e.exports=r},{"./util.js":38}],32:[function(t,e){"use strict";e.exports=function(e,r){function n(t){this.constructor$(t)}var i=e.PromiseInspection,o=t("./util.js");o.inherits(n,r),n.prototype._promiseResolved=function(t,e){this._values[t]=e;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},n.prototype._promiseFulfilled=function(t,e){var r=new i;r._bitField=268435456,r._settledValue=t,this._promiseResolved(e,r)},n.prototype._promiseRejected=function(t,e){var r=new i;r._bitField=134217728,r._settledValue=t,this._promiseResolved(e,r)},e.settle=function(t){return new n(t).promise()},e.prototype.settle=function(){return new n(this).promise()}}},{"./util.js":38}],33:[function(t,e){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return n("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var r=new i(t),o=r.promise();return r.setHowMany(e),r.init(),o}var s=t("./util.js"),a=t("./errors.js").RangeError,u=t("./errors.js").AggregateError,c=s.isArray;s.inherits(i,r),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),this._resolve(1===this.howMany()&&this._unwrap?this._values[0]:this._values))},i.prototype._promiseRejected=function(t){if(this._addRejected(t),this.howMany()>this._canPossiblyFulfill()){for(var e=new u,r=this.length();r<this._values.length;++r)e.push(this._values[r]);this._reject(e)}},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new a(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors.js":13,"./util.js":38}],34:[function(t,e){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValue=t._settledValue):(this._bitField=0,this._settledValue=void 0)}e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return this._settledValue},e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return this._settledValue},e.prototype.isFulfilled=t.prototype._isFulfilled=function(){return(268435456&this._bitField)>0},e.prototype.isRejected=t.prototype._isRejected=function(){return(134217728&this._bitField)>0},e.prototype.isPending=t.prototype._isPending=function(){return 0===(402653184&this._bitField)},e.prototype.isResolved=t.prototype._isResolved=function(){return(402653184&this._bitField)>0},t.prototype.isPending=function(){return this._target()._isPending()},t.prototype.isRejected=function(){return this._target()._isRejected()},t.prototype.isFulfilled=function(){return this._target()._isFulfilled()},t.prototype.isResolved=function(){return this._target()._isResolved()},t.prototype._value=function(){return this._settledValue},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue},t.prototype.value=function(){var t=this._target();if(!t.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return t._settledValue},t.prototype.reason=function(){var t=this._target();if(!t.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return t._unsetRejectionIsUnhandled(),t._settledValue},t.PromiseInspection=e}},{}],35:[function(t,e){"use strict";e.exports=function(e,r){function n(t,n){if(c(t)){if(t instanceof e)return t;if(o(t)){var l=new e(r);return t._then(l._fulfillUnchecked,l._rejectUncheckedCheckError,l._progressUnchecked,l,null),l}var h=a.tryCatch(i)(t);if(h===u){n&&n._pushContext();var l=e.reject(h.e);return n&&n._popContext(),l}if("function"==typeof h)return s(t,h,n)}return t}function i(t){return t.then}function o(t){return l.call(t,"_promise0")}function s(t,n,i){function o(r){l&&(t===r?l._rejectCallback(e._makeSelfResolutionError(),!1,!0):l._resolveCallback(r),l=null)}function s(t){l&&(l._rejectCallback(t,p,!0),l=null)}function c(t){l&&"function"==typeof l._progress&&l._progress(t)}var l=new e(r),h=l;i&&i._pushContext(),l._captureStackTrace(),i&&i._popContext();var p=!0,f=a.tryCatch(n).call(t,o,s,c);return p=!1,l&&f===u&&(l._rejectCallback(f.e,!0,!0),l=null),h}var a=t("./util.js"),u=a.errorObj,c=a.isObject,l={}.hasOwnProperty;return n}},{"./util.js":38}],36:[function(t,e){"use strict";e.exports=function(e,r){function n(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function i(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}var o=t("./util.js"),s=e.TimeoutError,a=function(t,e){if(t.isPending()){"string"!=typeof e&&(e="operation timed out");var r=new s(e);o.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._cancel(r)}},u=function(t){return c(+this).thenReturn(t)},c=e.delay=function(t,n){if(void 0===n){n=t,t=void 0;var i=new e(r);return setTimeout(function(){i._fulfill()},n),i}return n=+n,e.resolve(t)._then(u,null,null,n,void 0)};e.prototype.delay=function(t){return c(this,t)},e.prototype.timeout=function(t,e){t=+t;var r=this.then().cancellable();r._cancellationParent=this;var o=setTimeout(function(){a(r,e)},t);return r._then(n,i,void 0,o,void 0)}}},{"./util.js":38}],37:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){for(var r=t.length,n=0;r>n;++n){var i=t[n];if(i.isRejected())return e.reject(i.error());t[n]=i._settledValue}return t}function s(t){setTimeout(function(){throw t},0)}function a(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function u(t,r){function i(){if(o>=u)return c.resolve();var l=a(t[o++]);if(l instanceof e&&l._isDisposable()){try{l=n(l._getDisposer().tryDispose(r),t.promise)}catch(h){return s(h)}if(l instanceof e)return l._then(i,s,null,null,null)}i()}var o=0,u=t.length,c=e.defer();return i(),c.promise}function c(t){var e=new v;return e._settledValue=t,e._bitField=268435456,u(this,e).thenReturn(t)}function l(t){var e=new v;return e._settledValue=t,e._bitField=134217728,u(this,e).thenThrow(t)}function h(t,e,r){this._data=t,this._promise=e,this._context=r}function p(t,e,r){this.constructor$(t,e,r)}function f(t){return h.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}var _=t("./errors.js").TypeError,d=t("./util.js").inherits,v=e.PromiseInspection;h.prototype.data=function(){return this._data},h.prototype.promise=function(){return this._promise},h.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},h.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=null!==e?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},h.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},d(p,h),p.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},e.using=function(){var t=arguments.length;if(2>t)return r("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return r("fn must be a function\n\n See http://goo.gl/916lJJ\n");t--;for(var s=new Array(t),a=0;t>a;++a){var u=arguments[a];if(h.isDisposer(u)){var p=u;u=u.promise(),u._setDisposable(p)}else{var _=n(u);_ instanceof e&&(u=_._then(f,null,null,{resources:s,index:a},void 0))}s[a]=u}var d=e.settle(s).then(o).then(function(t){d._pushContext();var e;try{e=i.apply(void 0,t)}finally{d._popContext()}return e})._then(c,l,void 0,s,void 0);return s.promise=d,d},e.prototype._setDisposable=function(t){this._bitField=262144|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(262144&this._bitField)>0
+},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new _}}},{"./errors.js":13,"./util.js":38}],38:[function(t,e,r){"use strict";function n(){try{return T.apply(this,arguments)}catch(t){return F.e=t,F}}function i(t){return T=t,n}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return!o(t)}function a(t){return o(t)?new Error(v(t)):t}function u(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;n>r;++r)i[r]=t[r];return i[r]=e,i}function c(t,e,r){if(!w.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function l(t,e,r){if(o(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return w.defineProperty(t,e,n),t}function h(t){throw t}function p(t){try{if("function"==typeof t){var e=w.names(t.prototype);return w.isES5?e.length>1:e.length>0&&!(1===e.length&&"constructor"===e[0])}return!1}catch(r){return!1}}function f(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}function _(t){return R.test(t)}function d(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=e+i+r;return n}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){try{l(t,"isOperational",!0)}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function m(t){return t instanceof Error&&w.propertyIsWritable(t,"stack")}function j(t){return{}.toString.call(t)}function b(t,e,r){for(var n=w.names(t),i=0;i<n.length;++i){var o=n[i];r(o)&&w.defineProperty(e,o,w.getDescriptor(t,o))}}var w=t("./es5.js"),k="undefined"==typeof navigator,E=function(){try{var t={};return w.defineProperty(t,"f",{get:function(){return 3}}),3===t.f}catch(e){return!1}}(),F={e:{}},T,C=function(t,e){function r(){this.constructor=t,this.constructor$=e;for(var r in e.prototype)n.call(e.prototype,r)&&"$"!==r.charAt(r.length-1)&&(this[r+"$"]=e.prototype[r])}var n={}.hasOwnProperty;return r.prototype=e.prototype,t.prototype=new r,t.prototype},x=function(){return"string"!==this}.call("string"),P=function(){if(w.isES5){var t=Object.prototype,e=Object.getOwnPropertyNames;return function(r){for(var n=[],i=Object.create(null);null!=r&&r!==t;){var o;try{o=e(r)}catch(s){return n}for(var a=0;a<o.length;++a){var u=o[a];if(!i[u]){i[u]=!0;var c=Object.getOwnPropertyDescriptor(r,u);null!=c&&null==c.get&&null==c.set&&n.push(u)}}r=w.getPrototypeOf(r)}return n}}return function(t){var e=[];for(var r in t)e.push(r);return e}}(),R=/^[a-z$_][a-z$_0-9]*$/i,A=function(){return"stack"in new Error?function(t){return m(t)?t:new Error(v(t))}:function(t){if(m(t))return t;try{throw new Error(v(t))}catch(e){return e}}}(),S={isClass:p,isIdentifier:_,inheritedDataKeys:P,getDataPropertyOrDefault:c,thrower:h,isArray:w.isArray,haveGetters:E,notEnumerableProp:l,isPrimitive:o,isObject:s,canEvaluate:k,errorObj:F,tryCatch:i,inherits:C,withAppended:u,maybeWrapAsError:a,wrapsPrimitiveReceiver:x,toFastProperties:f,filledRange:d,toString:v,canAttachTrace:m,ensureErrorObject:A,originatesFromRejection:g,markAsOriginatingFromRejection:y,classString:j,copyDescriptors:b,hasDevTools:"undefined"!=typeof chrome&&chrome&&"function"==typeof chrome.loadTimes,isNode:"undefined"!=typeof process&&"[object process]"===j(process).toLowerCase()};try{throw new Error}catch(O){S.lastLineError=O}e.exports=S},{"./es5.js":14}],39:[function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function i(t){return"number"==typeof t}function o(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!i(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,i,a,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(r=this._events[t],s(r))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:for(i=arguments.length,a=new Array(i-1),u=1;i>u;u++)a[u-1]=arguments[u];r.apply(this,a)}else if(o(r)){for(i=arguments.length,a=new Array(i-1),u=1;i>u;u++)a[u-1]=arguments[u];for(c=r.slice(),i=c.length,u=0;i>u;u++)c[u].apply(this,a)}return!0},r.prototype.addListener=function(t,e){var i;if(!n(e))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,n(e.listener)?e.listener:e),this._events[t]?o(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,o(this._events[t])&&!this._events[t].warned){var i;i=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,i&&i>0&&this._events[t].length>i&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),i||(i=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var i=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,i,s,a;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],s=r.length,i=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(a=s;a-->0;)if(r[a]===e||r[a].listener&&r[a].listener===e){i=a;break}if(0>i)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],n(r))this.removeListener(t,r);else for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.listenerCount=function(t,e){var r;return r=t._events&&t._events[e]?n(t._events[e])?1:t._events[e].length:0}},{}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise);
\ No newline at end of file
try {throw new Error(); } catch (e) {firstLineError = e;}
var schedule = require("./schedule.js");
var Queue = require("./queue.js");
-var _process = typeof process !== "undefined" ? process : undefined;
+var util = require("./util.js");
function Async() {
this._isTickUsed = false;
this._lateQueue = new Queue(16);
this._normalQueue = new Queue(16);
+ this._trampolineEnabled = true;
var self = this;
this.drainQueues = function () {
self._drainQueues();
schedule.isStatic ? schedule(this.drainQueues) : schedule;
}
-Async.prototype.haveItemsQueued = function () {
- return this._normalQueue.length() > 0;
+Async.prototype.disableTrampolineIfNecessary = function() {
+ if (util.hasDevTools) {
+ this._trampolineEnabled = false;
+ }
};
-Async.prototype._withDomain = function(fn) {
- if (_process !== undefined &&
- _process.domain != null &&
- !fn.domain) {
- fn = _process.domain.bind(fn);
+Async.prototype.enableTrampoline = function() {
+ if (!this._trampolineEnabled) {
+ this._trampolineEnabled = true;
+ this._schedule = function(fn) {
+ setTimeout(fn, 0);
+ };
}
- return fn;
+};
+
+Async.prototype.haveItemsQueued = function () {
+ return this._normalQueue.length() > 0;
};
Async.prototype.throwLater = function(fn, arg) {
arg = fn;
fn = function () { throw arg; };
}
- fn = this._withDomain(fn);
+ var domain = this._getDomain();
+ if (domain !== undefined) fn = domain.bind(fn);
if (typeof setTimeout !== "undefined") {
setTimeout(function() {
fn(arg);
}
};
-Async.prototype.invokeLater = function (fn, receiver, arg) {
- fn = this._withDomain(fn);
+Async.prototype._getDomain = function() {};
+
+if (util.isNode) {
+ var EventsModule = require("events");
+
+ var domainGetter = function() {
+ var domain = process.domain;
+ if (domain === null) return undefined;
+ return domain;
+ };
+
+ if (EventsModule.usingDomains) {
+ Async.prototype._getDomain = domainGetter;
+ } else {
+ var descriptor =
+ Object.getOwnPropertyDescriptor(EventsModule, "usingDomains");
+
+ if (!descriptor.configurable) {
+ process.on("domainsActivated", function() {
+ Async.prototype._getDomain = domainGetter;
+ });
+ } else {
+ var usingDomains = false;
+ Object.defineProperty(EventsModule, "usingDomains", {
+ configurable: false,
+ enumerable: true,
+ get: function() {
+ return usingDomains;
+ },
+ set: function(value) {
+ if (usingDomains || !value) return;
+ usingDomains = true;
+ Async.prototype._getDomain = domainGetter;
+ util.toFastProperties(process);
+ process.emit("domainsActivated");
+ }
+ });
+ }
+
+
+ }
+}
+
+function AsyncInvokeLater(fn, receiver, arg) {
+ var domain = this._getDomain();
+ if (domain !== undefined) fn = domain.bind(fn);
this._lateQueue.push(fn, receiver, arg);
this._queueTick();
-};
+}
-Async.prototype.invokeFirst = function (fn, receiver, arg) {
- fn = this._withDomain(fn);
- this._normalQueue.unshift(fn, receiver, arg);
+function AsyncInvoke(fn, receiver, arg) {
+ var domain = this._getDomain();
+ if (domain !== undefined) fn = domain.bind(fn);
+ this._normalQueue.push(fn, receiver, arg);
this._queueTick();
-};
+}
-Async.prototype.invoke = function (fn, receiver, arg) {
- fn = this._withDomain(fn);
- this._normalQueue.push(fn, receiver, arg);
+function AsyncSettlePromises(promise) {
+ var domain = this._getDomain();
+ if (domain !== undefined) {
+ var fn = domain.bind(promise._settlePromises);
+ this._normalQueue.push(fn, promise, undefined);
+ } else {
+ this._normalQueue._pushOne(promise);
+ }
this._queueTick();
-};
+}
+
+if (!util.hasDevTools) {
+ Async.prototype.invokeLater = AsyncInvokeLater;
+ Async.prototype.invoke = AsyncInvoke;
+ Async.prototype.settlePromises = AsyncSettlePromises;
+} else {
+ Async.prototype.invokeLater = function (fn, receiver, arg) {
+ if (this._trampolineEnabled) {
+ AsyncInvokeLater.call(this, fn, receiver, arg);
+ } else {
+ setTimeout(function() {
+ fn.call(receiver, arg);
+ }, 100);
+ }
+ };
+
+ Async.prototype.invoke = function (fn, receiver, arg) {
+ if (this._trampolineEnabled) {
+ AsyncInvoke.call(this, fn, receiver, arg);
+ } else {
+ setTimeout(function() {
+ fn.call(receiver, arg);
+ }, 0);
+ }
+ };
+
+ Async.prototype.settlePromises = function(promise) {
+ if (this._trampolineEnabled) {
+ AsyncSettlePromises.call(this, promise);
+ } else {
+ setTimeout(function() {
+ promise._settlePromises();
+ }, 0);
+ }
+ };
+}
-Async.prototype.settlePromises = function(promise) {
- this._normalQueue._pushOne(promise);
+Async.prototype.invokeFirst = function (fn, receiver, arg) {
+ var domain = this._getDomain();
+ if (domain !== undefined) fn = domain.bind(fn);
+ this._normalQueue.unshift(fn, receiver, arg);
this._queueTick();
};
Promise.prototype.cancellable = function () {
if (this._cancellable()) return this;
+ async.enableTrampoline();
this._setCancellable();
this._cancellationParent = undefined;
return this;
}
removeCommonRoots(stacks);
removeDuplicateOrEmptyJumps(stacks);
- error.stack = reconstructStack(message, stacks);
+ util.notEnumerableProp(error, "stack", reconstructStack(message, stacks));
util.notEnumerableProp(error, "__stackCleaned__", true);
};
(!!process.env["BLUEBIRD_DEBUG"] ||
process.env["NODE_ENV"] === "development"));
+if (debugging) {
+ async.disableTrampolineIfNecessary();
+}
+
Promise.prototype._ensurePossibleRejectionHandled = function () {
this._setRejectionIsUnhandled();
async.invokeLater(this._notifyUnhandledRejection, this, undefined);
trace.attachExtraTrace(error);
} else if (!error.__stackCleaned__) {
var parsed = CapturedTrace.parseStackAndMessage(error);
- error.stack = parsed.message + "\n" + parsed.stack.join("\n");
+ util.notEnumerableProp(error, "stack",
+ parsed.message + "\n" + parsed.stack.join("\n"));
util.notEnumerableProp(error, "__stackCleaned__", true);
}
}
throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/DT1qyG\u000a");
}
debugging = CapturedTrace.isSupported();
+ if (debugging) {
+ async.disableTrampolineIfNecessary();
+ }
};
Promise.hasLongStackTraces = function () {
var defaultSuffix = "Async";
var defaultPromisified = {__isPromisified__: true};
var noCopyPropsPattern =
- /^(?:length|name|arguments|caller|prototype|__isPromisified__)$/;
+ /^(?:length|name|arguments|caller|callee|prototype|__isPromisified__)$/;
var defaultFilter = function(name, func) {
return util.isIdentifier(name) &&
name.charAt(0) !== "_" &&
return function() { div.classList.toggle("foo"); };
};
schedule.isStatic = true;
+} else if (typeof setImmediate !== "undefined") {
+ schedule = function (fn) {
+ setImmediate(fn);
+ };
} else if (typeof setTimeout !== "undefined") {
schedule = function (fn) {
setTimeout(fn, 0);
}
function toFastProperties(obj) {
- /*jshint -W027*/
+ /*jshint -W027,-W055,-W031*/
function f() {}
f.prototype = obj;
- return f;
+ var l = 8;
+ while (l--) new f();
+ return obj;
eval(obj);
}
markAsOriginatingFromRejection: markAsOriginatingFromRejection,
classString: classString,
copyDescriptors: copyDescriptors,
+ hasDevTools: typeof chrome !== "undefined" && chrome &&
+ typeof chrome.loadTimes === "function",
isNode: typeof process !== "undefined" &&
classString(process).toLowerCase() === "[object process]"
};
{
"name": "bluebird",
"description": "Full featured Promises/A+ implementation with exceptionally good performance",
- "version": "2.9.15",
+ "version": "2.9.24",
"keywords": [
"promise",
"performance",
"LICENSE",
"zalgo.js"
],
- "gitHead": "d5e06c2648b8be3c47cb5b6cb95f2bddf79c4c0a",
- "_id": "bluebird@2.9.15",
- "_shasum": "80b37137c1dee42efac86486b0afc5f858354ab0",
- "_from": "bluebird@>=2.9.14 <3.0.0",
- "_npmVersion": "2.7.0",
- "_nodeVersion": "1.5.1",
+ "gitHead": "3f58d8ea478329a2400ab7fa0bd841289b02fc07",
+ "_id": "bluebird@2.9.24",
+ "_shasum": "14a2e75f0548323dc35aa440d92007ca154e967c",
+ "_from": "bluebird@>=2.9.21 <3.0.0",
+ "_npmVersion": "2.7.1",
+ "_nodeVersion": "1.6.2",
"_npmUser": {
"name": "esailija",
"email": "petka_antonov@hotmail.com"
}
],
"dist": {
- "shasum": "80b37137c1dee42efac86486b0afc5f858354ab0",
- "tarball": "http://registry.npmjs.org/bluebird/-/bluebird-2.9.15.tgz"
+ "shasum": "14a2e75f0548323dc35aa440d92007ca154e967c",
+ "tarball": "http://registry.npmjs.org/bluebird/-/bluebird-2.9.24.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.15.tgz"
+ "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.9.24.tgz"
}
"tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz"
}
"tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz"
}
"tarball": "http://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz"
}
"tarball": "http://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz"
}
"tarball": "http://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz"
}
"tarball": "http://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz"
}
+++ /dev/null
-support
-test
-examples
-example
-*.sock
-dist
+++ /dev/null
-
-2.1.3 / 2015-03-13
-==================
-
- * Updated stdout/stderr example (#186)
- * Updated example/stdout.js to match debug current behaviour
- * Renamed example/stderr.js to stdout.js
- * Update Readme.md (#184)
- * replace high intensity foreground color for bold (#182, #183)
-
-2.1.2 / 2015-03-01
-==================
-
- * dist: recompile
- * update "ms" to v0.7.0
- * package: update "browserify" to v9.0.3
- * component: fix "ms.js" repo location
- * changed bower package name
- * updated documentation about using debug in a browser
- * fix: security error on safari (#167, #168, @yields)
-
-2.1.1 / 2014-12-29
-==================
-
- * browser: use `typeof` to check for `console` existence
- * browser: check for `console.log` truthiness (fix IE 8/9)
- * browser: add support for Chrome apps
- * Readme: added Windows usage remarks
- * Add `bower.json` to properly support bower install
-
-2.1.0 / 2014-10-15
-==================
-
- * node: implement `DEBUG_FD` env variable support
- * package: update "browserify" to v6.1.0
- * package: add "license" field to package.json (#135, @panuhorsmalahti)
-
-2.0.0 / 2014-09-01
-==================
-
- * package: update "browserify" to v5.11.0
- * node: use stderr rather than stdout for logging (#29, @stephenmathieson)
-
-1.0.4 / 2014-07-15
-==================
-
- * dist: recompile
- * example: remove `console.info()` log usage
- * example: add "Content-Type" UTF-8 header to browser example
- * browser: place %c marker after the space character
- * browser: reset the "content" color via `color: inherit`
- * browser: add colors support for Firefox >= v31
- * debug: prefer an instance `log()` function over the global one (#119)
- * Readme: update documentation about styled console logs for FF v31 (#116, @wryk)
-
-1.0.3 / 2014-07-09
-==================
-
- * Add support for multiple wildcards in namespaces (#122, @seegno)
- * browser: fix lint
-
-1.0.2 / 2014-06-10
-==================
-
- * browser: update color palette (#113, @gscottolson)
- * common: make console logging function configurable (#108, @timoxley)
- * node: fix %o colors on old node <= 0.8.x
- * Makefile: find node path using shell/which (#109, @timoxley)
-
-1.0.1 / 2014-06-06
-==================
-
- * browser: use `removeItem()` to clear localStorage
- * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777)
- * package: add "contributors" section
- * node: fix comment typo
- * README: list authors
-
-1.0.0 / 2014-06-04
-==================
-
- * make ms diff be global, not be scope
- * debug: ignore empty strings in enable()
- * node: make DEBUG_COLORS able to disable coloring
- * *: export the `colors` array
- * npmignore: don't publish the `dist` dir
- * Makefile: refactor to use browserify
- * package: add "browserify" as a dev dependency
- * Readme: add Web Inspector Colors section
- * node: reset terminal color for the debug content
- * node: map "%o" to `util.inspect()`
- * browser: map "%j" to `JSON.stringify()`
- * debug: add custom "formatters"
- * debug: use "ms" module for humanizing the diff
- * Readme: add "bash" syntax highlighting
- * browser: add Firebug color support
- * browser: add colors for WebKit browsers
- * node: apply log to `console`
- * rewrite: abstract common logic for Node & browsers
- * add .jshintrc file
-
-0.8.1 / 2014-04-14
-==================
-
- * package: re-add the "component" section
-
-0.8.0 / 2014-03-30
-==================
-
- * add `enable()` method for nodejs. Closes #27
- * change from stderr to stdout
- * remove unnecessary index.js file
-
-0.7.4 / 2013-11-13
-==================
-
- * remove "browserify" key from package.json (fixes something in browserify)
-
-0.7.3 / 2013-10-30
-==================
-
- * fix: catch localStorage security error when cookies are blocked (Chrome)
- * add debug(err) support. Closes #46
- * add .browser prop to package.json. Closes #42
-
-0.7.2 / 2013-02-06
-==================
-
- * fix package.json
- * fix: Mobile Safari (private mode) is broken with debug
- * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript
-
-0.7.1 / 2013-02-05
-==================
-
- * add repository URL to package.json
- * add DEBUG_COLORED to force colored output
- * add browserify support
- * fix component. Closes #24
-
-0.7.0 / 2012-05-04
-==================
-
- * Added .component to package.json
- * Added debug.component.js build
-
-0.6.0 / 2012-03-16
-==================
-
- * Added support for "-" prefix in DEBUG [Vinay Pulim]
- * Added `.enabled` flag to the node version [TooTallNate]
-
-0.5.0 / 2012-02-02
-==================
-
- * Added: humanize diffs. Closes #8
- * Added `debug.disable()` to the CS variant
- * Removed padding. Closes #10
- * Fixed: persist client-side variant again. Closes #9
-
-0.4.0 / 2012-02-01
-==================
-
- * Added browser variant support for older browsers [TooTallNate]
- * Added `debug.enable('project:*')` to browser variant [TooTallNate]
- * Added padding to diff (moved it to the right)
-
-0.3.0 / 2012-01-26
-==================
-
- * Added millisecond diff when isatty, otherwise UTC string
-
-0.2.0 / 2012-01-22
-==================
-
- * Added wildcard support
-
-0.1.0 / 2011-12-02
-==================
-
- * Added: remove colors unless stderr isatty [TooTallNate]
-
-0.0.1 / 2010-01-03
-==================
-
- * Initial release
+++ /dev/null
-
-# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
-THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
-THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
-
-# BIN directory
-BIN := $(THIS_DIR)/node_modules/.bin
-
-# applications
-NODE ?= $(shell which node)
-NPM ?= $(NODE) $(shell which npm)
-BROWSERIFY ?= $(NODE) $(BIN)/browserify
-
-all: dist/debug.js
-
-install: node_modules
-
-clean:
- @rm -rf node_modules dist
-
-dist:
- @mkdir -p $@
-
-dist/debug.js: node_modules browser.js debug.js dist
- @$(BROWSERIFY) \
- --standalone debug \
- . > $@
-
-node_modules: package.json
- @NODE_ENV= $(NPM) install
- @touch node_modules
-
-.PHONY: all install clean
+++ /dev/null
-# debug
-
- tiny node.js debugging utility modelled after node core's debugging technique.
-
-## Installation
-
-```bash
-$ npm install debug
-```
-
-## Usage
-
- With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.
-
-Example _app.js_:
-
-```js
-var debug = require('debug')('http')
- , http = require('http')
- , name = 'My App';
-
-// fake app
-
-debug('booting %s', name);
-
-http.createServer(function(req, res){
- debug(req.method + ' ' + req.url);
- res.end('hello\n');
-}).listen(3000, function(){
- debug('listening');
-});
-
-// fake worker of some kind
-
-require('./worker');
-```
-
-Example _worker.js_:
-
-```js
-var debug = require('debug')('worker');
-
-setInterval(function(){
- debug('doing some work');
-}, 1000);
-```
-
- The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:
-
- ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)
-
- ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)
-
-#### Windows note
-
- On Windows the environment variable is set using the `set` command.
-
- ```cmd
- set DEBUG=*,-not_this
- ```
-
-Then, run the program to be debugged as usual.
-
-## Millisecond diff
-
- When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.
-
- ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
-
- When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
-
- ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
-
-## Conventions
-
- If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".
-
-## Wildcards
-
- The `*` character may be used as a wildcard. Suppose for example your library has debuggers named "connect:bodyParser", "connect:compress", "connect:session", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.
-
- You can also exclude specific debuggers by prefixing them with a "-" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with "connect:".
-
-## Browser support
-
- Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include:
-
-```js
-window.myDebug = require("debug");
-```
-
- ("debug" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console:
-
-```js
-myDebug.enable("worker:*")
-```
-
- Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console.
-
-```js
-a = debug('worker:a');
-b = debug('worker:b');
-
-setInterval(function(){
- a('doing some work');
-}, 1000);
-
-setInterval(function(){
- b('doing some work');
-}, 1200);
-```
-
-#### Web Inspector Colors
-
- Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
- option. These are WebKit web inspectors, Firefox ([since version
- 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
- and the Firebug plugin for Firefox (any version).
-
- Colored output looks something like:
-
- ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)
-
-### stderr vs stdout
-
-You can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:
-
-Example _stdout.js_:
-
-```js
-var debug = require('debug');
-var error = debug('app:error');
-
-// by default stderr is used
-error('goes to stderr!');
-
-var log = debug('app:log');
-// set this namespace to log via console.log
-log.log = console.log.bind(console); // don't forget to bind to console!
-log('goes to stdout');
-error('still goes to stderr!');
-
-// set all output to go via console.info
-// overrides all per-namespace log settings
-debug.log = console.info.bind(console);
-error('now goes to stdout via console.info');
-log('still goes to stdout, but via console.info now');
-```
-
-## Authors
-
- - TJ Holowaychuk
- - Nathan Rajlich
-
-## License
-
-(The MIT License)
-
-Copyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-'Software'), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+++ /dev/null
-{
- "name": "visionmedia-debug",
- "main": "dist/debug.js",
- "version": "2.1.3",
- "homepage": "https://github.com/visionmedia/debug",
- "authors": [
- "TJ Holowaychuk <tj@vision-media.ca>"
- ],
- "description": "visionmedia-debug",
- "moduleType": [
- "amd",
- "es6",
- "globals",
- "node"
- ],
- "keywords": [
- "visionmedia",
- "debug"
- ],
- "license": "MIT",
- "ignore": [
- "**/.*",
- "node_modules",
- "bower_components",
- "test",
- "tests"
- ]
-}
+++ /dev/null
-
-/**
- * This is the web browser implementation of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
-exports = module.exports = require('./debug');
-exports.log = log;
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
-
-/**
- * Use chrome.storage.local if we are in an app
- */
-
-var storage;
-
-if (typeof chrome !== 'undefined' && typeof chrome.storage !== 'undefined')
- storage = chrome.storage.local;
-else
- storage = localstorage();
-
-/**
- * Colors.
- */
-
-exports.colors = [
- 'lightseagreen',
- 'forestgreen',
- 'goldenrod',
- 'dodgerblue',
- 'darkorchid',
- 'crimson'
-];
-
-/**
- * Currently only WebKit-based Web Inspectors, Firefox >= v31,
- * and the Firebug extension (any Firefox version) are known
- * to support "%c" CSS customizations.
- *
- * TODO: add a `localStorage` variable to explicitly enable/disable colors
- */
-
-function useColors() {
- // is webkit? http://stackoverflow.com/a/16459606/376773
- return ('WebkitAppearance' in document.documentElement.style) ||
- // is firebug? http://stackoverflow.com/a/398120/376773
- (window.console && (console.firebug || (console.exception && console.table))) ||
- // is firefox >= v31?
- // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
- (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31);
-}
-
-/**
- * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
- */
-
-exports.formatters.j = function(v) {
- return JSON.stringify(v);
-};
-
-
-/**
- * Colorize log arguments if enabled.
- *
- * @api public
- */
-
-function formatArgs() {
- var args = arguments;
- var useColors = this.useColors;
-
- args[0] = (useColors ? '%c' : '')
- + this.namespace
- + (useColors ? ' %c' : ' ')
- + args[0]
- + (useColors ? '%c ' : ' ')
- + '+' + exports.humanize(this.diff);
-
- if (!useColors) return args;
-
- var c = 'color: ' + this.color;
- args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));
-
- // the final "%c" is somewhat tricky, because there could be other
- // arguments passed either before or after the %c, so we need to
- // figure out the correct index to insert the CSS into
- var index = 0;
- var lastC = 0;
- args[0].replace(/%[a-z%]/g, function(match) {
- if ('%%' === match) return;
- index++;
- if ('%c' === match) {
- // we only are interested in the *last* %c
- // (the user may have provided their own)
- lastC = index;
- }
- });
-
- args.splice(lastC, 0, c);
- return args;
-}
-
-/**
- * Invokes `console.log()` when available.
- * No-op when `console.log` is not a "function".
- *
- * @api public
- */
-
-function log() {
- // this hackery is required for IE8/9, where
- // the `console.log` function doesn't have 'apply'
- return 'object' === typeof console
- && console.log
- && Function.prototype.apply.call(console.log, console, arguments);
-}
-
-/**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-
-function save(namespaces) {
- try {
- if (null == namespaces) {
- storage.removeItem('debug');
- } else {
- storage.debug = namespaces;
- }
- } catch(e) {}
-}
-
-/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
-
-function load() {
- var r;
- try {
- r = storage.debug;
- } catch(e) {}
- return r;
-}
-
-/**
- * Enable namespaces listed in `localStorage.debug` initially.
- */
-
-exports.enable(load());
-
-/**
- * Localstorage attempts to return the localstorage.
- *
- * This is necessary because safari throws
- * when a user disables cookies/localstorage
- * and you attempt to access it.
- *
- * @return {LocalStorage}
- * @api private
- */
-
-function localstorage(){
- try {
- return window.localStorage;
- } catch (e) {}
-}
+++ /dev/null
-{
- "name": "debug",
- "repo": "visionmedia/debug",
- "description": "small debugging utility",
- "version": "2.1.3",
- "keywords": [
- "debug",
- "log",
- "debugger"
- ],
- "main": "browser.js",
- "scripts": [
- "browser.js",
- "debug.js"
- ],
- "dependencies": {
- "rauchg/ms.js": "0.7.0"
- }
-}
+++ /dev/null
-
-/**
- * This is the common logic for both the Node.js and web browser
- * implementations of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
-exports = module.exports = debug;
-exports.coerce = coerce;
-exports.disable = disable;
-exports.enable = enable;
-exports.enabled = enabled;
-exports.humanize = require('ms');
-
-/**
- * The currently active debug mode names, and names to skip.
- */
-
-exports.names = [];
-exports.skips = [];
-
-/**
- * Map of special "%n" handling functions, for the debug "format" argument.
- *
- * Valid key names are a single, lowercased letter, i.e. "n".
- */
-
-exports.formatters = {};
-
-/**
- * Previously assigned color.
- */
-
-var prevColor = 0;
-
-/**
- * Previous log timestamp.
- */
-
-var prevTime;
-
-/**
- * Select a color.
- *
- * @return {Number}
- * @api private
- */
-
-function selectColor() {
- return exports.colors[prevColor++ % exports.colors.length];
-}
-
-/**
- * Create a debugger with the given `namespace`.
- *
- * @param {String} namespace
- * @return {Function}
- * @api public
- */
-
-function debug(namespace) {
-
- // define the `disabled` version
- function disabled() {
- }
- disabled.enabled = false;
-
- // define the `enabled` version
- function enabled() {
-
- var self = enabled;
-
- // set `diff` timestamp
- var curr = +new Date();
- var ms = curr - (prevTime || curr);
- self.diff = ms;
- self.prev = prevTime;
- self.curr = curr;
- prevTime = curr;
-
- // add the `color` if not set
- if (null == self.useColors) self.useColors = exports.useColors();
- if (null == self.color && self.useColors) self.color = selectColor();
-
- var args = Array.prototype.slice.call(arguments);
-
- args[0] = exports.coerce(args[0]);
-
- if ('string' !== typeof args[0]) {
- // anything else let's inspect with %o
- args = ['%o'].concat(args);
- }
-
- // apply any `formatters` transformations
- var index = 0;
- args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {
- // if we encounter an escaped % then don't increase the array index
- if (match === '%%') return match;
- index++;
- var formatter = exports.formatters[format];
- if ('function' === typeof formatter) {
- var val = args[index];
- match = formatter.call(self, val);
-
- // now we need to remove `args[index]` since it's inlined in the `format`
- args.splice(index, 1);
- index--;
- }
- return match;
- });
-
- if ('function' === typeof exports.formatArgs) {
- args = exports.formatArgs.apply(self, args);
- }
- var logFn = enabled.log || exports.log || console.log.bind(console);
- logFn.apply(self, args);
- }
- enabled.enabled = true;
-
- var fn = exports.enabled(namespace) ? enabled : disabled;
-
- fn.namespace = namespace;
-
- return fn;
-}
-
-/**
- * Enables a debug mode by namespaces. This can include modes
- * separated by a colon and wildcards.
- *
- * @param {String} namespaces
- * @api public
- */
-
-function enable(namespaces) {
- exports.save(namespaces);
-
- var split = (namespaces || '').split(/[\s,]+/);
- var len = split.length;
-
- for (var i = 0; i < len; i++) {
- if (!split[i]) continue; // ignore empty strings
- namespaces = split[i].replace(/\*/g, '.*?');
- if (namespaces[0] === '-') {
- exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
- } else {
- exports.names.push(new RegExp('^' + namespaces + '$'));
- }
- }
-}
-
-/**
- * Disable debug output.
- *
- * @api public
- */
-
-function disable() {
- exports.enable('');
-}
-
-/**
- * Returns true if the given mode name is enabled, false otherwise.
- *
- * @param {String} name
- * @return {Boolean}
- * @api public
- */
-
-function enabled(name) {
- var i, len;
- for (i = 0, len = exports.skips.length; i < len; i++) {
- if (exports.skips[i].test(name)) {
- return false;
- }
- }
- for (i = 0, len = exports.names.length; i < len; i++) {
- if (exports.names[i].test(name)) {
- return true;
- }
- }
- return false;
-}
-
-/**
- * Coerce `val`.
- *
- * @param {Mixed} val
- * @return {Mixed}
- * @api private
- */
-
-function coerce(val) {
- if (val instanceof Error) return val.stack || val.message;
- return val;
-}
+++ /dev/null
-
-/**
- * Module dependencies.
- */
-
-var tty = require('tty');
-var util = require('util');
-
-/**
- * This is the Node.js implementation of `debug()`.
- *
- * Expose `debug()` as the module.
- */
-
-exports = module.exports = require('./debug');
-exports.log = log;
-exports.formatArgs = formatArgs;
-exports.save = save;
-exports.load = load;
-exports.useColors = useColors;
-
-/**
- * Colors.
- */
-
-exports.colors = [6, 2, 3, 4, 5, 1];
-
-/**
- * The file descriptor to write the `debug()` calls to.
- * Set the `DEBUG_FD` env variable to override with another value. i.e.:
- *
- * $ DEBUG_FD=3 node script.js 3>debug.log
- */
-
-var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
-var stream = 1 === fd ? process.stdout :
- 2 === fd ? process.stderr :
- createWritableStdioStream(fd);
-
-/**
- * Is stdout a TTY? Colored output is enabled when `true`.
- */
-
-function useColors() {
- var debugColors = (process.env.DEBUG_COLORS || '').trim().toLowerCase();
- if (0 === debugColors.length) {
- return tty.isatty(fd);
- } else {
- return '0' !== debugColors
- && 'no' !== debugColors
- && 'false' !== debugColors
- && 'disabled' !== debugColors;
- }
-}
-
-/**
- * Map %o to `util.inspect()`, since Node doesn't do that out of the box.
- */
-
-var inspect = (4 === util.inspect.length ?
- // node <= 0.8.x
- function (v, colors) {
- return util.inspect(v, void 0, void 0, colors);
- } :
- // node > 0.8.x
- function (v, colors) {
- return util.inspect(v, { colors: colors });
- }
-);
-
-exports.formatters.o = function(v) {
- return inspect(v, this.useColors)
- .replace(/\s*\n\s*/g, ' ');
-};
-
-/**
- * Adds ANSI color escape codes if enabled.
- *
- * @api public
- */
-
-function formatArgs() {
- var args = arguments;
- var useColors = this.useColors;
- var name = this.namespace;
-
- if (useColors) {
- var c = this.color;
-
- args[0] = ' \u001b[3' + c + ';1m' + name + ' '
- + '\u001b[0m'
- + args[0] + '\u001b[3' + c + 'm'
- + ' +' + exports.humanize(this.diff) + '\u001b[0m';
- } else {
- args[0] = new Date().toUTCString()
- + ' ' + name + ' ' + args[0];
- }
- return args;
-}
-
-/**
- * Invokes `console.error()` with the specified arguments.
- */
-
-function log() {
- return stream.write(util.format.apply(this, arguments) + '\n');
-}
-
-/**
- * Save `namespaces`.
- *
- * @param {String} namespaces
- * @api private
- */
-
-function save(namespaces) {
- if (null == namespaces) {
- // If you set a process.env field to null or undefined, it gets cast to the
- // string 'null' or 'undefined'. Just delete instead.
- delete process.env.DEBUG;
- } else {
- process.env.DEBUG = namespaces;
- }
-}
-
-/**
- * Load `namespaces`.
- *
- * @return {String} returns the previously persisted debug modes
- * @api private
- */
-
-function load() {
- return process.env.DEBUG;
-}
-
-/**
- * Copied from `node/src/node.js`.
- *
- * XXX: It's lame that node doesn't expose this API out-of-the-box. It also
- * relies on the undocumented `tty_wrap.guessHandleType()` which is also lame.
- */
-
-function createWritableStdioStream (fd) {
- var stream;
- var tty_wrap = process.binding('tty_wrap');
-
- // Note stream._type is used for test-module-load-list.js
-
- switch (tty_wrap.guessHandleType(fd)) {
- case 'TTY':
- stream = new tty.WriteStream(fd);
- stream._type = 'tty';
-
- // Hack to have stream not keep the event loop alive.
- // See https://github.com/joyent/node/issues/1726
- if (stream._handle && stream._handle.unref) {
- stream._handle.unref();
- }
- break;
-
- case 'FILE':
- var fs = require('fs');
- stream = new fs.SyncWriteStream(fd, { autoClose: false });
- stream._type = 'fs';
- break;
-
- case 'PIPE':
- case 'TCP':
- var net = require('net');
- stream = new net.Socket({
- fd: fd,
- readable: false,
- writable: true
- });
-
- // FIXME Should probably have an option in net.Socket to create a
- // stream from an existing fd which is writable only. But for now
- // we'll just add this hack and set the `readable` member to false.
- // Test: ./node test/fixtures/echo.js < /etc/passwd
- stream.readable = false;
- stream.read = null;
- stream._type = 'pipe';
-
- // FIXME Hack to have stream not keep the event loop alive.
- // See https://github.com/joyent/node/issues/1726
- if (stream._handle && stream._handle.unref) {
- stream._handle.unref();
- }
- break;
-
- default:
- // Probably an error on in uv_guess_handle()
- throw new Error('Implement me. Unknown stream file type!');
- }
-
- // For supporting legacy API we put the FD here.
- stream.fd = fd;
-
- stream._isStdio = true;
-
- return stream;
-}
-
-/**
- * Enable namespaces listed in `process.env.DEBUG` initially.
- */
-
-exports.enable(load());
+++ /dev/null
-node_modules
-test
-History.md
-Makefile
-component.json
+++ /dev/null
-(The MIT License)
-
-Copyright (c) 2014 Guillermo Rauch <rauchg@gmail.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+++ /dev/null
-# ms.js: miliseconds conversion utility
-
-```js
-ms('2 days') // 172800000
-ms('1d') // 86400000
-ms('10h') // 36000000
-ms('2.5 hrs') // 9000000
-ms('2h') // 7200000
-ms('1m') // 60000
-ms('5s') // 5000
-ms('100') // 100
-```
-
-```js
-ms(60000) // "1m"
-ms(2 * 60000) // "2m"
-ms(ms('10 hours')) // "10h"
-```
-
-```js
-ms(60000, { long: true }) // "1 minute"
-ms(2 * 60000, { long: true }) // "2 minutes"
-ms(ms('10 hours'), { long: true }) // "10 hours"
-```
-
-- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](nodejs.org/download).
-- If a number is supplied to `ms`, a string with a unit is returned.
-- If a string that contains the number is supplied, it returns it as
-a number (e.g: it returns `100` for `'100'`).
-- If you pass a string with a number and a valid unit, the number of
-equivalent ms is returned.
-
-## License
-
-MIT
+++ /dev/null
-/**
- * Helpers.
- */
-
-var s = 1000;
-var m = s * 60;
-var h = m * 60;
-var d = h * 24;
-var y = d * 365.25;
-
-/**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @param {String|Number} val
- * @param {Object} options
- * @return {String|Number}
- * @api public
- */
-
-module.exports = function(val, options){
- options = options || {};
- if ('string' == typeof val) return parse(val);
- return options.long
- ? long(val)
- : short(val);
-};
-
-/**
- * Parse the given `str` and return milliseconds.
- *
- * @param {String} str
- * @return {Number}
- * @api private
- */
-
-function parse(str) {
- var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
- if (!match) return;
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'yrs':
- case 'yr':
- case 'y':
- return n * y;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'hrs':
- case 'hr':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'mins':
- case 'min':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 'secs':
- case 'sec':
- case 's':
- return n * s;
- case 'milliseconds':
- case 'millisecond':
- case 'msecs':
- case 'msec':
- case 'ms':
- return n;
- }
-}
-
-/**
- * Short format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function short(ms) {
- if (ms >= d) return Math.round(ms / d) + 'd';
- if (ms >= h) return Math.round(ms / h) + 'h';
- if (ms >= m) return Math.round(ms / m) + 'm';
- if (ms >= s) return Math.round(ms / s) + 's';
- return ms + 'ms';
-}
-
-/**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function long(ms) {
- return plural(ms, d, 'day')
- || plural(ms, h, 'hour')
- || plural(ms, m, 'minute')
- || plural(ms, s, 'second')
- || ms + ' ms';
-}
-
-/**
- * Pluralization helper.
- */
-
-function plural(ms, n, name) {
- if (ms < n) return;
- if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;
- return Math.ceil(ms / n) + ' ' + name + 's';
-}
+++ /dev/null
-{
- "name": "ms",
- "version": "0.7.0",
- "description": "Tiny ms conversion utility",
- "repository": {
- "type": "git",
- "url": "git://github.com/guille/ms.js.git"
- },
- "main": "./index",
- "devDependencies": {
- "mocha": "*",
- "expect.js": "*",
- "serve": "*"
- },
- "component": {
- "scripts": {
- "ms/index.js": "index.js"
- }
- },
- "gitHead": "1e9cd9b05ef0dc26f765434d2bfee42394376e52",
- "bugs": {
- "url": "https://github.com/guille/ms.js/issues"
- },
- "homepage": "https://github.com/guille/ms.js",
- "_id": "ms@0.7.0",
- "scripts": {},
- "_shasum": "865be94c2e7397ad8a57da6a633a6e2f30798b83",
- "_from": "ms@0.7.0",
- "_npmVersion": "1.4.21",
- "_npmUser": {
- "name": "rauchg",
- "email": "rauchg@gmail.com"
- },
- "maintainers": [
- {
- "name": "rauchg",
- "email": "rauchg@gmail.com"
- }
- ],
- "dist": {
- "shasum": "865be94c2e7397ad8a57da6a633a6e2f30798b83",
- "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.0.tgz",
- "readme": "ERROR: No README data found!"
-}
+++ /dev/null
-{
- "name": "debug",
- "version": "2.1.3",
- "repository": {
- "type": "git",
- "url": "git://github.com/visionmedia/debug.git"
- },
- "description": "small debugging utility",
- "keywords": [
- "debug",
- "log",
- "debugger"
- ],
- "author": {
- "name": "TJ Holowaychuk",
- "email": "tj@vision-media.ca"
- },
- "contributors": [
- {
- "name": "Nathan Rajlich",
- "email": "nathan@tootallnate.net",
- "url": "http://n8.io"
- }
- ],
- "license": "MIT",
- "dependencies": {
- "ms": "0.7.0"
- },
- "devDependencies": {
- "browserify": "9.0.3",
- "mocha": "*"
- },
- "main": "./node.js",
- "browser": "./browser.js",
- "component": {
- "scripts": {
- "debug/index.js": "browser.js",
- "debug/debug.js": "debug.js"
- }
- },
- "gitHead": "0a8e4b7e0d2d1b55ef4e7422498ca24c677ae63a",
- "bugs": {
- "url": "https://github.com/visionmedia/debug/issues"
- },
- "homepage": "https://github.com/visionmedia/debug",
- "_id": "debug@2.1.3",
- "scripts": {},
- "_shasum": "ce8ab1b5ee8fbee2bfa3b633cab93d366b63418e",
- "_from": "debug@>=2.1.3 <3.0.0",
- "_npmVersion": "2.5.1",
- "_nodeVersion": "0.12.0",
- "_npmUser": {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- },
- "maintainers": [
- {
- "name": "tjholowaychuk",
- "email": "tj@vision-media.ca"
- },
- {
- "name": "tootallnate",
- "email": "nathan@tootallnate.net"
- }
- ],
- "dist": {
- "shasum": "ce8ab1b5ee8fbee2bfa3b633cab93d366b63418e",
- "tarball": "http://registry.npmjs.org/debug/-/debug-2.1.3.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/debug/-/debug-2.1.3.tgz",
- "readme": "ERROR: No README data found!"
-}
if (reporter === true) {
validate('if (validate.errors === null) validate.errors = []')
if (verbose) {
- validate('validate.errors.push({field:%s,message:%s,value:%s})', JSON.stringify(formatName(prop || name)), JSON.stringify(msg), value || name)
+ validate('validate.errors.push({field:%s,message:%s,value:%s})', JSON.stringify(formatName(prop || name)), JSON.stringify(msg), value || name)
} else {
var n = gensym('error')
- scope[n] = {field:formatName(prop || name), message:msg}
+ scope[n] = {field:formatName(prop || name), message:msg}
validate('validate.errors.push(%s)', n)
}
}
--- /dev/null
+The MIT License (MIT)
+
+Copyright (c) 2014 Mathias Buus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
\ No newline at end of file
{
"name": "generate-object-property",
- "version": "1.1.0",
+ "version": "1.1.1",
"description": "Generate safe JS code that can used to reference a object property",
"repository": {
"type": "git",
"dependencies": {
"is-property": "^1.0.0"
},
- "gitHead": "836774061a38438800ebd8cb103f322ddbd1f118",
"bugs": {
"url": "https://github.com/mafintosh/generate-object-property/issues"
},
"homepage": "https://github.com/mafintosh/generate-object-property",
- "_id": "generate-object-property@1.1.0",
- "_shasum": "d9b9beccc3ce7e9fc6053d3bdf46c1dd9a0d8b34",
+ "main": "index.js",
+ "author": {
+ "name": "Mathias Buus",
+ "url": "@mafintosh"
+ },
+ "license": "MIT",
+ "gitHead": "366cb415f6b73904b809e554f685ef1eefe308d8",
+ "_id": "generate-object-property@1.1.1",
+ "_shasum": "8fda6b4cb69b34a189a6cebee7c4c268af47cc93",
"_from": "generate-object-property@>=1.1.0 <2.0.0",
- "_npmVersion": "1.4.21",
+ "_npmVersion": "2.7.1",
+ "_nodeVersion": "1.6.2",
"_npmUser": {
"name": "mafintosh",
"email": "mathiasbuus@gmail.com"
}
],
"dist": {
- "shasum": "d9b9beccc3ce7e9fc6053d3bdf46c1dd9a0d8b34",
- "tarball": "http://registry.npmjs.org/generate-object-property/-/generate-object-property-1.1.0.tgz"
+ "shasum": "8fda6b4cb69b34a189a6cebee7c4c268af47cc93",
+ "tarball": "http://registry.npmjs.org/generate-object-property/-/generate-object-property-1.1.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.1.0.tgz"
+ "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.1.1.tgz"
}
--- /dev/null
+{
+ "maxdepth": 4,
+ "maxstatements": 200,
+ "maxcomplexity": 12,
+ "maxlen": 80,
+ "maxparams": 5,
+
+ "curly": true,
+ "eqeqeq": true,
+ "immed": true,
+ "latedef": false,
+ "noarg": true,
+ "noempty": true,
+ "nonew": true,
+ "undef": true,
+ "unused": "vars",
+ "trailing": true,
+
+ "quotmark": true,
+ "expr": true,
+ "asi": true,
+
+ "browser": false,
+ "esnext": true,
+ "devel": false,
+ "node": false,
+ "nonstandard": false,
+
+ "predef": ["require", "module", "__dirname", "__filename"]
+}
"engines": {
"node": ">=0.4"
},
- "gitHead": "94a95d76154103290533b2c55ffa0fe4be16bfef",
+ "readme": "# xtend\n\n[![browser support][3]][4]\n\n[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges)\n\nExtend like a boss\n\nxtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence.\n\n## Examples\n\n```js\nvar extend = require(\"xtend\")\n\n// extend returns a new object. Does not mutate arguments\nvar combination = extend({\n a: \"a\",\n b: 'c'\n}, {\n b: \"b\"\n})\n// { a: \"a\", b: \"b\" }\n```\n\n## Stability status: Locked\n\n## MIT Licenced\n\n\n [3]: http://ci.testling.com/Raynos/xtend.png\n [4]: http://ci.testling.com/Raynos/xtend\n",
+ "readmeFilename": "README.md",
"_id": "xtend@4.0.0",
"_shasum": "8bc36ff87aedbe7ce9eaf0bca36b2354a743840f",
- "_from": "xtend@>=4.0.0 <5.0.0",
- "_npmVersion": "1.4.15",
- "_npmUser": {
- "name": "raynos",
- "email": "raynos2@gmail.com"
- },
- "maintainers": [
- {
- "name": "raynos",
- "email": "raynos2@gmail.com"
- }
- ],
- "dist": {
- "shasum": "8bc36ff87aedbe7ce9eaf0bca36b2354a743840f",
- "tarball": "http://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz"
+ "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.0.tgz",
+ "_from": "xtend@>=4.0.0 <5.0.0"
}
{
"name": "is-my-json-valid",
- "version": "2.10.0",
+ "version": "2.10.1",
"description": "A JSONSchema validator that uses code generation to be extremely fast",
"main": "index.js",
"dependencies": {
"url": "https://github.com/mafintosh/is-my-json-valid/issues"
},
"homepage": "https://github.com/mafintosh/is-my-json-valid",
- "gitHead": "21aa9b8916a2efb3172d17d2d3d1b517668834c7",
- "_id": "is-my-json-valid@2.10.0",
- "_shasum": "49755a8ecb2fe90baf922243cbaa245f910d2483",
+ "gitHead": "c2341ceadb4662cc7cd2a6b59fbffdb1c24bbc05",
+ "_id": "is-my-json-valid@2.10.1",
+ "_shasum": "bf20ca7e71116302f8660ac812659f71e22ea2d0",
"_from": "is-my-json-valid@>=2.10.0 <3.0.0",
- "_npmVersion": "2.7.0",
- "_nodeVersion": "1.5.1",
+ "_npmVersion": "2.7.5",
+ "_nodeVersion": "1.6.4",
"_npmUser": {
"name": "mafintosh",
"email": "mathiasbuus@gmail.com"
}
],
"dist": {
- "shasum": "49755a8ecb2fe90baf922243cbaa245f910d2483",
- "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.10.0.tgz"
+ "shasum": "bf20ca7e71116302f8660ac812659f71e22ea2d0",
+ "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.10.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.10.0.tgz"
+ "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.10.1.tgz"
}
+++ /dev/null
-language: node_js
-node_js:
- - 0.10
+++ /dev/null
-The MIT License (MIT)
-
-Copyright (c) 2011 Troy Goode <troygoode@gmail.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+++ /dev/null
-# require-directory
-
-Recursively iterates over specified directory, `require()`'ing each file, and returning a nested hash structure containing those modules.
-
-**[Follow me (@troygoode) on Twitter!](https://twitter.com/intent/user?screen_name=troygoode)**
-
-[![NPM](https://nodei.co/npm/require-directory.png?downloads=true&stars=true)](https://nodei.co/npm/require-directory/)
-
-[![build status](https://secure.travis-ci.org/troygoode/node-require-directory.png)](http://travis-ci.org/troygoode/node-require-directory)
-
-## How To Use
-
-### Installation (via [npm](https://npmjs.org/package/require-directory))
-
-```bash
-$ npm install require-directory
-```
-
-### Usage
-
-A common pattern in node.js is to include an index file which creates a hash of the files in its current directory. Given a directory structure like so:
-
-* app.js
-* routes/
- * index.js
- * home.js
- * auth/
- * login.js
- * logout.js
- * register.js
-
-`routes/index.js` uses `require-directory` to build the hash (rather than doing so manually) like so:
-
-```javascript
-var requireDirectory = require('require-directory');
-module.exports = requireDirectory(module);
-```
-
-`app.js` references `routes/index.js` like any other module, but it now has a hash/tree of the exports from the `./routes/` directory:
-
-```javascript
-var routes = require('./routes');
-
-// snip
-
-app.get('/', routes.home);
-app.get('/register', routes.auth.register);
-app.get('/login', routes.auth.login);
-app.get('/logout', routes.auth.logout);
-```
-
-The `routes` variable above is the equivalent of this:
-
-```javascript
-var routes = {
- home: require('routes/home.js'),
- auth: {
- login: require('routes/auth/login.js'),
- logout: require('routes/auth/logout.js'),
- register: require('routes/auth/register.js')
- }
-};
-```
-
-*Note that `routes.index` will be `undefined` as you would hope.*
-
-### Specifying Another Directory
-
-You can specify which directory you want to build a tree of (if it isn't the current directory for whatever reason) by passing it as the second parameter. Not specifying the path (`requireDirectory(module)`) is the equivelant of `requireDirectory(module, __dirname)`:
-
-```javascript
-var requireDirectory = require('require-directory');
-module.exports = requireDirectory(module, './some/subdirectory');
-```
-
-For example, in the [example in the Usage section](#usage) we could have avoided creating `routes/index.js` and instead changed the first lines of `app.js` to:
-
-```javascript
-var requireDirectory = require('require-directory');
-var routes = requireDirectory(module, './routes');
-```
-
-## Options
-
-You can pass an options hash to `require-directory` as the 2nd parameter (or 3rd if you're passing the path to another directory as the 2nd parameter already). Here are the available options:
-
-### Whitelisting
-
-Whitelisting (either via RegExp or function) allows you to specify that only certain files be loaded.
-
-```javascript
-var requireDirectory = require('require-directory'),
- whitelist = /onlyinclude.js$/,
- hash = requireDirectory(module, {include: whitelist});
-```
-
-```javascript
-var requireDirectory = require('require-directory'),
- check = function(path){
- if(/onlyinclude.js$/.test(path)){
- return true; // don't include
- }else{
- return false; // go ahead and include
- }
- },
- hash = requireDirectory(module, {include: check});
-```
-
-### Blacklisting
-
-Blacklisting (either via RegExp or function) allows you to specify that all but certain files should be loaded.
-
-```javascript
-var requireDirectory = require('require-directory'),
- blacklist = /dontinclude\.js$/,
- hash = requireDirectory(module, {exclude: blacklist});
-```
-
-```javascript
-var requireDirectory = require('require-directory'),
- check = function(path){
- if(/dontinclude\.js$/.test(path)){
- return false; // don't include
- }else{
- return true; // go ahead and include
- }
- },
- hash = requireDirectory(module, {exclude: check});
-```
-
-### Visiting Objects As They're Loaded
-
-`require-directory` takes a function as the `visit` option that will be called for each module that is added to module.exports.
-
-```javascript
-var requireDirectory = require('require-directory'),
- visitor = function(obj) {
- console.log(obj); // will be called for every module that is loaded
- },
- hash = requireDirectory(module, {visit: visitor});
-```
-
-The visitor can also transform the objects by returning a value:
-
-```javascript
-var requireDirectory = require('require-directory'),
- visitor = function(obj) {
- return obj(new Date());
- },
- hash = requireDirectory(module, {visit: visitor});
-```
-
-### Renaming Keys
-
-```javascript
-var requireDirectory = require('require-directory'),
- renamer = function(name) {
- return name.toUpperCase();
- },
- hash = requireDirectory(module, {rename: renamer});
-```
-
-### No Recursion
-
-```javascript
-var requireDirectory = require('require-directory'),
- hash = requireDirectory(module, {recurse: false});
-```
-
-## Run Unit Tests
-
-```bash
-$ npm run lint
-$ npm test
-```
-
-## License
-
-[MIT License](http://www.opensource.org/licenses/mit-license.php)
-
-## Author
-
-[Troy Goode](https://github.com/TroyGoode) ([troygoode@gmail.com](mailto:troygoode@gmail.com))
+++ /dev/null
-'use strict';
-
-var fs = require('fs'),
- join = require('path').join,
- resolve = require('path').resolve,
- dirname = require('path').dirname,
- defaultOptions = {
- extensions: ['js', 'json', 'coffee'],
- recurse: true,
- rename: function (name) {
- return name;
- },
- visit: function (obj) {
- return obj;
- }
- };
-
-function checkFileInclusion(path, filename, options) {
- return (
- // verify file has valid extension
- (new RegExp('\\.(' + options.extensions.join('|') + ')$', 'i').test(filename)) &&
-
- // if options.include is a RegExp, evaluate it and make sure the path passes
- !(options.include && options.include instanceof RegExp && !options.include.test(path)) &&
-
- // if options.include is a function, evaluate it and make sure the path passes
- !(options.include && typeof options.include === 'function' && !options.include(path, filename)) &&
-
- // if options.exclude is a RegExp, evaluate it and make sure the path doesn't pass
- !(options.exclude && options.exclude instanceof RegExp && options.exclude.test(path)) &&
-
- // if options.exclude is a function, evaluate it and make sure the path doesn't pass
- !(options.exclude && typeof options.exclude === 'function' && options.exclude(path, filename))
- );
-}
-
-function requireDirectory(m, path, options) {
- var retval = {};
-
- // path is optional
- if (path && !options && typeof path !== 'string') {
- options = path;
- path = null;
- }
-
- // default options
- options = options || {};
- for (var prop in defaultOptions) {
- if (typeof options[prop] === 'undefined') {
- options[prop] = defaultOptions[prop];
- }
- }
-
- // if no path was passed in, assume the equivelant of __dirname from caller
- // otherwise, resolve path relative to the equivalent of __dirname
- path = !path ? dirname(m.filename) : resolve(dirname(m.filename), path);
-
- // get the path of each file in specified directory, append to current tree node, recurse
- fs.readdirSync(path).forEach(function (filename) {
- var joined = join(path, filename),
- files,
- key,
- obj;
-
- if (fs.statSync(joined).isDirectory() && options.recurse) {
- // this node is a directory; recurse
- files = requireDirectory(m, joined, options);
- // exclude empty directories
- if (Object.keys(files).length) {
- retval[options.rename(filename, joined, filename)] = files;
- }
- } else {
- if (joined !== m.filename && checkFileInclusion(joined, filename, options)) {
- // hash node key shouldn't include file extension
- key = filename.substring(0, filename.lastIndexOf('.'));
- obj = m.require(joined);
- retval[options.rename(key, joined, filename)] = options.visit(obj, joined, filename) || obj;
- }
- }
- });
-
- return retval;
-}
-
-module.exports = requireDirectory;
-module.exports.defaults = defaultOptions;
+++ /dev/null
-{
- "author": {
- "name": "Troy Goode",
- "email": "troygoode@gmail.com",
- "url": "http://github.com/troygoode/"
- },
- "name": "require-directory",
- "version": "2.1.0",
- "description": "Recursively iterates over specified directory, require()'ing each file, and returning a nested hash structure containing those modules.",
- "keywords": [
- "require",
- "directory",
- "library",
- "recursive"
- ],
- "homepage": "https://github.com/troygoode/node-require-directory/",
- "main": "index.js",
- "repository": {
- "type": "git",
- "url": "git://github.com/troygoode/node-require-directory.git"
- },
- "contributors": [
- {
- "name": "Troy Goode",
- "email": "troygoode@gmail.com",
- "url": "http://github.com/troygoode/"
- }
- ],
- "licenses": [
- {
- "type": "MIT",
- "url": "http://www.opensource.org/licenses/mit-license.php"
- }
- ],
- "bugs": {
- "url": "http://github.com/troygoode/node-require-directory/issues/"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "devDependencies": {
- "jshint": "^2.6.0",
- "mocha": "^2.1.0"
- },
- "scripts": {
- "test": "mocha",
- "lint": "jshint index.js test/test.js"
- },
- "gitHead": "08f75bb9e14aa33834519c4788c5618e318925db",
- "_id": "require-directory@2.1.0",
- "_shasum": "707ab5d99b3e819ccf3f2bc77195bdcea0f0e61b",
- "_from": "require-directory@>=2.1.0 <3.0.0",
- "_npmVersion": "2.5.1",
- "_nodeVersion": "0.12.0",
- "_npmUser": {
- "name": "troygoode",
- "email": "troygoode@gmail.com"
- },
- "maintainers": [
- {
- "name": "troygoode",
- "email": "troygoode@gmail.com"
- }
- ],
- "dist": {
- "shasum": "707ab5d99b3e819ccf3f2bc77195bdcea0f0e61b",
- "tarball": "http://registry.npmjs.org/require-directory/-/require-directory-2.1.0.tgz"
- },
- "directories": {},
- "_resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.0.tgz"
-}
{
- "version": "1.4.0",
+ "version": "1.6.1",
"name": "har-validator",
"description": "Extremely fast HTTP Archive (HAR) validator using JSON Schema",
"author": {
},
"devDependencies": {
"codeclimate-test-reporter": "0.0.4",
- "istanbul": "^0.3.8",
+ "istanbul": "^0.3.11",
"mocha": "^2.2.1",
+ "require-directory": "^2.1.0",
"should": "^5.2.0",
- "standard": "^3.2.0"
+ "standard": "^3.3.0"
},
"dependencies": {
- "async": "^0.9.0",
- "bluebird": "^2.9.14",
+ "bluebird": "^2.9.21",
"chalk": "^1.0.0",
"commander": "^2.7.1",
- "debug": "^2.1.3",
- "is-my-json-valid": "^2.10.0",
- "require-directory": "^2.1.0"
+ "is-my-json-valid": "^2.10.0"
},
- "gitHead": "6d7268e7bb929aaa98d1c919dcba231ea5e81084",
- "_id": "har-validator@1.4.0",
- "_shasum": "845924893a05602a9791c319f81d628948b1b2af",
+ "gitHead": "aa68c8efacea7437bb545d816a14e20db444fde5",
+ "_id": "har-validator@1.6.1",
+ "_shasum": "baef452cde645eff7d26562e8e749d7fd000b7fd",
"_from": "har-validator@>=1.4.0 <2.0.0",
"_npmVersion": "2.5.1",
- "_nodeVersion": "0.12.0",
+ "_nodeVersion": "0.12.1",
"_npmUser": {
"name": "ahmadnassri",
"email": "ahmad@ahmadnassri.com"
}
],
"dist": {
- "shasum": "845924893a05602a9791c319f81d628948b1b2af",
- "tarball": "http://registry.npmjs.org/har-validator/-/har-validator-1.4.0.tgz"
+ "shasum": "baef452cde645eff7d26562e8e749d7fd000b7fd",
+ "tarball": "http://registry.npmjs.org/har-validator/-/har-validator-1.6.1.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/har-validator/-/har-validator-1.4.0.tgz"
+ "_resolved": "https://registry.npmjs.org/har-validator/-/har-validator-1.6.1.tgz"
}
--- /dev/null
+'use strict'
+
+function ValidationError (errors) {
+ this.name = 'ValidationError'
+ this.errors = errors
+}
+
+ValidationError.prototype = Error.prototype
+
+module.exports = ValidationError
'use strict'
+var schemas = require('./schemas')
+var ValidationError = require('./error')
var validator = require('is-my-json-valid')
-var schemas = require('./schemas.json')
-
-function ValidationError (errors) {
- this.name = 'ValidationError'
- this.errors = errors
-}
-
-ValidationError.prototype = Error.prototype
var runner = function (schema, data, cb) {
var validate = validator(schema, {
}
module.exports = function (data, cb) {
- return runner(schemas.log, data, cb)
+ return runner(schemas.har, data, cb)
}
Object.keys(schemas).map(function (name) {
+++ /dev/null
-{
- "log": {
- "type": "object",
- "required": ["log"],
- "properties": {
- "log": {
- "type": "object",
- "required": ["version", "creator", "entries"],
- "properties": {
- "version": { "type": "string" },
- "creator": { "$ref": "#creator" },
- "browser": { "$ref": "#creator" },
- "pages": {
- "type": "array",
- "items": { "$ref": "#page" }
- },
- "entries": {
- "type": "array",
- "items": { "$ref": "#entry" }
- },
- "comment": { "type": "string" }
- }
- }
- }
- },
-
- "creator": {
- "type": "object",
- "required": ["name", "version"],
- "properties": {
- "name": { "type": "string" },
- "version": { "type": "string" },
- "comment": { "type": "string" }
- }
- },
-
- "page": {
- "type": "object",
- "optional": true,
- "required": ["startedDateTime", "id", "title", "pageTimings"],
- "properties": {
- "startedDateTime": { "type": "string", "format": "date-time" },
- "id": { "type": "string", "unique": true },
- "title": { "type": "string" },
- "pageTimings": { "$ref": "#pageTimings" },
- "comment": { "type": "string" }
- }
- },
-
- "pageTimings": {
- "type": "object",
- "properties": {
- "onContentLoad": { "type": "number", "min": -1 },
- "onLoad": { "type": "number", "min": -1 },
- "comment": { "type": "string" }
- }
- },
-
- "entry": {
- "type": "object",
- "optional": true,
- "required": ["startedDateTime", "time", "request", "response", "cache", "timings"],
- "properties": {
- "pageref": { "type": "string" },
- "startedDateTime": { "type": "string", "format": "date-time" },
- "time": { "type": "number", "min": 0 },
- "request": { "$ref": "#request" },
- "response": { "$ref": "#response" },
- "cache": { "$ref": "#cache" },
- "timings": { "$ref": "#timings" },
- "serverIPAddress": { "type": "string", "format": "ipv4" },
- "connection": { "type": "string" },
- "comment": { "type": "string" }
- }
- },
-
- "request": {
- "type": "object",
- "required": ["method", "url", "httpVersion", "cookies", "headers", "queryString", "headersSize", "bodySize"],
- "properties": {
- "method": { "type": "string" },
- "url": { "type": "string", "format": "uri" },
- "httpVersion": { "type": "string" },
- "cookies": {
- "type": "array",
- "items": { "$ref": "#cookie" }
- },
- "headers": {
- "type": "array",
- "items": { "$ref": "#record" }
- },
- "queryString": {
- "type": "array",
- "items": { "$ref": "#record" }
- },
- "postData": { "$ref": "#postData" },
- "headersSize": { "type": "number" },
- "bodySize": { "type": "number" },
- "comment": { "type": "string" }
- }
- },
-
- "record": {
- "type": "object",
- "required": ["name", "value"],
- "properties": {
- "name": { "type": "string" },
- "value": { "type": "string" },
- "comment": { "type": "string" }
- }
- },
-
- "response": {
- "type": "object",
- "required": ["status", "statusText", "httpVersion", "cookies", "headers", "content", "redirectURL", "headersSize", "bodySize"],
- "properties": {
- "status": { "type": "number" },
- "statusText": { "type": "string" },
- "httpVersion": { "type": "string" },
- "cookies": {
- "type": "array",
- "items": { "$ref": "#cookie" }
- },
- "headers": {
- "type": "array",
- "items": { "$ref": "#record" }
- },
- "content": { "$ref": "#content" },
- "redirectURL": { "type": "string" },
- "headersSize": { "type": "number" },
- "bodySize": { "type": "number" },
- "comment": { "type": "string" }
- }
- },
-
- "cookie": {
- "type": "object",
- "required": ["name", "value"],
- "properties": {
- "name": { "type": "string" },
- "value": { "type": "string" },
- "path": { "type": "string" },
- "domain": { "type": "string" },
- "expires": {
- "type": "string",
- "format": "date-time"
- },
- "httpOnly": { "type": "boolean" },
- "secure": { "type": "boolean" },
- "comment": { "type": "string" }
- }
- },
-
- "postData": {
- "type": "object",
- "optional": true,
- "required": ["mimeType"],
- "properties": {
- "mimeType": { "type": "string" },
- "text": { "type": "string" },
- "params": {
- "type": "array",
- "required": ["name"],
- "properties": {
- "name": { "type": "string" },
- "value": { "type": "string" },
- "fileName": { "type": "string" },
- "contentType": { "type": "string" },
- "comment": { "type": "string" }
- }
- },
- "comment": { "type": "string" }
- }
- },
-
- "content": {
- "type": "object",
- "required": ["size", "mimeType"],
- "properties": {
- "size": { "type": "number" },
- "compression": { "type": "number" },
- "mimeType": { "type": "string" },
- "text": { "type": "string" },
- "encoding": { "type": "string" },
- "comment": { "type": "string" }
- }
- },
-
- "cache": {
- "properties": {
- "beforeRequest": { "$ref": "#cacheEntry" },
- "afterRequest": { "$ref": "#cacheEntry" },
- "comment": { "type": "string" }
- }
- },
-
- "cacheEntry": {
- "optional": true,
- "required": ["lastAccess", "eTag", "hitCount"],
- "properties": {
- "expires": { "type": "string" },
- "lastAccess": { "type": "string" },
- "eTag": { "type": "string" },
- "hitCount": { "type": "number" },
- "comment": { "type": "string" }
- }
- },
-
- "timings": {
- "required": ["send", "wait", "receive"],
- "properties": {
- "dns": { "type": "number", "min": -1 },
- "connect": { "type": "number", "min": -1 },
- "blocked": { "type": "number", "min": -1 },
- "send": { "type": "number", "min": -1 },
- "wait": { "type": "number", "min": -1 },
- "receive": { "type": "number", "min": -1 },
- "ssl": { "type": "number", "min": -1 },
- "comment": { "type": "string" }
- }
- }
-}
--- /dev/null
+{
+ "properties": {
+ "beforeRequest": {
+ "$ref": "#cacheEntry"
+ },
+ "afterRequest": {
+ "$ref": "#cacheEntry"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
--- /dev/null
+{
+ "optional": true,
+ "required": [
+ "lastAccess",
+ "eTag",
+ "hitCount"
+ ],
+ "properties": {
+ "expires": {
+ "type": "string"
+ },
+ "lastAccess": {
+ "type": "string"
+ },
+ "eTag": {
+ "type": "string"
+ },
+ "hitCount": {
+ "type": "integer"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
--- /dev/null
+{
+ "type": "object",
+ "required": [
+ "size",
+ "mimeType"
+ ],
+ "properties": {
+ "size": {
+ "type": "integer"
+ },
+ "compression": {
+ "type": "integer"
+ },
+ "mimeType": {
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
+ },
+ "encoding": {
+ "type": "string"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
--- /dev/null
+{
+ "type": "object",
+ "required": [
+ "name",
+ "value"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "path": {
+ "type": "string"
+ },
+ "domain": {
+ "type": "string"
+ },
+ "expires": {
+ "type": ["string", "null"],
+ "format": "date-time"
+ },
+ "httpOnly": {
+ "type": "boolean"
+ },
+ "secure": {
+ "type": "boolean"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
--- /dev/null
+{
+ "type": "object",
+ "required": [
+ "name",
+ "version"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "version": {
+ "type": "string"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
--- /dev/null
+{
+ "type": "object",
+ "optional": true,
+ "required": [
+ "startedDateTime",
+ "time",
+ "request",
+ "response",
+ "cache",
+ "timings"
+ ],
+ "properties": {
+ "pageref": {
+ "type": "string"
+ },
+ "startedDateTime": {
+ "type": "string",
+ "format": "date-time",
+ "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"
+ },
+ "time": {
+ "type": "number",
+ "min": 0
+ },
+ "request": {
+ "$ref": "#request"
+ },
+ "response": {
+ "$ref": "#response"
+ },
+ "cache": {
+ "$ref": "#cache"
+ },
+ "timings": {
+ "$ref": "#timings"
+ },
+ "serverIPAddress": {
+ "type": "string",
+ "format": "ipv4"
+ },
+ "connection": {
+ "type": "string"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
--- /dev/null
+{
+ "type": "object",
+ "required": [
+ "log"
+ ],
+ "properties": {
+ "log": {
+ "$ref": "#log"
+ }
+ }
+}
--- /dev/null
+'use strict'
+
+var schemas = {
+ cache: require('./cache.json'),
+ cacheEntry: require('./cacheEntry.json'),
+ content: require('./content.json'),
+ cookie: require('./cookie.json'),
+ creator: require('./creator.json'),
+ entry: require('./entry.json'),
+ har: require('./har.json'),
+ log: require('./log.json'),
+ page: require('./page.json'),
+ pageTimings: require('./pageTimings.json'),
+ postData: require('./postData.json'),
+ record: require('./record.json'),
+ request: require('./request.json'),
+ response: require('./response.json'),
+ timings: require('./timings.json')
+}
+
+// is-my-json-valid does not provide meaningful error messages for external schemas
+// this is a workaround
+schemas.cache.properties.beforeRequest = schemas.cacheEntry
+schemas.cache.properties.afterRequest = schemas.cacheEntry
+
+schemas.page.properties.pageTimings = schemas.pageTimings
+
+schemas.request.properties.cookies.items = schemas.cookie
+schemas.request.properties.headers.items = schemas.record
+schemas.request.properties.queryString.items = schemas.record
+schemas.request.properties.postData = schemas.postData
+
+schemas.response.properties.cookies.items = schemas.cookie
+schemas.response.properties.headers.items = schemas.record
+schemas.response.properties.content = schemas.content
+
+schemas.entry.properties.request = schemas.request
+schemas.entry.properties.response = schemas.response
+schemas.entry.properties.cache = schemas.cache
+schemas.entry.properties.timings = schemas.timings
+
+schemas.log.properties.creator = schemas.creator
+schemas.log.properties.browser = schemas.creator
+schemas.log.properties.pages.items = schemas.page
+schemas.log.properties.entries.items = schemas.entry
+
+schemas.har.properties.log = schemas.log
+
+module.exports = schemas
--- /dev/null
+{
+ "type": "object",
+ "required": [
+ "version",
+ "creator",
+ "entries"
+ ],
+ "properties": {
+ "version": {
+ "type": "string"
+ },
+ "creator": {
+ "$ref": "#creator"
+ },
+ "browser": {
+ "$ref": "#creator"
+ },
+ "pages": {
+ "type": "array",
+ "items": {
+ "$ref": "#page"
+ }
+ },
+ "entries": {
+ "type": "array",
+ "items": {
+ "$ref": "#entry"
+ }
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
--- /dev/null
+{
+ "type": "object",
+ "optional": true,
+ "required": [
+ "startedDateTime",
+ "id",
+ "title",
+ "pageTimings"
+ ],
+ "properties": {
+ "startedDateTime": {
+ "type": "string",
+ "format": "date-time",
+ "pattern": "^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"
+ },
+ "id": {
+ "type": "string",
+ "unique": true
+ },
+ "title": {
+ "type": "string"
+ },
+ "pageTimings": {
+ "$ref": "#pageTimings"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
--- /dev/null
+{
+ "type": "object",
+ "properties": {
+ "onContentLoad": {
+ "type": "number",
+ "min": -1
+ },
+ "onLoad": {
+ "type": "number",
+ "min": -1
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
--- /dev/null
+{
+ "type": "object",
+ "optional": true,
+ "required": [
+ "mimeType"
+ ],
+ "properties": {
+ "mimeType": {
+ "type": "string"
+ },
+ "text": {
+ "type": "string"
+ },
+ "params": {
+ "type": "array",
+ "required": [
+ "name"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "fileName": {
+ "type": "string"
+ },
+ "contentType": {
+ "type": "string"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
--- /dev/null
+{
+ "type": "object",
+ "required": [
+ "name",
+ "value"
+ ],
+ "properties": {
+ "name": {
+ "type": "string"
+ },
+ "value": {
+ "type": "string"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
--- /dev/null
+{
+ "type": "object",
+ "required": [
+ "method",
+ "url",
+ "httpVersion",
+ "cookies",
+ "headers",
+ "queryString",
+ "headersSize",
+ "bodySize"
+ ],
+ "properties": {
+ "method": {
+ "type": "string"
+ },
+ "url": {
+ "type": "string",
+ "format": "uri"
+ },
+ "httpVersion": {
+ "type": "string"
+ },
+ "cookies": {
+ "type": "array",
+ "items": {
+ "$ref": "#cookie"
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "$ref": "#record"
+ }
+ },
+ "queryString": {
+ "type": "array",
+ "items": {
+ "$ref": "#record"
+ }
+ },
+ "postData": {
+ "$ref": "#postData"
+ },
+ "headersSize": {
+ "type": "integer"
+ },
+ "bodySize": {
+ "type": "integer"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
--- /dev/null
+{
+ "type": "object",
+ "required": [
+ "status",
+ "statusText",
+ "httpVersion",
+ "cookies",
+ "headers",
+ "content",
+ "redirectURL",
+ "headersSize",
+ "bodySize"
+ ],
+ "properties": {
+ "status": {
+ "type": "integer"
+ },
+ "statusText": {
+ "type": "string"
+ },
+ "httpVersion": {
+ "type": "string"
+ },
+ "cookies": {
+ "type": "array",
+ "items": {
+ "$ref": "#cookie"
+ }
+ },
+ "headers": {
+ "type": "array",
+ "items": {
+ "$ref": "#record"
+ }
+ },
+ "content": {
+ "$ref": "#content"
+ },
+ "redirectURL": {
+ "type": "string"
+ },
+ "headersSize": {
+ "type": "integer"
+ },
+ "bodySize": {
+ "type": "integer"
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
--- /dev/null
+{
+ "required": [
+ "send",
+ "wait",
+ "receive"
+ ],
+ "properties": {
+ "dns": {
+ "type": "number",
+ "min": -1
+ },
+ "connect": {
+ "type": "number",
+ "min": -1
+ },
+ "blocked": {
+ "type": "number",
+ "min": -1
+ },
+ "send": {
+ "type": "number",
+ "min": -1
+ },
+ "wait": {
+ "type": "number",
+ "min": -1
+ },
+ "receive": {
+ "type": "number",
+ "min": -1
+ },
+ "ssl": {
+ "type": "number",
+ "min": -1
+ },
+ "comment": {
+ "type": "string"
+ }
+ }
+}
node_js:
- 0.10
+ - 0.12
+ - iojs
+++ /dev/null
-test:
- @node node_modules/lab/bin/lab -a code
-test-cov:
- @node node_modules/lab/bin/lab -a code -t 100
-test-cov-html:
- @node node_modules/lab/bin/lab -a code -r html -o coverage.html
-
-.PHONY: test test-cov test-cov-html
-
**boom** provides a set of utilities for returning HTTP errors. Each utility returns a `Boom` error response
object (instance of `Error`) which includes the following properties:
- `isBoom` - if `true`, indicates this is a `Boom` object instance.
+- `isServer` - convenience bool indicating status code >= 500.
- `message` - the error message.
- `output` - the formatted response. Can be directly manipulated after object construction to return a custom
error response. Allowed root keys:
### `Boom.tooManyRequests([message], [data])`
-Returns a 422 Too Many Requests error where:
+Returns a 429 Too Many Requests error where:
- `message` - optional message.
- `data` - optional additional error data.
internals.initialize = function (error, statusCode, message) {
- Hoek.assert(!isNaN(parseFloat(statusCode)) && isFinite(statusCode) && statusCode >= 400, 'First argument must be a number (400+):', statusCode);
+ Hoek.assert(Hoek.isInteger(statusCode) && statusCode >= 400, 'First argument must be a number (400+):', statusCode);
error.isBoom = true;
+ error.isServer = statusCode >= 500;
if (!error.hasOwnProperty('data')) {
error.data = null;
{
"name": "boom",
"description": "HTTP-friendly error objects",
- "version": "2.6.1",
+ "version": "2.7.0",
"repository": {
"type": "git",
"url": "git://github.com/hapijs/boom"
"lab": "5.x.x"
},
"scripts": {
- "test": "make test-cov"
+ "test": "lab -a code -t 100",
+ "test-cov-html": "lab -a code -r html -o coverage.html"
},
"licenses": [
{
"url": "http://github.com/hapijs/boom/raw/master/LICENSE"
}
],
- "gitHead": "860d6f8b0db89b263418b8575c65560482cbd1ba",
+ "gitHead": "fe25a73234007ebb4fa8f8071592f35240e67c1b",
"bugs": {
"url": "https://github.com/hapijs/boom/issues"
},
"homepage": "https://github.com/hapijs/boom",
- "_id": "boom@2.6.1",
- "_shasum": "4dc8ef9b6dfad9c43bbbfbe71fa4c21419f22753",
+ "_id": "boom@2.7.0",
+ "_shasum": "47c6c7f62dc6d68742a75c4010b035c62615d265",
"_from": "boom@>=2.0.0 <3.0.0",
- "_npmVersion": "1.4.28",
+ "_npmVersion": "2.7.0",
+ "_nodeVersion": "0.10.36",
"_npmUser": {
- "name": "hueniverse",
- "email": "eran@hueniverse.com"
+ "name": "arb",
+ "email": "arbretz@gmail.com"
},
"maintainers": [
{
}
],
"dist": {
- "shasum": "4dc8ef9b6dfad9c43bbbfbe71fa4c21419f22753",
- "tarball": "http://registry.npmjs.org/boom/-/boom-2.6.1.tgz"
+ "shasum": "47c6c7f62dc6d68742a75c4010b035c62615d265",
+ "tarball": "http://registry.npmjs.org/boom/-/boom-2.7.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/boom/-/boom-2.6.1.tgz"
+ "_resolved": "https://registry.npmjs.org/boom/-/boom-2.7.0.tgz"
}
var error = Boom.unauthorized(null);
expect(error.output.payload.message).to.not.exist();
+ expect(error.isServer).to.be.false();
done();
});
it('returns a 400 error statusCode', function (done) {
- expect(Boom.badRequest().output.statusCode).to.equal(400);
+ var error = Boom.badRequest();
+
+ expect(error.output.statusCode).to.equal(400);
+ expect(error.isServer).to.be.false();
done();
});
var err = Boom.internal('my message');
expect(err.message).to.equal('my message');
+ expect(err.isServer).to.true();
expect(err.output.payload.message).to.equal('An internal server error occurred');
done();
});
catch (err) {
var boom = Boom.internal('Someting bad', err);
expect(boom.message).to.equal('Someting bad: Unexpected end of input');
+ expect(boom.isServer).to.be.true();
done();
}
});
var err = Boom.badImplementation();
expect(err.output.statusCode).to.equal(500);
expect(err.isDeveloperError).to.equal(true);
+ expect(err.isServer).to.be.true();
done();
});
});
--- /dev/null
+{
+ "predef": [ ]
+ , "bitwise": false
+ , "camelcase": false
+ , "curly": false
+ , "eqeqeq": false
+ , "forin": false
+ , "immed": false
+ , "latedef": false
+ , "noarg": true
+ , "noempty": true
+ , "nonew": true
+ , "plusplus": false
+ , "quotmark": true
+ , "regexp": false
+ , "undef": true
+ , "unused": true
+ , "strict": false
+ , "trailing": true
+ , "maxlen": 120
+ , "asi": true
+ , "boss": true
+ , "debug": true
+ , "eqnull": true
+ , "esnext": true
+ , "evil": true
+ , "expr": true
+ , "funcscope": false
+ , "globalstrict": false
+ , "iterator": false
+ , "lastsemic": true
+ , "laxbreak": true
+ , "laxcomma": true
+ , "loopfunc": true
+ , "multistr": false
+ , "onecase": false
+ , "proto": false
+ , "regexdash": false
+ , "scripturl": true
+ , "smarttabs": false
+ , "shadow": false
+ , "sub": true
+ , "supernew": false
+ , "validthis": true
+ , "browser": true
+ , "couch": false
+ , "devel": false
+ , "dojo": false
+ , "mootools": false
+ , "node": true
+ , "nonstandard": true
+ , "prototypejs": false
+ , "rhino": false
+ , "worker": true
+ , "wsh": false
+ , "nomen": false
+ , "onevar": false
+ , "passfail": false
+}
\ No newline at end of file
"tarball": "http://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz"
}
"tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.3.tgz"
}
--- /dev/null
+{
+ "node": true,
+
+ "curly": true,
+ "latedef": true,
+ "quotmark": true,
+ "undef": true,
+ "unused": true,
+ "trailing": true
+}
--- /dev/null
+# qs
+
+A querystring parsing and stringifying library with some added security.
+
+[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs)
+
+Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf)
+
+The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).
+
+## Usage
+
+```javascript
+var Qs = require('qs');
+
+var obj = Qs.parse('a=c'); // { a: 'c' }
+var str = Qs.stringify(obj); // 'a=c'
+```
+
+### Parsing Objects
+
+```javascript
+Qs.parse(string, [options]);
+```
+
+**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.
+For example, the string `'foo[bar]=baz'` converts to:
+
+```javascript
+{
+ foo: {
+ bar: 'baz'
+ }
+}
+```
+
+URI encoded strings work too:
+
+```javascript
+Qs.parse('a%5Bb%5D=c');
+// { a: { b: 'c' } }
+```
+
+You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:
+
+```javascript
+{
+ foo: {
+ bar: {
+ baz: 'foobarbaz'
+ }
+ }
+}
+```
+
+By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like
+`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:
+
+```javascript
+{
+ a: {
+ b: {
+ c: {
+ d: {
+ e: {
+ f: {
+ '[g][h][i]': 'j'
+ }
+ }
+ }
+ }
+ }
+ }
+}
+```
+
+This depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`:
+
+```javascript
+Qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });
+// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }
+```
+
+The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.
+
+For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:
+
+```javascript
+Qs.parse('a=b&c=d', { parameterLimit: 1 });
+// { a: 'b' }
+```
+
+An optional delimiter can also be passed:
+
+```javascript
+Qs.parse('a=b;c=d', { delimiter: ';' });
+// { a: 'b', c: 'd' }
+```
+
+Delimiters can be a regular expression too:
+
+```javascript
+Qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });
+// { a: 'b', c: 'd', e: 'f' }
+```
+
+### Parsing Arrays
+
+**qs** can also parse arrays using a similar `[]` notation:
+
+```javascript
+Qs.parse('a[]=b&a[]=c');
+// { a: ['b', 'c'] }
+```
+
+You may specify an index as well:
+
+```javascript
+Qs.parse('a[1]=c&a[0]=b');
+// { a: ['b', 'c'] }
+```
+
+Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number
+to create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving
+their order:
+
+```javascript
+Qs.parse('a[1]=b&a[15]=c');
+// { a: ['b', 'c'] }
+```
+
+Note that an empty string is also a value, and will be preserved:
+
+```javascript
+Qs.parse('a[]=&a[]=b');
+// { a: ['', 'b'] }
+Qs.parse('a[0]=b&a[1]=&a[2]=c');
+// { a: ['b', '', 'c'] }
+```
+
+**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will
+instead be converted to an object with the index as the key:
+
+```javascript
+Qs.parse('a[100]=b');
+// { a: { '100': 'b' } }
+```
+
+This limit can be overridden by passing an `arrayLimit` option:
+
+```javascript
+Qs.parse('a[1]=b', { arrayLimit: 0 });
+// { a: { '1': 'b' } }
+```
+
+To disable array parsing entirely, set `arrayLimit` to `-1`.
+
+If you mix notations, **qs** will merge the two items into an object:
+
+```javascript
+Qs.parse('a[0]=b&a[b]=c');
+// { a: { '0': 'b', b: 'c' } }
+```
+
+You can also create arrays of objects:
+
+```javascript
+Qs.parse('a[][b]=c');
+// { a: [{ b: 'c' }] }
+```
+
+### Stringifying
+
+```javascript
+Qs.stringify(object, [options]);
+```
+
+When stringifying, **qs** always URI encodes output. Objects are stringified as you would expect:
+
+```javascript
+Qs.stringify({ a: 'b' });
+// 'a=b'
+Qs.stringify({ a: { b: 'c' } });
+// 'a%5Bb%5D=c'
+```
+
+Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.
+
+When arrays are stringified, by default they are given explicit indices:
+
+```javascript
+Qs.stringify({ a: ['b', 'c', 'd'] });
+// 'a[0]=b&a[1]=c&a[2]=d'
+```
+
+You may override this by setting the `indices` option to `false`:
+
+```javascript
+Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });
+// 'a=b&a=c&a=d'
+```
+
+You may use the `arrayFormat` option to specify the format of the output array
+
+```javascript
+Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })
+// 'a[0]=b&a[1]=c'
+Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })
+// 'a[]=b&a[]=c'
+Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
+// 'a=b&a=c'
+```
+
+Empty strings and null values will omit the value, but the equals sign (=) remains in place:
+
+```javascript
+Qs.stringify({ a: '' });
+// 'a='
+```
+
+Properties that are set to `undefined` will be omitted entirely:
+
+```javascript
+Qs.stringify({ a: null, b: undefined });
+// 'a='
+```
+
+The delimiter may be overridden with stringify as well:
+
+```javascript
+Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' });
+// 'a=b;c=d'
+```
"tarball": "http://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",
- "readme": "ERROR: No README data found!"
+ "_resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz"
}
--- /dev/null
+{
+ "node": true,
+ "asi": true,
+ "laxcomma": true
+}
"util",
"utility"
],
- "version": "2.54.0",
+ "version": "2.55.0",
"author": {
"name": "Mikeal Rogers",
"email": "mikeal.rogers@gmail.com"
"rimraf": "~2.2.8",
"server-destroy": "~1.0.0",
"tape": "~3.0.0",
- "taper": "~0.4.0"
+ "taper": "~0.4.0",
+ "bluebird": "~2.9.21"
},
- "gitHead": "12080382de2b0e57f3dbaafadc8109af7bbc85ed",
+ "gitHead": "b6000376387db12d0c2d7ed9ee87b0ba123e36dc",
"homepage": "https://github.com/request/request",
- "_id": "request@2.54.0",
- "_shasum": "a13917cd8e8fa73332da0bf2f84a30181def1953",
- "_from": "request@>=2.54.0 <2.55.0",
+ "_id": "request@2.55.0",
+ "_shasum": "d75c1cdf679d76bb100f9bffe1fe551b5c24e93d",
+ "_from": "request@>=2.55.0 <2.56.0",
"_npmVersion": "1.4.28",
"_npmUser": {
"name": "simov",
}
],
"dist": {
- "shasum": "a13917cd8e8fa73332da0bf2f84a30181def1953",
- "tarball": "http://registry.npmjs.org/request/-/request-2.54.0.tgz"
+ "shasum": "d75c1cdf679d76bb100f9bffe1fe551b5c24e93d",
+ "tarball": "http://registry.npmjs.org/request/-/request-2.55.0.tgz"
},
"directories": {},
- "_resolved": "https://registry.npmjs.org/request/-/request-2.54.0.tgz"
+ "_resolved": "https://registry.npmjs.org/request/-/request-2.55.0.tgz"
}
}
self.headers = self.headers ? copy(self.headers) : {}
+ // Delete headers with value undefined since they break
+ // ClientRequest.OutgoingMessage.setHeader in node 0.12
+ for (var headerName in self.headers) {
+ if (typeof self.headers[headerName] === 'undefined') {
+ delete self.headers[headerName]
+ }
+ }
+
caseless.httpify(self, self.headers)
if (!self.method) {
var end = function () {
if (self._form) {
- self._form.pipe(self)
+ if (!self._auth.hasAuth) {
+ self._form.pipe(self)
+ }
+ else if (self._auth.hasAuth && self._auth.sentAuth) {
+ self._form.pipe(self)
+ }
}
if (self._multipart && self._multipart.chunked) {
self._multipart.body.pipe(self)
console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.')
self.requestBodyStream.pipe(self)
} else if (!self.src) {
+ if (self._auth.hasAuth && !self._auth.sentAuth) {
+ self.end()
+ return
+ }
if (self.method !== 'GET' && typeof self.method !== 'undefined') {
self.setHeader('content-length', 0)
}
// better to drop in cwd? seems more standard.
opts.path = opts.path || path.resolve("node-tar-extract")
- // have to dump into a directory
opts.type = "Directory"
opts.Directory = true
entry.linkpath = entry.props.linkpath = lp
}
}
-
if (entry.type === "Link") {
- entry.linkpath = entry.props.linkpath = path.join(
- opts.path, path.join("/", entry.props.linkpath)
- )
+ entry.linkpath = entry.props.linkpath =
+ path.join(opts.path, path.join("/", entry.props.linkpath))
}
- if (entry.props && entry.props.linkpath) {
+ if (entry.type === "SymbolicLink") {
+ var dn = path.dirname(entry.path) || ""
var linkpath = entry.props.linkpath
- // normalize paths that point outside the extraction root
- if (path.resolve(opts.path, linkpath).indexOf(opts.path) !== 0) {
- entry.props.linkpath = path.join(opts.path, path.join("/", linkpath))
+ var target = path.resolve(opts.path, dn, linkpath)
+ if (target.indexOf(opts.path) !== 0) {
+ linkpath = path.join(opts.path, path.join("/", linkpath))
}
+ entry.linkpath = entry.props.linkpath = linkpath
}
})
},
"name": "tar",
"description": "tar for node",
- "version": "2.0.0",
+ "version": "2.0.1",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-tar.git"
"mkdirp": "^0.5.0"
},
"license": "BSD",
- "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'.\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": "9bde260b9ebe6808837a85bedf9c6f7bb04e004f",
+ "gitHead": "ce405d0b96f0fe186dd4cc68d666fabb0c59818d",
"bugs": {
"url": "https://github.com/isaacs/node-tar/issues"
},
"homepage": "https://github.com/isaacs/node-tar",
- "_id": "tar@2.0.0",
- "_shasum": "7cf627bc632167766ce2a5a1f23e4ecb8e3f28bc",
- "_from": "tar@>=2.0.0 <2.1.0"
+ "_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"
}
{ path: 'fixtures/',
mode: '755',
type: '5',
- depth: undefined,
- size: 0,
- linkpath: '',
- nlink: undefined,
- dev: undefined,
- ino: undefined
+ linkpath: ''
+ },
+ { path: 'fixtures/a/',
+ mode: '755',
+ type: '5',
+ linkpath: ''
},
{ path: 'fixtures/the-chumbler',
mode: '755',
type: '2',
- depth: undefined,
- size: 0,
linkpath: path.resolve(target, 'a/b/c/d/the-chumbler'),
- nlink: undefined,
- dev: undefined,
- ino: undefined
+ },
+ { path: 'fixtures/a/b/',
+ mode: '755',
+ type: '5',
+ linkpath: ''
+ },
+ { path: 'fixtures/a/x',
+ mode: '644',
+ type: '0',
+ linkpath: ''
+ },
+ { path: 'fixtures/a/b/c/',
+ mode: '755',
+ type: '5',
+ linkpath: ''
+ },
+ { path: 'fixtures/a/b/c/y',
+ mode: '755',
+ type: '2',
+ linkpath: '../../x',
}
]
depth: 1,
linkpath: undefined
},
+ { path: '/fixtures/a',
+ mode: '40755',
+ type: 'Directory',
+ depth: 2,
+ linkpath: undefined
+ },
+ { path: '/fixtures/a/b',
+ mode: '40755',
+ type: 'Directory',
+ depth: 3,
+ linkpath: undefined
+ },
+ { path: '/fixtures/a/b/c',
+ mode: '40755',
+ type: 'Directory',
+ depth: 4,
+ linkpath: undefined
+ },
+ { path: '/fixtures/a/b/c/y',
+ mode: '120755',
+ type: 'SymbolicLink',
+ depth: 5,
+ linkpath: '../../x'
+ },
+ { path: '/fixtures/a/x',
+ mode: '100644',
+ type: 'File',
+ depth: 3,
+ linkpath: undefined
+ },
{ path: '/fixtures/the-chumbler',
mode: '120755',
type: 'SymbolicLink',
depth: 2,
- size: 95,
- linkpath: path.resolve(target, 'a/b/c/d/the-chumbler'),
- nlink: 1
+ linkpath: path.resolve(target, 'a/b/c/d/the-chumbler')
}
]
})
extract.on('entry', function (entry) {
+ var mode = entry.props.mode & (~parseInt('22', 8))
var found = {
path: entry.path,
- mode: entry.props.mode.toString(8),
+ mode: mode.toString(8),
type: entry.props.type,
- depth: entry.props.depth,
- size: entry.props.size,
linkpath: entry.props.linkpath,
- nlink: entry.props.nlink,
- dev: entry.props.dev,
- ino: entry.props.ino
}
var wanted = expectEntries[ee++]
-
- t.equivalent(found, wanted, 'tar entry ' + ee + ' ' + wanted.path)
+ t.equivalent(found, wanted, 'tar entry ' + ee + ' ' + (wanted && wanted.path))
})
function next () {
function foundEntry (entry) {
var p = entry.path.substr(target.length)
+ var mode = entry.props.mode & (~parseInt('22', 8))
var found = {
path: p,
- mode: entry.props.mode.toString(8),
+ mode: mode.toString(8),
type: entry.props.type,
depth: entry.props.depth,
- size: entry.props.size,
- linkpath: entry.props.linkpath,
- nlink: entry.props.nlink
+ linkpath: entry.props.linkpath
}
var wanted = expectFiles[ef++]
-
- t.has(found, wanted, 'unpacked file ' + ef + ' ' + wanted.path)
+ t.equivalent(found, wanted, 'unpacked file ' + ef + ' ' + (wanted && wanted.path))
entry.on('entry', foundEntry)
}
{
- "version": "2.7.6",
+ "version": "2.8.3",
"name": "npm",
"description": "a package manager for JavaScript",
"keywords": [
"async-some": "~1.0.1",
"block-stream": "0.0.7",
"char-spinner": "~1.0.1",
- "child-process-close": "~0.1.1",
"chmodr": "~0.1.0",
"chownr": "0",
"cmd-shim": "~2.0.1",
- "columnify": "~1.4.1",
+ "columnify": "~1.5.1",
"config-chain": "~1.1.8",
"dezalgo": "~1.0.1",
"editor": "~0.1.0",
"fstream-npm": "~1.0.2",
"github-url-from-git": "~1.4.0",
"github-url-from-username-repo": "~1.0.2",
- "glob": "~5.0.3",
+ "glob": "~5.0.5",
"graceful-fs": "~3.0.6",
- "hosted-git-info": "~1.5.3",
+ "hosted-git-info": "~2.1.2",
"inflight": "~1.0.4",
"inherits": "~2.0.1",
"ini": "~1.3.3",
- "init-package-json": "~1.3.2",
+ "init-package-json": "~1.4.0",
"lockfile": "~1.0.0",
- "lru-cache": "~2.5.0",
+ "lru-cache": "~2.5.2",
"minimatch": "~2.0.4",
"mkdirp": "~0.5.0",
"node-gyp": "~1.0.3",
"nopt": "~3.0.1",
"normalize-git-url": "~1.0.0",
- "normalize-package-data": "~1.0.3",
+ "normalize-package-data": "~2.0.0",
"npm-cache-filename": "~1.0.1",
"npm-install-checks": "~1.0.5",
- "npm-package-arg": "~3.1.1",
- "npm-registry-client": "~6.1.2",
+ "npm-package-arg": "~4.0.0",
+ "npm-registry-client": "~6.3.2",
"npm-user-validate": "~0.1.1",
"npmlog": "~1.2.0",
"once": "~1.3.1",
"osenv": "~0.1.0",
"path-is-inside": "~1.0.0",
"read": "~1.0.4",
- "read-installed": "~3.1.5",
- "read-package-json": "~1.3.3",
+ "read-installed": "~4.0.0",
+ "read-package-json": "~2.0.0",
"readable-stream": "~1.0.33",
- "realize-package-specifier": "~2.2.0",
- "request": "~2.54.0",
+ "realize-package-specifier": "~3.0.0",
+ "request": "~2.55.0",
"retry": "~0.6.1",
"rimraf": "~2.3.2",
"semver": "~4.3.3",
"slide": "~1.1.6",
"sorted-object": "~1.0.0",
"strip-ansi": "~2.0.1",
- "tar": "~2.0.0",
+ "tar": "~2.0.1",
"text-table": "~0.2.0",
"uid-number": "0.0.6",
"umask": "~1.1.0",
"async-some",
"block-stream",
"char-spinner",
- "child-process-close",
"chmodr",
"chownr",
"cmd-shim",
"devDependencies": {
"marked": "~0.3.3",
"marked-man": "~0.1.4",
- "nock": "~1.4.0",
+ "nock": "~1.6.0",
"npm-registry-couchapp": "~2.6.7",
"npm-registry-mock": "~1.0.0",
"require-inject": "~1.2.0",
},
"scripts": {
"test-legacy": "node ./test/run.js",
- "test": "tap --timeout 120 test/tap/*.js",
- "tap": "tap --timeout 120 test/tap/*.js",
- "test-all": "node ./test/run.js && tap test/tap/*.js",
- "prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j8 doc",
+ "test": "tap --timeout 240 test/tap/*.js",
+ "tap": "tap --timeout 240 test/tap/*.js",
+ "test-all": "npm run test-legacy && npm test",
+ "prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc",
"dumpconf": "env | grep npm | sort | uniq"
},
"license": "Artistic-2.0"
-var spawn = require("child_process").spawn
-var path = require("path")
+// cheesy hackaround for test deps (read: nock) that rely on setImmediate
+if (!global.setImmediate || !require('timers').setImmediate) {
+ require('timers').setImmediate = global.setImmediate = function () {
+ var args = [arguments[0], 0].concat([].slice.call(arguments, 1))
+ setTimeout.apply(this, args)
+ }
+}
+
+var spawn = require('child_process').spawn
+var path = require('path')
var port = exports.port = 1337
-exports.registry = "http://localhost:" + port
-process.env.npm_config_loglevel = "error"
+exports.registry = 'http://localhost:' + port
+process.env.npm_config_loglevel = 'error'
-var npm_config_cache = path.resolve(__dirname, "npm_cache")
+var npm_config_cache = path.resolve(__dirname, 'npm_cache')
process.env.npm_config_cache = exports.npm_config_cache = npm_config_cache
-process.env.npm_config_userconfig = exports.npm_config_userconfig = path.join(__dirname, "fixtures", "config", "userconfig")
-process.env.npm_config_globalconfig = exports.npm_config_globalconfig = path.join(__dirname, "fixtures", "config", "globalconfig")
-process.env.random_env_var = "foo"
+process.env.npm_config_userconfig = exports.npm_config_userconfig = path.join(__dirname, 'fixtures', 'config', 'userconfig')
+process.env.npm_config_globalconfig = exports.npm_config_globalconfig = path.join(__dirname, 'fixtures', 'config', 'globalconfig')
+process.env.random_env_var = 'foo'
-var bin = exports.bin = require.resolve("../bin/npm-cli.js")
-var once = require("once")
+var bin = exports.bin = require.resolve('../bin/npm-cli.js')
+var chain = require('slide').chain
+var once = require('once')
exports.npm = function (cmd, opts, cb) {
cb = once(cb)
opts.env.npm_config_cache = npm_config_cache
}
- var stdout = ""
- , stderr = ""
- , node = process.execPath
- , child = spawn(node, cmd, opts)
+ var stdout = ''
+ var stderr = ''
+ var node = process.execPath
+ var child = spawn(node, cmd, opts)
- if (child.stderr) child.stderr.on("data", function (chunk) {
- stderr += chunk
- })
+ if (child.stderr) {
+ child.stderr.on('data', function (chunk) {
+ stderr += chunk
+ })
+ }
- if (child.stdout) child.stdout.on("data", function (chunk) {
- stdout += chunk
- })
+ if (child.stdout) {
+ child.stdout.on('data', function (chunk) {
+ stdout += chunk
+ })
+ }
- child.on("error", cb)
+ child.on('error', cb)
- child.on("close", function (code) {
+ child.on('close', function (code) {
cb(null, code, stdout, stderr)
})
return child
}
+
+exports.makeGitRepo = function (params, cb) {
+ // git must be called after npm.load because it uses config
+ var git = require('../lib/utils/git.js')
+
+ var root = params.path || process.cwd()
+ var user = params.user || 'PhantomFaker'
+ var email = params.email || 'nope@not.real'
+ var added = params.added || ['package.json']
+ var message = params.message || 'stub repo'
+
+ var opts = { cwd: root, env: { PATH: process.env.PATH }}
+ var commands = [
+ git.chainableExec(['init'], opts),
+ git.chainableExec(['config', 'user.name', user], opts),
+ git.chainableExec(['config', 'user.email', email], opts),
+ git.chainableExec(['add'].concat(added), opts),
+ git.chainableExec(['commit', '-m', message], opts)
+ ]
+
+ if (Array.isArray(params.commands)) {
+ commands = commands.concat(params.commands)
+ }
+
+ chain(commands, cb)
+}
-var fs = require("fs")
-var resolve = require("path").resolve
+var fs = require('fs')
+var resolve = require('path').resolve
-var chain = require("slide").chain
-var osenv = require("osenv")
-var mkdirp = require("mkdirp")
-var rimraf = require("rimraf")
-var test = require("tap").test
+var osenv = require('osenv')
+var mkdirp = require('mkdirp')
+var rimraf = require('rimraf')
+var test = require('tap').test
-var npm = require("../../lib/npm.js")
-var common = require("../common-tap.js")
+var npm = require('../../lib/npm.js')
+var common = require('../common-tap.js')
-var pkg = resolve(__dirname, "add-remote-git")
-var repo = resolve(__dirname, "add-remote-git-repo")
+var pkg = resolve(__dirname, 'add-remote-git')
+var repo = resolve(__dirname, 'add-remote-git-repo')
var daemon
var daemonPID
var git
-test("setup", function (t) {
+test('setup', function (t) {
bootstrap()
setup(function (er, r) {
if (er) {
})
})
-test("install from repo on 'Windows'", function (t) {
+test('install from repo on \'Windows\'', function (t) {
// before we confuse everything by switching the platform
- require("../../lib/install.js")
- require("../../lib/unbuild.js")
- process.platform = "win32"
+ require('../../lib/install.js')
+ require('../../lib/unbuild.js')
+ process.platform = 'win32'
process.chdir(pkg)
- npm.commands.install(".", [], function (er) {
- t.ifError(er, "npm installed via git")
+ npm.commands.install('.', [], function (er) {
+ t.ifError(er, 'npm installed via git')
t.end()
})
})
-test("clean", function (t) {
- daemon.on("close", function () {
+test('clean', function (t) {
+ daemon.on('close', function () {
cleanup()
t.end()
})
})
var pjParent = JSON.stringify({
- name : "parent",
- version : "1.2.3",
- dependencies : {
- "child" : "git://localhost:1233/child.git"
+ name: 'parent',
+ version: '1.2.3',
+ dependencies: {
+ child: 'git://localhost:1233/child.git'
}
-}, null, 2) + "\n"
+}, null, 2) + '\n'
var pjChild = JSON.stringify({
- name : "child",
- version : "1.0.3"
-}, null, 2) + "\n"
+ name: 'child',
+ version: '1.0.3'
+}, null, 2) + '\n'
function bootstrap () {
rimraf.sync(pkg)
mkdirp.sync(pkg)
- fs.writeFileSync(resolve(pkg, "package.json"), pjParent)
+ fs.writeFileSync(resolve(pkg, 'package.json'), pjParent)
}
function setup (cb) {
rimraf.sync(repo)
mkdirp.sync(repo)
- fs.writeFileSync(resolve(repo, "package.json"), pjChild)
- npm.load({ registry : common.registry, loglevel : "silent" }, function () {
+ fs.writeFileSync(resolve(repo, 'package.json'), pjChild)
+ npm.load({ registry: common.registry, loglevel: 'silent' }, function () {
// some really cheesy monkeypatching
- require("module")._cache[require.resolve("which")] = {
- exports : function (_, cb) { cb() }
+ require('module')._cache[require.resolve('which')] = {
+ exports: function (_, cb) { cb() }
}
- git = require("../../lib/utils/git.js")
+ git = require('../../lib/utils/git.js')
function startDaemon (cb) {
// start git server
var d = git.spawn(
[
- "daemon",
- "--verbose",
- "--listen=localhost",
- "--export-all",
- "--base-path=.",
- "--port=1233"
+ 'daemon',
+ '--verbose',
+ '--listen=localhost',
+ '--export-all',
+ '--base-path=.',
+ '--port=1233'
],
{
- cwd : pkg,
- env : process.env,
- stdio : ["pipe", "pipe", "pipe"]
+ cwd: pkg,
+ env: process.env,
+ stdio: ['pipe', 'pipe', 'pipe']
}
)
- d.stderr.on("data", childFinder)
+ d.stderr.on('data', childFinder)
function childFinder (c) {
var cpid = c.toString().match(/^\[(\d+)\]/)
if (cpid[1]) {
- this.removeListener("data", childFinder)
+ this.removeListener('data', childFinder)
cb(null, [d, cpid[1]])
}
}
}
- var opts = {
- cwd : repo,
- env : process.env
- }
-
- chain(
- [
- git.chainableExec(["init"], opts),
- git.chainableExec(["config", "user.name", "PhantomFaker"], opts),
- git.chainableExec(["config", "user.email", "nope@not.real"], opts),
- git.chainableExec(["add", "package.json"], opts),
- git.chainableExec(["commit", "-m", "stub package"], opts),
+ common.makeGitRepo({
+ path: repo,
+ commands: [
git.chainableExec(
- ["clone", "--bare", repo, "child.git"],
- { cwd : pkg, env : process.env }
+ ['clone', '--bare', repo, 'child.git'],
+ { cwd: pkg, env: process.env }
),
startDaemon
- ],
- cb
- )
+ ]
+ }, cb)
})
}
var resolve = require('path').resolve
var url = require('url')
-var chain = require('slide').chain
var osenv = require('osenv')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
test('cache from repo', function (t) {
process.chdir(pkg)
var addRemoteGit = require('../../lib/cache/add-remote-git.js')
- addRemoteGit(cloneURL, false, function (er, data) {
+ addRemoteGit(cloneURL, function (er, data) {
t.ifError(er, 'cached via git')
t.equal(
url.parse(data._resolved).protocol,
npm.load({ registry: common.registry, loglevel: 'silent' }, function () {
git = require('../../lib/utils/git.js')
- var opts = {
- cwd: repo,
- env: process.env
- }
-
- chain(
- [
- git.chainableExec(['init'], opts),
- git.chainableExec(['config', 'user.name', 'PhantomFaker'], opts),
- git.chainableExec(['config', 'user.email', 'nope@not.real'], opts),
- git.chainableExec(['add', 'package.json'], opts),
- git.chainableExec(['commit', '-m', 'stub package'], opts),
- git.chainableExec(
- ['clone', '--bare', repo, 'child.git'],
- { cwd: pkg, env: process.env }
- )
- ],
- cb
- )
+ common.makeGitRepo({
+ path: repo,
+ commands: [git.chainableExec(
+ ['clone', '--bare', repo, 'child.git'],
+ { cwd: pkg, env: process.env }
+ )]
+ }, cb)
})
}
--- /dev/null
+'use strict'
+var test = require('tap').test
+
+var npm = require('../../lib/npm.js')
+var common = require('../common-tap.js')
+
+test('setup', function (t) {
+ var opts = {
+ registry: common.registry,
+ loglevel: 'silent'
+ }
+ npm.load(opts, function (er) {
+ t.ifError(er, 'npm loaded without error')
+
+ t.end()
+ })
+})
+
+test('add-remote-git#get-resolved git: passthru', function (t) {
+ var getResolved = require('../../lib/cache/add-remote-git.js').getResolved
+
+ verify('git:github.com/foo/repo')
+ verify('git:github.com/foo/repo.git')
+ verify('git://github.com/foo/repo#decadacefadabade')
+ verify('git://github.com/foo/repo.git#decadacefadabade')
+
+ function verify (uri) {
+ t.equal(
+ getResolved(uri, 'decadacefadabade'),
+ 'git://github.com/foo/repo.git#decadacefadabade',
+ uri + ' normalized to canonical form git://github.com/foo/repo.git#decadacefadabade'
+ )
+ }
+ t.end()
+})
+
+test('add-remote-git#get-resolved SSH', function (t) {
+ var getResolved = require('../../lib/cache/add-remote-git.js').getResolved
+
+ t.comment('tests for https://github.com/npm/npm/issues/7961')
+ verify('git@github.com:foo/repo')
+ verify('git@github.com:foo/repo#master')
+ verify('git+ssh://git@github.com/foo/repo#master')
+ verify('git+ssh://git@github.com/foo/repo#decadacefadabade')
+
+ function verify (uri) {
+ t.equal(
+ getResolved(uri, 'decadacefadabade'),
+ 'git+ssh://git@github.com/foo/repo.git#decadacefadabade',
+ uri + ' normalized to canonical form git+ssh://git@github.com/foo/repo.git#decadacefadabade'
+ )
+ }
+ t.end()
+})
+
+test('add-remote-git#get-resolved HTTPS', function (t) {
+ var getResolved = require('../../lib/cache/add-remote-git.js').getResolved
+
+ verify('https://github.com/foo/repo')
+ verify('https://github.com/foo/repo#master')
+ verify('git+https://github.com/foo/repo.git#master')
+ verify('git+https://github.com/foo/repo#decadacefadabade')
+
+ function verify (uri) {
+ t.equal(
+ getResolved(uri, 'decadacefadabade'),
+ 'git+https://github.com/foo/repo.git#decadacefadabade',
+ uri + ' normalized to canonical form git+https://github.com/foo/repo.git#decadacefadabade'
+ )
+ }
+ t.end()
+})
+
+test('add-remote-git#get-resolved edge cases', function (t) {
+ var getResolved = require('../../lib/cache/add-remote-git.js').getResolved
+
+ t.notOk(
+ getResolved('git@bananaboat.com:galbi.git', 'decadacefadabade'),
+ 'non-hosted Git SSH non-URI strings are invalid'
+ )
+
+ t.equal(
+ getResolved('git+ssh://git.bananaboat.net/foo', 'decadacefadabade'),
+ 'git+ssh://git.bananaboat.net/foo#decadacefadabade',
+ 'don\'t break non-hosted SSH URLs'
+ )
+
+ t.equal(
+ getResolved('git://gitbub.com/foo/bar.git', 'decadacefadabade'),
+ 'git://gitbub.com/foo/bar.git#decadacefadabade',
+ 'don\'t break non-hosted git: URLs'
+ )
+
+ t.comment('test for https://github.com/npm/npm/issues/3224')
+ t.equal(
+ getResolved('git+ssh://git@git.example.com:my-repo.git#9abe82cb339a70065e75300f62b742622774693c', 'decadacefadabade'),
+ 'git+ssh://git@git.example.com:my-repo.git#decadacefadabade',
+ 'preserve weird colon in semi-standard ssh:// URLs'
+ )
+ t.end()
+})
var fs = require('fs')
var resolve = require('path').resolve
-var chain = require('slide').chain
var osenv = require('osenv')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
}
}
- var opts = {
- cwd: repo,
- env: process.env
- }
-
- chain(
- [
- git.chainableExec(['init'], opts),
- git.chainableExec(['config', 'user.name', 'PhantomFaker'], opts),
- git.chainableExec(['config', 'user.email', 'nope@not.real'], opts),
- git.chainableExec(['add', 'package.json'], opts),
- git.chainableExec(['commit', '-m', 'stub package'], opts),
+ common.makeGitRepo({
+ path: repo,
+ commands: [
git.chainableExec(
['clone', '--bare', repo, 'child.git'],
{ cwd: pkg, env: process.env }
),
startDaemon
- ],
- cb
- )
+ ]
+ }, cb)
})
}
-var fs = require("fs")
-var resolve = require("path").resolve
+var fs = require('fs')
+var resolve = require('path').resolve
-var chain = require("slide").chain
-var osenv = require("osenv")
-var mkdirp = require("mkdirp")
-var rimraf = require("rimraf")
-var test = require("tap").test
+var osenv = require('osenv')
+var mkdirp = require('mkdirp')
+var rimraf = require('rimraf')
+var test = require('tap').test
-var npm = require("../../lib/npm.js")
-var common = require("../common-tap.js")
+var npm = require('../../lib/npm.js')
+var common = require('../common-tap.js')
-var pkg = resolve(__dirname, "add-remote-git")
-var repo = resolve(__dirname, "add-remote-git-repo")
+var pkg = resolve(__dirname, 'add-remote-git')
+var repo = resolve(__dirname, 'add-remote-git-repo')
var daemon
var daemonPID
var git
-test("setup", function (t) {
+test('setup', function (t) {
bootstrap()
setup(function (er, r) {
- t.ifError(er, "git started up successfully")
+ t.ifError(er, 'git started up successfully')
if (!er) {
daemon = r[r.length - 2]
})
})
-test("install from repo", function (t) {
+test('install from repo', function (t) {
process.chdir(pkg)
- npm.commands.install(".", [], function (er) {
- t.ifError(er, "npm installed via git")
+ npm.commands.install('.', [], function (er) {
+ t.ifError(er, 'npm installed via git')
t.end()
})
})
-test("clean", function (t) {
- daemon.on("close", function () {
+test('clean', function (t) {
+ daemon.on('close', function () {
cleanup()
t.end()
})
})
var pjParent = JSON.stringify({
- name : "parent",
- version : "1.2.3",
- dependencies : {
- "child" : "git://localhost:1234/child.git"
+ name: 'parent',
+ version: '1.2.3',
+ dependencies: {
+ child: 'git://localhost:1234/child.git'
}
-}, null, 2) + "\n"
+}, null, 2) + '\n'
var pjChild = JSON.stringify({
- name : "child",
- version : "1.0.3"
-}, null, 2) + "\n"
+ name: 'child',
+ version: '1.0.3'
+}, null, 2) + '\n'
function bootstrap () {
mkdirp.sync(pkg)
- fs.writeFileSync(resolve(pkg, "package.json"), pjParent)
+ fs.writeFileSync(resolve(pkg, 'package.json'), pjParent)
}
function setup (cb) {
mkdirp.sync(repo)
- fs.writeFileSync(resolve(repo, "package.json"), pjChild)
- npm.load({ registry : common.registry, loglevel : "silent" }, function () {
- git = require("../../lib/utils/git.js")
+ fs.writeFileSync(resolve(repo, 'package.json'), pjChild)
+ npm.load({ registry: common.registry, loglevel: 'silent' }, function () {
+ git = require('../../lib/utils/git.js')
function startDaemon (cb) {
// start git server
var d = git.spawn(
[
- "daemon",
- "--verbose",
- "--listen=localhost",
- "--export-all",
- "--base-path=.",
- "--port=1234"
+ 'daemon',
+ '--verbose',
+ '--listen=localhost',
+ '--export-all',
+ '--base-path=.',
+ '--port=1234'
],
{
- cwd : pkg,
- env : process.env,
- stdio : ["pipe", "pipe", "pipe"]
+ cwd: pkg,
+ env: process.env,
+ stdio: ['pipe', 'pipe', 'pipe']
}
)
- d.stderr.on("data", childFinder)
+ d.stderr.on('data', childFinder)
function childFinder (c) {
var cpid = c.toString().match(/^\[(\d+)\]/)
if (cpid[1]) {
- this.removeListener("data", childFinder)
+ this.removeListener('data', childFinder)
cb(null, [d, cpid[1]])
}
}
}
- var opts = {
- cwd : repo,
- env : process.env
- }
-
- chain(
- [
- git.chainableExec(["init"], opts),
- git.chainableExec(["config", "user.name", "PhantomFaker"], opts),
- git.chainableExec(["config", "user.email", "nope@not.real"], opts),
- git.chainableExec(["add", "package.json"], opts),
- git.chainableExec(["commit", "-m", "stub package"], opts),
+ common.makeGitRepo({
+ path: repo,
+ commands: [
git.chainableExec(
- ["clone", "--bare", repo, "child.git"],
- { cwd : pkg, env : process.env }
+ ['clone', '--bare', repo, 'child.git'],
+ { cwd: pkg, env: process.env }
),
startDaemon
- ],
- cb
- )
+ ]
+ }, cb)
})
}
-var fs = require("fs")
-var path = require("path")
-var mkdirp = require("mkdirp")
-var rimraf = require("rimraf")
-var mr = require("npm-registry-mock")
+var fs = require('fs')
+var path = require('path')
+var mkdirp = require('mkdirp')
+var rimraf = require('rimraf')
+var mr = require('npm-registry-mock')
-var test = require("tap").test
-var common = require("../common-tap.js")
+var test = require('tap').test
+var common = require('../common-tap.js')
-var opts = {cwd : __dirname}
-var pkg = path.resolve(__dirname, "adduser-legacy-auth")
-var outfile = path.resolve(pkg, "_npmrc")
+var opts = { cwd: __dirname }
+var pkg = path.resolve(__dirname, 'adduser-legacy-auth')
+var outfile = path.resolve(pkg, '_npmrc')
-var contents = "_auth=" + new Buffer("u:x").toString("base64") + "\n" +
- "registry=https://nonexistent.lvh.me/registry\n" +
- "email=u@p.me\n"
+var contents = '_auth=' + new Buffer('u:x').toString('base64') + '\n' +
+ 'registry=https://nonexistent.lvh.me/registry\n' +
+ 'email=u@p.me\n'
var responses = {
- "Username" : "u\n",
- "Password" : "p\n",
- "Email" : "u@p.me\n"
+ 'Username': 'u\n',
+ 'Password': 'p\n',
+ 'Email': 'u@p.me\n'
}
function mocks (server) {
server.filteringRequestBody(function (r) {
- if (r.match(/\"_id\":\"org\.couchdb\.user:u\"/)) {
- return "auth"
+ if (r.match(/"_id":"org\.couchdb\.user:u"/)) {
+ return 'auth'
}
})
- server.put("/-/user/org.couchdb.user:u", "auth")
- .reply(409, {"error": "user exists"})
- server.get("/-/user/org.couchdb.user:u?write=true")
- .reply(200, {_rev : "3-deadcafebabebeef"})
- server.put("/-/user/org.couchdb.user:u/-rev/3-deadcafebabebeef", "auth", {"authorization" : "Basic dTpw"})
- .reply(201, {username : "u", password : "p", email : "u@p.me"})
+ server.put('/-/user/org.couchdb.user:u', 'auth')
+ .reply(409, { error: 'user exists' })
+ server.get('/-/user/org.couchdb.user:u?write=true')
+ .reply(200, { _rev: '3-deadcafebabebeef' })
+ server.put(
+ '/-/user/org.couchdb.user:u/-rev/3-deadcafebabebeef',
+ 'auth',
+ { authorization: 'Basic dTpw' }
+ ).reply(201, { username: 'u', password: 'p', email: 'u@p.me' })
}
-test("setup", function (t) {
+test('setup', function (t) {
mkdirp(pkg, function (er) {
- t.ifError(er, pkg + " made successfully")
+ t.ifError(er, pkg + ' made successfully')
fs.writeFile(outfile, contents, function (er) {
- t.ifError(er, "wrote legacy config")
+ t.ifError(er, 'wrote legacy config')
t.end()
})
})
})
-test("npm login", function (t) {
- mr({port : common.port, plugin : mocks}, function (er, s) {
+test('npm login', function (t) {
+ mr({ port: common.port, plugin: mocks }, function (er, s) {
var runner = common.npm(
[
- "login",
- "--registry", common.registry,
- "--loglevel", "silly",
- "--userconfig", outfile
+ 'login',
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ '--userconfig', outfile
],
opts,
- function (err, code) {
- t.notOk(code, "exited OK")
- t.notOk(err, "no error output")
- var config = fs.readFileSync(outfile, "utf8")
- t.like(config, /:always-auth=false/, "always-auth is scoped and false (by default)")
+ function (err, code, stdout, stderr) {
+ t.ifError(err, 'npm ran without issue')
+ t.notOk(code, 'exited OK')
+ t.notOk(stderr, 'no error output')
+ var config = fs.readFileSync(outfile, 'utf8')
+ t.like(config, /:always-auth=false/, 'always-auth is scoped and false (by default)')
s.close()
rimraf(outfile, function (err) {
- t.ifError(err, "removed config file OK")
+ t.ifError(err, 'removed config file OK')
t.end()
})
})
- var o = "", e = "", remaining = Object.keys(responses).length
- runner.stdout.on("data", function (chunk) {
+ var o = '', e = '', remaining = Object.keys(responses).length
+ runner.stdout.on('data', function (chunk) {
remaining--
o += chunk
- var label = chunk.toString("utf8").split(":")[0]
+ var label = chunk.toString('utf8').split(':')[0]
runner.stdin.write(responses[label])
if (remaining === 0) runner.stdin.end()
})
- runner.stderr.on("data", function (chunk) { e += chunk })
+ runner.stderr.on('data', function (chunk) { e += chunk })
})
})
-test("cleanup", function (t) {
- rimraf.sync(outfile)
- t.pass("cleaned up")
+test('cleanup', function (t) {
+ rimraf.sync(pkg)
+ t.pass('cleaned up')
t.end()
})
--- /dev/null
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var requireInject = require('require-inject')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'bitbucket-https-url-with-creds-package')
+
+var json = {
+ name: 'bitbucket-https-url-with-creds-package',
+ version: '0.0.0',
+ dependencies: {
+ 'private': 'git+https://user:pass@bitbucket.org/foo/private.git'
+ }
+}
+
+test('setup', function (t) {
+ setup()
+ t.end()
+})
+
+test('bitbucket-https-url-with-creds-package', function (t) {
+ var cloneUrls = [
+ ['https://user:pass@bitbucket.org/foo/private.git', 'Bitbucket URLs with passwords try only that.']
+ ]
+
+ var npm = requireInject.installGlobally('../../lib/npm.js', {
+ 'child_process': {
+ 'execFile': function (cmd, args, options, cb) {
+ process.nextTick(function () {
+ if (args[0] !== 'clone') return cb(null, '', '')
+ var cloneUrl = cloneUrls.shift()
+ if (cloneUrl) {
+ t.is(args[3], cloneUrl[0], cloneUrl[1])
+ } else {
+ t.fail('too many attempts to clone')
+ }
+ cb(new Error())
+ })
+ }
+ }
+ })
+
+ var opts = {
+ cache: path.resolve(pkg, 'cache'),
+ prefix: pkg,
+ registry: common.registry,
+ loglevel: 'silent'
+ }
+ npm.load(opts, function (er) {
+ t.ifError(er, 'npm loaded without error')
+ npm.commands.install([], function (er) {
+ t.ok(er, 'mocked install failed as expected')
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
--- /dev/null
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var requireInject = require('require-inject')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'bitbucket-https-url-with-creds')
+
+var json = {
+ name: 'bitbucket-https-url-with-creds',
+ version: '0.0.0'
+}
+
+test('setup', function (t) {
+ setup()
+ t.end()
+})
+
+test('bitbucket-https-url-with-creds', function (t) {
+ var cloneUrls = [
+ ['https://user:pass@bitbucket.org/foo/private.git', 'Bitbucket URLs with passwords try only that.']
+ ]
+
+ var npm = requireInject.installGlobally('../../lib/npm.js', {
+ 'child_process': {
+ 'execFile': function (cmd, args, options, cb) {
+ process.nextTick(function () {
+ if (args[0] !== 'clone') return cb(null, '', '')
+ var cloneUrl = cloneUrls.shift()
+ if (cloneUrl) {
+ t.is(args[3], cloneUrl[0], cloneUrl[1])
+ } else {
+ t.fail('too many attempts to clone')
+ }
+ cb(new Error())
+ })
+ }
+ }
+ })
+
+ var opts = {
+ cache: path.resolve(pkg, 'cache'),
+ prefix: pkg,
+ registry: common.registry,
+ loglevel: 'silent'
+ }
+ npm.load(opts, function (er) {
+ t.ifError(er, 'npm loaded without error')
+ npm.commands.install(['git+https://user:pass@bitbucket.org/foo/private.git'], function (er) {
+ t.ok(er, 'mocked install failed as expected')
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
--- /dev/null
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var requireInject = require('require-inject')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'bitbucket-shortcut-package')
+
+var json = {
+ name: 'bitbucket-shortcut-package',
+ version: '0.0.0',
+ dependencies: {
+ 'private': 'bitbucket:foo/private'
+ }
+}
+
+test('setup', function (t) {
+ setup()
+ t.end()
+})
+
+test('bitbucket-shortcut', function (t) {
+ var cloneUrls = [
+ ['git@bitbucket.org:foo/private.git', 'Bitbucket shortcuts try SSH first'],
+ ['https://bitbucket.org/foo/private.git', 'Bitbucket shortcuts try HTTPS URLs second']
+ ]
+
+ var npm = requireInject.installGlobally('../../lib/npm.js', {
+ 'child_process': {
+ 'execFile': function (cmd, args, options, cb) {
+ process.nextTick(function () {
+ if (args[0] !== 'clone') return cb(null, '', '')
+ var cloneUrl = cloneUrls.shift()
+ if (cloneUrl) {
+ t.is(args[3], cloneUrl[0], cloneUrl[1])
+ } else {
+ t.fail('too many attempts to clone')
+ }
+ cb(new Error())
+ })
+ }
+ }
+ })
+
+ var opts = {
+ cache: path.resolve(pkg, 'cache'),
+ prefix: pkg,
+ registry: common.registry,
+ loglevel: 'silent'
+ }
+ npm.load(opts, function (er) {
+ t.ifError(er, 'npm loaded without error')
+ npm.commands.install([], function (er) {
+ t.ok(er, 'mocked install failed as expected')
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
--- /dev/null
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var requireInject = require('require-inject')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'bitbucket-shortcut')
+
+var json = {
+ name: 'bitbucket-shortcut',
+ version: '0.0.0'
+}
+
+test('setup', function (t) {
+ setup()
+ t.end()
+})
+
+test('bitbucket-shortcut', function (t) {
+ var cloneUrls = [
+ ['git@bitbucket.org:foo/private.git', 'Bitbucket shortcuts try SSH first'],
+ ['https://bitbucket.org/foo/private.git', 'Bitbucket shortcuts try HTTPS URLs second']
+ ]
+
+ var npm = requireInject.installGlobally('../../lib/npm.js', {
+ 'child_process': {
+ 'execFile': function (cmd, args, options, cb) {
+ process.nextTick(function () {
+ if (args[0] !== 'clone') return cb(null, '', '')
+ var cloneUrl = cloneUrls.shift()
+ if (cloneUrl) {
+ t.is(args[3], cloneUrl[0], cloneUrl[1])
+ } else {
+ t.fail('too many attempts to clone')
+ }
+ cb(new Error())
+ })
+ }
+ }
+ })
+
+ var opts = {
+ cache: path.resolve(pkg, 'cache'),
+ prefix: pkg,
+ registry: common.registry,
+ loglevel: 'silent'
+ }
+ npm.load(opts, function (er) {
+ t.ifError(er, 'npm loaded without error')
+ npm.commands.install(['bitbucket:foo/private'], function (er) {
+ t.ok(er, 'mocked install failed as expected')
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
-var test = require("tap").test
-var path = require("path")
-var fs = require("fs")
-var rimraf = require("rimraf")
-var mkdirp = require("mkdirp")
-var mr = require("npm-registry-mock")
-var common = require("../common-tap.js")
-var cache = path.resolve(__dirname, "cache-shasum-fork", "CACHE")
-var cwd = path.resolve(__dirname, "cache-shasum-fork", "CWD")
-var server
+var fs = require('graceful-fs')
+var path = require('path')
-// Test for https://github.com/npm/npm/issues/3265
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
-test("mock reg", function (t) {
- rimraf.sync(cache)
- mkdirp.sync(cache)
- rimraf.sync(cwd)
- mkdirp.sync(path.join(cwd, "node_modules"))
- mr({port : common.port}, function (er, s) {
+var common = require('../common-tap.js')
+
+// Install from a tarball that thinks it is underscore@1.5.1
+// (but is actually a fork)
+var forkPath = path.resolve(
+ __dirname, '..', 'fixtures', 'forked-underscore-1.5.1.tgz'
+)
+var pkg = path.resolve(__dirname, 'cache-shasum-fork')
+var cache = path.join(pkg, 'cache')
+var server
+
+test('setup', function (t) {
+ setup()
+ t.comment('test for https://github.com/npm/npm/issues/3265')
+ mr({ port: common.port }, function (er, s) {
server = s
- t.pass("ok")
t.end()
})
})
-test("npm cache - install from fork", function (t) {
- // Install from a tarball that thinks it is underscore@1.5.1
- // (but is actually a fork)
- var forkPath = path.resolve(
- __dirname, "cache-shasum-fork", "underscore-1.5.1.tgz")
- common.npm(["install", forkPath], {
- cwd: cwd,
- env: {
- "npm_config_cache" : cache,
- "npm_config_registry" : common.registry,
- "npm_config_loglevel" : "silent"
- }
- }, function (err, code, stdout, stderr) {
- t.ifErr(err, "install finished without error")
- t.notOk(stderr, "Should not get data on stderr: " + stderr)
- t.equal(code, 0, "install finished successfully")
+test('npm cache - install from fork', function (t) {
+ setup()
+ common.npm(
+ [
+ '--loglevel', 'silent',
+ '--registry', common.registry,
+ 'install', forkPath
+ ],
+ {
+ cwd: pkg,
+ env: { npm_config_cache: cache }
+ },
+ function (err, code, stdout, stderr) {
+ t.ifErr(err, 'install finished without error')
+ t.notOk(stderr, 'Should not get data on stderr: ' + stderr)
+ t.equal(code, 0, 'install finished successfully')
- t.equal(stdout, "underscore@1.5.1 node_modules/underscore\n")
- var index = fs.readFileSync(
- path.join(cwd, "node_modules", "underscore", "index.js"),
- "utf8"
- )
- t.equal(index, 'console.log("This is the fork");\n\n')
- t.end()
- })
+ t.equal(stdout, 'underscore@1.5.1 node_modules/underscore\n')
+ var index = fs.readFileSync(
+ path.join(pkg, 'node_modules', 'underscore', 'index.js'),
+ 'utf8'
+ )
+ t.equal(index, 'console.log("This is the fork");\n\n')
+ t.end()
+ }
+ )
})
-test("npm cache - install from origin", function (t) {
- // Now install the real 1.5.1.
- rimraf.sync(path.join(cwd, "node_modules"))
- mkdirp.sync(path.join(cwd, "node_modules"))
- common.npm(["install", "underscore"], {
- cwd: cwd,
- env: {
- "npm_config_cache" : cache,
- "npm_config_registry" : common.registry,
- "npm_config_loglevel" : "silent"
- }
- }, function (err, code, stdout, stderr) {
- t.ifErr(err, "install finished without error")
- t.equal(code, 0, "install finished successfully")
- t.notOk(stderr, "Should not get data on stderr: " + stderr)
- t.equal(stdout, "underscore@1.5.1 node_modules/underscore\n")
- var index = fs.readFileSync(
- path.join(cwd, "node_modules", "underscore", "index.js"),
- "utf8"
- )
- t.equal(index, "module.exports = require('./underscore');\n")
- t.end()
- })
+// Now install the real 1.5.1.
+test('npm cache - install from origin', function (t) {
+ setup()
+ common.npm(
+ [
+ '--loglevel', 'silent',
+ '--registry', common.registry,
+ 'install', 'underscore'
+ ],
+ {
+ cwd: pkg,
+ env: { npm_config_cache: cache }
+ },
+ function (err, code, stdout, stderr) {
+ t.ifErr(err, 'install finished without error')
+ t.equal(code, 0, 'install finished successfully')
+ t.notOk(stderr, 'Should not get data on stderr: ' + stderr)
+ t.equal(stdout, 'underscore@1.5.1 node_modules/underscore\n')
+ var index = fs.readFileSync(
+ path.join(pkg, 'node_modules', 'underscore', 'index.js'),
+ 'utf8'
+ )
+ t.equal(index, 'module.exports = require(\'./underscore\');\n')
+ t.end()
+ }
+ )
})
-test("cleanup", function (t) {
+test('cleanup', function (t) {
server.close()
- rimraf.sync(cache)
- rimraf.sync(cwd)
+ cleanup()
t.end()
})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
+
+function setup () {
+ mkdirp.sync(cache)
+ mkdirp.sync(path.join(pkg, 'node_modules'))
+ process.chdir(pkg)
+}
-var test = require("tap").test
- , fs = require("fs")
- , path = require("path")
- , existsSync = fs.existsSync || path.existsSync
- , npm = require("../../")
- , rimraf = require("rimraf")
- , osenv = require("osenv")
- , mr = require("npm-registry-mock")
- , common = require("../common-tap.js")
- , server
-
-var pkg = path.resolve(__dirname, "circular-dep")
-
-test("installing a package that depends on the current package", function (t) {
- t.plan(1)
+var fs = require('graceful-fs')
+var path = require('path')
+var existsSync = fs.existsSync || path.existsSync
+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.resolve(__dirname, 'circular-dep')
+var minimist = path.join(pkg, 'minimist')
+
+var EXEC_OPTS = {
+ cwd: path.join(pkg, 'minimist/node_modules'),
+ npm_config_cache: path.join(pkg, 'cache')
+}
+
+var json = {
+ name: 'minimist',
+ version: '0.0.5',
+ dependencies: {
+ optimist: '0.6.0'
+ }
+}
+
+test('setup', function (t) {
+ t.comment('test for https://github.com/npm/npm/issues/4312')
setup(function () {
- npm.install("optimist", function (err) {
- if (err) return t.fail(err)
- npm.dedupe(function (err) {
- if (err) return t.fail(err)
- t.ok(existsSync(path.resolve(pkg,
- "minimist", "node_modules", "optimist",
- "node_modules", "minimist"
- )), "circular dependency uncircled")
- cleanup()
- server.close()
- })
- })
+ t.end()
})
})
+test('installing a package that depends on the current package', function (t) {
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ 'install', 'optimist'
+ ],
+ EXEC_OPTS,
+ function (err, code, stdout, stderr) {
+ t.ifError(err, 'npm ran without issue')
+ t.notOk(code, 'npm ran without raising an error code')
+ t.notOk(stderr, 'no error output')
+
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ 'dedupe'
+ ],
+ EXEC_OPTS,
+ function (err, code, stdout, stderr) {
+ t.ifError(err, 'npm ran without issue')
+ t.notOk(code, 'npm ran without raising an error code')
+ t.notOk(stderr, 'no error output')
+
+ t.ok(existsSync(path.resolve(
+ minimist,
+ 'node_modules', 'optimist',
+ 'node_modules', 'minimist'
+ )), 'circular dependency uncircled')
+ t.end()
+ }
+ )
+ }
+ )
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ server.close()
+ t.end()
+})
+
function setup (cb) {
cleanup()
- process.chdir(path.resolve(pkg, "minimist"))
+ mkdirp.sync(minimist)
+ fs.writeFileSync(
+ path.join(minimist, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(path.resolve(pkg, 'minimist'))
- fs.mkdirSync(path.resolve(pkg, "minimist/node_modules"))
- mr({port : common.port}, function (er, s) {
+ fs.mkdirSync(path.resolve(pkg, 'minimist/node_modules'))
+ mr({ port: common.port }, function (er, s) {
server = s
- npm.load({
- loglevel: "silent",
- registry: common.registry,
- cache: path.resolve(pkg, "cache")
- }, cb)
+ cb()
})
}
-function cleanup() {
+function cleanup () {
process.chdir(osenv.tmpdir())
- rimraf.sync(path.resolve(pkg, "minimist/node_modules"))
- rimraf.sync(path.resolve(pkg, "cache"))
+ rimraf.sync(pkg)
}
+++ /dev/null
-{
- "name": "minimist",
- "version": "0.0.5",
- "dependencies": {
- "optimist": "0.6.0"
- }
-}
-var test = require("tap").test
- , fs = require("fs")
- , path = require("path")
- , existsSync = fs.existsSync || path.existsSync
- , rimraf = require("rimraf")
- , mr = require("npm-registry-mock")
- , common = require("../common-tap.js")
-
-var EXEC_OPTS = {}
-
-test("dedupe finds the common module and moves it up one level", function (t) {
- setup(function (s) {
+var fs = require('graceful-fs')
+var path = require('path')
+var existsSync = fs.existsSync || path.existsSync
+
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+var server
+
+var pkg = path.join(__dirname, 'dedupe')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ author: 'Dedupe tester',
+ name: 'dedupe',
+ version: '0.0.0',
+ dependencies: {
+ optimist: '0.6.0',
+ clean: '2.1.6'
+ }
+}
+
+test('setup', function (t) {
+ t.comment('test for https://github.com/npm/npm/issues/4675')
+ setup(function () {
+ t.end()
+ })
+})
+
+test('dedupe finds the common module and moves it up one level', function (t) {
+ common.npm(
+ [
+ '--registry', common.registry,
+ 'install', '.'
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifError(err, 'successfully installed directory')
+ t.equal(code, 0, 'npm install exited with code')
common.npm(
- [
- "install", ".",
- "--registry", common.registry
- ],
- EXEC_OPTS,
- function (err, code) {
- t.ifError(err, "successfully installed directory")
- t.equal(code, 0, "npm install exited with code")
- common.npm(["dedupe"], {}, function (err, code) {
- t.ifError(err, "successfully deduped against previous install")
- t.notOk(code, "npm dedupe exited with code")
- t.ok(existsSync(path.join(__dirname, "dedupe", "node_modules", "minimist")))
- t.ok(!existsSync(path.join(__dirname, "dedupe", "node_modules", "checker")))
- s.close() // shutdown mock registry.
+ [
+ 'dedupe'
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifError(err, 'successfully deduped against previous install')
+ t.notOk(code, 'npm dedupe exited with code')
+
+ t.ok(existsSync(path.join(pkg, 'node_modules', 'minimist')))
+ t.notOk(existsSync(path.join(pkg, 'node_modules', 'checker')))
+
t.end()
- })
- })
+ }
+ )
})
})
+test('cleanup', function (t) {
+ server.close()
+ cleanup()
+
+ t.end()
+})
+
+function cleanup () {
+ rimraf.sync(pkg)
+}
+
function setup (cb) {
- process.chdir(path.join(__dirname, "dedupe"))
- mr({port : common.port}, function (er, s) { // create mock registry.
- rimraf.sync(path.join(__dirname, "dedupe", "node_modules"))
- fs.mkdirSync(path.join(__dirname, "dedupe", "node_modules"))
- cb(s)
+ cleanup()
+ mkdirp.sync(path.join(pkg, 'node_modules'))
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+
+ mr({ port: common.port }, function (er, s) {
+ server = s
+ cb()
})
}
+++ /dev/null
-{
- "author": "Dedupe tester",
- "name": "dedupe",
- "version": "0.0.0",
- "dependencies": {
- "optimist": "0.6.0",
- "clean": "2.1.6"
- }
-}
--- /dev/null
+// this is a test for fix #2538
+
+// the false_name-test-package has the name property 'test-package' set
+// in the package.json and a dependency named 'test-package' is also a
+// defined dependency of 'test-package-with-one-dep'.
+//
+// this leads to a conflict during installation and the fix is covered
+// by this test
+
+var fs = require('graceful-fs')
+var path = require('path')
+var existsSync = fs.existsSync || path.existsSync
+
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.join(__dirname, 'false-name')
+var cache = path.join(pkg, 'cache')
+var server
+
+var EXEC_OPTS = { cwd: pkg }
+
+var indexContent = 'module.exports = true\n'
+var json = {
+ name: 'test-package',
+ version: '0.0.0',
+ main: 'index.js',
+ dependencies: {
+ 'test-package-with-one-dep': '0.0.0'
+ }
+}
+
+test('setup', function (t) {
+ t.comment('test for https://github.com/npm/npm/issues/2538')
+ setup()
+ mr({ port: common.port }, function (er, s) {
+ server = s
+ t.end()
+ })
+})
+
+test('not every pkg.name can be required', function (t) {
+ common.npm(
+ [
+ 'install', '.',
+ '--cache', cache,
+ '--registry', common.registry
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifErr(err, 'install finished without error')
+ t.equal(code, 0, 'install exited ok')
+ t.ok(existsSync(path.join(
+ pkg,
+ 'node_modules/test-package-with-one-dep',
+ 'node_modules/test-package'
+ )), 'package installed OK')
+ t.end()
+ }
+ )
+})
+
+test('cleanup', function (t) {
+ server.close()
+ cleanup()
+ t.end()
+})
+
+function cleanup () {
+ rimraf.sync(pkg)
+}
+
+function setup () {
+ cleanup()
+ mkdirp.sync(cache)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ fs.writeFileSync(path.join(pkg, 'index.js'), indexContent)
+}
+++ /dev/null
-// this is a test for fix #2538
-
-// the false_name-test-package has the name property "test-package" set
-// in the package.json and a dependency named "test-package" is also a
-// defined dependency of "test-package-with-one-dep".
-//
-// this leads to a conflict during installation and the fix is covered
-// by this test
-
-var test = require("tap").test
- , fs = require("fs")
- , path = require("path")
- , existsSync = fs.existsSync || path.existsSync
- , rimraf = require("rimraf")
- , common = require("../common-tap.js")
- , mr = require("npm-registry-mock")
- , pkg = path.resolve(__dirname, "false_name")
- , cache = path.resolve(pkg, "cache")
- , nodeModules = path.resolve(pkg, "node_modules")
-
-var EXEC_OPTS = { cwd: pkg }
-
-test("setup", function(t) {
- cleanup()
- fs.mkdirSync(nodeModules)
- t.end()
-})
-
-test("not every pkg.name can be required", function (t) {
- t.plan(3)
- mr({port : common.port}, function (er, s) {
- common.npm([
- "install", ".",
- "--cache", cache,
- "--registry", common.registry
- ], EXEC_OPTS, function (err, code) {
- s.close()
- t.ifErr(err, "install finished without error")
- t.equal(code, 0, "install exited ok")
- t.ok(existsSync(path.resolve(pkg,
- "node_modules/test-package-with-one-dep",
- "node_modules/test-package")))
- })
- })
-})
-
-function cleanup() {
- rimraf.sync(cache)
- rimraf.sync(nodeModules)
-}
-
-test("cleanup", function (t) {
- cleanup()
- t.end()
-})
+++ /dev/null
-module.exports = true
+++ /dev/null
-{
- "name": "test-package",
- "version": "0.0.0",
- "main": "index.js",
- "dependencies": {
- "test-package-with-one-dep": "0.0.0"
- }
-}
--- /dev/null
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var requireInject = require('require-inject')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'gist-short-shortcut-package')
+
+var json = {
+ name: 'gist-short-shortcut-package',
+ version: '0.0.0',
+ dependencies: {
+ 'private-gist': 'gist:deadbeef'
+ }
+}
+
+test('setup', function (t) {
+ setup()
+ t.end()
+})
+
+test('gist-short-shortcut-package', function (t) {
+ var cloneUrls = [
+ ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'],
+ ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'],
+ ['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH third']
+ ]
+ var npm = requireInject.installGlobally('../../lib/npm.js', {
+ 'child_process': {
+ 'execFile': function (cmd, args, options, cb) {
+ process.nextTick(function () {
+ if (args[0] !== 'clone') return cb(null, '', '')
+ var cloneUrl = cloneUrls.shift()
+ if (cloneUrl) {
+ t.is(args[3], cloneUrl[0], cloneUrl[1])
+ } else {
+ t.fail('too many attempts to clone')
+ }
+ cb(new Error())
+ })
+ }
+ }
+ })
+
+ var opts = {
+ cache: path.resolve(pkg, 'cache'),
+ prefix: pkg,
+ registry: common.registry,
+ loglevel: 'silent'
+ }
+ npm.load(opts, function (er) {
+ t.ifError(er, 'npm loaded without error')
+ npm.commands.install([], function (er, result) {
+ t.ok(er, 'mocked install failed as expected')
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
--- /dev/null
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var requireInject = require('require-inject')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'gist-short-shortcut')
+
+var json = {
+ name: 'gist-short-shortcut',
+ version: '0.0.0'
+}
+
+test('setup', function (t) {
+ setup()
+ t.end()
+})
+
+test('gist-shortcut', function (t) {
+ var cloneUrls = [
+ ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'],
+ ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'],
+ ['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH third']
+ ]
+ var npm = requireInject.installGlobally('../../lib/npm.js', {
+ 'child_process': {
+ 'execFile': function (cmd, args, options, cb) {
+ process.nextTick(function () {
+ if (args[0] !== 'clone') return cb(null, '', '')
+ var cloneUrl = cloneUrls.shift()
+ if (cloneUrl) {
+ t.is(args[3], cloneUrl[0], cloneUrl[1])
+ } else {
+ t.fail('too many attempts to clone')
+ }
+ cb(new Error())
+ })
+ }
+ }
+ })
+
+ var opts = {
+ cache: path.resolve(pkg, 'cache'),
+ prefix: pkg,
+ registry: common.registry,
+ loglevel: 'silent'
+ }
+ npm.load(opts, function (er) {
+ t.ifError(er, 'npm loaded without error')
+ npm.commands.install(['gist:deadbeef'], function (er, result) {
+ t.ok(er, 'mocked install failed as expected')
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
--- /dev/null
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var requireInject = require('require-inject')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'gist-shortcut-package')
+
+var json = {
+ name: 'gist-shortcut-package',
+ version: '0.0.0',
+ dependencies: {
+ 'private-gist': 'gist:foo/deadbeef'
+ }
+}
+
+test('setup', function (t) {
+ setup()
+ t.end()
+})
+
+test('gist-shortcut-package', function (t) {
+ var cloneUrls = [
+ ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'],
+ ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'],
+ ['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH third']
+ ]
+ var npm = requireInject.installGlobally('../../lib/npm.js', {
+ 'child_process': {
+ 'execFile': function (cmd, args, options, cb) {
+ process.nextTick(function () {
+ if (args[0] !== 'clone') return cb(null, '', '')
+ var cloneUrl = cloneUrls.shift()
+ if (cloneUrl) {
+ t.is(args[3], cloneUrl[0], cloneUrl[1])
+ } else {
+ t.fail('too many attempts to clone')
+ }
+ cb(new Error())
+ })
+ }
+ }
+ })
+
+ var opts = {
+ cache: path.resolve(pkg, 'cache'),
+ prefix: pkg,
+ registry: common.registry,
+ loglevel: 'silent'
+ }
+ npm.load(opts, function (er) {
+ t.ifError(er, 'npm loaded without error')
+ npm.commands.install([], function (er, result) {
+ t.ok(er, 'mocked install failed as expected')
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
--- /dev/null
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var requireInject = require('require-inject')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'gist-shortcut')
+
+var json = {
+ name: 'gist-shortcut',
+ version: '0.0.0'
+}
+
+test('setup', function (t) {
+ setup()
+ t.end()
+})
+
+test('gist-shortcut', function (t) {
+ var cloneUrls = [
+ ['git://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try git URLs first'],
+ ['https://gist.github.com/deadbeef.git', 'GitHub gist shortcuts try HTTPS URLs second'],
+ ['git@gist.github.com:/deadbeef.git', 'GitHub gist shortcuts try SSH third']
+ ]
+ var npm = requireInject.installGlobally('../../lib/npm.js', {
+ 'child_process': {
+ 'execFile': function (cmd, args, options, cb) {
+ process.nextTick(function () {
+ if (args[0] !== 'clone') return cb(null, '', '')
+ var cloneUrl = cloneUrls.shift()
+ if (cloneUrl) {
+ t.is(args[3], cloneUrl[0], cloneUrl[1])
+ } else {
+ t.fail('too many attempts to clone')
+ }
+ cb(new Error())
+ })
+ }
+ }
+ })
+
+ var opts = {
+ cache: path.resolve(pkg, 'cache'),
+ prefix: pkg,
+ registry: common.registry,
+ loglevel: 'silent'
+ }
+ npm.load(opts, function (er) {
+ t.ifError(er, 'npm loaded without error')
+ npm.commands.install(['gist:foo/deadbeef'], function (er, result) {
+ t.ok(er, 'mocked install failed as expected')
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
-var test = require("tap").test
- , common = require("../common-tap")
- , path = require("path")
- , rimraf = require("rimraf")
- , mkdirp = require("mkdirp")
- , pkg = path.resolve(__dirname, "git-cache-locking")
- , tmp = path.join(pkg, "tmp")
- , cache = path.join(pkg, "cache")
+var test = require('tap').test
+var common = require('../common-tap')
+var path = require('path')
+var rimraf = require('rimraf')
+var mkdirp = require('mkdirp')
+var pkg = path.resolve(__dirname, 'git-cache-locking')
+var tmp = path.join(pkg, 'tmp')
+var cache = path.join(pkg, 'cache')
-
-test("setup", function (t) {
+test('setup', function (t) {
rimraf.sync(pkg)
- mkdirp.sync(path.resolve(pkg, "node_modules"))
+ mkdirp.sync(path.resolve(pkg, 'node_modules'))
t.end()
})
-test("git-cache-locking: install a git dependency", function (t) {
-
+test('git-cache-locking: install a git dependency', function (t) {
// disable git integration tests on Travis.
if (process.env.TRAVIS) return t.end()
// package c depends on a.git#master and b.git#master
// package b depends on a.git#master
common.npm([
- "install",
- "git://github.com/nigelzor/npm-4503-c.git"
+ 'install',
+ 'git://github.com/nigelzor/npm-4503-c.git'
], {
cwd: pkg,
env: {
- "npm_config_cache": cache,
- "npm_config_tmp": tmp,
- "npm_config_prefix": pkg,
- "npm_config_global": "false",
+ npm_config_cache: cache,
+ npm_config_tmp: tmp,
+ npm_config_prefix: pkg,
+ npm_config_global: 'false',
HOME: process.env.HOME,
Path: process.env.PATH,
PATH: process.env.PATH
}
- }, function (err, code) {
- t.ifErr(err, "npm install finished without error")
- t.equal(0, code, "npm install should succeed")
+ }, function (err, code, stdout, stderr) {
+ t.ifErr(err, 'npm install finished without error')
+ t.equal(0, code, 'npm install should succeed')
t.end()
})
})
-test("cleanup", function(t) {
+test('cleanup', function (t) {
rimraf.sync(pkg)
t.end()
})
var fs = require('fs')
var resolve = require('path').resolve
-var chain = require('slide').chain
var osenv = require('osenv')
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')
}
}
- var opts = {
- cwd: repo,
- env: process.env
- }
-
- chain(
- [
- git.chainableExec(['init'], opts),
- git.chainableExec(['config', 'user.name', 'PhantomFaker'], opts),
- git.chainableExec(['config', 'user.email', 'nope@not.real'], opts),
- git.chainableExec(['add', 'package.json'], opts),
- git.chainableExec(['commit', '-m', 'stub package'], opts),
+ common.makeGitRepo({
+ path: repo,
+ commands: [
git.chainableExec(
['clone', '--bare', repo, 'child.git'],
{ cwd: pkg, env: process.env }
),
startDaemon
- ],
- cb
- )
+ ]
+ }, cb)
})
}
--- /dev/null
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var requireInject = require('require-inject')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'github-shortcut-package')
+
+var json = {
+ name: 'github-shortcut-package',
+ version: '0.0.0',
+ dependencies: {
+ 'private': 'foo/private'
+ }
+}
+
+test('setup', function (t) {
+ setup()
+ t.end()
+})
+
+test('github-shortcut-package', function (t) {
+ var cloneUrls = [
+ ['git://github.com/foo/private.git', 'GitHub shortcuts try git URLs first'],
+ ['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs second'],
+ ['git@github.com:foo/private.git', 'GitHub shortcuts try SSH third']
+ ]
+ var npm = requireInject.installGlobally('../../lib/npm.js', {
+ 'child_process': {
+ 'execFile': function (cmd, args, options, cb) {
+ process.nextTick(function () {
+ if (args[0] !== 'clone') return cb(null, '', '')
+ var cloneUrl = cloneUrls.shift()
+ if (cloneUrl) {
+ t.is(args[3], cloneUrl[0], cloneUrl[1])
+ } else {
+ t.fail('too many attempts to clone')
+ }
+ cb(new Error())
+ })
+ }
+ }
+ })
+
+ var opts = {
+ cache: path.resolve(pkg, 'cache'),
+ prefix: pkg,
+ registry: common.registry,
+ loglevel: 'silent'
+ }
+ npm.load(opts, function (er) {
+ t.ifError(er, 'npm loaded without error')
+ npm.commands.install([], function (er, result) {
+ t.ok(er, 'mocked install failed as expected')
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
var requireInject = require('require-inject')
+var rimraf = require('rimraf')
var test = require('tap').test
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'github-shortcut')
+
+var json = {
+ name: 'github-shortcut',
+ version: '0.0.0'
+}
+
+test('setup', function (t) {
+ setup()
+ t.end()
+})
+
test('github-shortcut', function (t) {
var cloneUrls = [
- ['git://github.com/foo/private.git', 'github shortcuts try git:// first'],
- ['ssh://git@github.com/foo/private.git', 'github shortcuts try ssh:// urls second']
+ ['git://github.com/foo/private.git', 'GitHub shortcuts try git URLs first'],
+ ['https://github.com/foo/private.git', 'GitHub shortcuts try HTTPS URLs third'],
+ ['git@github.com:foo/private.git', 'GitHub shortcuts try SSH second']
]
var npm = requireInject.installGlobally('../../lib/npm.js', {
'child_process': {
}
})
- npm.load({loglevel: 'silent'}, function () {
+ var opts = {
+ cache: path.resolve(pkg, 'cache'),
+ prefix: pkg,
+ registry: common.registry,
+ loglevel: 'silent'
+ }
+ npm.load(opts, function (er) {
+ t.ifError(er, 'npm loaded without error')
npm.commands.install(['foo/private'], function (er, result) {
+ t.ok(er, 'mocked install failed as expected')
t.end()
})
})
})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
--- /dev/null
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var requireInject = require('require-inject')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'gitlab-shortcut-package')
+
+var json = {
+ name: 'gitlab-shortcut-package',
+ version: '0.0.0',
+ dependencies: {
+ 'private': 'gitlab:foo/private'
+ }
+}
+
+test('setup', function (t) {
+ setup()
+ t.end()
+})
+
+test('gitlab-shortcut-package', function (t) {
+ var cloneUrls = [
+ ['git@gitlab.com:foo/private.git', 'GitLab shortcuts try SSH first'],
+ ['https://gitlab.com/foo/private.git', 'GitLab shortcuts try HTTPS URLs second']
+ ]
+ var npm = requireInject.installGlobally('../../lib/npm.js', {
+ 'child_process': {
+ 'execFile': function (cmd, args, options, cb) {
+ process.nextTick(function () {
+ if (args[0] !== 'clone') return cb(null, '', '')
+ var cloneUrl = cloneUrls.shift()
+ if (cloneUrl) {
+ t.is(args[3], cloneUrl[0], cloneUrl[1])
+ } else {
+ t.fail('too many attempts to clone')
+ }
+ cb(new Error())
+ })
+ }
+ }
+ })
+
+ var opts = {
+ cache: path.resolve(pkg, 'cache'),
+ prefix: pkg,
+ registry: common.registry,
+ loglevel: 'silent'
+ }
+ npm.load(opts, function (er) {
+ t.ifError(er, 'npm loaded without error')
+ npm.commands.install([], function (er, result) {
+ t.ok(er, 'mocked install failed as expected')
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
--- /dev/null
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var requireInject = require('require-inject')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'gitlab-shortcut')
+
+var json = {
+ name: 'gitlab-shortcut',
+ version: '0.0.0'
+}
+
+test('setup', function (t) {
+ setup()
+ t.end()
+})
+
+test('gitlab-shortcut', function (t) {
+ var cloneUrls = [
+ ['git@gitlab.com:foo/private.git', 'GitLab shortcuts try SSH first'],
+ ['https://gitlab.com/foo/private.git', 'GitLab shortcuts try HTTPS URLs second']
+ ]
+ var npm = requireInject.installGlobally('../../lib/npm.js', {
+ 'child_process': {
+ 'execFile': function (cmd, args, options, cb) {
+ process.nextTick(function () {
+ if (args[0] !== 'clone') return cb(null, '', '')
+ var cloneUrl = cloneUrls.shift()
+ if (cloneUrl) {
+ t.is(args[3], cloneUrl[0], cloneUrl[1])
+ } else {
+ t.fail('too many attempts to clone')
+ }
+ cb(new Error())
+ })
+ }
+ }
+ })
+
+ var opts = {
+ cache: path.resolve(pkg, 'cache'),
+ prefix: pkg,
+ registry: common.registry,
+ loglevel: 'silent'
+ }
+ npm.load(opts, function (er) {
+ t.ifError(er, 'npm loaded without error')
+ npm.commands.install(['gitlab:foo/private'], function (er, result) {
+ t.ok(er, 'mocked install failed as expected')
+ t.end()
+ })
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
-var common = require("../common-tap")
-var test = require("tap").test
-var path = require("path")
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap')
// ignore-scripts/package.json has scripts that always exit with non-zero error
-// codes. The "install" script is omitted so that npm tries to run node-gyp,
-// which should also fail.
-var pkg = path.resolve(__dirname, "ignore-scripts")
+// codes.
+var pkg = path.resolve(__dirname, 'ignore-scripts')
+
+var gypfile = 'bad_binding_file\n'
+var json = {
+ author: 'Milton the Aussie',
+ name: 'ignore-scripts',
+ version: '0.0.0',
+ scripts: {
+ prepublish: 'exit 123',
+ publish: 'exit 123',
+ postpublish: 'exit 123',
+ preinstall: 'exit 123',
+ install: 'exit 123',
+ postinstall: 'exit 123',
+ preuninstall: 'exit 123',
+ uninstall: 'exit 123',
+ postuninstall: 'exit 123',
+ pretest: 'exit 123',
+ test: 'exit 123',
+ posttest: 'exit 123',
+ prestop: 'exit 123',
+ stop: 'exit 123',
+ poststop: 'exit 123',
+ prestart: 'exit 123',
+ start: 'exit 123',
+ poststart: 'exit 123',
+ prerestart: 'exit 123',
+ restart: 'exit 123',
+ postrestart: 'exit 123'
+ }
+}
+
+test('setup', function (t) {
+ setup()
+ t.end()
+})
-test("ignore-scripts: install using the option", function (t) {
- createChild(["install", "--ignore-scripts"], function (err, code) {
- t.ifError(err, "install with scripts ignored finished successfully")
- t.equal(code, 0, "npm install exited with code")
+test('ignore-scripts: install using the option', function (t) {
+ createChild(['install', '--ignore-scripts'], function (err, code) {
+ t.ifError(err, 'install with scripts ignored finished successfully')
+ t.equal(code, 0, 'npm install exited with code')
t.end()
})
})
-test("ignore-scripts: install NOT using the option", function (t) {
- createChild(["install"], function (err, code) {
- t.ifError(err, "install with scripts successful")
- t.notEqual(code, 0, "npm install exited with code")
+test('ignore-scripts: install NOT using the option', function (t) {
+ createChild(['install'], function (err, code) {
+ t.ifError(err, 'install with scripts successful')
+ t.notEqual(code, 0, 'npm install exited with code')
t.end()
})
})
var scripts = [
- "prepublish", "publish", "postpublish",
- "preinstall", "install", "postinstall",
- "preuninstall", "uninstall", "postuninstall",
- "pretest", "test", "posttest",
- "prestop", "stop", "poststop",
- "prestart", "start", "poststart",
- "prerestart", "restart", "postrestart"
+ 'prepublish', 'publish', 'postpublish',
+ 'preinstall', 'install', 'postinstall',
+ 'preuninstall', 'uninstall', 'postuninstall',
+ 'pretest', 'test', 'posttest',
+ 'prestop', 'stop', 'poststop',
+ 'prestart', 'start', 'poststart',
+ 'prerestart', 'restart', 'postrestart'
]
scripts.forEach(function (script) {
- test("ignore-scripts: run-script "+script+" using the option", function (t) {
- createChild(["--ignore-scripts", "run-script", script], function (err, code) {
- t.ifError(err, "run-script " + script + " with ignore-scripts successful")
- t.equal(code, 0, "npm run-script exited with code")
+ test('ignore-scripts: run-script ' + script + ' using the option', function (t) {
+ createChild(['--ignore-scripts', 'run-script', script], function (err, code, stdout, stderr) {
+ t.ifError(err, 'run-script ' + script + ' with ignore-scripts successful')
+ t.equal(code, 0, 'npm run-script exited with code')
t.end()
})
})
})
scripts.forEach(function (script) {
- test("ignore-scripts: run-script "+script+" NOT using the option", function (t) {
- createChild(["run-script", script], function (err, code) {
- t.ifError(err, "run-script " + script + " finished successfully")
- t.notEqual(code, 0, "npm run-script exited with code")
+ test('ignore-scripts: run-script ' + script + ' NOT using the option', function (t) {
+ createChild(['run-script', script], function (err, code) {
+ t.ifError(err, 'run-script ' + script + ' finished successfully')
+ t.notEqual(code, 0, 'npm run-script exited with code')
t.end()
})
})
})
-function createChild (args, cb) {
- var env = {
- HOME: process.env.HOME,
- Path: process.env.PATH,
- PATH: process.env.PATH,
- "npm_config_loglevel": "silent"
- }
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
- if (process.platform === "win32")
- env.npm_config_cache = "%APPDATA%\\npm-cache"
+function cleanup () {
+ rimraf.sync(pkg)
+}
- return common.npm(args, {
- cwd: pkg,
- stdio: "inherit",
- env: env
- }, cb)
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(path.join(pkg, 'binding.gyp'), gypfile)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+}
+
+function createChild (args, cb) {
+ return common.npm(
+ args.concat(['--loglevel', 'silent']),
+ { cwd: pkg },
+ cb
+ )
}
+++ /dev/null
-bad_binding_file
+++ /dev/null
-{
- "author": "Milton the Aussie",
- "name": "ignore-scripts",
- "version": "0.0.0",
- "scripts": {
- "prepublish": "exit 123",
- "publish": "exit 123",
- "postpublish": "exit 123",
- "preinstall": "exit 123",
- "postinstall": "exit 123",
- "preuninstall": "exit 123",
- "install": "exit 123",
- "uninstall": "exit 123",
- "postuninstall": "exit 123",
- "pretest": "exit 123",
- "test": "exit 123",
- "posttest": "exit 123",
- "prestop": "exit 123",
- "stop": "exit 123",
- "poststop": "exit 123",
- "prestart": "exit 123",
- "start": "exit 123",
- "poststart": "exit 123",
- "prerestart": "exit 123",
- "restart": "exit 123",
- "postrestart": "exit 123"
- }
-}
-var common = require("../common-tap.js")
-var test = require("tap").test
-var pkg = require("path").join(__dirname,"ignore-shrinkwrap")
+var fs = require('graceful-fs')
+var path = require('path')
-var mr = require("npm-registry-mock")
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var rimraf = require('rimraf')
+var test = require('tap').test
-var spawn = require("child_process").spawn
-var npm = require.resolve("../../bin/npm-cli.js")
-var node = process.execPath
+var common = require('../common-tap.js')
+
+var pkg = require('path').join(__dirname, 'ignore-shrinkwrap')
+
+var EXEC_OPTS = { cwd: pkg }
var customMocks = {
- "get": {
- "/package.js": [200, {"ente" : true}],
- "/shrinkwrap.js": [200, {"ente" : true}]
+ 'get': {
+ '/package.js': [200, { ente: true }],
+ '/shrinkwrap.js': [200, { ente: true }]
+ }
+}
+
+var json = {
+ author: 'Rocko Artischocko',
+ name: 'ignore-shrinkwrap',
+ version: '0.0.0',
+ dependencies: {
+ 'npm-test-ignore-shrinkwrap-file': 'http://localhost:1337/package.js'
+ }
+}
+
+var shrinkwrap = {
+ name: 'ignore-shrinkwrap',
+ version: '0.0.0',
+ dependencies: {
+ 'npm-test-ignore-shrinkwrap-file': {
+ version: '1.2.3',
+ from: 'http://localhost:1337/shrinkwrap.js',
+ resolved: 'http://localhost:1337/shrinkwrap.js',
+ dependencies: {
+ opener: {
+ version: '1.3.0',
+ from: 'opener@1.3.0'
+ }
+ }
+ }
}
}
-test("ignore-shrinkwrap: using the option", function (t) {
- mr({port: common.port, mocks: customMocks}, function (err, s) {
- s._server.on("request", function (req) {
+test('setup', function (t) {
+ setup()
+ t.end()
+})
+
+test('npm install --no-shrinkwrap', function (t) {
+ mr({ port: common.port, mocks: customMocks }, function (err, s) {
+ t.ifError(err, 'mock registry bootstrapped without issue')
+ s._server.on('request', function (req) {
switch (req.url) {
- case "/shrinkwrap.js":
- t.fail()
+ case '/shrinkwrap.js':
+ t.fail('npm-shrinkwrap.json used instead of package.json')
break
- case "/package.js":
- t.pass("package.json used")
+ case '/package.js':
+ t.pass('package.json used')
}
})
- var child = createChild(true)
- child.on("close", function () {
- s.close()
- t.end()
- })
+
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ 'install', '--no-shrinkwrap'
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifError(err, 'npm ran without issue')
+ t.ok(code, "install isn't going to succeed")
+ s.close()
+ t.end()
+ }
+ )
})
})
-test("ignore-shrinkwrap: NOT using the option", function (t) {
- mr({port: common.port, mocks: customMocks}, function (err, s) {
- s._server.on("request", function (req) {
+test('npm install (with shrinkwrap)', function (t) {
+ mr({ port: common.port, mocks: customMocks }, function (err, s) {
+ t.ifError(err, 'mock registry bootstrapped without issue')
+ s._server.on('request', function (req) {
switch (req.url) {
- case "/shrinkwrap.js":
- t.pass("shrinkwrap used")
+ case '/shrinkwrap.js':
+ t.pass('shrinkwrap used')
break
- case "/package.js":
- t.fail()
+ case '/package.js':
+ t.fail('shrinkwrap ignored')
}
})
- var child = createChild(false)
- child.on("close", function () {
- s.close()
- t.end()
- })
+
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ 'install'
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifError(err, 'npm ran without issue')
+ t.ok(code, "install isn't going to succeed")
+ s.close()
+ t.end()
+ }
+ )
})
})
-function createChild (ignoreShrinkwrap) {
- var args
- if (ignoreShrinkwrap) {
- args = [npm, "install", "--no-shrinkwrap"]
- } else {
- args = [npm, "install"]
- }
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
- return spawn(node, args, {
- cwd: pkg,
- env: {
- "npm_config_registry": common.registry,
- "npm_config_cache_lock_stale": 1000,
- "npm_config_cache_lock_wait": 1000,
- HOME: process.env.HOME,
- Path: process.env.PATH,
- PATH: process.env.PATH
- }
- })
+function cleanup () {
+ rimraf.sync(pkg)
+}
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ fs.writeFileSync(
+ path.join(pkg, 'npm-shrinkwrap.json'),
+ JSON.stringify(shrinkwrap, null, 2)
+ )
+ process.chdir(pkg)
}
+++ /dev/null
-{
- "name": "ignore-shrinkwrap",
- "version": "0.0.0",
- "dependencies": {
- "npm-test-ignore-shrinkwrap-file": {
- "version": "1.2.3",
- "from": "http://localhost:1337/shrinkwrap.js",
- "resolved": "http://localhost:1337/shrinkwrap.js",
- "dependencies": {
- "opener": {
- "version": "1.3.0",
- "from": "opener@1.3.0"
- }
- }
- }
- }
-}
+++ /dev/null
-{
- "author": "Rocko Artischocko",
- "name": "ignore-shrinkwrap",
- "version": "0.0.0",
- "dependencies": {
- "npm-test-ignore-shrinkwrap-file": "http://localhost:1337/package.js"
- }
-}
-var common = require("../common-tap.js")
-var test = require("tap").test
-var path = require("path")
-var fs = require("fs")
-var rimraf = require("rimraf")
-var mkdirp = require("mkdirp")
-var pkg = path.join(__dirname, "install-at-locally")
-
-var EXEC_OPTS = { }
-
-test("setup", function (t) {
- mkdirp.sync(pkg)
- mkdirp.sync(path.resolve(pkg, "node_modules"))
- process.chdir(pkg)
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.join(__dirname, 'install-at-locally')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ name: 'install-at-locally',
+ version: '0.0.0'
+}
+
+test('setup', function (t) {
+ cleanup()
t.end()
})
-test("\"npm install ./package@1.2.3\" should install local pkg", function(t) {
- common.npm(["install", "./package@1.2.3"], EXEC_OPTS, function(err, code) {
- var p = path.resolve(pkg, "node_modules/install-at-locally/package.json")
- t.ifError(err, "install local package successful")
- t.equal(code, 0, "npm install exited with code")
- t.ok(JSON.parse(fs.readFileSync(p, "utf8")))
+test('\'npm install ./package@1.2.3\' should install local pkg', function (t) {
+ var target = './package@1.2.3'
+ setup(target)
+ common.npm(['install', target], EXEC_OPTS, function (err, code) {
+ var p = path.resolve(pkg, 'node_modules/install-at-locally/package.json')
+ t.ifError(err, 'install local package successful')
+ t.equal(code, 0, 'npm install exited with code')
+ t.ok(JSON.parse(fs.readFileSync(p, 'utf8')))
t.end()
})
})
-test("\"npm install install/at/locally@./package@1.2.3\" should install local pkg", function(t) {
- common.npm(["install", "./package@1.2.3"], EXEC_OPTS, function(err, code) {
- var p = path.resolve(pkg, "node_modules/install-at-locally/package.json")
- t.ifError(err, "install local package in explicit directory successful")
- t.equal(code, 0, "npm install exited with code")
- t.ok(JSON.parse(fs.readFileSync(p, "utf8")))
+test('\'npm install install/at/locally@./package@1.2.3\' should install local pkg', function (t) {
+ var target = 'install/at/locally@./package@1.2.3'
+ setup(target)
+ common.npm(['install', target], EXEC_OPTS, function (err, code) {
+ var p = path.resolve(pkg, 'node_modules/install-at-locally/package.json')
+ t.ifError(err, 'install local package in explicit directory successful')
+ t.equal(code, 0, 'npm install exited with code')
+ t.ok(JSON.parse(fs.readFileSync(p, 'utf8')))
t.end()
})
})
-test("cleanup", function(t) {
- process.chdir(__dirname)
- rimraf.sync(path.resolve(pkg, "node_modules"))
+test('cleanup', function (t) {
+ cleanup()
t.end()
})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
+
+function setup (target) {
+ cleanup()
+ var root = path.resolve(pkg, target)
+ mkdirp.sync(root)
+ fs.writeFileSync(
+ path.join(root, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ mkdirp.sync(path.resolve(pkg, 'node_modules'))
+ process.chdir(pkg)
+}
+++ /dev/null
-{
- "name": "install-at-locally",
- "version": "0.0.0",
- "description": "Test for 404-parent"
-}
-var common = require("../common-tap.js")
-var test = require("tap").test
-var path = require("path")
-var fs = require("fs")
-var rimraf = require("rimraf")
-var mkdirp = require("mkdirp")
-var pkg = path.join(__dirname, "install-cli-production")
-
-var EXEC_OPTS = {
- cwd: pkg
+var fs = require('graceful-fs')
+var path = require('path')
+var existsSync = fs.existsSync || path.existsSync
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.join(__dirname, 'install-cli-production')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ name: 'install-cli-production',
+ description: 'fixture',
+ version: '0.0.0',
+ scripts: {
+ prepublish: 'exit 123'
+ },
+ dependencies: {
+ dependency: 'file:./dependency'
+ },
+ devDependencies: {
+ 'dev-dependency': 'file:./dev-dependency'
+ }
+}
+
+var dependency = {
+ name: 'dependency',
+ description: 'fixture',
+ version: '0.0.0'
+}
+
+var devDependency = {
+ name: 'dev-dependency',
+ description: 'fixture',
+ version: '0.0.0'
}
-test("setup", function(t) {
- mkdirp.sync(pkg)
- mkdirp.sync(path.resolve(pkg, "node_modules"))
+test('setup', function (t) {
+ mkdirp.sync(path.join(pkg, 'dependency'))
+ fs.writeFileSync(
+ path.join(pkg, 'dependency', 'package.json'),
+ JSON.stringify(dependency, null, 2)
+ )
+
+ mkdirp.sync(path.join(pkg, 'devDependency'))
+ fs.writeFileSync(
+ path.join(pkg, 'devDependency', 'package.json'),
+ JSON.stringify(devDependency, null, 2)
+ )
+
+ mkdirp.sync(path.join(pkg, 'node_modules'))
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+
process.chdir(pkg)
t.end()
})
-test("\"npm install --production\" should install dependencies", function(t) {
- common.npm(["install", "--production"], EXEC_OPTS, function(err, code) {
- t.ifError(err, "install production successful")
- t.equal(code, 0, "npm install exited with code")
- var p = path.resolve(pkg, "node_modules/dependency/package.json")
- t.ok(JSON.parse(fs.readFileSync(p, "utf8")))
- t.end()
- })
-})
-
-test("\"npm install --production\" should not install dev dependencies", function(t) {
- common.npm(["install", "--production"], EXEC_OPTS, function(err, code) {
- t.ifError(err, "install production successful")
- t.equal(code, 0, "npm install exited with code")
- var p = path.resolve(pkg, "node_modules/dev-dependency/package.json")
- t.ok(!fs.existsSync(p), "")
+test('\'npm install --production\' should only install dependencies', function (t) {
+ common.npm(['install', '--production'], EXEC_OPTS, function (err, code) {
+ t.ifError(err, 'install production successful')
+ t.equal(code, 0, 'npm install did not raise error code')
+ t.ok(
+ JSON.parse(fs.readFileSync(
+ path.resolve(pkg, 'node_modules/dependency/package.json'), 'utf8')
+ ),
+ 'dependency was installed'
+ )
+ t.notOk(
+ existsSync(path.resolve(pkg, 'node_modules/dev-dependency/package.json')),
+ 'devDependency was NOT installed'
+ )
t.end()
})
})
-test("cleanup", function(t) {
- process.chdir(__dirname)
- rimraf.sync(path.resolve(pkg, "node_modules"))
+test('cleanup', function (t) {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
t.end()
})
+++ /dev/null
-{
- "name": "dependency",
- "description": "fixture",
- "version": "0.0.0"
-}
+++ /dev/null
-{
- "name": "dev-dependency",
- "description": "fixture",
- "version": "0.0.0"
-}
+++ /dev/null
-{
- "name": "install-cli-production",
- "description": "fixture",
- "version": "0.0.0",
- "scripts": {
- "prepublish": "exit 123"
- },
- "dependencies": {
- "dependency": "file:./dependency"
- },
- "devDependencies": {
- "dev-dependency": "file:./dev-dependency"
- }
-}
-var common = require("../common-tap.js")
-var test = require("tap").test
-var mr = require("npm-registry-mock")
-var path = require("path")
+var fs = require('graceful-fs')
+var path = require('path')
-var pkg = path.resolve(__dirname, "install-cli")
+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.resolve(__dirname, 'install-cli-unicode')
function hasOnlyAscii (s) {
return /^[\000-\177]*$/.test(s)
}
-var EXEC_OPTS = {
- cwd : pkg
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ name: 'install-cli',
+ description: 'fixture',
+ version: '0.0.1',
+ dependencies: {
+ read: '1.0.5'
+ }
}
-test("does not use unicode with --unicode false", function (t) {
- t.plan(5)
- mr({port : common.port}, function (er, s) {
- common.npm(["install", "--unicode", "false", "read"], EXEC_OPTS, function (err, code, stdout) {
- t.ifError(err, "install package read without unicode success")
- t.notOk(code, "npm install exited with code 0")
- t.ifError(err)
- t.ok(stdout, stdout.length)
- t.ok(hasOnlyAscii(stdout))
- s.close()
- })
+test('setup', function (t) {
+ rimraf.sync(pkg)
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+
+ mr({ port: common.port }, function (er, s) {
+ server = s
+ t.end()
})
})
-test("cleanup", function (t) {
- mr({port : common.port}, function (er, s) {
- common.npm(["uninstall", "read"], EXEC_OPTS, function (err, code) {
- t.ifError(err, "uninstall read package success")
- t.notOk(code, "npm uninstall exited with code 0")
- s.close()
- })
- })
+test('does not use unicode with --unicode false', function (t) {
+ common.npm(
+ [
+ '--unicode', 'false',
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ 'install', 'optimist'
+ ],
+ EXEC_OPTS,
+ function (err, code, stdout) {
+ t.ifError(err, 'install package read without unicode success')
+ t.notOk(code, 'npm install exited with code 0')
+ t.ifError(err, 'npm install ran without issue')
+ t.ok(stdout, 'got some output')
+ t.ok(hasOnlyAscii(stdout), 'only ASCII in install output')
+
+ t.end()
+ }
+ )
+})
+
+test('cleanup', function (t) {
+ server.close()
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+
t.end()
})
+++ /dev/null
-# Tests for `npm install` CLI output.
+++ /dev/null
-module.exports = true
+++ /dev/null
-{
- "name": "install-cli",
- "description": "fixture",
- "version": "0.0.1",
- "main": "index.js",
- "dependencies": {
- "read": "1.0.5"
- },
- "repository": "git://github.com/robertkowalski/bogusfixture"
-}
-var common = require("../common-tap")
-var test = require("tap").test
-var path = require("path")
-var fs = require("fs")
-var rimraf = require("rimraf")
-var pkg = path.join(__dirname, "install-from-local", "package-with-local-paths")
+var fs = require('graceful-fs')
+var path = require('path')
-var EXEC_OPTS = { }
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap')
+
+var root = path.join(__dirname, 'install-from-local')
+var pkg = path.join(root, 'package-with-local-paths')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var localPaths = {
+ name: 'package-with-local-paths',
+ version: '0.0.0',
+ dependencies: {
+ 'package-local-dependency': 'file:../package-local-dependency'
+ },
+ devDependencies: {
+ 'package-local-dev-dependency': 'file:../package-local-dev-dependency'
+ }
+}
+
+var localDependency = {
+ name: 'package-local-dependency',
+ version: '0.0.0',
+ description: 'Test for local installs'
+}
+
+var localDevDependency = {
+ name: 'package-local-dev-dependency',
+ version: '0.0.0',
+ description: 'Test for local installs'
+}
+
+test('setup', function (t) {
+ rimraf.sync(pkg)
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(localPaths, null, 2)
+ )
+
+ mkdirp.sync(path.join(root, 'package-local-dependency'))
+ fs.writeFileSync(
+ path.join(root, 'package-local-dependency', 'package.json'),
+ JSON.stringify(localDependency, null, 2)
+ )
+
+ mkdirp.sync(path.join(root, 'package-local-dev-dependency'))
+ fs.writeFileSync(
+ path.join(root, 'package-local-dev-dependency', 'package.json'),
+ JSON.stringify(localDevDependency, null, 2)
+ )
-test("setup", function (t) {
process.chdir(pkg)
t.end()
})
-test('"npm install" should install local packages', function (t) {
- common.npm(["install", "."], EXEC_OPTS, function (err, code) {
- t.ifError(err, "error should not exist")
- t.notOk(code, "npm install exited with code 0")
- var dependencyPackageJson = path.resolve(pkg, "node_modules/package-local-dependency/package.json")
- t.ok(
- JSON.parse(fs.readFileSync(dependencyPackageJson, "utf8")),
- "package with local dependency installed"
- )
-
- var devDependencyPackageJson = path.resolve(pkg, "node_modules/package-local-dev-dependency/package.json")
- t.ok(
- JSON.parse(fs.readFileSync(devDependencyPackageJson, "utf8")),
- "package with local dev dependency installed"
- )
-
- t.end()
- })
+test('\'npm install\' should install local packages', function (t) {
+ common.npm(
+ [
+ 'install', '.'
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifError(err, 'error should not exist')
+ t.notOk(code, 'npm install exited with code 0')
+ var dependencyPackageJson = path.resolve(
+ pkg,
+ 'node_modules/package-local-dependency/package.json'
+ )
+ t.ok(
+ JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8')),
+ 'package with local dependency installed'
+ )
+
+ var devDependencyPackageJson = path.resolve(
+ pkg, 'node_modules/package-local-dev-dependency/package.json'
+ )
+ t.ok(
+ JSON.parse(fs.readFileSync(devDependencyPackageJson, 'utf8')),
+ 'package with local dev dependency installed'
+ )
+
+ t.end()
+ }
+ )
})
-test("cleanup", function (t) {
- process.chdir(__dirname)
- rimraf.sync(path.resolve(pkg, "node_modules"))
+test('cleanup', function (t) {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(root)
t.end()
})
+++ /dev/null
-{
- "name": "package-local-dependency",
- "version": "0.0.0",
- "description": "Test for local installs"
-}
+++ /dev/null
-{
- "name": "package-local-dev-dependency",
- "version": "0.0.0",
- "description": "Test for local installs"
-}
+++ /dev/null
-{
- "name": "@scoped/package",
- "version": "0.0.0",
- "description": "Test for local installs"
-}
+++ /dev/null
-{
- "name": "package-with-local-paths",
- "version": "0.0.0",
- "dependencies": {
- "package-local-dependency": "file:../package-local-dependency"
- },
- "devDependencies": {
- "package-local-dev-dependency": "file:../package-local-dev-dependency"
- }
-}
+++ /dev/null
-{
- "name": "package-with-scoped-paths",
- "version": "0.0.0",
- "dependencies": {
- "package-local-dependency": "file:../package-local-dependency",
- "@scoped/package-scoped-dependency": "file:../package-scoped-dependency"
- }
-}
-var common = require("../common-tap.js")
-var test = require("tap").test
-var npm = require("../../")
-var path = require("path")
-var fs = require("fs")
-var rimraf = require("rimraf")
-var mkdirp = require("mkdirp")
-var pkg = path.join(__dirname, "install-save-exact")
-var mr = require("npm-registry-mock")
-
-test("setup", function (t) {
- mkdirp.sync(pkg)
- mkdirp.sync(path.resolve(pkg, "node_modules"))
- process.chdir(pkg)
- t.end()
-})
+var fs = require('graceful-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-save-exact')
-test("\"npm install --save --save-exact\" should install local pkg", function (t) {
- resetPackageJSON(pkg)
- mr({port : common.port}, function (er, s) {
- npm.load({
- cache: pkg + "/cache",
- loglevel: "silent",
- registry: common.registry }, function (err) {
- t.ifError(err)
- npm.config.set("save", true)
- npm.config.set("save-exact", true)
- npm.commands.install(["underscore@1.3.1"], function (err) {
- t.ifError(err)
- var p = path.resolve(pkg, "node_modules/underscore/package.json")
- t.ok(JSON.parse(fs.readFileSync(p)))
- p = path.resolve(pkg, "package.json")
- var pkgJson = JSON.parse(fs.readFileSync(p, "utf8"))
- t.deepEqual(pkgJson.dependencies, {
- "underscore": "1.3.1"
- }, "Underscore dependency should specify exactly 1.3.1")
- npm.config.set("save", undefined)
- npm.config.set("save-exact", undefined)
- s.close()
- t.end()
- })
- })
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ name: 'install-save-exact',
+ version: '0.0.1',
+ description: 'fixture'
+}
+
+test('setup', function (t) {
+ setup()
+ mr({ port: common.port }, function (er, s) {
+ server = s
+ t.end()
})
})
-test("\"npm install --save-dev --save-exact\" should install local pkg", function (t) {
- resetPackageJSON(pkg)
-
- mr({port : common.port}, function (er, s) {
- npm.load({
- cache: pkg + "/cache",
- loglevel: "silent",
- registry: common.registry }, function (err) {
- t.ifError(err)
- npm.config.set("save-dev", true)
- npm.config.set("save-exact", true)
- npm.commands.install(["underscore@1.3.1"], function (err) {
- t.ifError(err)
- var p = path.resolve(pkg, "node_modules/underscore/package.json")
- t.ok(JSON.parse(fs.readFileSync(p)))
- p = path.resolve(pkg, "package.json")
- var pkgJson = JSON.parse(fs.readFileSync(p, "utf8"))
- console.log(pkgJson)
- t.deepEqual(pkgJson.devDependencies, {
- "underscore": "1.3.1"
- }, "underscore devDependency should specify exactly 1.3.1")
- s.close()
- npm.config.set("save-dev", undefined)
- npm.config.set("save-exact", undefined)
- t.end()
- })
- })
- })
+test('\'npm install --save --save-exact\' should install local pkg', function (t) {
+ common.npm(
+ [
+ '--loglevel', 'silent',
+ '--registry', common.registry,
+ '--save',
+ '--save-exact',
+ 'install', 'underscore@1.3.1'
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifError(err, 'npm ran without issue')
+ t.notOk(code, 'npm install exited without raising an error code')
+
+ var p = path.resolve(pkg, 'node_modules/underscore/package.json')
+ t.ok(JSON.parse(fs.readFileSync(p)))
+
+ p = path.resolve(pkg, 'package.json')
+ var pkgJson = JSON.parse(fs.readFileSync(p, 'utf8'))
+
+ t.same(
+ pkgJson.dependencies,
+ { 'underscore': '1.3.1' },
+ 'underscore dependency should specify exactly 1.3.1'
+ )
+
+ t.end()
+ }
+ )
+})
+
+test('\'npm install --save-dev --save-exact\' should install local pkg', function (t) {
+ setup()
+
+ common.npm(
+ [
+ '--loglevel', 'silent',
+ '--registry', common.registry,
+ '--save-dev',
+ '--save-exact',
+ 'install', 'underscore@1.3.1'
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifError(err, 'npm ran without issue')
+ t.notOk(code, 'npm install exited without raising an error code')
+
+ var p = path.resolve(pkg, 'node_modules/underscore/package.json')
+ t.ok(JSON.parse(fs.readFileSync(p)))
+
+ p = path.resolve(pkg, 'package.json')
+ var pkgJson = JSON.parse(fs.readFileSync(p, 'utf8'))
+
+ t.same(
+ pkgJson.devDependencies,
+ { 'underscore': '1.3.1' },
+ 'underscore dependency should specify exactly 1.3.1'
+ )
+
+ t.end()
+ }
+ )
})
-test("cleanup", function (t) {
- process.chdir(__dirname)
- rimraf.sync(path.resolve(pkg, "node_modules"))
- rimraf.sync(path.resolve(pkg, "cache"))
- resetPackageJSON(pkg)
+test('cleanup', function (t) {
+ server.close()
+ cleanup()
t.end()
})
-function resetPackageJSON(pkg) {
- var pkgJson = JSON.parse(fs.readFileSync(pkg + "/package.json", "utf8"))
- delete pkgJson.dependencies
- delete pkgJson.devDependencies
- delete pkgJson.optionalDependencies
- var json = JSON.stringify(pkgJson, null, 2) + "\n"
- var p = path.resolve(pkg, "package.json")
- fs.writeFileSync(p, json, "ascii")
+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(json, null, 2)
+ )
+ process.chdir(pkg)
}
+++ /dev/null
-# just a test
+++ /dev/null
-module.exports = true
+++ /dev/null
-{
- "name": "bla",
- "description": "fixture",
- "version": "0.0.1",
- "main": "index.js",
- "repository": "git://github.com/robertkowalski/bogusfixture"
-}
-var common = require("../common-tap.js")
-var test = require("tap").test
-var path = require("path")
-var fs = require("fs")
-var rimraf = require("rimraf")
-var pkg = path.join(__dirname, "install-save-local", "package")
+var fs = require('graceful-fs')
+var path = require('path')
-var EXEC_OPTS = { }
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
-test("setup", function (t) {
- resetPackageJSON(pkg)
- process.chdir(pkg)
+var common = require('../common-tap.js')
+
+var root = path.join(__dirname, 'install-save-local')
+var pkg = path.join(root, 'package')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ name: 'install-save-local',
+ version: '0.0.0'
+}
+
+var localDependency = {
+ name: 'package-local-dependency',
+ version: '0.0.0'
+}
+
+var localDevDependency = {
+ name: 'package-local-dev-dependency',
+ version: '0.0.0'
+}
+
+test('setup', function (t) {
+ setup()
t.end()
})
-test('"npm install --save ../local/path" should install local package and save to package.json', function (t) {
- resetPackageJSON(pkg)
- common.npm(["install", "--save", "../package-local-dependency"], EXEC_OPTS, function (err, code) {
- t.ifError(err)
- t.notOk(code, "npm install exited with code 0")
-
- var dependencyPackageJson = path.resolve(pkg, "node_modules/package-local-dependency/package.json")
- t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, "utf8")))
-
- var pkgJson = JSON.parse(fs.readFileSync(pkg + "/package.json", "utf8"))
- t.deepEqual(pkgJson.dependencies, {
- "package-local-dependency": "file:../package-local-dependency"
- })
- t.end()
- })
+test('\'npm install --save ../local/path\' should save to package.json', function (t) {
+ common.npm(
+ [
+ '--loglevel', 'silent',
+ '--save',
+ 'install', '../package-local-dependency'
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifError(err, 'npm install ran without issue')
+ t.notOk(code, 'npm install exited with code 0')
+
+ var dependencyPackageJson = path.join(
+ pkg, 'node_modules', 'package-local-dependency', 'package.json'
+ )
+ t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8')))
+
+ var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8'))
+ t.deepEqual(
+ pkgJson.dependencies,
+ { 'package-local-dependency': 'file:../package-local-dependency' },
+ 'local package saved correctly'
+ )
+ t.end()
+ }
+ )
})
-test('"npm install --save-dev ../local/path" should install local package and save to package.json', function (t) {
- resetPackageJSON(pkg)
- common.npm(["install", "--save-dev", "../package-local-dev-dependency"], EXEC_OPTS, function (err, code) {
- t.ifError(err)
- t.notOk(code, "npm install exited with code 0")
+test('\'npm install --save-dev ../local/path\' should save to package.json', function (t) {
+ setup()
+ common.npm(
+ [
+ '--loglevel', 'silent',
+ '--save-dev',
+ 'install', '../package-local-dev-dependency'
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifError(err, 'npm install ran without issue')
+ t.notOk(code, 'npm install exited with code 0')
- var dependencyPackageJson = path.resolve(pkg, "node_modules/package-local-dev-dependency/package.json")
- t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, "utf8")))
+ var dependencyPackageJson = path.resolve(
+ pkg, 'node_modules', 'package-local-dev-dependency', 'package.json'
+ )
+ t.ok(JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8')))
- var pkgJson = JSON.parse(fs.readFileSync(pkg + "/package.json", "utf8"))
- t.deepEqual(pkgJson.devDependencies, {
- "package-local-dev-dependency": "file:../package-local-dev-dependency"
- })
+ var pkgJson = JSON.parse(fs.readFileSync(pkg + '/package.json', 'utf8'))
+ t.deepEqual(
+ pkgJson.devDependencies,
+ { 'package-local-dev-dependency': 'file:../package-local-dev-dependency' },
+ 'local package saved correctly'
+ )
- t.end()
- })
+ t.end()
+ }
+ )
})
-
-test("cleanup", function (t) {
- resetPackageJSON(pkg)
- process.chdir(__dirname)
- rimraf.sync(path.resolve(pkg, "node_modules"))
+test('cleanup', function (t) {
+ cleanup()
t.end()
})
-function resetPackageJSON(pkg) {
- var pkgJson = JSON.parse(fs.readFileSync(pkg + "/package.json", "utf8"))
- delete pkgJson.dependencies
- delete pkgJson.devDependencies
- var json = JSON.stringify(pkgJson, null, 2) + "\n"
- fs.writeFileSync(pkg + "/package.json", json, "ascii")
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ process.chdir(__dirname)
+ rimraf.sync(root)
+}
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+
+ mkdirp.sync(path.join(root, 'package-local-dependency'))
+ fs.writeFileSync(
+ path.join(root, 'package-local-dependency', 'package.json'),
+ JSON.stringify(localDependency, null, 2)
+ )
+
+ mkdirp.sync(path.join(root, 'package-local-dev-dependency'))
+ fs.writeFileSync(
+ path.join(root, 'package-local-dev-dependency', 'package.json'),
+ JSON.stringify(localDevDependency, null, 2)
+ )
+
+ process.chdir(pkg)
}
+++ /dev/null
-{
- "name": "package-local-dependency",
- "version": "0.0.0",
- "description": "Test for local installs"
-}
+++ /dev/null
-{
- "name": "package-local-dev-dependency",
- "version": "0.0.0",
- "description": "Test for local installs"
-}
+++ /dev/null
-{
- "name": "package",
- "version": "0.0.0"
-}
-var common = require("../common-tap.js")
-var test = require("tap").test
-var npm = require("../../")
-var path = require("path")
-var fs = require("fs")
-var rimraf = require("rimraf")
-var mkdirp = require("mkdirp")
-var pkg = path.join(__dirname, "install-save-prefix")
-var mr = require("npm-registry-mock")
-
-test("setup", function (t) {
- mkdirp.sync(pkg)
- mkdirp.sync(path.resolve(pkg, "node_modules"))
- process.chdir(pkg)
- t.end()
-})
+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-save-prefix')
+
+var EXEC_OPTS = { cwd: pkg }
-test("npm install --save with default save-prefix should install local pkg versioned to allow minor updates", function (t) {
- resetPackageJSON(pkg)
- mr({port : common.port}, function (er, s) {
- npm.load({
- cache: pkg + "/cache",
- loglevel: "silent",
- "save-prefix": "^",
- registry: common.registry }, function (err) {
- t.ifError(err)
- npm.config.set("save", true)
- npm.commands.install(["underscore@latest"], function (err) {
- t.ifError(err)
- var p = path.resolve(pkg, "node_modules/underscore/package.json")
- t.ok(JSON.parse(fs.readFileSync(p)))
- var pkgJson = JSON.parse(fs.readFileSync(pkg + "/package.json", "utf8"))
- t.deepEqual(pkgJson.dependencies, {
- "underscore": "^1.5.1"
- }, "Underscore dependency should specify ^1.5.1")
- npm.config.set("save", undefined)
- s.close()
- t.end()
- })
- })
+var json = {
+ name: 'install-save-prefix',
+ version: '0.0.1'
+}
+
+test('setup', function (t) {
+ setup()
+ mr({ port: common.port }, function (er, s) {
+ t.ifError(er, 'started mock registry')
+ server = s
+ t.end()
})
})
-test("npm install --save-dev with default save-prefix should install local pkg to dev dependencies versioned to allow minor updates", function (t) {
- resetPackageJSON(pkg)
- mr({port : common.port}, function (er, s) {
- npm.load({
- cache: pkg + "/cache",
- loglevel: "silent",
- "save-prefix": "^",
- registry: common.registry }, function (err) {
- t.ifError(err)
- npm.config.set("save-dev", true)
- npm.commands.install(["underscore@1.3.1"], function (err) {
- t.ifError(err)
- var p = path.resolve(pkg, "node_modules/underscore/package.json")
- t.ok(JSON.parse(fs.readFileSync(p)))
- var pkgJson = JSON.parse(fs.readFileSync(pkg + "/package.json", "utf8"))
- t.deepEqual(pkgJson.devDependencies, {
- "underscore": "^1.3.1"
- }, "Underscore devDependency should specify ^1.3.1")
- npm.config.set("save-dev", undefined)
- s.close()
- t.end()
- })
- })
- })
+test('install --save with \'^\' save prefix should accept minor updates', function (t) {
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ '--save-prefix', '^',
+ '--save',
+ 'install', 'underscore@latest'
+ ],
+ 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')
+ t.ok(JSON.parse(fs.readFileSync(p)))
+
+ var pkgJson = JSON.parse(fs.readFileSync(
+ path.join(pkg, 'package.json'),
+ 'utf8'
+ ))
+ t.deepEqual(
+ pkgJson.dependencies,
+ { 'underscore': '^1.5.1' },
+ 'got expected save prefix and version of 1.5.1'
+ )
+ t.end()
+ }
+ )
})
-test("npm install --save with \"~\" save-prefix should install local pkg versioned to allow patch updates", function (t) {
- resetPackageJSON(pkg)
- mr({port : common.port}, function (er, s) {
- npm.load({
- cache: pkg + "/cache",
- loglevel: "silent",
- registry: common.registry }, function (err) {
- t.ifError(err)
- npm.config.set("save", true)
- npm.config.set("save-prefix", "~")
- npm.commands.install(["underscore@1.3.1"], function (err) {
- t.ifError(err)
- var p = path.resolve(pkg, "node_modules/underscore/package.json")
- t.ok(JSON.parse(fs.readFileSync(p)))
- var pkgJson = JSON.parse(fs.readFileSync(pkg + "/package.json", "utf8"))
- t.deepEqual(pkgJson.dependencies, {
- "underscore": "~1.3.1"
- }, "Underscore dependency should specify ~1.3.1")
- npm.config.set("save", undefined)
- npm.config.set("save-prefix", undefined)
- s.close()
- t.end()
- })
- })
- })
+test('install --save-dev with \'^\' save prefix should accept minor dev updates', function (t) {
+ setup()
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ '--save-prefix', '^',
+ '--save-dev',
+ 'install', 'underscore@1.3.1'
+ ],
+ 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')
+ t.ok(JSON.parse(fs.readFileSync(p)))
+
+ var pkgJson = JSON.parse(fs.readFileSync(
+ path.join(pkg, 'package.json'),
+ 'utf8'
+ ))
+ t.deepEqual(
+ pkgJson.devDependencies,
+ { 'underscore': '^1.3.1' },
+ 'got expected save prefix and version of 1.3.1'
+ )
+ t.end()
+ }
+ )
})
-test("npm install --save-dev with \"~\" save-prefix should install local pkg to dev dependencies versioned to allow patch updates", function (t) {
- resetPackageJSON(pkg)
- mr({port : common.port}, function (er, s) {
- npm.load({
- cache: pkg + "/cache",
- loglevel: "silent",
- registry: common.registry }, function (err) {
- t.ifError(err)
- npm.config.set("save-dev", true)
- npm.config.set("save-prefix", "~")
- npm.commands.install(["underscore@1.3.1"], function (err) {
- t.ifError(err)
- var p = path.resolve(pkg, "node_modules/underscore/package.json")
- t.ok(JSON.parse(fs.readFileSync(p)))
- var pkgJson = JSON.parse(fs.readFileSync(pkg + "/package.json", "utf8"))
- t.deepEqual(pkgJson.devDependencies, {
- "underscore": "~1.3.1"
- }, "Underscore devDependency should specify ~1.3.1")
- npm.config.set("save-dev", undefined)
- npm.config.set("save-prefix", undefined)
- s.close()
- t.end()
- })
- })
- })
+test('install --save with \'~\' save prefix should accept patch updates', function (t) {
+ setup()
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ '--save-prefix', '~',
+ '--save',
+ 'install', 'underscore@1.3.1'
+ ],
+ 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')
+ t.ok(JSON.parse(fs.readFileSync(p)))
+
+ var pkgJson = JSON.parse(fs.readFileSync(
+ path.join(pkg, 'package.json'),
+ 'utf8'
+ ))
+ t.deepEqual(
+ pkgJson.dependencies,
+ { 'underscore': '~1.3.1' },
+ 'got expected save prefix and version of 1.3.1'
+ )
+ t.end()
+ }
+ )
})
-test("cleanup", function (t) {
- process.chdir(__dirname)
- rimraf.sync(path.resolve(pkg, "node_modules"))
- rimraf.sync(path.resolve(pkg, "cache"))
- resetPackageJSON(pkg)
+test('install --save-dev with \'~\' save prefix should accept patch updates', function (t) {
+ setup()
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ '--save-prefix', '~',
+ '--save-dev',
+ 'install', 'underscore@1.3.1'
+ ],
+ 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')
+ t.ok(JSON.parse(fs.readFileSync(p)))
+
+ var pkgJson = JSON.parse(fs.readFileSync(
+ path.join(pkg, 'package.json'),
+ 'utf8'
+ ))
+ t.deepEqual(
+ pkgJson.devDependencies,
+ { 'underscore': '~1.3.1' },
+ 'got expected save prefix and version of 1.3.1'
+ )
+ t.end()
+ }
+ )
+})
+
+test('cleanup', function (t) {
+ server.close()
+ cleanup()
t.end()
})
-function resetPackageJSON(pkg) {
- var pkgJson = JSON.parse(fs.readFileSync(pkg + "/package.json", "utf8"))
- delete pkgJson.dependencies
- delete pkgJson.devDependencies
- delete pkgJson.optionalDependencies
- var json = JSON.stringify(pkgJson, null, 2) + "\n"
- fs.writeFileSync(pkg + "/package.json", json, "ascii")
+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(json, null, 2)
+ )
+
+ process.chdir(pkg)
}
+++ /dev/null
-# just a test
+++ /dev/null
-module.exports = true
+++ /dev/null
-{
- "name": "bla",
- "description": "fixture",
- "version": "0.0.1",
- "main": "index.js",
- "repository": "git://github.com/robertkowalski/bogusfixture"
-}
-var common = require("../common-tap")
-var existsSync = require("fs").existsSync
-var join = require("path").join
+var fs = require('graceful-fs')
+var path = require('path')
+var existsSync = fs.existsSync || path.existsSync
-var test = require("tap").test
-var rimraf = require("rimraf")
-var mkdirp = require("mkdirp")
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
-var pkg = join(__dirname, "install-from-local", "package-with-scoped-paths")
-var modules = join(pkg, "node_modules")
+var common = require('../common-tap')
-var EXEC_OPTS = {
- cwd : pkg
+var root = path.join(__dirname, 'install-scoped-already-installed')
+var pkg = path.join(root, 'package-with-scoped-paths')
+var modules = path.join(pkg, 'node_modules')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var scopedPaths = {
+ name: 'package-with-scoped-paths',
+ version: '0.0.0',
+ dependencies: {
+ 'package-local-dependency': 'file:../package-local-dependency',
+ '@scoped/package-scoped-dependency': 'file:../package-scoped-dependency'
+ }
+}
+
+var localDependency = {
+ name: 'package-local-dependency',
+ version: '0.0.0',
+ description: 'Test for local installs'
}
-test("setup", function (t) {
- rimraf.sync(modules)
- rimraf.sync(join(pkg, "cache"))
+var scopedDependency = {
+ name: '@scoped/package',
+ version: '0.0.0',
+ description: 'Test for local installs'
+}
+
+test('setup', function (t) {
+ rimraf.sync(root)
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(scopedPaths, null, 2)
+ )
+
+ mkdirp.sync(path.join(root, 'package-local-dependency'))
+ fs.writeFileSync(
+ path.join(root, 'package-local-dependency', 'package.json'),
+ JSON.stringify(localDependency, null, 2)
+ )
+
+ mkdirp.sync(path.join(root, 'package-scoped-dependency'))
+ fs.writeFileSync(
+ path.join(root, 'package-scoped-dependency', 'package.json'),
+ JSON.stringify(scopedDependency, null, 2)
+ )
+
process.chdir(pkg)
- mkdirp.sync(modules)
t.end()
})
-test("installing already installed local scoped package", function (t) {
- common.npm(["install", "--loglevel", "silent"], EXEC_OPTS, function (err, code, stdout) {
- var installed = parseNpmInstallOutput(stdout)
- t.ifError(err, "error should not exist")
- t.notOk(code, "npm install exited with code 0")
- t.ifError(err, "install ran to completion without error")
- t.ok(
- existsSync(join(modules, "@scoped", "package", "package.json")),
- "package installed"
- )
- t.ok(
- contains(installed, "node_modules/@scoped/package"),
- "installed @scoped/package"
- )
- t.ok(
- contains(installed, "node_modules/package-local-dependency"),
- "installed package-local-dependency"
- )
-
- common.npm(["install", "--loglevel", "silent"], EXEC_OPTS, function (err, code, stdout) {
- installed = parseNpmInstallOutput(stdout)
- t.ifError(err, "error should not exist")
- t.notOk(code, "npm install exited with code 0")
-
- t.ifError(err, "install ran to completion without error")
+test('installing already installed local scoped package', function (t) {
+ common.npm(
+ [
+ '--loglevel', 'silent',
+ 'install'
+ ],
+ EXEC_OPTS,
+ function (err, code, stdout) {
+ var installed = parseNpmInstallOutput(stdout)
+ t.ifError(err, 'install ran to completion without error')
+ t.notOk(code, 'npm install exited with code 0')
t.ok(
- existsSync(join(modules, "@scoped", "package", "package.json")),
- "package installed"
+ existsSync(path.join(modules, '@scoped', 'package', 'package.json')),
+ 'package installed'
)
-
- t.notOk(
- contains(installed, "node_modules/@scoped/package"),
- "did not reinstall @scoped/package"
+ t.ok(
+ contains(installed, 'node_modules/@scoped/package'),
+ 'installed @scoped/package'
)
- t.notOk(
- contains(installed, "node_modules/package-local-dependency"),
- "did not reinstall package-local-dependency"
+ t.ok(
+ contains(installed, 'node_modules/package-local-dependency'),
+ 'installed package-local-dependency'
)
- t.end()
- })
- })
+
+ common.npm(
+ [
+ '--loglevel', 'silent',
+ 'install'
+ ],
+ EXEC_OPTS,
+ function (err, code, stdout) {
+ t.ifError(err, 'install ran to completion without error')
+ t.notOk(code, 'npm install raised no error code')
+
+ installed = parseNpmInstallOutput(stdout)
+
+ t.ok(
+ existsSync(path.join(modules, '@scoped', 'package', 'package.json')),
+ 'package installed'
+ )
+
+ t.notOk(
+ contains(installed, 'node_modules/@scoped/package'),
+ 'did not reinstall @scoped/package'
+ )
+ t.notOk(
+ contains(installed, 'node_modules/package-local-dependency'),
+ 'did not reinstall package-local-dependency'
+ )
+ t.end()
+ }
+ )
+ }
+ )
})
-test("cleanup", function (t) {
- process.chdir(__dirname)
- rimraf.sync(join(modules))
- rimraf.sync(join(pkg, "cache"))
+test('cleanup', function (t) {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(root)
t.end()
})
-function contains(list, element) {
- for (var i=0; i < list.length; ++i) {
+function contains (list, element) {
+ for (var i = 0; i < list.length; ++i) {
if (list[i] === element) {
return true
}
return false
}
-function parseNpmInstallOutput(stdout) {
+function parseNpmInstallOutput (stdout) {
return stdout.trim().split(/\n\n|\s+/)
}
-var common = require("../common-tap.js")
-var existsSync = require("fs").existsSync
-var join = require("path").join
-var exec = require("child_process").exec
+var exec = require('child_process').exec
+var fs = require('graceful-fs')
+var path = require('path')
+var existsSync = fs.existsSync || path.existsSync
-var test = require("tap").test
-var rimraf = require("rimraf")
-var mkdirp = require("mkdirp")
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
-var pkg = join(__dirname, "install-scoped")
-var work = join(__dirname, "install-scoped-TEST")
-var modules = join(work, "node_modules")
+var common = require('../common-tap.js')
-var EXEC_OPTS = {}
+var pkg = path.join(__dirname, 'install-scoped-link')
+var work = path.join(__dirname, 'install-scoped-link-TEST')
+var modules = path.join(work, 'node_modules')
+
+var EXEC_OPTS = { cwd: work }
+
+var world = 'console.log("hello blrbld")\n'
+
+var json = {
+ name: '@scoped/package',
+ version: '0.0.0',
+ bin: {
+ hello: './world.js'
+ }
+}
+
+test('setup', function (t) {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ fs.writeFileSync(path.join(pkg, 'world.js'), world)
-test("setup", function (t) {
mkdirp.sync(modules)
process.chdir(work)
t.end()
})
-test("installing package with links", function (t) {
- common.npm(["install", pkg], EXEC_OPTS, function (err, code) {
- t.ifError(err, "install ran to completion without error")
- t.notOk(code, "npm install exited with code 0")
+test('installing package with links', function (t) {
+ common.npm(
+ [
+ '--loglevel', 'silent',
+ 'install', pkg
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifError(err, 'install ran to completion without error')
+ t.notOk(code, 'npm install exited with code 0')
- t.ok(
- existsSync(join(modules, "@scoped", "package", "package.json")),
- "package installed"
- )
- t.ok(existsSync(join(modules, ".bin")), "binary link directory exists")
+ t.ok(
+ existsSync(path.join(modules, '@scoped', 'package', 'package.json')),
+ 'package installed'
+ )
+ t.ok(existsSync(path.join(modules, '.bin')), 'binary link directory exists')
- var hello = join(modules, ".bin", "hello")
- t.ok(existsSync(hello), "binary link exists")
+ var hello = path.join(modules, '.bin', 'hello')
+ t.ok(existsSync(hello), 'binary link exists')
- exec("node " + hello, function (err, stdout, stderr) {
- t.ifError(err, "command ran fine")
- t.notOk(stderr, "got no error output back")
- t.equal(stdout, "hello blrbld\n", "output was as expected")
+ exec('node ' + hello, function (err, stdout, stderr) {
+ t.ifError(err, 'command ran fine')
+ t.notOk(stderr, 'got no error output back')
+ t.equal(stdout, 'hello blrbld\n', 'output was as expected')
- t.end()
- })
- })
+ t.end()
+ })
+ }
+ )
})
-test("cleanup", function (t) {
- process.chdir(__dirname)
- rimraf.sync(work)
+test('cleanup', function (t) {
+ cleanup()
t.end()
})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(work)
+ rimraf.sync(pkg)
+}
--- /dev/null
+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 common = require('../common-tap.js')
+var pkg = path.join(__dirname, 'install-scoped-with-peer-dependency')
+var local = path.join(pkg, 'package')
+
+var EXEC_OPTS = { }
+
+var json = {
+ name: '@scope/package',
+ version: '0.0.0',
+ peerDependencies: {
+ underscore: '*'
+ }
+}
+
+test('setup', function (t) {
+ setup()
+
+ t.end()
+})
+
+test('it should install peerDependencies in same tree level as the parent package', function (t) {
+ common.npm(['install', './package'], EXEC_OPTS, function (err, code, stdout, stderr) {
+ t.ifError(err, 'install local package successful')
+ t.equal(code, 0, 'npm install exited with code')
+ t.notOk(stderr, 'npm install exited without any error output')
+
+ var p = path.resolve(pkg, 'node_modules/underscore/package.json')
+ t.ok(JSON.parse(fs.readFileSync(p, 'utf8')))
+ t.end()
+ })
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function setup () {
+ cleanup()
+ mkdirp.sync(local)
+ mkdirp.sync(path.resolve(pkg, 'node_modules'))
+ fs.writeFileSync(
+ path.join(local, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+}
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
+++ /dev/null
-{
- "name": "@scoped/package",
- "version": "0.0.0",
- "bin": {
- "hello": "./world.js"
- }
-}
+++ /dev/null
-console.log("hello blrbld")
-var test = require("tap").test
-var common = require("../common-tap.js")
-var path = require("path")
-var rimraf = require("rimraf")
-var pkg = path.resolve(__dirname, "lifecycle-path")
-var fs = require("fs")
-var link = path.resolve(pkg, "node-bin")
+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 common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'lifecycle-path')
+var link = path.resolve(pkg, 'node-bin')
var PATH
-if (process.platform === "win32") {
+if (process.platform === 'win32') {
// On Windows the 'comspec' environment variable is used,
// so cmd.exe does not need to be on the path.
- PATH = "C:\\foo\\bar"
+ PATH = 'C:\\foo\\bar'
} else {
// On non-Windows, without the path to the shell, nothing usually works.
- PATH = "/bin:/usr/bin"
+ PATH = '/bin:/usr/bin'
+}
+
+var printPath = 'console.log(process.env.PATH)\n'
+
+var json = {
+ name: 'glorb',
+ version: '1.2.3',
+ scripts: {
+ path: './node-bin/node print-path.js'
+ }
}
-test("setup", function (t) {
- rimraf.sync(link)
- fs.symlinkSync(path.dirname(process.execPath), link, "dir")
+test('setup', function (t) {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ fs.writeFileSync(path.join(pkg, 'print-path.js'), printPath)
+ fs.symlinkSync(path.dirname(process.execPath), link, 'dir')
t.end()
})
-test("make sure the path is correct", function (t) {
- common.npm(["run-script", "path"], {
+test('make sure the path is correct', function (t) {
+ common.npm(['run-script', 'path'], {
cwd: pkg,
env: {
PATH: PATH,
- stdio: [ 0, "pipe", 2 ]
+ stdio: [ 0, 'pipe', 2 ]
}
}, function (er, code, stdout) {
if (er) throw er
- t.equal(code, 0, "exit code")
+ t.equal(code, 0, 'exit code')
// remove the banner, we just care about the last line
stdout = stdout.trim().split(/\r|\n/).pop()
- var pathSplit = process.platform === "win32" ? ";" : ":"
- var root = path.resolve(__dirname, "../..")
+ var pathSplit = process.platform === 'win32' ? ';' : ':'
+ var root = path.resolve(__dirname, '../..')
var actual = stdout.split(pathSplit).map(function (p) {
if (p.indexOf(root) === 0) {
- p = "{{ROOT}}" + p.substr(root.length)
+ p = '{{ROOT}}' + p.substr(root.length)
}
- return p.replace(/\\/g, "/")
+ return p.replace(/\\/g, '/')
})
// get the ones we tacked on, then the system-specific requirements
var expect = [
- "{{ROOT}}/bin/node-gyp-bin",
- "{{ROOT}}/test/tap/lifecycle-path/node_modules/.bin"
+ '{{ROOT}}/bin/node-gyp-bin',
+ '{{ROOT}}/test/tap/lifecycle-path/node_modules/.bin'
].concat(PATH.split(pathSplit).map(function (p) {
- return p.replace(/\\/g, "/")
+ return p.replace(/\\/g, '/')
}))
t.same(actual, expect)
t.end()
})
})
-test("clean", function (t) {
- rimraf.sync(link)
+test('cleanup', function (t) {
+ cleanup()
t.end()
})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
+++ /dev/null
-{"name":"glorb","version":"1.2.3","scripts":{"path":"./node-bin/node print-path.js"}}
+++ /dev/null
-console.log(process.env.PATH)
-var test = require("tap").test
-var npm = require.resolve("../../bin/npm-cli.js")
+var fs = require('graceful-fs')
+var path = require('path')
+var spawn = require('child_process').spawn
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
var node = process.execPath
-var spawn = require("child_process").spawn
-var path = require("path")
-var pkg = path.resolve(__dirname, "lifecycle-signal")
+var npm = require.resolve('../../bin/npm-cli.js')
+
+var pkg = path.resolve(__dirname, 'lifecycle-signal')
+
+var json = {
+ name: 'lifecycle-signal',
+ version: '1.2.5',
+ scripts: {
+ preinstall: 'node -e "process.kill(process.pid,\'SIGSEGV\')"'
+ }
+}
+
+test('setup', function (t) {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
-test("lifecycle signal abort", function (t) {
+ process.chdir(pkg)
+ t.end()
+})
+
+test('lifecycle signal abort', function (t) {
// windows does not use lifecycle signals, abort
- if (process.platform === "win32" || process.env.TRAVIS) return t.end()
+ if (process.platform === 'win32' || process.env.TRAVIS) return t.end()
- var child = spawn(node, [npm, "install"], {
+ var child = spawn(node, [npm, 'install'], {
cwd: pkg
})
- child.on("close", function (code, signal) {
+ child.on('close', function (code, signal) {
t.equal(code, null)
- t.equal(signal, "SIGSEGV")
+ t.equal(signal, 'SIGSEGV')
t.end()
})
})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
+++ /dev/null
-{ "name":"lifecycle-signal",
- "version":"1.2.5",
- "scripts": {"preinstall":"node -e 'process.kill(process.pid,\"SIGSEGV\")'"}}
-var common = require("../common-tap")
- , test = require("tap").test
- , path = require("path")
- , rimraf = require("rimraf")
- , osenv = require("osenv")
- , mkdirp = require("mkdirp")
- , pkg = path.resolve(__dirname, "ls-depth")
- , mr = require("npm-registry-mock")
- , opts = {cwd: pkg}
+var fs = require('graceful-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
-function cleanup () {
- process.chdir(osenv.tmpdir())
- rimraf.sync(pkg + "/cache")
- rimraf.sync(pkg + "/tmp")
- rimraf.sync(pkg + "/node_modules")
+var common = require('../common-tap')
+
+var pkg = path.resolve(__dirname, 'ls-depth-cli')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ name: 'ls-depth-cli',
+ version: '0.0.0',
+ dependencies: {
+ 'test-package-with-one-dep': '0.0.0'
+ }
}
-test("setup", function (t) {
+test('setup', function (t) {
cleanup()
- mkdirp.sync(pkg + "/cache")
- mkdirp.sync(pkg + "/tmp")
- mr({port : common.port}, function (er, s) {
- var cmd = ["install", "--registry=" + common.registry]
- common.npm(cmd, opts, function (er, c) {
- if (er) throw er
- t.equal(c, 0)
- s.close()
- t.end()
- })
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ mr({ port: common.port }, function (er, s) {
+ common.npm(
+ [
+ '--registry', common.registry,
+ 'install'
+ ],
+ EXEC_OPTS,
+ function (er, c) {
+ t.ifError(er, 'setup installation ran without issue')
+ t.equal(c, 0)
+ s.close()
+ t.end()
+ }
+ )
})
})
-test("npm ls --depth=0", function (t) {
- common.npm(["ls", "--depth=0"], opts, function (er, c, out) {
- if (er) throw er
- t.equal(c, 0)
- t.has(out, /test-package-with-one-dep@0\.0\.0/
- , "output contains test-package-with-one-dep@0.0.0")
- t.doesNotHave(out, /test-package@0\.0\.0/
- , "output not contains test-package@0.0.0")
- t.end()
- })
+test('npm ls --depth=0', function (t) {
+ common.npm(
+ ['ls', '--depth=0'],
+ EXEC_OPTS,
+ function (er, c, out) {
+ t.ifError(er, 'npm ls ran without issue')
+ t.equal(c, 0, 'ls ran without raising error code')
+ t.has(
+ out,
+ /test-package-with-one-dep@0\.0\.0/,
+ 'output contains test-package-with-one-dep@0.0.0'
+ )
+ t.doesNotHave(
+ out,
+ /test-package@0\.0\.0/,
+ 'output not contains test-package@0.0.0'
+ )
+ t.end()
+ }
+ )
})
-test("npm ls --depth=1", function (t) {
- common.npm(["ls", "--depth=1"], opts, function (er, c, out) {
- if (er) throw er
- t.equal(c, 0)
- t.has(out, /test-package-with-one-dep@0\.0\.0/
- , "output contains test-package-with-one-dep@0.0.0")
- t.has(out, /test-package@0\.0\.0/
- , "output contains test-package@0.0.0")
- t.end()
- })
+test('npm ls --depth=1', function (t) {
+ common.npm(
+ ['ls', '--depth=1'],
+ EXEC_OPTS,
+ function (er, c, out) {
+ t.ifError(er, 'npm ls ran without issue')
+ t.equal(c, 0, 'ls ran without raising error code')
+ t.has(
+ out,
+ /test-package-with-one-dep@0\.0\.0/,
+ 'output contains test-package-with-one-dep@0.0.0'
+ )
+ t.has(
+ out,
+ /test-package@0\.0\.0/,
+ 'output contains test-package@0.0.0'
+ )
+ t.end()
+ }
+ )
})
-test("npm ls --depth=Infinity", function (t) {
+test('npm ls --depth=Infinity', function (t) {
// travis has a preconfigured depth=0, in general we can not depend
// on the default value in all environments, so explictly set it here
- common.npm(["ls", "--depth=Infinity"], opts, function (er, c, out) {
- if (er) throw er
- t.equal(c, 0)
- t.has(out, /test-package-with-one-dep@0\.0\.0/
- , "output contains test-package-with-one-dep@0.0.0")
- t.has(out, /test-package@0\.0\.0/
- , "output contains test-package@0.0.0")
- t.end()
- })
+ common.npm(
+ ['ls', '--depth=Infinity'],
+ EXEC_OPTS,
+ function (er, c, out) {
+ t.ifError(er, 'npm ls ran without issue')
+ t.equal(c, 0, 'ls ran without raising error code')
+ t.has(
+ out,
+ /test-package-with-one-dep@0\.0\.0/,
+ 'output contains test-package-with-one-dep@0.0.0'
+ )
+ t.has(
+ out,
+ /test-package@0\.0\.0/,
+ 'output contains test-package@0.0.0'
+ )
+ t.end()
+ }
+ )
})
-test("cleanup", function (t) {
+test('cleanup', function (t) {
cleanup()
t.end()
})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
-var common = require("../common-tap")
- , test = require("tap").test
- , path = require("path")
- , rimraf = require("rimraf")
- , osenv = require("osenv")
- , mkdirp = require("mkdirp")
- , pkg = path.resolve(__dirname, "ls-depth-unmet")
- , mr = require("npm-registry-mock")
- , opts = {cwd: pkg}
- , cache = path.resolve(pkg, "cache")
- , tmp = path.resolve(pkg, "tmp")
- , nodeModules = path.resolve(pkg, "node_modules")
+var fs = require('graceful-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
-function cleanup () {
- process.chdir(osenv.tmpdir())
- rimraf.sync(cache)
- rimraf.sync(tmp)
- rimraf.sync(nodeModules)
+var common = require('../common-tap')
+
+var pkg = path.resolve(__dirname, 'ls-depth-unmet')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ name: 'ls-depth-umnet',
+ author: 'Evan You',
+ version: '0.0.0',
+ dependencies: {
+ 'test-package-with-one-dep': '0.0.0',
+ underscore: '1.5.1',
+ optimist: '0.6.0'
+ }
}
-test("setup", function (t) {
+test('setup', function (t) {
cleanup()
- mkdirp.sync(cache)
- mkdirp.sync(tmp)
- mr({port : common.port}, function (er, s) {
- var cmd = ["install", "underscore@1.3.1", "mkdirp", "test-package-with-one-dep", "--registry=" + common.registry]
- common.npm(cmd, opts, function (er, c) {
- if (er) throw er
- t.equal(c, 0)
- s.close()
- t.end()
- })
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ mr({ port: common.port }, function (er, s) {
+ common.npm(
+ [
+ '--registry', common.registry,
+ 'install', 'underscore@1.3.1', 'mkdirp', 'test-package-with-one-dep'
+ ],
+ EXEC_OPTS,
+ function (er, c) {
+ t.ifError(er, 'setup installation ran without issue')
+ t.equal(c, 0)
+ s.close()
+ t.end()
+ }
+ )
})
})
-test("npm ls --depth=0", function (t) {
- common.npm(["ls", "--depth=0"], opts, function (er, c, out) {
- if (er) throw er
- t.equal(c, 1)
- t.has(out, /UNMET DEPENDENCY optimist@0\.6\.0/
- , "output contains optimist@0.6.0 and labeled as unmet dependency")
- t.has(out, /mkdirp@0\.3\.5 extraneous/
- , "output contains mkdirp@0.3.5 and labeled as extraneous")
- t.has(out, /underscore@1\.3\.1 invalid/
- , "output contains underscore@1.3.1 and labeled as invalid")
- t.has(out, /test-package-with-one-dep@0\.0\.0\n/
- , "output contains test-package-with-one-dep@0.0.0 and has no labels")
- t.doesNotHave(out, /test-package@0\.0\.0/
- , "output does not contain test-package@0.0.0 which is at depth=1")
- t.end()
- })
+test('npm ls --depth=0', function (t) {
+ common.npm(
+ ['ls', '--depth=0'],
+ EXEC_OPTS,
+ function (er, c, out) {
+ t.ifError(er, 'setup installation ran without issue')
+ t.equal(c, 1, 'ls barfed')
+ t.has(
+ out,
+ /UNMET DEPENDENCY optimist@0\.6\.0/,
+ 'output contains optimist@0.6.0 and labeled as unmet dependency'
+ )
+ t.has(
+ out,
+ /mkdirp@0\.3\.5 extraneous/,
+ 'output contains mkdirp@0.3.5 and labeled as extraneous'
+ )
+ t.has(
+ out,
+ /underscore@1\.3\.1 invalid/,
+ 'output contains underscore@1.3.1 and labeled as invalid'
+ )
+ t.has(
+ out,
+ /test-package-with-one-dep@0\.0\.0\n/,
+ 'output contains test-package-with-one-dep@0.0.0 and has no labels'
+ )
+ t.doesNotHave(
+ out,
+ /test-package@0\.0\.0/,
+ 'output does not contain test-package@0.0.0 which is at depth=1'
+ )
+ t.end()
+ }
+ )
})
-test("npm ls --depth=1", function (t) {
- common.npm(["ls", "--depth=1"], opts, function (er, c, out) {
- if (er) throw er
- t.equal(c, 1)
- t.has(out, /UNMET DEPENDENCY optimist@0\.6\.0/
- , "output contains optimist@0.6.0 and labeled as unmet dependency")
- t.has(out, /mkdirp@0\.3\.5 extraneous/
- , "output contains mkdirp@0.3.5 and labeled as extraneous")
- t.has(out, /underscore@1\.3\.1 invalid/
- , "output contains underscore@1.3.1 and labeled as invalid")
- t.has(out, /test-package-with-one-dep@0\.0\.0\n/
- , "output contains test-package-with-one-dep@0.0.0 and has no labels")
- t.has(out, /test-package@0\.0\.0/
- , "output contains test-package@0.0.0 which is at depth=1")
- t.end()
- })
+test('npm ls --depth=1', function (t) {
+ common.npm(
+ ['ls', '--depth=1'],
+ EXEC_OPTS,
+ function (er, c, out) {
+ t.ifError(er, 'setup installation ran without issue')
+ t.equal(c, 1, 'ls barfed')
+ t.has(
+ out,
+ /UNMET DEPENDENCY optimist@0\.6\.0/,
+ 'output contains optimist@0.6.0 and labeled as unmet dependency'
+ )
+ t.has(
+ out,
+ /mkdirp@0\.3\.5 extraneous/,
+ 'output contains mkdirp@0.3.5 and labeled as extraneous'
+ )
+ t.has(
+ out,
+ /underscore@1\.3\.1 invalid/,
+ 'output contains underscore@1.3.1 and labeled as invalid'
+ )
+ t.has(
+ out,
+ /test-package-with-one-dep@0\.0\.0\n/,
+ 'output contains test-package-with-one-dep@0.0.0 and has no labels'
+ )
+ t.has(
+ out,
+ /test-package@0\.0\.0/,
+ 'output contains test-package@0.0.0 which is at depth=1'
+ )
+ t.end()
+ }
+ )
})
-test("npm ls --depth=Infinity", function (t) {
+test('npm ls --depth=Infinity', function (t) {
// travis has a preconfigured depth=0, in general we can not depend
// on the default value in all environments, so explictly set it here
- common.npm(["ls", "--depth=Infinity"], opts, function (er, c, out) {
- if (er) throw er
- t.equal(c, 1)
- t.has(out, /UNMET DEPENDENCY optimist@0\.6\.0/
- , "output contains optimist@0.6.0 and labeled as unmet dependency")
- t.has(out, /mkdirp@0\.3\.5 extraneous/
- , "output contains mkdirp@0.3.5 and labeled as extraneous")
- t.has(out, /underscore@1\.3\.1 invalid/
- , "output contains underscore@1.3.1 and labeled as invalid")
- t.has(out, /test-package-with-one-dep@0\.0\.0\n/
- , "output contains test-package-with-one-dep@0.0.0 and has no labels")
- t.has(out, /test-package@0\.0\.0/
- , "output contains test-package@0.0.0 which is at depth=1")
- t.end()
- })
+ common.npm(
+ ['ls', '--depth=Infinity'],
+ EXEC_OPTS,
+ function (er, c, out) {
+ t.ifError(er, 'setup installation ran without issue')
+ t.equal(c, 1, 'ls barfed')
+ t.has(
+ out,
+ /UNMET DEPENDENCY optimist@0\.6\.0/,
+ 'output contains optimist@0.6.0 and labeled as unmet dependency'
+ )
+ t.has(
+ out,
+ /mkdirp@0\.3\.5 extraneous/,
+ 'output contains mkdirp@0.3.5 and labeled as extraneous'
+ )
+ t.has(
+ out,
+ /underscore@1\.3\.1 invalid/,
+ 'output contains underscore@1.3.1 and labeled as invalid'
+ )
+ t.has(
+ out,
+ /test-package-with-one-dep@0\.0\.0\n/,
+ 'output contains test-package-with-one-dep@0.0.0 and has no labels'
+ )
+ t.has(
+ out,
+ /test-package@0\.0\.0/,
+ 'output contains test-package@0.0.0 which is at depth=1'
+ )
+ t.end()
+ }
+ )
})
-test("cleanup", function (t) {
+test('cleanup', function (t) {
cleanup()
t.end()
})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
+++ /dev/null
-{
- "name": "ls-depth-umnet",
- "author": "Evan You",
- "version": "0.0.0",
- "dependencies": {
- "test-package-with-one-dep": "0.0.0",
- "underscore": "1.5.1",
- "optimist": "0.6.0"
- }
-}
\ No newline at end of file
+++ /dev/null
-{
- "author": "Rocko Artischocko",
- "name": "ls-depth",
- "version": "0.0.0",
- "dependencies": {
- "test-package-with-one-dep": "0.0.0"
- }
-}
-var common = require('../common-tap')
-var test = require('tap').test
+var fs = require('graceful-fs')
var path = require('path')
-var rimraf = require('rimraf')
-var osenv = require('osenv')
+
var mkdirp = require('mkdirp')
-var pkg = path.resolve(__dirname, 'ls-depth')
var mr = require('npm-registry-mock')
-var opts = {cwd: pkg}
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
-function cleanup () {
- process.chdir(osenv.tmpdir())
- rimraf.sync(pkg + '/cache')
- rimraf.sync(pkg + '/tmp')
- rimraf.sync(pkg + '/node_modules')
+var common = require('../common-tap')
+
+var pkg = path.resolve(__dirname, 'ls-depth')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ name: 'ls-env',
+ version: '0.0.0',
+ dependencies: {
+ 'test-package-with-one-dep': '0.0.0'
+ }
}
test('setup', function (t) {
cleanup()
- mkdirp.sync(pkg + '/cache')
- mkdirp.sync(pkg + '/tmp')
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
mr({port: common.port}, function (er, s) {
common.npm(
[
- 'install',
- '--registry', common.registry
+ '--registry', common.registry,
+ 'install'
],
- opts,
+ EXEC_OPTS,
function (er, c) {
t.ifError(er, 'install ran without issue')
t.equal(c, 0)
})
test('npm ls --dev', function (t) {
- common.npm(['ls', '--dev'], opts, function (er, code, stdout) {
+ common.npm(['ls', '--dev'], EXEC_OPTS, function (er, code, stdout) {
t.ifError(er, 'ls --dev ran without issue')
t.equal(code, 0)
t.has(stdout, /(empty)/, 'output contains (empty)')
})
test('npm ls --production', function (t) {
- common.npm(['ls', '--production'], opts, function (er, code, stdout) {
+ common.npm(['ls', '--production'], EXEC_OPTS, function (er, code, stdout) {
t.ifError(er, 'ls --production ran without issue')
t.notOk(code, 'npm exited ok')
t.has(
})
test('npm ls --prod', function (t) {
- common.npm(['ls', '--prod'], opts, function (er, code, stdout) {
+ common.npm(['ls', '--prod'], EXEC_OPTS, function (er, code, stdout) {
t.ifError(er, 'ls --prod ran without issue')
t.notOk(code, 'npm exited ok')
t.has(
cleanup()
t.end()
})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
-var cat = require("graceful-fs").writeFileSync
-var resolve = require("path").resolve
+var cat = require('graceful-fs').writeFileSync
+var resolve = require('path').resolve
-var mkdirp = require("mkdirp")
-var mr = require("npm-registry-mock")
-var rimraf = require("rimraf")
-var test = require("tap").test
-var tmpdir = require("osenv").tmpdir
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var rimraf = require('rimraf')
+var test = require('tap').test
+var tmpdir = require('osenv').tmpdir
-var common = require("../common-tap.js")
+var common = require('../common-tap.js')
-var pkg = resolve(__dirname, "ls-l-depth-0")
-var dep = resolve(pkg, "deps", "glock")
-var modules = resolve(pkg, "node_modules")
+var pkg = resolve(__dirname, 'ls-l-depth-0')
+var dep = resolve(pkg, 'deps', 'glock')
+var modules = resolve(pkg, 'node_modules')
var expected =
- "\n" +
- "│ " + pkg + "\n" +
- "│ \n" +
- "└── glock@1.8.7\n" +
- " an inexplicably hostile sample package\n" +
- " https://github.com/npm/glo.ck\n" +
- " https://glo.ck\n" +
- "\n"
+ '\n' +
+ '│ ' + pkg + '\n' +
+ '│ \n' +
+ '└── glock@1.8.7\n' +
+ ' an inexplicably hostile sample package\n' +
+ ' git+https://github.com/npm/glo.ck.git\n' +
+ ' https://glo.ck\n' +
+ '\n'
var server
-var EXEC_OPTS = {
- cwd : pkg
-}
+var EXEC_OPTS = { cwd: pkg }
-test("setup", function (t) {
+test('setup', function (t) {
setup()
- mr({port : common.port}, function (er, s) {
+ mr({ port: common.port }, function (er, s) {
server = s
t.end()
})
})
-test("#6311: npm ll --depth=0 duplicates listing", function (t) {
+test('#6311: npm ll --depth=0 duplicates listing', function (t) {
common.npm(
[
- "--loglevel", "silent",
- "--registry", common.registry,
- "install", dep
+ '--loglevel', 'silent',
+ '--registry', common.registry,
+ 'install', dep
],
EXEC_OPTS,
function (err, code, stdout, stderr) {
- t.ifError(err, "npm install ran without error")
- t.notOk(code, "npm install exited cleanly")
- t.notOk(stderr, "npm install ran silently")
+ t.ifError(err, 'npm install ran without error')
+ t.notOk(code, 'npm install exited cleanly')
+ t.notOk(stderr, 'npm install ran silently')
t.equal(
stdout.trim(),
- "glock@1.8.7 node_modules/glock\n└── underscore@1.5.1",
- "got expected install output"
+ 'glock@1.8.7 node_modules/glock\n└── underscore@1.5.1',
+ 'got expected install output'
)
common.npm(
[
- "--loglevel", "silent",
- "ls", "--long",
- "--depth", "0"
+ '--loglevel', 'silent',
+ 'ls', '--long',
+ '--depth', '0'
],
EXEC_OPTS,
function (err, code, stdout, stderr) {
- t.ifError(err, "npm ll ran without error")
- t.notOk(code, "npm ll exited cleanly")
- t.notOk(stderr, "npm ll ran silently")
+ t.ifError(err, 'npm ll ran without error')
+ t.notOk(code, 'npm ll exited cleanly')
+ t.notOk(stderr, 'npm ll ran silently')
t.equal(
stdout,
expected,
- "got expected package name"
+ 'got expected package name'
)
t.end()
)
})
-test("cleanup", function (t) {
+test('cleanup', function (t) {
cleanup()
server.close()
})
var fixture = {
- "name" : "glock",
- "version" : "1.8.7",
- "private" : true,
- "description" : "an inexplicably hostile sample package",
- "homepage" : "https://glo.ck",
- "repository" : "https://github.com/npm/glo.ck",
- "dependencies" : {
- "underscore" : "1.5.1"
+ 'name': 'glock',
+ 'version': '1.8.7',
+ 'private': true,
+ 'description': 'an inexplicably hostile sample package',
+ 'homepage': 'https://glo.ck',
+ 'repository': 'https://github.com/npm/glo.ck',
+ 'dependencies': {
+ 'underscore': '1.5.1'
}
}
mkdirp.sync(modules)
mkdirp.sync(dep)
- cat(resolve(dep, "package.json"), JSON.stringify(fixture))
+ cat(resolve(dep, 'package.json'), JSON.stringify(fixture))
}
-var test = require("tap").test
-var npm = require("../../")
+var test = require('tap').test
+var npm = require('../../')
-var mapRegistry = require("../../lib/utils/map-to-registry.js")
+var common = require('../common-tap.js')
+var mapRegistry = require('../../lib/utils/map-to-registry.js')
var creds = {
- "//registry.npmjs.org/:username" : "u",
- "//registry.npmjs.org/:_password" : new Buffer("p").toString("base64"),
- "//registry.npmjs.org/:email" : "e"
+ '//registry.npmjs.org/:username': 'u',
+ '//registry.npmjs.org/:_password': new Buffer('p').toString('base64'),
+ '//registry.npmjs.org/:email': 'e',
+ cache: common.npm_config_cache
}
-test("setup", function (t) {
+test('setup', function (t) {
npm.load(creds, function (err) {
t.ifError(err)
t.end()
})
})
-test("mapRegistryToURI", function (t) {
+test('mapRegistryToURI', function (t) {
t.plan(16)
- mapRegistry("basic", npm.config, function (er, uri, auth, registry) {
- t.ifError(er, "mapRegistryToURI worked")
- t.equal(uri, "https://registry.npmjs.org/basic")
+ mapRegistry('basic', npm.config, function (er, uri, auth, registry) {
+ t.ifError(er, 'mapRegistryToURI worked')
+ t.equal(uri, 'https://registry.npmjs.org/basic')
t.deepEqual(auth, {
- scope : "//registry.npmjs.org/",
- token : undefined,
- username : "u",
- password : "p",
- email : "e",
- auth : "dTpw",
- alwaysAuth : false
+ scope: '//registry.npmjs.org/',
+ token: undefined,
+ username: 'u',
+ password: 'p',
+ email: 'e',
+ auth: 'dTpw',
+ alwaysAuth: false
})
- t.equal(registry, "https://registry.npmjs.org/")
+ t.equal(registry, 'https://registry.npmjs.org/')
})
- npm.config.set("scope", "test")
- npm.config.set("@test:registry", "http://reg.npm/design/-/rewrite/")
- npm.config.set("//reg.npm/design/-/rewrite/:_authToken", "a-token")
- mapRegistry("simple", npm.config, function (er, uri, auth, registry) {
- t.ifError(er, "mapRegistryToURI worked")
- t.equal(uri, "http://reg.npm/design/-/rewrite/simple")
+ npm.config.set('scope', 'test')
+ npm.config.set('@test:registry', 'http://reg.npm/design/-/rewrite/')
+ npm.config.set('//reg.npm/design/-/rewrite/:_authToken', 'a-token')
+ mapRegistry('simple', npm.config, function (er, uri, auth, registry) {
+ t.ifError(er, 'mapRegistryToURI worked')
+ t.equal(uri, 'http://reg.npm/design/-/rewrite/simple')
t.deepEqual(auth, {
- scope : "//reg.npm/design/-/rewrite/",
- token : "a-token",
- username : undefined,
- password : undefined,
- email : undefined,
- auth : undefined,
- alwaysAuth : undefined
+ scope: '//reg.npm/design/-/rewrite/',
+ token: 'a-token',
+ username: undefined,
+ password: undefined,
+ email: undefined,
+ auth: undefined,
+ alwaysAuth: undefined
})
- t.equal(registry, "http://reg.npm/design/-/rewrite/")
+ t.equal(registry, 'http://reg.npm/design/-/rewrite/')
})
- npm.config.set("scope", "")
- npm.config.set("@test2:registry", "http://reg.npm/-/rewrite/")
- npm.config.set("//reg.npm/-/rewrite/:_authToken", "b-token")
- mapRegistry("@test2/easy", npm.config, function (er, uri, auth, registry) {
- t.ifError(er, "mapRegistryToURI worked")
- t.equal(uri, "http://reg.npm/-/rewrite/@test2%2feasy")
+ npm.config.set('scope', '')
+ npm.config.set('@test2:registry', 'http://reg.npm/-/rewrite/')
+ npm.config.set('//reg.npm/-/rewrite/:_authToken', 'b-token')
+ mapRegistry('@test2/easy', npm.config, function (er, uri, auth, registry) {
+ t.ifError(er, 'mapRegistryToURI worked')
+ t.equal(uri, 'http://reg.npm/-/rewrite/@test2%2feasy')
t.deepEqual(auth, {
- scope : "//reg.npm/-/rewrite/",
- token : "b-token",
- username : undefined,
- password : undefined,
- email : undefined,
- auth : undefined,
- alwaysAuth : undefined
+ scope: '//reg.npm/-/rewrite/',
+ token: 'b-token',
+ username: undefined,
+ password: undefined,
+ email: undefined,
+ auth: undefined,
+ alwaysAuth: undefined
})
- t.equal(registry, "http://reg.npm/-/rewrite/")
+ t.equal(registry, 'http://reg.npm/-/rewrite/')
})
- npm.config.set("scope", "test")
- npm.config.set("@test3:registry", "http://reg.npm/design/-/rewrite/relative")
- npm.config.set("//reg.npm/design/-/rewrite/:_authToken", "c-token")
- mapRegistry("@test3/basic", npm.config, function (er, uri, auth, registry) {
- t.ifError(er, "mapRegistryToURI worked")
- t.equal(uri, "http://reg.npm/design/-/rewrite/relative/@test3%2fbasic")
+ npm.config.set('scope', 'test')
+ npm.config.set('@test3:registry', 'http://reg.npm/design/-/rewrite/relative')
+ npm.config.set('//reg.npm/design/-/rewrite/:_authToken', 'c-token')
+ mapRegistry('@test3/basic', npm.config, function (er, uri, auth, registry) {
+ t.ifError(er, 'mapRegistryToURI worked')
+ t.equal(uri, 'http://reg.npm/design/-/rewrite/relative/@test3%2fbasic')
t.deepEqual(auth, {
- scope : "//reg.npm/design/-/rewrite/",
- token : "c-token",
- username : undefined,
- password : undefined,
- email : undefined,
- auth : undefined,
- alwaysAuth : undefined
+ scope: '//reg.npm/design/-/rewrite/',
+ token: 'c-token',
+ username: undefined,
+ password: undefined,
+ email: undefined,
+ auth: undefined,
+ alwaysAuth: undefined
})
- t.equal(registry, "http://reg.npm/design/-/rewrite/relative/")
+ t.equal(registry, 'http://reg.npm/design/-/rewrite/relative/')
})
})
+++ /dev/null
-require("../common-tap.js")
-var test = require("tap").test
-var npm = require("../../lib/npm.js")
-
-// this is the narrowest way to replace a function in the module cache
-var found = true
-var remoteGitPath = require.resolve("../../lib/cache/add-remote-git.js")
-require("module")._cache[remoteGitPath] = {
- id: remoteGitPath,
- exports: function stub(_, __, cb) {
- if (found) {
- cb(null, {})
- }
- else {
- cb(new Error("not on filesystem"))
- }
- }
-}
-
-// only load maybeGithub now, so it gets the stub from cache
-var maybeGithub = require("../../lib/cache/maybe-github.js")
-
-test("should throw with no parameters", function (t) {
- t.plan(1)
-
- t.throws(function () {
- maybeGithub()
- }, "throws when called without parameters")
-})
-
-test("should throw with wrong parameter types", function (t) {
- t.plan(2)
-
- t.throws(function () {
- maybeGithub({}, function () {})
- }, "expects only a package name")
-
- t.throws(function () {
- maybeGithub("npm/xxx-noexist", "ham")
- }, "is always async")
-})
-
-test("should find an existing package on Github", function (t) {
- found = true
- npm.load({}, function (error) {
- t.notOk(error, "bootstrapping succeeds")
- t.doesNotThrow(function () {
- maybeGithub("npm/npm", function (error, data) {
- t.notOk(error, "no issues in looking things up")
- t.ok(data, "received metadata from Github")
- t.end()
- })
- })
- })
-})
-
-test("shouldn't find a nonexistent package on Github", function (t) {
- found = false
- npm.load({}, function () {
- t.doesNotThrow(function () {
- maybeGithub("npm/xxx-noexist", function (error, data) {
- t.equal(
- error.message,
- "not on filesystem",
- "passed through original error message"
- )
- t.notOk(data, "didn't pass any metadata")
- t.end()
- })
- })
- })
-})
-var test = require("tap").test
-var rimraf = require("rimraf")
-var common = require("../common-tap.js")
-var path = require("path")
-var fs = require("fs")
-
-var pkg = path.resolve(__dirname, "optional-metadep-rollback-collision")
-var nm = path.resolve(pkg, "node_modules")
-var cache = path.resolve(pkg, "cache")
-var pidfile = path.resolve(pkg, "child.pid")
-
-test("setup", function (t) {
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'optional-metadep-rollback-collision')
+var deps = path.resolve(pkg, 'deps')
+var nm = path.resolve(pkg, 'node_modules')
+var cache = path.resolve(pkg, 'cache')
+var pidfile = path.resolve(pkg, 'child.pid')
+
+var json = {
+ name: 'optional-metadep-rollback-collision',
+ version: '1.0.0',
+ description: 'let\'s just see about that race condition',
+ optionalDependencies: {
+ opdep: 'file:./deps/opdep'
+ }
+}
+
+var d1 = {
+ name: 'd1',
+ version: '1.0.0',
+ description: 'I FAIL CONSTANTLY',
+ scripts: {
+ preinstall: 'sleep 1'
+ },
+ dependencies: {
+ foo: 'http://localhost:8080/'
+ }
+}
+
+var d2 = {
+ name: 'd2',
+ version: '1.0.0',
+ description: 'how do you *really* know you exist?',
+ scripts: {
+ postinstall: 'node blart.js'
+ },
+ dependencies: {
+ 'graceful-fs': '^3.0.2',
+ mkdirp: '^0.5.0',
+ rimraf: '^2.2.8'
+ }
+}
+
+var opdep = {
+ name: 'opdep',
+ version: '1.0.0',
+ description: 'To explode, of course!',
+ main: 'index.js',
+ scripts: {
+ preinstall: 'node bad-server.js'
+ },
+ dependencies: {
+ d1: 'file:../d1',
+ d2: 'file:../d2'
+ }
+}
+
+test('setup', function (t) {
cleanup()
+
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+
+ mkdirp.sync(path.join(deps, 'd1'))
+ fs.writeFileSync(
+ path.join(deps, 'd1', 'package.json'),
+ JSON.stringify(d1, null, 2)
+ )
+
+ mkdirp.sync(path.join(deps, 'd2'))
+ fs.writeFileSync(
+ path.join(deps, 'd2', 'package.json'),
+ JSON.stringify(d2, null, 2)
+ )
+ fs.writeFileSync(path.join(deps, 'd2', 'blart.js'), blart)
+
+ mkdirp.sync(path.join(deps, 'opdep'))
+ fs.writeFileSync(
+ path.join(deps, 'opdep', 'package.json'),
+ JSON.stringify(opdep, null, 2)
+ )
+ fs.writeFileSync(path.join(deps, 'opdep', 'bad-server.js'), badServer)
+
t.end()
})
-test("go go test racer", function (t) {
- common.npm(["install", "--prefix=" + pkg, "--fetch-retries=0", "--cache=" + cache], {
- cwd: pkg,
- env: {
- PATH: process.env.PATH,
- Path: process.env.Path,
- "npm_config_loglevel": "silent"
+test('go go test racer', function (t) {
+ common.npm(
+ [
+ '--prefix', pkg,
+ '--fetch-retries', '0',
+ '--loglevel', 'silent',
+ '--cache', cache,
+ 'install'
+ ],
+ {
+ cwd: pkg,
+ env: {
+ PATH: process.env.PATH,
+ Path: process.env.Path
+ },
+ stdio: [0, 'pipe', 2]
},
- stdio: [ 0, "pipe", 2 ]
- }, function (er, code, sout) {
- if (er) throw er
- t.notOk(code, "npm install exited with code 0")
- t.equal(sout, "ok\nok\n")
- t.notOk(/not ok/.test(sout), "should not contain the string 'not ok'")
- t.end()
- })
+ function (er, code, stdout, stderr) {
+ t.ifError(er, 'install ran to completion without error')
+ t.notOk(code, 'npm install exited with code 0')
+
+ t.equal(stdout, 'ok\nok\n')
+ t.notOk(/not ok/.test(stdout), 'should not contain the string \'not ok\'')
+ t.end()
+ }
+ )
})
-test("verify results", function (t) {
+test('verify results', function (t) {
t.throws(function () {
fs.statSync(nm)
})
t.end()
})
-test("cleanup", function (t) {
+test('cleanup', function (t) {
cleanup()
t.end()
})
function cleanup () {
+ process.chdir(osenv.tmpdir())
try {
var pid = +fs.readFileSync(pidfile)
- process.kill(pid, "SIGKILL")
+ process.kill(pid, 'SIGKILL')
} catch (er) {}
- rimraf.sync(cache)
- rimraf.sync(nm)
- rimraf.sync(pidfile)
+ rimraf.sync(pkg)
}
+
+var badServer = function () {/*
+var createServer = require('http').createServer
+var spawn = require('child_process').spawn
+var fs = require('fs')
+var path = require('path')
+var pidfile = path.resolve(__dirname, '..', '..', 'child.pid')
+
+if (process.argv[2]) {
+ console.log('ok')
+ createServer(function (req, res) {
+ setTimeout(function () {
+ res.writeHead(404)
+ res.end()
+ }, 1000)
+ this.close()
+ }).listen(8080)
+} else {
+ var child = spawn(
+ process.execPath,
+ [__filename, 'whatever'],
+ {
+ stdio: [0, 1, 2],
+ detached: true
+ }
+ )
+ child.unref()
+
+ // kill any prior children, if existing.
+ try {
+ var pid = +fs.readFileSync(pidfile)
+ process.kill(pid, 'SIGKILL')
+ } catch (er) {}
+
+ fs.writeFileSync(pidfile, child.pid + '\n')
+}
+*/}.toString().split('\n').slice(1, -1).join('\n')
+
+var blart = function () {/*
+var rando = require('crypto').randomBytes
+var resolve = require('path').resolve
+
+var mkdirp = require('mkdirp')
+var rimraf = require('rimraf')
+var writeFile = require('graceful-fs').writeFile
+
+var BASEDIR = resolve(__dirname, 'arena')
+
+var keepItGoingLouder = {}
+var writers = 0
+var errors = 0
+
+function gensym () { return rando(16).toString('hex') }
+
+function writeAlmostForever (filename) {
+ if (!keepItGoingLouder[filename]) {
+ writers--
+ if (writers < 1) return done()
+ } else {
+ writeFile(filename, keepItGoingLouder[filename], function (err) {
+ if (err) errors++
+
+ writeAlmostForever(filename)
+ })
+ }
+}
+
+function done () {
+ rimraf(BASEDIR, function () {
+ if (errors > 0) console.log('not ok - %d errors', errors)
+ else console.log('ok')
+ })
+}
+
+mkdirp(BASEDIR, function go () {
+ for (var i = 0; i < 16; i++) {
+ var filename = resolve(BASEDIR, gensym() + '.txt')
+
+ keepItGoingLouder[filename] = ''
+ for (var j = 0; j < 512; j++) keepItGoingLouder[filename] += filename
+
+ writers++
+ writeAlmostForever(filename)
+ }
+
+ setTimeout(function viktor () {
+ // kill all the writers
+ keepItGoingLouder = {}
+ }, 3 * 1000)
+})
+*/}.toString().split('\n').slice(1, -1).join('\n')
+++ /dev/null
-{
- "name": "d1",
- "version": "1.0.0",
- "description": "I FAIL CONSTANTLY",
- "scripts": {
- "preinstall": "sleep 1"
- },
- "dependencies": {
- "foo": "http://localhost:8080/"
- },
- "author": "Forrest L Norvell <ogd@aoaioxxysz.net>",
- "license": "ISC"
-}
+++ /dev/null
-var rando = require("crypto").randomBytes
-var resolve = require("path").resolve
-
-var mkdirp = require("mkdirp")
-var rimraf = require("rimraf")
-var writeFile = require("graceful-fs").writeFile
-
-var BASEDIR = resolve(__dirname, "arena")
-
-var keepItGoingLouder = {}
-var writers = 0
-var errors = 0
-
-function gensym() { return rando(16).toString("hex") }
-
-function writeAlmostForever(filename) {
- if (!keepItGoingLouder[filename]) {
- writers--
- if (writers < 1) return done()
- }
- else {
- writeFile(filename, keepItGoingLouder[filename], function (err) {
- if (err) errors++
-
- writeAlmostForever(filename)
- })
- }
-}
-
-function done() {
- rimraf(BASEDIR, function () {
- if (errors > 0) console.log("not ok - %d errors", errors)
- else console.log("ok")
- })
-}
-
-mkdirp(BASEDIR, function go() {
- for (var i = 0; i < 16; i++) {
- var filename = resolve(BASEDIR, gensym() + ".txt")
-
- keepItGoingLouder[filename] = ""
- for (var j = 0; j < 512; j++) keepItGoingLouder[filename] += filename
-
- writers++
- writeAlmostForever(filename)
- }
-
- setTimeout(function viktor() {
- // kill all the writers
- keepItGoingLouder = {}
- }, 3 * 1000)
-})
+++ /dev/null
-{
- "name": "d2",
- "version": "1.0.0",
- "description": "how do you *really* know you exist?",
- "scripts": {
- "postinstall": "node blart.js"
- },
- "dependencies": {
- "graceful-fs": "^3.0.2",
- "mkdirp": "^0.5.0",
- "rimraf": "^2.2.8"
- },
- "author": "Forrest L Norvell <ogd@aoaioxxysz.net>",
- "license": "ISC"
-}
+++ /dev/null
-var createServer = require("http").createServer
-var spawn = require("child_process").spawn
-var fs = require("fs")
-var path = require("path")
-var pidfile = path.resolve(__dirname, "..", "..", "child.pid")
-
-if (process.argv[2]) {
- console.log("ok")
- createServer(function (req, res) {
- setTimeout(function () {
- res.writeHead(404)
- res.end()
- }, 1000)
- this.close()
- }).listen(8080)
-}
-else {
- var child = spawn(
- process.execPath,
- [__filename, "whatever"],
- {
- stdio: [0, 1, 2],
- detached: true
- }
- )
- child.unref()
-
- // kill any prior children, if existing.
- try {
- var pid = +fs.readFileSync(pidfile)
- process.kill(pid, "SIGKILL")
- } catch (er) {}
-
- fs.writeFileSync(pidfile, child.pid + "\n")
-}
+++ /dev/null
-{
- "name": "opdep",
- "version": "1.0.0",
- "description": "To explode, of course!",
- "main": "index.js",
- "scripts": {
- "preinstall": "node bad-server.js"
- },
- "dependencies": {
- "d1": "file:../d1",
- "d2": "file:../d2"
- },
- "author": "Forrest L Norvell <ogd@aoaioxxysz.net>",
- "license": "ISC"
-}
+++ /dev/null
-{
- "name": "optional-metadep-rollback-collision",
- "version": "1.0.0",
- "description": "let's just see about that race condition",
- "optionalDependencies": {
- "opdep": "file:./deps/opdep"
- },
- "author": "Forrest L Norvell <ogd@aoaioxxysz.net>",
- "license": "ISC"
-}
-var common = require("../common-tap.js")
-var test = require("tap").test
-var mkdirp = require("mkdirp")
-var rimraf = require("rimraf")
-var mr = require("npm-registry-mock")
-var path = require("path")
-
-var pkg = path.resolve(__dirname, "outdated")
-var cache = path.resolve(pkg, "cache")
-mkdirp.sync(cache)
-
-var EXEC_OPTS = {
- cwd: pkg
-}
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'outdated-color')
-function hasControlCodes(str) {
+var EXEC_OPTS = { cwd: pkg }
+
+function hasControlCodes (str) {
return str.length !== ansiTrim(str).length
}
function ansiTrim (str) {
- var r = new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|" +
- "\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g")
- return str.replace(r, "")
+ var r = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' +
+ '\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g')
+ return str.replace(r, '')
+}
+
+var json = {
+ name: 'outdated-color',
+ description: 'fixture',
+ version: '0.0.1',
+ dependencies: {
+ underscore: '1.3.1'
+ }
}
+test('setup', function (t) {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+
+ process.chdir(pkg)
+ t.end()
+})
+
// note hard to automate tests for color = true
// as npm kills the color config when it detects
-// it"s not running in a tty
-test("does not use ansi styling", function (t) {
+// it's not running in a tty
+test('does not use ansi styling', function (t) {
t.plan(4)
- mr({port : common.port}, function (er, s) { // create mock registry.
+ mr({ port: common.port }, function (er, s) { // create mock registry.
common.npm(
[
- "outdated",
- "--registry", common.registry,
- "underscore"
+ '--registry', common.registry,
+ 'outdated', 'underscore'
],
EXEC_OPTS,
function (err, code, stdout) {
t.ifError(err)
- t.notOk(code, "npm outdated exited with code 0")
+ t.notOk(code, 'npm outdated exited with code 0')
t.ok(stdout, stdout.length)
t.ok(!hasControlCodes(stdout))
s.close()
})
})
-test("cleanup", function (t) {
- rimraf.sync(cache)
+test('cleanup', function (t) {
+ cleanup()
t.end()
})
+
+function cleanup () {
+ rimraf.sync(pkg)
+}
-var common = require("../common-tap")
- , path = require("path")
- , test = require("tap").test
- , rimraf = require("rimraf")
- , npm = require("../../")
- , mr = require("npm-registry-mock")
- , pkg = path.resolve(__dirname, "outdated-depth")
- , cache = path.resolve(pkg, "cache")
- , nodeModules = path.resolve(pkg, "node_modules")
+var fs = require('graceful-fs')
+var path = require('path')
-function cleanup () {
- rimraf.sync(nodeModules)
- rimraf.sync(cache)
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var npm = require('../../')
+var common = require('../common-tap')
+
+var pkg = path.resolve(__dirname, 'outdated-depth')
+
+var json = {
+ name: 'outdated-depth',
+ version: '1.2.3',
+ dependencies: {
+ underscore: '1.3.1',
+ 'npm-test-peer-deps': '0.0.0'
+ }
}
-test("outdated depth zero", function (t) {
+test('setup', function (t) {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ process.chdir(pkg)
+
+ t.end()
+})
+
+test('outdated depth zero', function (t) {
var expected = [
pkg,
- "underscore",
- "1.3.1",
- "1.3.1",
- "1.5.1",
- "1.3.1"
+ 'underscore',
+ '1.3.1',
+ '1.3.1',
+ '1.5.1',
+ '1.3.1'
]
- process.chdir(pkg)
-
- mr({port : common.port}, function (er, s) {
- npm.load({
- cache: cache
- , loglevel: "silent"
- , registry: common.registry
- }
- , function () {
- npm.install(".", function (er) {
+ mr({ port: common.port }, function (er, s) {
+ npm.load(
+ {
+ loglevel: 'silent',
+ registry: common.registry
+ },
+ function () {
+ npm.install('.', function (er) {
if (er) throw new Error(er)
npm.outdated(function (err, d) {
if (err) throw new Error(err)
})
})
-test("cleanup", function (t) {
+test('cleanup', function (t) {
cleanup()
t.end()
})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
+++ /dev/null
-# just a test
+++ /dev/null
-module.exports = true
+++ /dev/null
-{
- "name": "whatever",
- "description": "yeah idk",
- "version": "1.2.3",
- "main": "index.js",
- "dependencies": {
- "underscore": "1.3.1",
- "npm-test-peer-deps": "0.0.0"
- },
- "repository": "git://github.com/luk-/whatever"
-}
// config
var pkg = path.resolve(__dirname, 'outdated-git')
var cache = path.resolve(pkg, 'cache')
+var json = {
+ name: 'outdated-git',
+ author: 'Rocko Artischocko',
+ description: 'fixture',
+ version: '0.0.1',
+ main: 'index.js',
+ dependencies: {
+ 'foo-private': 'git://github.com/robertkowalski/foo-private.git',
+ 'foo-private-credentials': 'git://user:pass@github.com/robertkowalski/foo-private.git',
+ 'foo-github': 'robertkowalski/foo'
+ }
+}
test('setup', function (t) {
setup()
t.plan(5)
npm.load({cache: cache, registry: common.registry, loglevel: 'silent'}, function () {
npm.commands.outdated([], function (er, d) {
- t.equal('git', d[0][3])
- t.equal('git', d[0][4])
- t.equal('git://github.com/robertkowalski/foo-private.git', d[0][5])
- t.equal('git://user:pass@github.com/robertkowalski/foo-private.git', d[1][5])
- t.equal('git+https://github.com/robertkowalski/foo', d[2][5])
+ t.equal(d[0][3], 'git')
+ t.equal(d[0][4], 'git')
+ t.equal(d[0][5], 'git://github.com/robertkowalski/foo-private.git')
+ t.equal(d[1][5], 'git://user:pass@github.com/robertkowalski/foo-private.git')
+ t.equal(d[2][5], 'github:robertkowalski/foo')
})
})
})
t.end()
})
-var json = {
- name: 'outdated-git',
- author: 'Rocko Artischocko',
- description: 'fixture',
- version: '0.0.1',
- main: 'index.js',
- dependencies: {
- 'foo-private': 'git://github.com/robertkowalski/foo-private.git',
- 'foo-private-credentials': 'git://user:pass@github.com/robertkowalski/foo-private.git',
- 'foo-github': 'robertkowalski/foo'
- }
-}
-
function setup () {
mkdirp.sync(cache)
fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2), 'utf8')
-var common = require("../common-tap.js")
-var test = require("tap").test
-var npm = require("../../")
-var mkdirp = require("mkdirp")
-var rimraf = require("rimraf")
-var mr = require("npm-registry-mock")
-var path = require("path")
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var npm = require('../../')
+var common = require('../common-tap.js')
// config
-var pkg = path.resolve(__dirname, "outdated-include-devdependencies")
-var cache = path.resolve(pkg, "cache")
-mkdirp.sync(cache)
+var pkg = path.resolve(__dirname, 'outdated-include-devdependencies')
+var cache = path.resolve(pkg, 'cache')
-test("includes devDependencies in outdated", function (t) {
+var json = {
+ author: 'Rocko Artischocko',
+ name: 'ignore-shrinkwrap',
+ version: '0.0.0',
+ devDependencies: {
+ underscore: '>=1.3.1'
+ }
+}
+
+test('setup', function (t) {
+ cleanup()
+ mkdirp.sync(cache)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ t.end()
+})
+
+test('includes devDependencies in outdated', function (t) {
process.chdir(pkg)
- mr({port : common.port}, function (er, s) {
- npm.load({cache: cache, registry: common.registry}, function () {
+ mr({ port: common.port }, function (er, s) {
+ npm.load({ cache: cache, registry: common.registry }, function () {
npm.outdated(function (er, d) {
- t.equal("1.5.1", d[0][3])
+ t.equal('1.5.1', d[0][3])
s.close()
t.end()
})
})
})
-test("cleanup", function (t) {
- rimraf.sync(cache)
+test('cleanup', function (t) {
+ cleanup()
t.end()
})
+
+function cleanup () {
+ rimraf.sync(pkg)
+}
+++ /dev/null
-{
- "author": "Rocko Artischocko",
- "name": "ignore-shrinkwrap",
- "version": "0.0.0",
- "devDependencies": {
- "underscore": ">=1.3.1"
- }
-}
\ No newline at end of file
-var common = require("../common-tap.js")
- , test = require("tap").test
- , rimraf = require("rimraf")
- , npm = require("../../")
- , mr = require("npm-registry-mock")
- , path = require("path")
- , osenv = require("osenv")
- , spawn = require("child_process").spawn
- , node = process.execPath
- , npmc = require.resolve("../../")
- , pkg = path.resolve(__dirname, "outdated-new-versions")
- , args = [ npmc
- , "outdated"
- , "--json"
- , "--silent"
- , "--registry=" + common.registry
- , "--cache=" + pkg + "/cache"
- ]
+var fs = require('graceful-fs')
+var path = require('path')
-var expected = { underscore:
- { current: "1.3.3"
- , wanted: "1.3.3"
- , latest: "1.5.1"
- , location: "node_modules" + path.sep + "underscore"
- }
- , request:
- { current: "0.9.5"
- , wanted: "0.9.5"
- , latest: "2.27.0"
- , location: "node_modules" + path.sep + "request"
- }
- }
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
-test("it should log json data", function (t) {
+var common = require('../common-tap.js')
+var server
+
+var pkg = path.resolve(__dirname, 'outdated-json')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ name: 'outdated-json',
+ author: 'Rockbert',
+ version: '0.0.0',
+ dependencies: {
+ underscore: '~1.3.1'
+ },
+ devDependencies: {
+ request: '~0.9.0'
+ }
+}
+
+var expected = {
+ underscore: {
+ current: '1.3.3',
+ wanted: '1.3.3',
+ latest: '1.5.1',
+ location: 'node_modules' + path.sep + 'underscore'
+ },
+ request: {
+ current: '0.9.5',
+ wanted: '0.9.5',
+ latest: '2.27.0',
+ location: 'node_modules' + path.sep + 'request'
+ }
+}
+
+test('setup', function (t) {
cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
process.chdir(pkg)
+ mr({ port: common.port }, function (er, s) {
+ t.ifError(er, 'mock registry should never fail to start')
+ server = s
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--silent',
+ 'install'
+ ],
+ EXEC_OPTS,
+ function (err, code) {
+ t.ifError(err, 'npm install ran without issue')
+ t.notOk(code, 'npm install ran without raising error code')
- mr({port : common.port}, function (er, s) {
- npm.load({
- cache: pkg + "/cache",
- loglevel: "silent",
- registry: common.registry }
- , function () {
- npm.install(".", function (err) {
- t.ifError(err, "error should not exist")
- var child = spawn(node, args)
- , out = ""
- child.stdout
- .on("data", function (buf) {
- out += buf.toString()
- })
- .pipe(process.stdout)
- child.on("exit", function () {
- out = JSON.parse(out)
- t.deepEqual(out, expected)
- s.close()
- t.end()
- })
- })
- })
+ t.end()
+ }
+ )
})
})
-test("cleanup", function (t) {
+test('it should log json data', function (t) {
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--silent',
+ '--json',
+ 'outdated'
+ ],
+ EXEC_OPTS,
+ function (err, code, stdout) {
+ t.ifError(err, 'npm outdated ran without issue')
+ t.notOk(code, 'npm outdated ran without raising error code')
+ var out
+ t.doesNotThrow(function () {
+ out = JSON.parse(stdout)
+ }, 'output correctly parsed as JSON')
+ t.deepEqual(out, expected)
+
+ t.end()
+ }
+ )
+})
+
+test('cleanup', function (t) {
+ server.close()
cleanup()
t.end()
})
function cleanup () {
// windows fix for locked files
process.chdir(osenv.tmpdir())
- rimraf.sync(pkg + "/node_modules")
- rimraf.sync(pkg + "/cache")
+ rimraf.sync(pkg)
}
-var path = require("path")
+var fs = require('graceful-fs')
+var path = require('path')
-var mr = require("npm-registry-mock")
-var rimraf = require("rimraf")
-var test = require("tap").test
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var rimraf = require('rimraf')
+var test = require('tap').test
-var common = require("../common-tap.js")
-var npm = require("../../")
+var common = require('../common-tap.js')
+var npm = require('../../')
// config
-var pkg = path.resolve(__dirname, "outdated")
-var cache = path.resolve(pkg, "cache")
-var nodeModules = path.resolve(pkg, "node_modules")
+var pkg = path.resolve(__dirname, 'outdated-long')
+var cache = path.resolve(pkg, 'cache')
-test("it should not throw", function (t) {
+var json = {
+ name: 'outdated-long',
+ description: 'fixture',
+ version: '0.0.1',
+ dependencies: {
+ underscore: '1.3.1'
+ }
+}
+
+test('setup', function (t) {
cleanup()
+ mkdirp.sync(cache)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+
process.chdir(pkg)
+ t.end()
+})
+test('it should not throw', function (t) {
var originalLog = console.log
+
var output = []
- var expOut = [ path.resolve(__dirname, "outdated/node_modules/underscore"),
- path.resolve(__dirname, "outdated/node_modules/underscore")
- + ":underscore@1.3.1"
- + ":underscore@1.3.1"
- + ":underscore@1.5.1"
- + ":dependencies" ]
- var expData = [ [ path.resolve(__dirname, "outdated"),
- "underscore",
- "1.3.1",
- "1.3.1",
- "1.5.1",
- "1.3.1",
- "dependencies" ] ]
+ var expOut = [
+ path.resolve(pkg, 'node_modules', 'underscore'),
+ path.resolve(pkg, 'node_modules', 'underscore') +
+ ':underscore@1.3.1' +
+ ':underscore@1.3.1' +
+ ':underscore@1.5.1' +
+ ':dependencies'
+ ]
+
+ var expData = [
+ [
+ pkg,
+ 'underscore',
+ '1.3.1',
+ '1.3.1',
+ '1.5.1',
+ '1.3.1',
+ 'dependencies'
+ ]
+ ]
console.log = function () {
output.push.apply(output, arguments)
}
- mr({port : common.port}, function (er, s) {
- npm.load({
- cache : "cache",
- loglevel : "silent",
- parseable : true,
- registry : common.registry
- },
- function () {
- npm.install(".", function (err) {
- t.ifError(err, "install success")
- npm.config.set("long", true)
- npm.outdated(function (er, d) {
- t.ifError(er, "outdated success")
- console.log = originalLog
- t.same(output, expOut)
- t.same(d, expData)
- s.close()
- t.end()
+ mr({ port: common.port }, function (er, s) {
+ npm.load(
+ {
+ cache: 'cache',
+ loglevel: 'silent',
+ parseable: true,
+ registry: common.registry
+ },
+ function () {
+ npm.install('.', function (err) {
+ t.ifError(err, 'install success')
+ npm.config.set('long', true)
+ npm.outdated(function (er, d) {
+ t.ifError(er, 'outdated success')
+
+ console.log = originalLog
+
+ t.same(output, expOut)
+ t.same(d, expData)
+
+ s.close()
+ t.end()
+ })
})
- })
- })
+ }
+ )
})
})
-test("cleanup", function (t) {
+test('cleanup', function (t) {
cleanup()
t.end()
})
function cleanup () {
- rimraf.sync(nodeModules)
- rimraf.sync(cache)
+ rimraf.sync(pkg)
}
-var common = require("../common-tap.js")
-var test = require("tap").test
-var npm = require("../../")
-var mkdirp = require("mkdirp")
-var rimraf = require("rimraf")
-var path = require("path")
+var fs = require('graceful-fs')
+var path = require('path')
-var mr = require("npm-registry-mock")
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var rimraf = require('rimraf')
+var test = require('tap').test
-var pkg = path.resolve(__dirname, "outdated-new-versions")
-var cache = path.resolve(pkg, "cache")
-mkdirp.sync(cache)
+var common = require('../common-tap.js')
+var npm = require('../../')
+var pkg = path.resolve(__dirname, 'outdated-new-versions')
+var cache = path.resolve(pkg, 'cache')
-test("dicovers new versions in outdated", function (t) {
+var json = {
+ name: 'new-versions-with-outdated',
+ author: 'Rockbert',
+ version: '0.0.0',
+ dependencies: {
+ underscore: '~1.3.1'
+ },
+ devDependencies: {
+ request: '~0.9.0'
+ }
+}
+
+test('setup', function (t) {
+ cleanup()
+ mkdirp.sync(cache)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ t.end()
+})
+
+test('dicovers new versions in outdated', function (t) {
process.chdir(pkg)
t.plan(2)
- mr({port : common.port}, function (er, s) {
- npm.load({cache: cache, registry: common.registry}, function () {
+ mr({ port: common.port }, function (er, s) {
+ npm.load({ cache: cache, registry: common.registry }, function () {
npm.outdated(function (er, d) {
for (var i = 0; i < d.length; i++) {
- if (d[i][1] === "underscore")
- t.equal("1.5.1", d[i][4])
- if (d[i][1] === "request")
- t.equal("2.27.0", d[i][4])
+ if (d[i][1] === 'underscore') t.equal('1.5.1', d[i][4])
+ if (d[i][1] === 'request') t.equal('2.27.0', d[i][4])
}
s.close()
t.end()
})
})
-test("cleanup", function (t) {
- rimraf.sync(cache)
+test('cleanup', function (t) {
+ cleanup()
t.end()
})
+
+function cleanup () {
+ rimraf.sync(pkg)
+}
+++ /dev/null
-{
- "name": "new-versions-with-outdated",
- "author": "Rockbert",
- "version": "0.0.0",
- "dependencies": {
- "underscore": "~1.3.1"
- },
- "devDependencies": {
- "request": "~0.9.0"
- }
-}
-var common = require("../common-tap.js")
-var test = require("tap").test
-var rimraf = require("rimraf")
-var npm = require("../../")
-var path = require("path")
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var mr = require('npm-registry-mock')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var npm = require('../../')
+var common = require('../common-tap.js')
-var mr = require("npm-registry-mock")
// config
-var pkg = path.resolve(__dirname, "outdated")
-var cache = path.resolve(pkg, "cache")
-var nodeModules = path.resolve(pkg, "node_modules")
+var pkg = path.resolve(__dirname, 'outdated')
+var cache = path.resolve(pkg, 'cache')
-test("it should not throw", function (t) {
+var json = {
+ name: 'outdated',
+ description: 'fixture',
+ version: '0.0.1',
+ dependencies: {
+ underscore: '1.3.1'
+ }
+}
+
+test('setup', function (t) {
cleanup()
+ mkdirp.sync(cache)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+
process.chdir(pkg)
+ t.end()
+})
+test('it should not throw', function (t) {
var originalLog = console.log
+
var output = []
- var expOut = [ path.resolve(__dirname, "outdated/node_modules/underscore")
- , path.resolve(__dirname, "outdated/node_modules/underscore")
- + ":underscore@1.3.1"
- + ":underscore@1.3.1"
- + ":underscore@1.5.1" ]
- var expData = [ [ path.resolve(__dirname, "outdated")
- , "underscore"
- , "1.3.1"
- , "1.3.1"
- , "1.5.1"
- , "1.3.1" ] ]
+ var expOut = [
+ path.resolve(pkg, 'node_modules', 'underscore'),
+ path.resolve(pkg, 'node_modules', 'underscore') +
+ ':underscore@1.3.1' +
+ ':underscore@1.3.1' +
+ ':underscore@1.5.1'
+ ]
+
+ var expData = [
+ [
+ pkg,
+ 'underscore',
+ '1.3.1',
+ '1.3.1',
+ '1.5.1',
+ '1.3.1'
+ ]
+ ]
console.log = function () {
output.push.apply(output, arguments)
}
- mr({port : common.port}, function (er, s) {
- npm.load({
- cache: "cache",
- loglevel: "silent",
- parseable: true,
- registry: common.registry }
- , function () {
- npm.install(".", function (err) {
- t.ifError(err, "install success")
- npm.outdated(function (er, d) {
- t.ifError(er, "outdated success")
- console.log = originalLog
- t.same(output, expOut)
- t.same(d, expData)
- s.close()
- t.end()
+ mr({ port: common.port }, function (er, s) {
+ npm.load(
+ {
+ cache: 'cache',
+ loglevel: 'silent',
+ parseable: true,
+ registry: common.registry
+ },
+ function () {
+ npm.install('.', function (err) {
+ t.ifError(err, 'install success')
+ npm.outdated(function (er, d) {
+ t.ifError(er, 'outdated success')
+
+ console.log = originalLog
+
+ t.same(output, expOut)
+ t.same(d, expData)
+
+ s.close()
+ t.end()
+ })
})
- })
- })
+ }
+ )
})
})
-test("cleanup", function (t) {
+test('cleanup', function (t) {
cleanup()
t.end()
})
function cleanup () {
- rimraf.sync(nodeModules)
- rimraf.sync(cache)
+ rimraf.sync(pkg)
}
+++ /dev/null
-# just a test
+++ /dev/null
-module.exports = true
+++ /dev/null
-{
- "name": "bla",
- "description": "fixture",
- "version": "0.0.1",
- "main": "index.js",
- "dependencies": {
- "underscore": "1.3.1"
- },
- "repository": "git://github.com/robertkowalski/bogusfixture"
-}
+++ /dev/null
-{
- "name": "package-with-peer-dep",
- "version": "0.0.0",
- "peerDependencies": {
- "opener": "*"
- }
-}
-var common = require("../common-tap")
-var path = require("path")
-var test = require("tap").test
-var rimraf = require("rimraf")
-var npm = require("../../")
-var mr = require("npm-registry-mock")
-var pkg = path.resolve(__dirname, "peer-deps-invalid")
-var cache = path.resolve(pkg, "cache")
-var nodeModules = path.resolve(pkg, "node_modules")
-
-test("installing dependencies that have conflicting peerDependencies", function (t) {
- rimraf.sync(nodeModules)
- rimraf.sync(cache)
+var fs = require('graceful-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 npm = require('../../')
+var common = require('../common-tap')
+
+var pkg = path.resolve(__dirname, 'peer-deps-invalid')
+var cache = path.resolve(pkg, 'cache')
+
+var json = {
+ author: 'Domenic Denicola <domenic@domenicdenicola.com> (http://domenicdenicola.com/)',
+ name: 'peer-deps-invalid',
+ version: '0.0.0',
+ dependencies: {
+ 'npm-test-peer-deps-file': 'http://localhost:1337/ok.js',
+ 'npm-test-peer-deps-file-invalid': 'http://localhost:1337/invalid.js'
+ }
+}
+
+test('setup', function (t) {
+ cleanup()
+ mkdirp.sync(cache)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ fs.writeFileSync(path.join(pkg, 'file-ok.js'), fileOK)
+ fs.writeFileSync(path.join(pkg, 'file-fail.js'), fileFail)
+
process.chdir(pkg)
+ t.end()
+})
+test('installing dependencies that have conflicting peerDependencies', function (t) {
var customMocks = {
- "get": {
- "/ok.js": [200, path.join(pkg, "file-ok.js")],
- "/invalid.js": [200, path.join(pkg, "file-fail.js")]
+ 'get': {
+ '/ok.js': [200, path.join(pkg, 'file-ok.js')],
+ '/invalid.js': [200, path.join(pkg, 'file-fail.js')]
}
}
- mr({port: common.port, mocks: customMocks}, function (err, s) { // create mock registry.
- t.ifError(err, "mock registry started")
- npm.load({
- cache: cache,
- registry: common.registry
- }, function () {
- npm.commands.install([], function (err) {
- if (!err) {
- t.fail("No error!")
- } else {
- t.equal(err.code, "EPEERINVALID")
- }
- t.end()
- s.close() // shutdown mock registry.
- })
- })
+ mr({port: common.port, mocks: customMocks}, function (err, s) {
+ t.ifError(err, 'mock registry started')
+ npm.load(
+ {
+ cache: cache,
+ registry: common.registry
+ },
+ function () {
+ npm.commands.install([], function (err) {
+ if (!err) {
+ t.fail('No error!')
+ } else {
+ t.equal(err.code, 'EPEERINVALID')
+ }
+ s.close()
+ t.end()
+ })
+ }
+ )
})
})
-test("cleanup", function (t) {
- rimraf.sync(nodeModules)
- rimraf.sync(cache)
+test('cleanup', function (t) {
+ cleanup()
t.end()
})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
+
+var fileFail = function () {
+/**package
+* { "name": "npm-test-peer-deps-file-invalid"
+* , "main": "index.js"
+* , "version": "1.2.3"
+* , "description":"This one should conflict with the other one"
+* , "peerDependencies": { "underscore": "1.3.3" }
+* }
+**/
+ module.exports = 'I\'m just a lonely index, naked as the day I was born.'
+}.toString().split('\n').slice(1, -1).join('\n')
+
+var fileOK = function () {
+/**package
+* { "name": "npm-test-peer-deps-file"
+* , "main": "index.js"
+* , "version": "1.2.3"
+* , "description":"No package.json in sight!"
+* , "peerDependencies": { "underscore": "1.3.1" }
+* , "dependencies": { "mkdirp": "0.3.5" }
+* }
+**/
+ module.exports = 'I\'m just a lonely index, naked as the day I was born.'
+}.toString().split('\n').slice(1, -1).join('\n')
+++ /dev/null
-/**package
-* { "name": "npm-test-peer-deps-file-invalid"
-* , "main": "index.js"
-* , "version": "1.2.3"
-* , "description":"This one should conflict with the other one"
-* , "peerDependencies": { "underscore": "1.3.3" }
-* }
-**/
-
-module.exports = "I\'m just a lonely index, naked as the day I was born."
+++ /dev/null
-/**package
-* { "name": "npm-test-peer-deps-file"
-* , "main": "index.js"
-* , "version": "1.2.3"
-* , "description":"No package.json in sight!"
-* , "peerDependencies": { "underscore": "1.3.1" }
-* , "dependencies": { "mkdirp": "0.3.5" }
-* }
-**/
-
-module.exports = "I\'m just a lonely index, naked as the day I was born."
+++ /dev/null
-{
- "author": "Domenic Denicola <domenic@domenicdenicola.com> (http://domenicdenicola.com/)",
- "name": "peer-deps-invalid",
- "version": "0.0.0",
- "dependencies": {
- "npm-test-peer-deps-file": "http://localhost:1337/ok.js",
- "npm-test-peer-deps-file-invalid": "http://localhost:1337/invalid.js"
- }
-}
-var common = require("../common-tap")
-var fs = require("fs")
-var path = require("path")
-var test = require("tap").test
-var rimraf = require("rimraf")
-var npm = require("../../")
-var mr = require("npm-registry-mock")
-var pkg = path.resolve(__dirname, "peer-deps-without-package-json")
-var cache = path.resolve(pkg, "cache")
-var nodeModules = path.resolve(pkg, "node_modules")
-
-test("installing a peerDependencies-using package without a package.json present (GH-3049)", function (t) {
-
- rimraf.sync(nodeModules)
- rimraf.sync(cache)
-
- fs.mkdirSync(nodeModules)
+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 npm = require('../../')
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'peer-deps-without-package-json')
+var cache = path.resolve(pkg, 'cache')
+var nodeModules = path.resolve(pkg, 'node_modules')
+
+test('setup', function (t) {
+ t.comment('test for https://github.com/npm/npm/issues/3049')
+ cleanup()
+ mkdirp.sync(cache)
+ mkdirp.sync(nodeModules)
+ fs.writeFileSync(path.join(pkg, 'file-js.js'), fileJS)
process.chdir(pkg)
+ t.end()
+})
+
+test('installing a peerDeps-using package without package.json', function (t) {
var customMocks = {
- "get": {
- "/ok.js": [200, path.join(pkg, "file-js.js")]
+ 'get': {
+ '/ok.js': [200, path.join(pkg, 'file-js.js')]
}
}
mr({port: common.port, mocks: customMocks}, function (err, s) {
- t.ifError(err, "mock registry booted")
+ t.ifError(err, 'mock registry booted')
npm.load({
registry: common.registry,
cache: cache
}, function () {
- npm.install(common.registry + "/ok.js", function (err) {
- t.ifError(err, "installed ok.js")
+ npm.install(common.registry + '/ok.js', function (err) {
+ t.ifError(err, 'installed ok.js')
t.ok(
- fs.existsSync(path.join(nodeModules, "/npm-test-peer-deps-file")),
- "passive peer dep installed"
+ fs.existsSync(path.join(nodeModules, 'npm-test-peer-deps-file')),
+ 'passive peer dep installed'
)
t.ok(
- fs.existsSync(path.join(nodeModules, "/underscore")),
- "underscore installed"
+ fs.existsSync(path.join(nodeModules, 'underscore')),
+ 'underscore installed'
)
t.end()
})
})
-test("cleanup", function (t) {
- rimraf.sync(nodeModules)
- rimraf.sync(cache)
+test('cleanup', function (t) {
+ cleanup()
t.end()
})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
+
+var fileJS = function () {
+/**package
+* { "name": "npm-test-peer-deps-file"
+* , "main": "index.js"
+* , "version": "1.2.3"
+* , "description":"No package.json in sight!"
+* , "peerDependencies": { "underscore": "1.3.1" }
+* , "dependencies": { "mkdirp": "0.3.5" }
+* }
+**/
+
+ module.exports = 'I\'m just a lonely index, naked as the day I was born.'
+}.toString().split('\n').slice(1, -1).join('\n')
+++ /dev/null
-/**package
-* { "name": "npm-test-peer-deps-file"
-* , "main": "index.js"
-* , "version": "1.2.3"
-* , "description":"No package.json in sight!"
-* , "peerDependencies": { "underscore": "1.3.1" }
-* , "dependencies": { "mkdirp": "0.3.5" }
-* }
-**/
-
-module.exports = "I\'m just a lonely index, naked as the day I was born."
-var test = require("tap").test
-var common = require("../common-tap")
-var fs = require("fs")
-var rimraf = require("rimraf")
-var mr = require("npm-registry-mock")
-var env = process.env
-var path = require("path")
+var fs = require('fs')
+var path = require('path')
-var pkg = path.resolve(__dirname, "prune")
-var cache = path.resolve(pkg, "cache")
-var nodeModules = path.resolve(pkg, "node_modules")
-
-var EXEC_OPTS = { cwd: pkg, env: env }
-EXEC_OPTS.env.npm_config_depth = "Infinity"
+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')
var server
-test("reg mock", function (t) {
- mr({port : common.port}, function (er, s) {
- server = s
- t.pass("registry mock started")
- t.end()
- })
-})
+var pkg = path.resolve(__dirname, 'prune')
+var cache = path.resolve(pkg, 'cache')
-function cleanup () {
- rimraf.sync(cache)
- rimraf.sync(nodeModules)
+var json = {
+ name: 'prune',
+ description: 'fixture',
+ version: '0.0.1',
+ main: 'index.js',
+ dependencies: {
+ underscore: '1.3.1'
+ },
+ devDependencies: {
+ mkdirp: '*'
+ }
+}
+
+var EXEC_OPTS = {
+ cwd: pkg,
+ npm_config_depth: 'Infinity'
}
-test("setup", function (t) {
+test('setup', function (t) {
cleanup()
- t.pass("setup")
- t.end()
+ mkdirp.sync(cache)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ mr({ port: common.port }, function (er, s) {
+ server = s
+ t.end()
+ })
})
-test("npm install", function (t) {
+test('npm install', function (t) {
common.npm([
- "install",
- "--cache", cache,
- "--registry", common.registry,
- "--loglevel", "silent",
- "--production", "false"
+ 'install',
+ '--cache', cache,
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ '--production', 'false'
], EXEC_OPTS, function (err, code, stdout, stderr) {
- t.ifErr(err, "install finished successfully")
- t.notOk(code, "exit ok")
- t.notOk(stderr, "Should not get data on stderr: " + stderr)
+ t.ifErr(err, 'install finished successfully')
+ t.notOk(code, 'exit ok')
+ t.notOk(stderr, 'Should not get data on stderr: ' + stderr)
t.end()
})
})
-test("npm install test-package", function (t) {
+test('npm install test-package', function (t) {
common.npm([
- "install", "test-package",
- "--cache", cache,
- "--registry", common.registry,
- "--loglevel", "silent",
- "--production", "false"
+ 'install', 'test-package',
+ '--cache', cache,
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ '--production', 'false'
], EXEC_OPTS, function (err, code, stdout, stderr) {
- t.ifErr(err, "install finished successfully")
- t.notOk(code, "exit ok")
- t.notOk(stderr, "Should not get data on stderr: " + stderr)
+ t.ifErr(err, 'install finished successfully')
+ t.notOk(code, 'exit ok')
+ t.notOk(stderr, 'Should not get data on stderr: ' + stderr)
t.end()
})
})
-test("verify installs", function (t) {
- var dirs = fs.readdirSync(pkg + "/node_modules").sort()
- t.same(dirs, [ "test-package", "mkdirp", "underscore" ].sort())
+test('verify installs', function (t) {
+ var dirs = fs.readdirSync(pkg + '/node_modules').sort()
+ t.same(dirs, [ 'test-package', 'mkdirp', 'underscore' ].sort())
t.end()
})
-test("npm prune", function (t) {
+test('npm prune', function (t) {
common.npm([
- "prune",
- "--loglevel", "silent",
- "--production", "false"
+ 'prune',
+ '--loglevel', 'silent',
+ '--production', 'false'
], EXEC_OPTS, function (err, code, stdout, stderr) {
- t.ifErr(err, "prune finished successfully")
- t.notOk(code, "exit ok")
- t.notOk(stderr, "Should not get data on stderr: " + stderr)
+ t.ifErr(err, 'prune finished successfully')
+ t.notOk(code, 'exit ok')
+ t.notOk(stderr, 'Should not get data on stderr: ' + stderr)
t.end()
})
})
-test("verify installs", function (t) {
- var dirs = fs.readdirSync(pkg + "/node_modules").sort()
- t.same(dirs, [ "mkdirp", "underscore" ])
+test('verify installs', function (t) {
+ var dirs = fs.readdirSync(pkg + '/node_modules').sort()
+ t.same(dirs, [ 'mkdirp', 'underscore' ])
t.end()
})
-test("npm prune", function (t) {
+test('npm prune', function (t) {
common.npm([
- "prune",
- "--loglevel", "silent",
- "--production"
+ 'prune',
+ '--loglevel', 'silent',
+ '--production'
], EXEC_OPTS, function (err, code, stderr) {
- t.ifErr(err, "prune finished successfully")
- t.notOk(code, "exit ok")
- t.equal(stderr, "unbuild mkdirp@0.3.5\n")
+ t.ifErr(err, 'prune finished successfully')
+ t.notOk(code, 'exit ok')
+ t.equal(stderr, 'unbuild mkdirp@0.3.5\n')
t.end()
})
})
-test("verify installs", function (t) {
- var dirs = fs.readdirSync(pkg + "/node_modules").sort()
- t.same(dirs, [ "underscore" ])
+test('verify installs', function (t) {
+ var dirs = fs.readdirSync(pkg + '/node_modules').sort()
+ t.same(dirs, [ 'underscore' ])
t.end()
})
-test("cleanup", function (t) {
+test('cleanup', function (t) {
server.close()
cleanup()
- t.pass("cleaned up")
+ t.pass('cleaned up')
t.end()
})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
+++ /dev/null
-{
- "name": "bla",
- "description": "fixture",
- "version": "0.0.1",
- "main": "index.js",
- "dependencies": {
- "underscore": "1.3.1"
- },
- "devDependencies": {
- "mkdirp": "*"
- },
- "repository": "git://github.com/robertkowalski/bogusfixture"
-}
var pkg = path.join(__dirname, "prepublish_package")
-// TODO: nock uses setImmediate, breaks 0.8: replace with mockRegistry
-if (!global.setImmediate) {
- global.setImmediate = function () {
- var args = [arguments[0], 0].concat([].slice.call(arguments, 1))
- setTimeout.apply(this, args)
- }
-}
-
test("setup", function (t) {
mkdirp(path.join(pkg, "cache"), next)
-var test = require("tap").test
-var common = require("../common-tap")
-var path = require("path")
-var pkg = path.resolve(__dirname, "scripts-whitespace-windows")
-var tmp = path.resolve(pkg, "tmp")
-var cache = path.resolve(pkg, "cache")
-var modules = path.resolve(pkg, "node_modules")
-var dep = path.resolve(pkg, "dep")
-
-var mkdirp = require("mkdirp")
-var rimraf = require("rimraf")
-
-test("setup", function (t) {
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap')
+
+var pkg = path.resolve(__dirname, 'scripts-whitespace-windows')
+var tmp = path.resolve(pkg, 'tmp')
+var cache = path.resolve(pkg, 'cache')
+var dep = path.resolve(pkg, 'dep')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ name: 'scripts-whitespace-windows',
+ version: '1.0.0',
+ description: 'a test',
+ repository: 'git://github.com/robertkowalski/bogus',
+ scripts: {
+ foo: 'foo --title \"Analysis of\" --recurse -d report src'
+ },
+ dependencies: {
+ 'scripts-whitespace-windows-dep': '0.0.1'
+ }
+}
+
+var dependency = {
+ name: 'scripts-whitespace-windows-dep',
+ version: '0.0.1',
+ bin: [ 'bin/foo' ]
+}
+
+test('setup', function (t) {
cleanup()
- mkdirp.sync(cache)
mkdirp.sync(tmp)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+ fs.writeFileSync(
+ path.join(pkg, 'README.md'),
+ "### THAT'S RIGHT\n"
+ )
- common.npm(["i", dep], {
+ mkdirp.sync(path.join(dep, 'bin'))
+ fs.writeFileSync(
+ path.join(dep, 'package.json'),
+ JSON.stringify(dependency, null, 2)
+ )
+ fs.writeFileSync(path.join(dep, 'bin', 'foo'), foo)
+
+ common.npm(['i', dep], {
cwd: pkg,
env: {
- "npm_config_cache": cache,
- "npm_config_tmp": tmp,
- "npm_config_prefix": pkg,
- "npm_config_global": "false"
+ npm_config_cache: cache,
+ npm_config_tmp: tmp,
+ npm_config_prefix: pkg,
+ npm_config_global: 'false'
}
}, function (err, code, stdout, stderr) {
- t.ifErr(err, "npm i " + dep + " finished without error")
- t.equal(code, 0, "npm i " + dep + " exited ok")
- t.notOk(stderr, "no output stderr")
+ t.ifErr(err, 'npm i ' + dep + ' finished without error')
+ t.equal(code, 0, 'npm i ' + dep + ' exited ok')
+ console.log('stderr', stderr)
+ t.notOk(stderr, 'no output stderr')
t.end()
})
})
-test("test", function (t) {
- common.npm(["run", "foo"], { cwd: pkg }, function (err, code, stdout, stderr) {
- t.ifErr(err, "npm run finished without error")
- t.equal(code, 0, "npm run exited ok")
- t.notOk(stderr, "no output stderr: ", stderr)
+test('test', function (t) {
+ common.npm(['run', 'foo'], EXEC_OPTS, function (err, code, stdout, stderr) {
+ t.ifErr(err, 'npm run finished without error')
+ t.equal(code, 0, 'npm run exited ok')
+ t.notOk(stderr, 'no output stderr: ', stderr)
stdout = stdout.trim()
t.ok(/npm-test-fine/.test(stdout))
t.end()
})
})
-test("cleanup", function (t) {
+test('cleanup', function (t) {
cleanup()
t.end()
})
-function cleanup() {
- rimraf.sync(cache)
- rimraf.sync(tmp)
- rimraf.sync(modules)
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
}
+
+var foo = function () {/*
+#!/usr/bin/env node
+
+if (process.argv.length === 8)
+ console.log('npm-test-fine')
+*/}.toString().split('\n').slice(1, -1).join('\n')
+++ /dev/null
-#!/usr/bin/env node
-
-if (process.argv.length === 8)
- console.log('npm-test-fine')
+++ /dev/null
-{
- "name": "scripts-whitespace-windows-dep",
- "version": "0.0.1",
- "bin": [ "bin/foo" ],
- "repository": "git://github.com/robertkowalski/bogusfixture"
-}
+++ /dev/null
-{
- "name": "scripts-whitespace-windows",
- "scripts": {
- "foo": "foo --title \"Analysis of\" --recurse -d report src"
- },
- "description": "a test",
- "repository": "git://github.com/robertkowalski/bogus",
- "dependencies": {
- "scripts-whitespace-windows-dep": "0.0.1"
- }
-}
-var common = require("../common-tap.js")
-var test = require("tap").test
-var rimraf = require("rimraf")
-var mr = require("npm-registry-mock")
-var fs = require("fs")
-var path = require("path")
-var pkg = path.resolve(__dirname, "search")
-var cache = path.resolve(pkg, "cache")
-var registryCache = path.resolve(cache, "localhost_1337", "-", "all")
-var cacheJsonFile = path.resolve(registryCache, ".cache.json")
-var mkdirp = require("mkdirp")
+var fs = require('graceful-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 pkg = path.resolve(__dirname, 'search')
+var cache = path.resolve(pkg, 'cache')
+var registryCache = path.resolve(cache, 'localhost_1337', '-', 'all')
+var cacheJsonFile = path.resolve(registryCache, '.cache.json')
var timeMock = {
epoch: 1411727900,
- future: 1411727900+100,
- all: 1411727900+25,
+ future: 1411727900 + 100,
+ all: 1411727900 + 25,
since: 0 // filled by since server callback
}
var EXEC_OPTS = {}
-function cleanupCache() {
- rimraf.sync(cache)
-}
-function cleanup () { cleanupCache() }
-
-function setupCache() {
- mkdirp.sync(cache)
- mkdirp.sync(registryCache)
- var res = fs.writeFileSync(cacheJsonFile, stringifyUpdated(timeMock.epoch))
- if (res) throw new Error("Creating cache file failed")
-}
-
var mocks = {
/* Since request, always response with an _update time > the time requested */
- sinceFuture: function(server) {
- server.filteringPathRegEx(/startkey=[^&]*/g, function(s) {
+ sinceFuture: function (server) {
+ server.filteringPathRegEx(/startkey=[^&]*/g, function (s) {
var _allMock = JSON.parse(JSON.stringify(allMock))
- timeMock.since = _allMock._updated = s.replace("startkey=", "")
- server.get("/-/all/since?stale=update_after&" + s)
+ timeMock.since = _allMock._updated = s.replace('startkey=', '')
+ server.get('/-/all/since?stale=update_after&' + s)
.reply(200, _allMock)
return s
})
},
- allFutureUpdatedOnly: function(server) {
- server.get("/-/all")
+ allFutureUpdatedOnly: function (server) {
+ server.get('/-/all')
.reply(200, stringifyUpdated(timeMock.future))
},
- all: function(server) {
- server.get("/-/all")
+ all: function (server) {
+ server.get('/-/all')
.reply(200, allMock)
}
}
-
-test("No previous cache, init cache triggered by first search", function(t) {
- cleanupCache()
+test('No previous cache, init cache triggered by first search', function (t) {
+ cleanup()
mr({ port: common.port, plugin: mocks.allFutureUpdatedOnly }, function (err, s) {
+ t.ifError(err, 'mock registry started')
common.npm([
- "search", "do not do extra search work on my behalf",
- "--registry", common.registry,
- "--cache", cache,
- "--loglevel", "silent",
- "--color", "always"
+ 'search', 'do not do extra search work on my behalf',
+ '--registry', common.registry,
+ '--cache', cache,
+ '--loglevel', 'silent',
+ '--color', 'always'
],
EXEC_OPTS,
- function(err, code) {
+ function (err, code) {
s.close()
- t.equal(code, 0, "search finished successfully")
- t.ifErr(err, "search finished successfully")
+ t.equal(code, 0, 'search finished successfully')
+ t.ifErr(err, 'search finished successfully')
+
+ t.ok(
+ fs.existsSync(cacheJsonFile),
+ cacheJsonFile + ' expected to have been created'
+ )
- t.ok(fs.existsSync(cacheJsonFile),
- cacheJsonFile + " expected to have been created")
- var cacheData = JSON.parse(fs.readFileSync(cacheJsonFile, "utf8"))
+ var cacheData = JSON.parse(fs.readFileSync(cacheJsonFile, 'utf8'))
t.equal(cacheData._updated, String(timeMock.future))
t.end()
})
})
})
-test("previous cache, _updated set, should trigger since request", function(t) {
- cleanupCache()
+test('previous cache, _updated set, should trigger since request', function (t) {
setupCache()
- function m(server) {
- [ mocks.all, mocks.sinceFuture ].forEach(function(m) {
+ function m (server) {
+ [ mocks.all, mocks.sinceFuture ].forEach(function (m) {
m(server)
})
}
mr({ port: common.port, plugin: m }, function (err, s) {
+ t.ifError(err, 'mock registry started')
common.npm([
- "search", "do not do extra search work on my behalf",
- "--registry", common.registry,
- "--cache", cache,
- "--loglevel", "silly",
- "--color", "always"
+ 'search', 'do not do extra search work on my behalf',
+ '--registry', common.registry,
+ '--cache', cache,
+ '--loglevel', 'silly',
+ '--color', 'always'
],
EXEC_OPTS,
- function(err, code) {
+ function (err, code) {
s.close()
- t.equal(code, 0, "search finished successfully")
- t.ifErr(err, "search finished successfully")
+ t.equal(code, 0, 'search finished successfully')
+ t.ifErr(err, 'search finished successfully')
- var cacheData = JSON.parse(fs.readFileSync(cacheJsonFile, "utf8"))
- t.equal(cacheData._updated,
+ var cacheData = JSON.parse(fs.readFileSync(cacheJsonFile, 'utf8'))
+ t.equal(
+ cacheData._updated,
timeMock.since,
- "cache update time gotten from since response")
- cleanupCache()
+ 'cache update time gotten from since response'
+ )
t.end()
})
})
})
-
var searches = [
{
- term: "f36b6a6123da50959741e2ce4d634f96ec668c56",
- description: "non-regex",
+ term: 'f36b6a6123da50959741e2ce4d634f96ec668c56',
+ description: 'non-regex',
location: 241
},
{
- term: "/f36b6a6123da50959741e2ce4d634f96ec668c56/",
- description: "regex",
+ term: '/f36b6a6123da50959741e2ce4d634f96ec668c56/',
+ description: 'regex',
location: 241
}
]
-searches.forEach(function(search) {
- test(search.description + " search in color", function(t) {
- cleanupCache()
+searches.forEach(function (search) {
+ test(search.description + ' search in color', function (t) {
+ cleanup()
mr({ port: common.port, plugin: mocks.all }, function (er, s) {
common.npm([
- "search", search.term,
- "--registry", common.registry,
- "--cache", cache,
- "--loglevel", "silent",
- "--color", "always"
+ 'search', search.term,
+ '--registry', common.registry,
+ '--cache', cache,
+ '--loglevel', 'silent',
+ '--color', 'always'
],
EXEC_OPTS,
- function(err, code, stdout) {
+ function (err, code, stdout) {
s.close()
- t.equal(code, 0, "search finished successfully")
- t.ifErr(err, "search finished successfully")
+ t.equal(code, 0, 'search finished successfully')
+ t.ifErr(err, 'search finished successfully')
// \033 == \u001B
- var markStart = "\u001B\\[[0-9][0-9]m"
- var markEnd = "\u001B\\[0m"
+ var markStart = '\u001B\\[[0-9][0-9]m'
+ var markEnd = '\u001B\\[0m'
- var re = new RegExp(markStart + ".*?" + markEnd)
+ var re = new RegExp(markStart + '.*?' + markEnd)
var cnt = stdout.search(re)
- t.equal(cnt, search.location,
- search.description + " search for " + search.term)
+ t.equal(
+ cnt,
+ search.location,
+ search.description + ' search for ' + search.term
+ )
t.end()
})
})
})
})
-test("cleanup", function (t) {
+test('cleanup', function (t) {
cleanup()
t.end()
})
-function stringifyUpdated(time) {
- return JSON.stringify({ _updated : String(time) })
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
+
+function setupCache () {
+ cleanup()
+ mkdirp.sync(cache)
+ mkdirp.sync(registryCache)
+ var res = fs.writeFileSync(cacheJsonFile, stringifyUpdated(timeMock.epoch))
+ if (res) throw new Error('Creating cache file failed')
+}
+
+function stringifyUpdated (time) {
+ return JSON.stringify({ _updated: String(time) })
}
var allMock = {
- "_updated": timeMock.all,
- "generator-frontcow": {
- "name": "generator-frontcow",
- "description": "f36b6a6123da50959741e2ce4d634f96ec668c56 This is a fake description to ensure we do not accidentally search the real npm registry or use some kind of cache",
- "dist-tags": {
- "latest": "0.1.19"
+ '_updated': timeMock.all,
+ 'generator-frontcow': {
+ 'name': 'generator-frontcow',
+ 'description': 'f36b6a6123da50959741e2ce4d634f96ec668c56 This is a fake description to ensure we do not accidentally search the real npm registry or use some kind of cache',
+ 'dist-tags': {
+ 'latest': '0.1.19'
},
- "maintainers": [
+ 'maintainers': [
{
- "name": "bcabanes",
- "email": "contact@benjamincabanes.com"
+ 'name': 'bcabanes',
+ 'email': 'contact@benjamincabanes.com'
}
],
- "homepage": "https://github.com/bcabanes/generator-frontcow",
- "keywords": [
- "sass",
- "frontend",
- "yeoman-generator",
- "atomic",
- "design",
- "sass",
- "foundation",
- "foundation5",
- "atomic design",
- "bourbon",
- "polyfill",
- "font awesome"
+ 'homepage': 'https://github.com/bcabanes/generator-frontcow',
+ 'keywords': [
+ 'sass',
+ 'frontend',
+ 'yeoman-generator',
+ 'atomic',
+ 'design',
+ 'sass',
+ 'foundation',
+ 'foundation5',
+ 'atomic design',
+ 'bourbon',
+ 'polyfill',
+ 'font awesome'
],
- "repository": {
- "type": "git",
- "url": "https://github.com/bcabanes/generator-frontcow"
+ 'repository': {
+ 'type': 'git',
+ 'url': 'https://github.com/bcabanes/generator-frontcow'
},
- "author": {
- "name": "ben",
- "email": "contact@benjamincabanes.com",
- "url": "https://github.com/bcabanes"
+ 'author': {
+ 'name': 'ben',
+ 'email': 'contact@benjamincabanes.com',
+ 'url': 'https://github.com/bcabanes'
},
- "bugs": {
- "url": "https://github.com/bcabanes/generator-frontcow/issues"
+ 'bugs': {
+ 'url': 'https://github.com/bcabanes/generator-frontcow/issues'
},
- "license": "MIT",
- "readmeFilename": "README.md",
- "time": {
- "modified": "2014-10-03T02:26:18.406Z"
+ 'license': 'MIT',
+ 'readmeFilename': 'README.md',
+ 'time': {
+ 'modified': '2014-10-03T02:26:18.406Z'
},
- "versions": {
- "0.1.19": "latest"
+ 'versions': {
+ '0.1.19': 'latest'
}
},
- "marko": {
- "name": "marko",
- "description": "Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.",
- "dist-tags": {
- "latest": "1.2.16"
+ 'marko': {
+ 'name': 'marko',
+ 'description': 'Marko is an extensible, streaming, asynchronous, high performance, HTML-based templating language that can be used in Node.js or in the browser.',
+ 'dist-tags': {
+ 'latest': '1.2.16'
},
- "maintainers": [
+ 'maintainers': [
{
- "name": "pnidem",
- "email": "pnidem@gmail.com"
+ 'name': 'pnidem',
+ 'email': 'pnidem@gmail.com'
},
{
- "name": "philidem",
- "email": "phillip.idem@gmail.com"
+ 'name': 'philidem',
+ 'email': 'phillip.idem@gmail.com'
}
],
- "homepage": "https://github.com/raptorjs/marko",
- "keywords": [
- "templating",
- "template",
- "async",
- "streaming"
+ 'homepage': 'https://github.com/raptorjs/marko',
+ 'keywords': [
+ 'templating',
+ 'template',
+ 'async',
+ 'streaming'
],
- "repository": {
- "type": "git",
- "url": "https://github.com/raptorjs/marko.git"
+ 'repository': {
+ 'type': 'git',
+ 'url': 'https://github.com/raptorjs/marko.git'
},
- "author": {
- "name": "Patrick Steele-Idem",
- "email": "pnidem@gmail.com"
+ 'author': {
+ 'name': 'Patrick Steele-Idem',
+ 'email': 'pnidem@gmail.com'
},
- "bugs": {
- "url": "https://github.com/raptorjs/marko/issues"
+ 'bugs': {
+ 'url': 'https://github.com/raptorjs/marko/issues'
},
- "license": "Apache License v2.0",
- "readmeFilename": "README.md",
- "users": {
- "pnidem": true
+ 'license': 'Apache License v2.0',
+ 'readmeFilename': 'README.md',
+ 'users': {
+ 'pnidem': true
},
- "time": {
- "modified": "2014-10-03T02:27:31.775Z"
+ 'time': {
+ 'modified': '2014-10-03T02:27:31.775Z'
},
- "versions": {
- "1.2.16": "latest"
+ 'versions': {
+ '1.2.16': 'latest'
}
}
}
-var test = require("tap").test
- , npm = require("../../")
- , mr = require("npm-registry-mock")
- , common = require("../common-tap.js")
- , path = require("path")
- , fs = require("fs")
- , osenv = require("osenv")
- , rimraf = require("rimraf")
- , pkg = path.resolve(__dirname, "shrinkwrap-empty-deps")
- , cache = path.resolve(pkg, "cache")
-
-test("returns a list of removed items", function (t) {
- var desiredResultsPath = path.resolve(pkg, "npm-shrinkwrap.json")
+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 pkg = path.resolve(__dirname, 'shrinkwrap-empty-deps')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ author: 'Rockbert',
+ name: 'shrinkwrap-empty-deps',
+ version: '0.0.0',
+ dependencies: {},
+ devDependencies: {}
+}
+
+test('setup', function (t) {
cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+
+ process.chdir(pkg)
+ t.end()
+})
+
+test('returns a list of removed items', function (t) {
+ mr({ port: common.port }, function (er, s) {
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ 'shrinkwrap'
+ ],
+ EXEC_OPTS,
+ function (err, code, stdout, stderr) {
+ t.ifError(err, 'shrinkwrap ran without issue')
+ t.notOk(code, 'shrinkwrap ran without raising error code')
+
+ fs.readFile(path.resolve(pkg, 'npm-shrinkwrap.json'), function (err, desired) {
+ t.ifError(err, 'read npm-shrinkwrap.json without issue')
+ t.same(
+ {
+ 'name': 'shrinkwrap-empty-deps',
+ 'version': '0.0.0',
+ 'dependencies': {}
+ },
+ JSON.parse(desired),
+ 'shrinkwrap handled empty deps without exploding'
+ )
- mr({port : common.port}, function (er, s) {
- setup(function () {
- npm.shrinkwrap([], function (err) {
- if (err) return t.fail(err)
- fs.readFile(desiredResultsPath, function (err, desired) {
- if (err) return t.fail(err)
- t.deepEqual({
- "name": "npm-test-shrinkwrap-empty-deps",
- "version": "0.0.0",
- "dependencies": {}
- }, JSON.parse(desired))
- cleanup()
s.close()
t.end()
})
- })
- })
+ }
+ )
})
})
-function setup (cb) {
+test('cleanup', function (t) {
cleanup()
- process.chdir(pkg)
- npm.load({cache: cache, registry: common.registry}, function () {
- cb()
- })
-}
+
+ t.end()
+})
function cleanup () {
process.chdir(osenv.tmpdir())
- rimraf.sync(path.resolve(pkg, "npm-shrinkwrap.json"))
+ rimraf.sync(pkg)
}
+++ /dev/null
-{
- "author": "Rockbert",
- "name": "npm-test-shrinkwrap-empty-deps",
- "version": "0.0.0",
- "dependencies": {},
- "devDependencies": {}
-}
-var common = require("../common-tap")
- , test = require("tap").test
- , path = require("path")
- , rimraf = require("rimraf")
- , mkdirp = require("mkdirp")
- , pkg = path.resolve(__dirname, "startstop")
- , cache = path.resolve(pkg, "cache")
- , tmp = path.resolve(pkg, "tmp")
- , opts = { cwd: pkg }
+var fs = require('graceful-fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+var test = require('tap').test
+
+var common = require('../common-tap')
+
+var pkg = path.resolve(__dirname, 'startstop')
+
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ name: 'startstop',
+ version: '1.2.3',
+ scripts: {
+ start: 'node -e \"console.log(\'start\')\"',
+ stop: 'node -e \"console.log(\'stop\')\"'
+ }
+}
function testOutput (t, command, er, code, stdout, stderr) {
- t.notOk(code, "npm " + command + " exited with code 0")
+ t.notOk(code, 'npm ' + command + ' exited with code 0')
- if (stderr)
- throw new Error("npm " + command + " stderr: " + stderr.toString())
+ if (stderr) throw new Error('npm ' + command + ' stderr: ' + stderr.toString())
stdout = stdout.trim().split(/\n|\r/)
stdout = stdout[stdout.length - 1]
t.end()
}
-function cleanup () {
- rimraf.sync(cache)
- rimraf.sync(tmp)
-}
-
-test("setup", function (t) {
+test('setup', function (t) {
cleanup()
- mkdirp.sync(cache)
- mkdirp.sync(tmp)
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
t.end()
})
-test("npm start", function (t) {
- common.npm(["start"], opts, testOutput.bind(null, t, "start"))
+test('npm start', function (t) {
+ common.npm(['start'], EXEC_OPTS, testOutput.bind(null, t, 'start'))
})
-test("npm stop", function (t) {
- common.npm(["stop"], opts, testOutput.bind(null, t, "stop"))
+test('npm stop', function (t) {
+ common.npm(['stop'], EXEC_OPTS, testOutput.bind(null, t, 'stop'))
})
-test("npm restart", function (t) {
- common.npm(["restart"], opts, function (er, c, stdout) {
- if (er)
- throw er
+test('npm restart', function (t) {
+ common.npm(['restart'], EXEC_OPTS, function (er, c, stdout) {
+ if (er) throw er
- var output = stdout.split("\n").filter(function (val) {
+ var output = stdout.split('\n').filter(function (val) {
return val.match(/^s/)
})
- t.same(output.sort(), ["start", "stop"].sort())
+ t.same(output.sort(), ['start', 'stop'].sort())
t.end()
})
})
-test("cleanup", function (t) {
+test('cleanup', function (t) {
cleanup()
t.end()
})
+
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
+}
+++ /dev/null
-{"name":"startstop"
-,"version":"1.2.3"
-,"scripts":{
- "start":"node -e \"console.log('start')\"",
- "stop":"node -e \"console.log('stop')\""
- }
-}
-var path = require("path")
-var test = require("tap").test
-var fs = require("fs")
-var rimraf = require("rimraf")
-var mkdirp = require("mkdirp")
-var sprintf = require("sprintf-js").sprintf
-var common = require("../common-tap.js")
+var fs = require('fs')
+var path = require('path')
+
+var mkdirp = require('mkdirp')
+var rimraf = require('rimraf')
+var test = require('tap').test
+var sprintf = require('sprintf-js').sprintf
+
+var common = require('../common-tap.js')
+var pkg = path.resolve(__dirname, 'umask-lifecycle')
-var pkg = path.resolve(__dirname, "umask-lifecycle")
var pj = JSON.stringify({
- name:"x",
- version: "1.2.3",
- scripts: { umask: "$npm_execpath config get umask && echo \"$npm_config_umask\" && node -p 'process.umask()'" }
-}, null, 2) + "\n"
+ name: 'x',
+ version: '1.2.3',
+ scripts: { umask: '$npm_execpath config get umask && echo "$npm_config_umask" && node -pe "process.umask()"' }
+}, null, 2) + '\n'
var umask = process.umask()
var expected = [
- "",
- "> x@1.2.3 umask "+path.join(__dirname, "umask-lifecycle"),
- "> $npm_execpath config get umask && echo \"$npm_config_umask\" && node -p 'process.umask()'",
- "",
- sprintf("%04o", umask),
- sprintf("%04o", umask),
- sprintf("%d", umask),
- ""
-].join("\n")
+ '',
+ '> x@1.2.3 umask ' + path.join(__dirname, 'umask-lifecycle'),
+ '> $npm_execpath config get umask && echo "$npm_config_umask" && node -pe "process.umask()"',
+ '',
+ sprintf('%04o', umask),
+ sprintf('%04o', umask),
+ sprintf('%d', umask),
+ ''
+].join('\n')
-test("setup", function (t) {
+test('setup', function (t) {
rimraf.sync(pkg)
mkdirp.sync(pkg)
- fs.writeFileSync(pkg + "/package.json", pj)
+ fs.writeFileSync(pkg + '/package.json', pj)
t.end()
})
-test("umask script", function (t) {
- common.npm(["run", "umask"], {
+test('umask script', function (t) {
+ common.npm(['run', 'umask'], {
cwd: pkg,
env: {
PATH: process.env.PATH,
Path: process.env.Path,
- "npm_config_loglevel": "warn"
+ 'npm_config_loglevel': 'warn'
}
}, function (er, code, sout, serr) {
t.equal(sout, expected)
- t.equal(serr, "")
+ t.equal(serr, '')
t.end()
})
})
-test("clean", function (t) {
+test('clean', function (t) {
rimraf.sync(pkg)
t.end()
})
-var test = require("tap").test
- , npm = require("../../")
- , rimraf = require("rimraf")
- , mr = require("npm-registry-mock")
- , common = require("../common-tap.js")
- , path = require("path")
- , pkg = path.join(__dirname, "uninstall-package")
-
-test("returns a list of removed items", function (t) {
- t.plan(1)
- mr({port : common.port}, function (er, s) {
- setup(function () {
- npm.install(".", function (err) {
- if (err) return t.fail(err)
- npm.uninstall("underscore", "request", "lala", function (err, d) {
- if (err) return t.fail(err)
- t.same(d.sort(), ["underscore", "request"].sort())
- s.close()
- t.end()
- })
- })
- })
- })
-})
+var fs = require('graceful-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 pkg = path.join(__dirname, 'uninstall-package')
-test("cleanup", function (t) {
+var EXEC_OPTS = { cwd: pkg }
+
+var json = {
+ name: 'uninstall-package',
+ version: '0.0.0',
+ dependencies: {
+ underscore: '~1.3.1',
+ request: '~0.9.0'
+ }
+}
+
+test('setup', function (t) {
cleanup()
+ mkdirp.sync(pkg)
+ process.chdir(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+
t.end()
})
-function setup (cb) {
- cleanup()
- process.chdir(pkg)
- npm.load({cache: pkg + "/cache", registry: common.registry}, function () {
- cb()
+test('returns a list of removed items', function (t) {
+ mr({ port: common.port }, function (er, s) {
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ 'install', '.'
+ ],
+ EXEC_OPTS,
+ function (err, code, stdout, stderr) {
+ t.ifError(err, 'install ran without issue')
+ t.notOk(code, 'install ran without raising error code')
+ common.npm(
+ [
+ '--registry', common.registry,
+ '--loglevel', 'silent',
+ 'uninstall', 'underscore', 'request', 'lala'
+ ],
+ EXEC_OPTS,
+ function (err, code, stdout, stderr) {
+ t.ifError(err, 'uninstall ran without issue')
+ t.notOk(code, 'uninstall ran without raising error code')
+ t.has(stdout, /unbuild underscore@1.3.3/, 'underscore uninstalled')
+ t.has(stdout, /unbuild request@0.9.5/, 'request uninstalled')
+
+ s.close()
+ t.end()
+ }
+ )
+ }
+ )
})
-}
+})
+
+test('cleanup', function (t) {
+ cleanup()
+ t.end()
+})
function cleanup () {
- rimraf.sync(pkg + "/node_modules")
- rimraf.sync(pkg + "/cache")
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
}
+++ /dev/null
-{
- "name": "beep",
- "version": "0.0.0",
- "author": "Rockbert",
- "description": "i am a fixture",
- "main": "index.js",
- "dependencies": {
- "underscore": "~1.3.1",
- "request": "~0.9.0"
- }
-}
-var test = require("tap").test
-var rimraf = require("rimraf")
-var mkdirp = require("mkdirp")
-var common = require("../common-tap.js")
-var path = require("path")
-var fs = require("fs")
-var dir = path.resolve(__dirname, "unpack-foreign-tarball")
-var root = path.resolve(dir, "root")
-var nm = path.resolve(root, "node_modules")
-var cache = path.resolve(dir, "cache")
-var tmp = path.resolve(dir, "tmp")
-var pkg = path.resolve(nm, "npm-test-gitignore")
+var fs = require('graceful-fs')
+var path = require('path')
-var env = {
- "npm_config_cache": cache,
- "npm_config_tmp": tmp
-}
+var test = require('tap').test
+var mkdirp = require('mkdirp')
+var osenv = require('osenv')
+var rimraf = require('rimraf')
+
+var common = require('../common-tap.js')
+
+var fixtures = path.resolve(__dirname, '..', 'fixtures')
+
+var pkg = path.resolve(__dirname, 'unpack-foreign-tarball')
+var nm = path.resolve(pkg, 'node_modules')
+var target = path.resolve(nm, 'npm-test-gitignore')
+var cache = path.resolve(pkg, 'cache')
+var tmp = path.resolve(pkg, 'tmp')
-var conf = {
- env: env,
- cwd: root,
- stdio: [ "pipe", "pipe", 2 ]
+var EXEC_OPTS = {
+ env: {
+ 'npm_config_cache': cache,
+ 'npm_config_tmp': tmp
+ },
+ cwd: pkg,
+ stdio: [ 'pipe', 'pipe', 2 ]
}
function verify (t, files, err, code) {
if (code) {
- t.fail("exited with failure: " + code)
+ t.fail('exited with failure: ' + code)
return t.end()
}
- var actual = fs.readdirSync(pkg).sort()
- var expect = files.concat([".npmignore", "package.json"]).sort()
+ var actual = fs.readdirSync(target).sort()
+ var expect = files.concat(['.npmignore', 'package.json']).sort()
t.same(actual, expect)
t.end()
}
-test("npmignore only", function (t) {
+test('setup', function (t) {
setup()
- var file = path.resolve(dir, "npmignore.tgz")
- common.npm(["install", file], conf, verify.bind(null, t, ["foo"]))
+ t.comment('test for https://github.com/npm/npm/issues/5658')
+ t.end()
+})
+
+test('npmignore only', function (t) {
+ var file = path.resolve(fixtures, 'npmignore.tgz')
+ common.npm(['install', file], EXEC_OPTS, verify.bind(null, t, ['foo']))
})
-test("gitignore only", function (t) {
+test('gitignore only', function (t) {
setup()
- var file = path.resolve(dir, "gitignore.tgz")
- common.npm(["install", file], conf, verify.bind(null, t, ["foo"]))
+ var file = path.resolve(fixtures, 'gitignore.tgz')
+ common.npm(['install', file], EXEC_OPTS, verify.bind(null, t, ['foo']))
})
-test("gitignore and npmignore", function (t) {
+test('gitignore and npmignore', function (t) {
setup()
- var file = path.resolve(dir, "gitignore-and-npmignore.tgz")
- common.npm(["install", file], conf, verify.bind(null, t, ["foo", "bar"]))
+ var file = path.resolve(fixtures, 'gitignore-and-npmignore.tgz')
+ common.npm(['install', file], EXEC_OPTS, verify.bind(null, t, ['foo', 'bar']))
})
-test("gitignore and npmignore, not gzipped 1/2", function (t) {
+test('gitignore and npmignore, not gzipped 1/2', function (t) {
setup()
- var file = path.resolve(dir, "gitignore-and-npmignore.tar")
- common.npm(["install", file], conf, verify.bind(null, t, ["foo", "bar"]))
+ var file = path.resolve(fixtures, 'gitignore-and-npmignore.tar')
+ common.npm(['install', file], EXEC_OPTS, verify.bind(null, t, ['foo', 'bar']))
})
-test("gitignore and npmignore, not gzipped 2/2", function (t) {
+test('gitignore and npmignore, not gzipped 2/2', function (t) {
setup()
- var file = path.resolve(dir, "gitignore-and-npmignore-2.tar")
- common.npm(["install", file], conf, verify.bind(null, t, ["foo", "bar"]))
+ var file = path.resolve(fixtures, 'gitignore-and-npmignore-2.tar')
+ common.npm(['install', file], EXEC_OPTS, verify.bind(null, t, ['foo', 'bar']))
})
-test("clean", function (t) {
- clean()
+test('cleanup', function (t) {
+ cleanup()
t.end()
})
function setup () {
- clean()
+ cleanup()
mkdirp.sync(nm)
- mkdirp.sync(cache)
mkdirp.sync(tmp)
}
-function clean () {
- rimraf.sync(root)
- rimraf.sync(cache)
- rimraf.sync(tmp)
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
}
-var common = require("../common-tap.js")
-var test = require("tap").test
-var npm = require("../../")
-var mkdirp = require("mkdirp")
-var rimraf = require("rimraf")
-var fs = require("fs")
-var path = require("path")
-var mr = require("npm-registry-mock")
-
-var PKG_DIR = path.resolve(__dirname, "update-save")
-var PKG = path.resolve(PKG_DIR, "package.json")
-var CACHE_DIR = path.resolve(PKG_DIR, "cache")
-var MODULES_DIR = path.resolve(PKG_DIR, "node_modules")
+var fs = require('graceful-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.resolve(__dirname, 'update-save')
+var cache = path.resolve(pkg, 'cache')
var EXEC_OPTS = {
- cwd: PKG_DIR,
- stdio: "ignore",
+ cwd: pkg,
+ stdio: 'ignore',
env: {
- "npm_config_registry": common.registry,
- "npm_config_loglevel": "verbose",
- "npm_config_save_prefix": "^"
+ npm_config_registry: common.registry,
+ npm_config_loglevel: 'verbose',
+ npm_config_save_prefix: '^'
}
}
-var DEFAULT_PKG = {
- "name": "update-save-example",
- "version": "1.2.3",
- "dependencies": {
- "mkdirp": "~0.3.0"
+var json = {
+ name: 'update-save-example',
+ version: '1.2.3',
+ dependencies: {
+ mkdirp: '~0.3.0'
},
- "devDependencies": {
- "underscore": "~1.3.1"
+ devDependencies: {
+ underscore: '~1.3.1'
}
}
-var s // mock server reference
+function clone (a) {
+ return extend({}, a)
+}
+
+function extend (a, b) {
+ for (var key in b) { a[key] = b[key] }
+ return a
+}
-test("setup", function (t) {
- resetPackage()
+test('setup', function (t) {
+ setup()
- mr({port : common.port}, function (er, server) {
- npm.load({cache: CACHE_DIR, registry: common.registry}, function (err) {
- t.ifError(err)
- s = server
- t.end()
- })
+ mr({ port: common.port }, function (er, s) {
+ t.ifError(er)
+ server = s
+ t.end()
})
})
-test("update regular dependencies only", function (t) {
- resetPackage()
+test('update regular dependencies only', function (t) {
+ setup()
- common.npm(["update", "--save"], EXEC_OPTS, function (err, code) {
+ common.npm(['update', '--save'], EXEC_OPTS, function (err, code) {
t.ifError(err)
- t.notOk(code, "npm update exited with code 0")
+ t.notOk(code, 'npm update exited with code 0')
+
+ var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8'))
+ t.deepEqual(
+ pkgdata.dependencies,
+ { mkdirp: '^0.3.5' },
+ 'only dependencies updated'
+ )
+ t.deepEqual(
+ pkgdata.devDependencies,
+ json.devDependencies,
+ 'dev dependencies should be untouched'
+ )
+ t.deepEqual(
+ pkgdata.optionalDependencies,
+ json.optionalDependencies,
+ 'optional dependencies should be untouched'
+ )
- var pkgdata = JSON.parse(fs.readFileSync(PKG, "utf8"))
- t.deepEqual(pkgdata.dependencies, {mkdirp: "^0.3.5"}, "only dependencies updated")
- t.deepEqual(pkgdata.devDependencies, DEFAULT_PKG.devDependencies, "dev dependencies should be untouched")
- t.deepEqual(pkgdata.optionalDependencies, DEFAULT_PKG.optionalDependencies, "optional dependencies should be untouched")
t.end()
})
})
-test("update devDependencies only", function (t) {
- resetPackage()
+test('update devDependencies only', function (t) {
+ setup()
- common.npm(["update", "--save-dev"], EXEC_OPTS, function (err, code) {
+ common.npm(['update', '--save-dev'], EXEC_OPTS, function (err, code) {
t.ifError(err)
- t.notOk(code, "npm update exited with code 0")
+ t.notOk(code, 'npm update exited with code 0')
+
+ var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8'))
+ t.deepEqual(
+ pkgdata.dependencies,
+ json.dependencies,
+ 'dependencies should be untouched'
+ )
+ t.deepEqual(
+ pkgdata.devDependencies,
+ { underscore: '^1.3.3' },
+ 'dev dependencies should be updated'
+ )
+ t.deepEqual(
+ pkgdata.optionalDependencies,
+ json.optionalDependencies,
+ 'optional dependencies should be untouched'
+ )
- var pkgdata = JSON.parse(fs.readFileSync(PKG, "utf8"))
- t.deepEqual(pkgdata.dependencies, DEFAULT_PKG.dependencies, "dependencies should be untouched")
- t.deepEqual(pkgdata.devDependencies, {underscore: "^1.3.3"}, "dev dependencies should be updated")
- t.deepEqual(pkgdata.optionalDependencies, DEFAULT_PKG.optionalDependencies, "optional dependencies should be untouched")
t.end()
})
})
-test("update optionalDependencies only", function (t) {
- resetPackage({
- "optionalDependencies": {
- "underscore": "~1.3.1"
- }
- })
+test('update optionalDependencies only', function (t) {
+ setup({ optionalDependencies: { underscore: '~1.3.1' } })
- common.npm(["update", "--save-optional"], EXEC_OPTS, function (err, code) {
+ common.npm(['update', '--save-optional'], EXEC_OPTS, function (err, code) {
t.ifError(err)
- t.notOk(code, "npm update exited with code 0")
+ t.notOk(code, 'npm update exited with code 0')
+
+ var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8'))
+ t.deepEqual(
+ pkgdata.dependencies,
+ json.dependencies,
+ 'dependencies should be untouched'
+ )
+ t.deepEqual(
+ pkgdata.devDependencies,
+ json.devDependencies,
+ 'dev dependencies should be untouched'
+ )
+ t.deepEqual(
+ pkgdata.optionalDependencies,
+ { underscore: '^1.3.3' },
+ 'optional dependencies should be updated'
+ )
- var pkgdata = JSON.parse(fs.readFileSync(PKG, "utf8"))
- t.deepEqual(pkgdata.dependencies, DEFAULT_PKG.dependencies, "dependencies should be untouched")
- t.deepEqual(pkgdata.devDependencies, DEFAULT_PKG.devDependencies, "dev dependencies should be untouched")
- t.deepEqual(pkgdata.optionalDependencies, {underscore: "^1.3.3"}, "optional dependencies should be updated")
t.end()
})
})
-test("optionalDependencies are merged into dependencies during --save", function (t) {
- var pkg = resetPackage({
- "optionalDependencies": {
- "underscore": "~1.3.1"
- }
- })
+test('optionalDependencies are merged into dependencies during --save', function (t) {
+ var cloned = setup({ optionalDependencies: { underscore: '~1.3.1' } })
- common.npm(["update", "--save"], EXEC_OPTS, function (err, code) {
+ common.npm(['update', '--save'], EXEC_OPTS, function (err, code) {
t.ifError(err)
- t.notOk(code, "npm update exited with code 0")
+ t.notOk(code, 'npm update exited with code 0')
+
+ var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8'))
+ t.deepEqual(
+ pkgdata.dependencies,
+ { mkdirp: '^0.3.5' },
+ 'dependencies should not include optional dependencies'
+ )
+ t.deepEqual(
+ pkgdata.devDependencies,
+ cloned.devDependencies,
+ 'dev dependencies should be untouched'
+ )
+ t.deepEqual(
+ pkgdata.optionalDependencies,
+ cloned.optionalDependencies,
+ 'optional dependencies should be untouched'
+ )
- var pkgdata = JSON.parse(fs.readFileSync(PKG, "utf8"))
- t.deepEqual(pkgdata.dependencies, {mkdirp: "^0.3.5"}, "dependencies should not include optional dependencies")
- t.deepEqual(pkgdata.devDependencies, pkg.devDependencies, "dev dependencies should be untouched")
- t.deepEqual(pkgdata.optionalDependencies, pkg.optionalDependencies, "optional dependencies should be untouched")
t.end()
})
})
-test("semver prefix is replaced with configured save-prefix", function (t) {
- resetPackage()
+test('semver prefix is replaced with configured save-prefix', function (t) {
+ setup()
- common.npm(["update", "--save", "--save-prefix", "~"], EXEC_OPTS, function (err, code) {
+ common.npm(['update', '--save', '--save-prefix', '~'], EXEC_OPTS, function (err, code) {
t.ifError(err)
- t.notOk(code, "npm update exited with code 0")
-
- var pkgdata = JSON.parse(fs.readFileSync(PKG, "utf8"))
- t.deepEqual(pkgdata.dependencies, {
- mkdirp: "~0.3.5"
- }, "dependencies should be updated")
- t.deepEqual(pkgdata.devDependencies, DEFAULT_PKG.devDependencies, "dev dependencies should be untouched")
- t.deepEqual(pkgdata.optionalDependencies, DEFAULT_PKG.optionalDependencies, "optional dependencies should be updated")
+ t.notOk(code, 'npm update exited with code 0')
+
+ var pkgdata = JSON.parse(fs.readFileSync(path.join(pkg, 'package.json'), 'utf8'))
+ t.deepEqual(
+ pkgdata.dependencies,
+ { mkdirp: '~0.3.5' },
+ 'dependencies should be updated'
+ )
+ t.deepEqual(
+ pkgdata.devDependencies,
+ json.devDependencies,
+ 'dev dependencies should be untouched'
+ )
+ t.deepEqual(
+ pkgdata.optionalDependencies,
+ json.optionalDependencies,
+ 'optional dependencies should be updated'
+ )
+
t.end()
})
})
-function resetPackage(extendWith) {
- rimraf.sync(CACHE_DIR)
- rimraf.sync(MODULES_DIR)
- mkdirp.sync(CACHE_DIR)
- var pkg = clone(DEFAULT_PKG)
- extend(pkg, extendWith)
- for (var key in extend) { pkg[key] = extend[key]}
- fs.writeFileSync(PKG, JSON.stringify(pkg, null, 2), "ascii")
- return pkg
-}
-
-test("cleanup", function (t) {
- s.close()
- resetPackage() // restore package.json
- rimraf.sync(CACHE_DIR)
- rimraf.sync(MODULES_DIR)
+test('cleanup', function (t) {
+ server.close()
+ cleanup()
t.end()
})
-function clone(a) {
- return extend({}, a)
+function cleanup () {
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(pkg)
}
-function extend(a, b) {
- for (var key in b) { a[key] = b[key]}
- return a
+function setup (extendWith) {
+ cleanup()
+ mkdirp.sync(cache)
+ process.chdir(pkg)
+
+ var template = clone(json)
+ extend(template, extendWith)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(template, null, 2)
+ )
+ return template
}
+++ /dev/null
-# just a test
+++ /dev/null
-module.exports = true
+++ /dev/null
-{
- "name": "update-save-example",
- "version": "1.2.3",
- "dependencies": {
- "mkdirp": "~0.3.0"
- },
- "devDependencies": {
- "underscore": "~1.3.1"
- }
-}
\ No newline at end of file
-var test = require("tap").test
-var rimraf = require("rimraf")
-var path = require("path")
-var osenv = require("osenv")
-var mr = require("npm-registry-mock")
-var pkg = path.resolve(__dirname, "url-dependencies")
-var common = require("../common-tap")
+var fs = require('graceful-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')
+var server
+
+var pkg = path.resolve(__dirname, 'url-dependencies')
+
+var json = {
+ author: 'Steve Mason',
+ name: 'url-dependencies',
+ version: '0.0.0',
+ dependencies: {
+ underscore: common.registry + '/underscore/-/underscore-1.3.1.tgz'
+ }
+}
var mockRoutes = {
- "get": {
- "/underscore/-/underscore-1.3.1.tgz": [200]
+ 'get': {
+ '/underscore/-/underscore-1.3.1.tgz': [200]
}
}
-test("url-dependencies: download first time", function (t) {
- cleanup()
+test('setup', function (t) {
+ mr({ port: common.port, mocks: mockRoutes }, function (er, s) {
+ server = s
+ t.end()
+ })
+})
- performInstall(t, function (output){
- if (!tarballWasFetched(output)){
- t.fail("Tarball was not fetched")
+test('url-dependencies: download first time', function (t) {
+ setup()
+
+ performInstall(t, function (output) {
+ if (!tarballWasFetched(output)) {
+ t.fail('Tarball was not fetched')
} else {
- t.pass("Tarball was fetched")
+ t.pass('Tarball was fetched')
}
t.end()
})
})
-test("url-dependencies: do not download subsequent times", function (t) {
- cleanup()
+test('url-dependencies: do not download subsequent times', function (t) {
+ setup()
performInstall(t, function () {
performInstall(t, function (output) {
- if (tarballWasFetched(output)){
- t.fail("Tarball was fetched second time around")
+ if (tarballWasFetched(output)) {
+ t.fail('Tarball was fetched second time around')
} else {
- t.pass("Tarball was not fetched")
+ t.pass('Tarball was not fetched')
}
t.end()
})
})
})
-function tarballWasFetched(output){
- return output.indexOf("http fetch GET " + common.registry + "/underscore/-/underscore-1.3.1.tgz") > -1
+test('cleanup', function (t) {
+ server.close()
+ cleanup()
+ t.end()
+})
+
+function cleanup () {
+ // windows fix for locked files
+ process.chdir(osenv.tmpdir())
+ rimraf.sync(path.resolve(pkg))
+}
+
+function setup () {
+ cleanup()
+ mkdirp.sync(pkg)
+ fs.writeFileSync(
+ path.join(pkg, 'package.json'),
+ JSON.stringify(json, null, 2)
+ )
+}
+
+function tarballWasFetched (output) {
+ return output.indexOf(
+ 'http fetch GET ' +
+ common.registry +
+ '/underscore/-/underscore-1.3.1.tgz'
+ ) > -1
}
function performInstall (t, cb) {
- mr({port: common.port, mocks: mockRoutes}, function (er, s) {
- var opts = {
- cwd : pkg,
- env: {
- "npm_config_registry": common.registry,
- "npm_config_cache_lock_stale": 1000,
- "npm_config_cache_lock_wait": 1000,
- "npm_config_loglevel": "http",
- HOME: process.env.HOME,
- Path: process.env.PATH,
- PATH: process.env.PATH
- }
+ var opts = {
+ cwd: pkg,
+ env: {
+ npm_config_registry: common.registry,
+ npm_config_cache_lock_stale: 1000,
+ npm_config_cache_lock_wait: 1000,
+ npm_config_loglevel: 'http',
+ HOME: process.env.HOME,
+ Path: process.env.PATH,
+ PATH: process.env.PATH
}
- common.npm(["install"], opts, function (err, code, stdout, stderr) {
- t.ifError(err, "install success")
- t.notOk(code, "npm install exited with code 0")
- s.close()
- cb(stderr)
- })
- })
-}
+ }
+ common.npm(['install'], opts, function (err, code, stdout, stderr) {
+ t.ifError(err, 'install success')
+ t.notOk(code, 'npm install exited with code 0')
-function cleanup() {
- // windows fix for locked files
- process.chdir(osenv.tmpdir())
- rimraf.sync(path.resolve(pkg, "node_modules"))
+ cb(stderr)
+ })
}
+++ /dev/null
-{
- "author": "Steve Mason",
- "name": "url-dependencies",
- "version": "0.0.0",
- "dependencies": {
- "underscore": "http://localhost:1337/underscore/-/underscore-1.3.1.tgz"
- }
-}
var fs = require('fs')
var path = require('path')
-var chain = require('slide').chain
var mkdirp = require('mkdirp')
var osenv = require('osenv')
var rimraf = require('rimraf')
npm.load({ prefix: pkg, userconfig: npmrc }, function () {
var git = require('../../lib/utils/git.js')
- var opts = { cwd: pkg, env: { PATH: process.env.PATH } }
- chain(
- [
- git.chainableExec(['init'], opts),
- git.chainableExec(['config', 'user.name', 'PhantomFaker'], opts),
- git.chainableExec(['config', 'user.email', 'nope@not.real'], opts),
- git.chainableExec(['add', 'package.json'], opts),
- git.chainableExec(['add', '.npmrc'], opts),
- git.chainableExec(['commit', '-m', 'stub package'], opts)
- ],
- function (er) {
- t.ifErr(er, 'git bootstrap ran without error')
+ common.makeGitRepo({ path: pkg }, function (er) {
+ t.ifErr(er, 'git bootstrap ran without error')
- common.npm(
- [
- 'version',
- 'patch',
- '--loglevel', 'silent'
- // package config is picked up from env
- ],
- opts,
- 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')
+ 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(
- ['log'],
- { cwd: pkg, env: process.env },
- function (er, log, stderr) {
- t.ok(log.match(/:bookmark: 0\.1\.3/g), 'config was picked up by version')
- t.end()
- }
- )
- }
- )
- }
- )
+ git.whichAndExec(
+ ['log'],
+ { cwd: pkg, env: process.env },
+ function (er, log, stderr) {
+ t.ok(log.match(/:bookmark: 0\.1\.3/g), 'config was picked up by version')
+ t.end()
+ }
+ )
+ }
+ )
+ })
})
})
-var common = require("../common-tap.js")
-var test = require("tap").test
-var npm = require("../../")
-var osenv = require("osenv")
-var path = require("path")
-var fs = require("fs")
-var rimraf = require("rimraf")
-var mkdirp = require("mkdirp")
-var which = require("which")
-var spawn = require("child_process").spawn
-
-var pkg = path.resolve(__dirname, "version-shrinkwrap")
-var cache = path.resolve(pkg, "cache")
-
-test("npm version <semver> updates shrinkwrap - no git", function (t) {
+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('../../')
+var common = require('../common-tap.js')
+
+var pkg = path.resolve(__dirname, 'version-shrinkwrap')
+var cache = path.resolve(pkg, 'cache')
+
+test('npm version <semver> updates shrinkwrap - no git', function (t) {
setup()
- npm.load({ cache: pkg + "/cache", registry: common.registry }, function () {
- npm.commands.version(["patch"], function(err) {
- if (err) return t.fail("Error perform version patch")
- var shrinkwrap = require(path.resolve(pkg, "npm-shrinkwrap.json"))
- t.equal(shrinkwrap.version, "0.0.1", "got expected version")
+ npm.load({ cache: pkg + '/cache', registry: common.registry }, function () {
+ npm.commands.version(['patch'], function (err) {
+ if (err) return t.fail('Error perform version patch')
+ var shrinkwrap = require(path.resolve(pkg, 'npm-shrinkwrap.json'))
+ t.equal(shrinkwrap.version, '0.0.1', 'got expected version')
t.end()
})
})
})
-test("npm version <semver> updates git works with no shrinkwrap", function (t) {
+test('npm version <semver> updates git works with no shrinkwrap', function (t) {
setup()
+ rimraf.sync(path.resolve(pkg, 'npm-shrinkwrap.json'))
- rimraf.sync(path.resolve(pkg, "npm-shrinkwrap.json"))
-
- var opts = {
- cache : cache,
- registry : common.registry
- }
- npm.load(opts, function () {
- npm.config.set("sign-git-tag", false)
- which("git", function (err, git) {
- if (err) t.fail("Git not installed, or which git command error")
+ npm.config.set('sign-git-tag', false)
- initRepo()
+ common.makeGitRepo({
+ path: pkg,
+ added: ['package.json']
+ }, version)
- function initRepo () {
- var init = spawn(git, ["init"])
- init.stdout.pipe(process.stdout)
- init.on("exit", function (code) {
- t.notOk(code, "git init exited without issue")
-
- configName()
- })
- }
-
- function configName () {
- var namer = spawn(git, ["config", "user.name", "Phantom Faker"])
- namer.stdout.pipe(process.stdout)
- namer.on("exit", function (code) {
- t.notOk(code, "git config user.name exited without issue")
-
- configEmail()
- })
- }
+ function version (er, stdout, stderr) {
+ t.ifError(er, 'git repo initialized without issue')
+ t.notOk(stderr, 'no error output')
- function configEmail () {
- var emailer = spawn(git, ["config", "user.email", "nope@not.real"])
- emailer.stdout.pipe(process.stdout)
- emailer.on("exit", function (code) {
- t.notOk(code, "git config user.email exited without issue")
-
- addAll()
- })
- }
-
- function addAll () {
- var emailer = spawn(git, ["add", "package.json"])
- emailer.stdout.pipe(process.stdout)
- emailer.on("exit", function (code) {
- t.notOk(code, "git add package.json exited without issue")
-
- commit()
- })
-
- }
+ npm.commands.version(['patch'], checkCommit)
+ }
- function commit () {
- var emailer = spawn(git, ["commit", "-m", "test setup"])
- emailer.stdout.pipe(process.stdout)
- emailer.on("exit", function (code) {
- t.notOk(code, "git commit -m 'test setup' exited without issue")
+ function checkCommit (er) {
+ t.ifError(er, 'version command ran without error')
- version()
- })
+ var shrinkwrap = require(path.resolve(pkg, 'npm-shrinkwrap.json'))
+ t.equal(shrinkwrap.version, '0.0.1', 'got expected version')
- }
+ var opts = { cwd: pkg, env: { PATH: process.env.PATH }}
+ var git = require('../../lib/utils/git.js')
+ git.whichAndExec(
+ ['show', 'HEAD', '--name-only'],
+ opts,
+ function (er, stdout, stderr) {
+ t.ifError(er, 'git show ran without issues')
+ t.notOk(stderr, 'no error output')
- function version () {
- npm.commands.version(["patch"], checkCommit)
- }
+ var lines = stdout.split('\n')
+ t.notEqual(lines.indexOf('package.json'), -1, 'package.json commited')
+ t.equal(lines.indexOf('npm-shrinkwrap.json'), -1, 'npm-shrinkwrap.json not present')
- function checkCommit (er) {
- t.ifError(er, "version command ran without error")
-
- var shrinkwrap = require(path.resolve(pkg, "npm-shrinkwrap.json"))
- t.equal(shrinkwrap.version, "0.0.1", "got expected version")
-
- var shower = spawn(git, ["show", "HEAD", "--name-only"])
- var out = "", eout = ""
- shower.stdout.on("data", function (d) {
- out += d.toString()
- })
- shower.stderr.on("data", function (d) {
- eout += d.toString()
- })
- shower.on("exit", function (code) {
- t.notOk(code, "git show HEAD exited without issue")
- t.notOk(err, "git show produced no error output")
-
- var lines = out.split("\n")
- t.notEqual(lines.indexOf("package.json"), -1, "package.json commited")
- t.equal(lines.indexOf("npm-shrinkwrap.json"), -1, "npm-shrinkwrap.json not present")
-
- t.end()
- })
+ t.end()
}
- })
- })
+ )
+ }
})
-test("npm version <semver> updates shrinkwrap and updates git", function (t) {
+test('npm version <semver> updates shrinkwrap and updates git', function (t) {
setup()
- var opts = {
- cache : cache,
- registry : common.registry
- }
- npm.load(opts, function () {
- npm.config.set("sign-git-tag", false)
- which("git", function (err, git) {
- t.ifError(err, "git found")
-
- initRepo()
-
- function initRepo () {
- var init = spawn(git, ["init"])
- init.stdout.pipe(process.stdout)
- init.on("exit", function (code) {
- t.notOk(code, "git init exited without issue")
-
- configName()
- })
- }
-
- function configName () {
- var namer = spawn(git, ["config", "user.name", "Phantom Faker"])
- namer.stdout.pipe(process.stdout)
- namer.on("exit", function (code) {
- t.notOk(code, "git config user.name exited without issue")
-
- configEmail()
- })
- }
-
- function configEmail () {
- var emailer = spawn(git, ["config", "user.email", "nope@not.real"])
- emailer.stdout.pipe(process.stdout)
- emailer.on("exit", function (code) {
- t.notOk(code, "git config user.email exited without issue")
-
- addAll()
- })
- }
+ npm.config.set('sign-git-tag', false)
- function addAll () {
- var emailer = spawn(git, ["add", "package.json", "npm-shrinkwrap.json"])
- emailer.stdout.pipe(process.stdout)
- emailer.on("exit", function (code) {
- t.notOk(code, "git add package.json npm-shrinkwrap.json exited without issue")
+ common.makeGitRepo({
+ path: pkg,
+ added: ['package.json', 'npm-shrinkwrap.json']
+ }, version)
- commit()
- })
+ function version (er, stdout, stderr) {
+ t.ifError(er, 'git repo initialized without issue')
+ t.notOk(stderr, 'no error output')
- }
+ npm.commands.version(['patch'], checkCommit)
+ }
- function commit () {
- var emailer = spawn(git, ["commit", "-m", "test setup"])
- emailer.stdout.pipe(process.stdout)
- emailer.on("exit", function (code) {
- t.notOk(code, "git commit -m 'test setup' exited without issue")
+ function checkCommit (er) {
+ t.ifError(er, 'version command ran without error')
- version()
- })
+ var shrinkwrap = require(path.resolve(pkg, 'npm-shrinkwrap.json'))
+ t.equal(shrinkwrap.version, '0.0.1', 'got expected version')
- }
+ var git = require('../../lib/utils/git.js')
+ var opts = { cwd: pkg, env: { PATH: process.env.PATH }}
+ git.whichAndExec(
+ ['show', 'HEAD', '--name-only'],
+ opts,
+ function (er, stdout, stderr) {
+ t.ifError(er, 'git show ran without issues')
+ t.notOk(stderr, 'no error output')
- function version () {
- npm.commands.version(["patch"], checkCommit)
- }
+ var lines = stdout.split('\n')
+ t.notEqual(lines.indexOf('package.json'), -1, 'package.json commited')
+ t.notEqual(lines.indexOf('npm-shrinkwrap.json'), -1, 'npm-shrinkwrap.json commited')
- function checkCommit (er) {
- t.ifError(er, "version command ran without error")
-
- var shrinkwrap = require(path.resolve(pkg, "npm-shrinkwrap.json"))
- t.equal(shrinkwrap.version, "0.0.1", "got expected version")
-
- var shower = spawn(git, ["show", "HEAD", "--name-only"])
- var out = "", eout = ""
- shower.stdout.on("data", function (d) {
- out += d.toString()
- })
- shower.stderr.on("data", function (d) {
- eout += d.toString()
- })
- shower.on("exit", function (code) {
- t.notOk(code, "git show HEAD exited without issue")
- t.notOk(err, "git show produced no error output")
-
- var lines = out.split("\n")
- t.notEqual(lines.indexOf("package.json"), -1, "package.json commited")
- t.notEqual(lines.indexOf("npm-shrinkwrap.json"), -1, "npm-shrinkwrap.json commited")
-
- t.end()
- })
+ t.end()
}
- })
- })
+ )
+ }
})
-test("cleanup", function(t) {
+test('cleanup', function (t) {
// windows fix for locked files
process.chdir(osenv.tmpdir())
t.end()
})
-function setup() {
+function setup () {
rimraf.sync(pkg)
mkdirp.sync(pkg)
mkdirp.sync(cache)
var contents = {
- author: "Nathan Bowser && Faiq Raza",
- name: "version-with-shrinkwrap-test",
- version: "0.0.0",
- description: "Test for version with shrinkwrap update"
+ author: 'Nathan Bowser && Faiq Raza',
+ name: 'version-with-shrinkwrap-test',
+ version: '0.0.0',
+ description: 'Test for version with shrinkwrap update'
}
- fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify(contents), "utf8")
- fs.writeFileSync(path.resolve(pkg, "npm-shrinkwrap.json"), JSON.stringify(contents), "utf8")
+ fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify(contents), 'utf8')
+ fs.writeFileSync(path.resolve(pkg, 'npm-shrinkwrap.json'), JSON.stringify(contents), 'utf8')
process.chdir(pkg)
}