diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml index 0fbe8dc335..2734148642 100644 --- a/deps/npm/.travis.yml +++ b/deps/npm/.travis.yml @@ -1,5 +1,11 @@ language: node_js -script: "npm run-script tap" node_js: - "0.11" - "0.10" +env: + - DEPLOY_VERSION=testing +before_install: + - "npm config set spin false" + - "npm install -g npm@^2" + - "sudo mkdir -p /var/run/couchdb" +script: "npm run-script tap" diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index 330c1ac17a..a8afe8ac75 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,69 @@ +### v2.0.0 (2014-09-12): + +BREAKING CHANGES: + +* [`4378a17`](https://github.com/npm/npm/commit/4378a17db340404a725ffe2eb75c9936f1612670) + `semver@4.0.0`: prerelease versions no longer show up in ranges; `^0.x.y` + behaves the way it did in `semver@2` rather than `semver@3`; docs have been + reorganized for comprehensibility ([@isaacs](https://github.com/isaacs)) +* [`c6ddb64`](https://github.com/npm/npm/commit/c6ddb6462fe32bf3a27b2c4a62a032a92e982429) + npm now assumes that node is newer than 0.6 + ([@isaacs](https://github.com/isaacs)) + +Other changes: + +* [`ea515c3`](https://github.com/npm/npm/commit/ea515c3b858bf493a7b87fa4cdc2110a0d9cef7f) + [#6043](https://github.com/npm/npm/issues/6043) `slide@1.1.6`: wait until all + callbacks have finished before proceeding + ([@othiym23](https://github.com/othiym23)) +* [`0b0a59d`](https://github.com/npm/npm/commit/0b0a59d504f20f424294b1590ace73a7464f0378) + [#6043](https://github.com/npm/npm/issues/6043) defer rollbacks until just + before the CLI exits ([@isaacs](https://github.com/isaacs)) +* [`a11c88b`](https://github.com/npm/npm/commit/a11c88bdb1488b87d8dcac69df9a55a7a91184b6) + [#6175](https://github.com/npm/npm/issues/6175) pack scoped packages + correctly ([@othiym23](https://github.com/othiym23)) +* [`e4e48e0`](https://github.com/npm/npm/commit/e4e48e037d4e95fdb6acec80b04c5c6eaee59970) + [#6121](https://github.com/npm/npm/issues/6121) `read-installed@3.1.2`: don't + mark linked dev dependencies as extraneous + ([@isaacs](https://github.com/isaacs)) +* [`d673e41`](https://github.com/npm/npm/commit/d673e4185d43362c2b2a91acbca8c057e7303c7b) + `cmd-shim@2.0.1`: depend on `graceful-fs` directly + ([@ForbesLindesay](https://github.com/ForbesLindesay)) +* [`9d54d45`](https://github.com/npm/npm/commit/9d54d45e602d595bdab7eae09b9fa1dc46370147) + `npm-registry-couchapp@2.5.3`: make tests more reliable on Travis + ([@iarna](https://github.com/iarna)) +* [`673d738`](https://github.com/npm/npm/commit/673d738c6142c3d043dcee0b7aa02c9831a2e0ca) + ensure permissions are set correctly in cache when running as root + ([@isaacs](https://github.com/isaacs)) +* [`6e6a5fb`](https://github.com/npm/npm/commit/6e6a5fb74af10fd345411df4e121e554e2e3f33e) + prepare for upgrade to `node-semver@4.0.0` + ([@isaacs](https://github.com/isaacs)) +* [`ab8dd87`](https://github.com/npm/npm/commit/ab8dd87b943262f5996744e8d4cc30cc9358b7d7) + swap out `ronn` for `marked-man@0.1.3` ([@isaacs](https://github.com/isaacs)) +* [`803da54`](https://github.com/npm/npm/commit/803da5404d5a0b7c9defa3fe7fa0f2d16a2b19d3) + `npm-registry-client@3.2.0`: prepare for `node-semver@4.0.0` and include more + error information ([@isaacs](https://github.com/isaacs)) +* [`4af0e71`](https://github.com/npm/npm/commit/4af0e7134f5757c3d456d83e8349224a4ba12660) + make default error display less scary ([@isaacs](https://github.com/isaacs)) +* [`4fd9e79`](https://github.com/npm/npm/commit/4fd9e7901a15abff7a3dd478d99ce239b9580bca) + `npm-registry-client@3.2.1`: handle errors returned by the registry much, + much better ([@othiym23](https://github.com/othiym23)) +* [`ca791e2`](https://github.com/npm/npm/commit/ca791e27e97e51c1dd491bff6622ac90b54c3e23) + restore a long (always?) missing pass for deduping + ([@othiym23](https://github.com/othiym23)) +* [`ca0ef0e`](https://github.com/npm/npm/commit/ca0ef0e99bbdeccf28d550d0296baa4cb5e7ece2) + correctly interpret relative paths for local dependencies + ([@othiym23](https://github.com/othiym23)) +* [`5eb8db2`](https://github.com/npm/npm/commit/5eb8db2c370eeb4cd34f6e8dc6a935e4ea325621) + `npm-package-arg@2.1.2`: support git+file:// URLs for local bare repos + ([@othiym23](https://github.com/othiym23)) +* [`860a185`](https://github.com/npm/npm/commit/860a185c43646aca84cb93d1c05e2266045c316b) + tweak docs to no longer advocate checking in `node_modules` + ([@hunterloftis](https://github.com/hunterloftis)) +* [`80e9033`](https://github.com/npm/npm/commit/80e9033c40e373775e35c674faa6c1948661782b) + add links to nodejs.org downloads to docs + ([@meetar](https://github.com/meetar)) + ### v1.4.28 (2014-09-12): * [`f4540b6`](https://github.com/npm/npm/commit/f4540b6537a87e653d7495a9ddcf72949fdd4d14) @@ -8,16 +74,101 @@ callbacks have finished before proceeding ([@othiym23](https://github.com/othiym23)) +### v2.0.0-beta.3 (2014-09-04): + +* [`fa79413`](https://github.com/npm/npm/commit/fa794138bec8edb7b88639db25ee9c010d2f4c2b) + [#6119](https://github.com/npm/npm/issues/6119) fall back to registry installs + if package.json is missing in a local directory ([@iarna](https://github.com/iarna)) +* [`16073e2`](https://github.com/npm/npm/commit/16073e2d8ae035961c4c189b602d4aacc6d6b387) + `npm-package-arg@2.1.0`: support file URIs as local specs + ([@othiym23](https://github.com/othiym23)) +* [`9164acb`](https://github.com/npm/npm/commit/9164acbdee28956fa816ce5e473c559395ae4ec2) + `github-url-from-username-repo@1.0.2`: don't match strings that are already + URIs ([@othiym23](https://github.com/othiym23)) +* [`4067d6b`](https://github.com/npm/npm/commit/4067d6bf303a69be13f3af4b19cf4fee1b0d3e12) + [#5629](https://github.com/npm/npm/issues/5629) support saving of local packages + in `package.json` ([@dylang](https://github.com/dylang)) +* [`1b2ffdf`](https://github.com/npm/npm/commit/1b2ffdf359a8c897a78f91fc5a5d535c97aaec97) + [#6097](https://github.com/npm/npm/issues/6097) document scoped packages + ([@seldo](https://github.com/seldo)) +* [`0a67d53`](https://github.com/npm/npm/commit/0a67d536067c4808a594d81288d34c0f7e97e105) + [#6007](https://github.com/npm/npm/issues/6007) `request@2.42.0`: properly + set headers on proxy requests ([@isaacs](https://github.com/isaacs)) +* [`9bac6b8`](https://github.com/npm/npm/commit/9bac6b860b674d24251bb7b8ba412fdb26cbc836) + `npmconf@2.0.8`: disallow semver ranges in tag configuration + ([@isaacs](https://github.com/isaacs)) +* [`d2d4d7c`](https://github.com/npm/npm/commit/d2d4d7cd3c32f91a87ffa11fe464d524029011c3) + [#6082](https://github.com/npm/npm/issues/6082) don't allow tagging with a + semver range as the tag name ([@isaacs](https://github.com/isaacs)) + ### v1.4.27 (2014-09-04): * [`4cf3c8f`](https://github.com/npm/npm/commit/4cf3c8fd78c9e2693a5f899f50c28f4823c88e2e) - [#6007](https://github.com/npm/npm/issues/6007) `request@2.42.0`: properly set + [#6007](https://github.com/npm/npm/issues/6007) request@2.42.0: properly set headers on proxy requests ([@isaacs](https://github.com/isaacs)) * [`403cb52`](https://github.com/npm/npm/commit/403cb526be1472bb7545fa8e62d4976382cdbbe5) - [#6055](https://github.com/npm/npm/issues/6055) `npmconf@1.1.8`: restore + [#6055](https://github.com/npm/npm/issues/6055) npmconf@1.1.8: restore case-insensitivity of environmental config ([@iarna](https://github.com/iarna)) +### v2.0.0-beta.2 (2014-08-29): + +SPECIAL LABOR DAY WEEKEND RELEASE PARTY WOOO + +* [`ed207e8`](https://github.com/npm/npm/commit/ed207e88019de3150037048df6267024566e1093) + `npm-registry-client@3.1.7`: Clean up auth logic and improve logging around + auth decisions. Also error on trying to change a user document without + writing to it. ([@othiym23](https://github.com/othiym23)) +* [`66c7423`](https://github.com/npm/npm/commit/66c7423b7fb07a326b83c83727879410d43c439f) + `npmconf@2.0.7`: support -C as an alias for --prefix + ([@isaacs](https://github.com/isaacs)) +* [`0dc6a07`](https://github.com/npm/npm/commit/0dc6a07c778071c94c2251429c7d107e88a45095) + [#6059](https://github.com/npm/npm/issues/6059) run commands in prefix, not + cwd ([@isaacs](https://github.com/isaacs)) +* [`65d2179`](https://github.com/npm/npm/commit/65d2179af96737eb9038eaa24a293a62184aaa13) + `github-url-from-username-repo@1.0.1`: part 3 handle slashes in branch names + ([@robertkowalski](https://github.com/robertkowalski)) +* [`e8d75d0`](https://github.com/npm/npm/commit/e8d75d0d9f148ce2b3e8f7671fa281945bac363d) + [#6057](https://github.com/npm/npm/issues/6057) `read-installed@3.1.1`: + properly handle extraneous dev dependencies of required dependencies + ([@othiym23](https://github.com/othiym23)) +* [`0602f70`](https://github.com/npm/npm/commit/0602f708f070d524ad41573afd4c57171cab21ad) + [#6064](https://github.com/npm/npm/issues/6064) ls: do not show deps of + extraneous deps ([@isaacs](https://github.com/isaacs)) + +### v2.0.0-beta.1 (2014-08-28): + +* [`78a1fc1`](https://github.com/npm/npm/commit/78a1fc12307a0cbdbc944775ed831b876ee65855) + `github-url-from-git@1.4.0`: add support for git+https and git+ssh + ([@stefanbuck](https://github.com/stefanbuck)) +* [`bf247ed`](https://github.com/npm/npm/commit/bf247edf5429c6b3ec4d4cb798fa0eb0a9c19fc1) + `columnify@1.2.1` ([@othiym23](https://github.com/othiym23)) +* [`4bbe682`](https://github.com/npm/npm/commit/4bbe682a6d4eabcd23f892932308c9f228bf4de3) + `cmd-shim@2.0.0`: upgrade to graceful-fs 3 + ([@ForbesLindesay](https://github.com/ForbesLindesay)) +* [`ae1d590`](https://github.com/npm/npm/commit/ae1d590bdfc2476a4ed446e760fea88686e3ae05) + `npm-package-arg@2.0.4`: accept slashes in branch names + ([@thealphanerd](https://github.com/thealphanerd)) +* [`b2f51ae`](https://github.com/npm/npm/commit/b2f51aecadf585711e145b6516f99e7c05f53614) + `semver@3.0.1`: semver.clean() is cleaner + ([@isaacs](https://github.com/isaacs)) +* [`1d041a8`](https://github.com/npm/npm/commit/1d041a8a5ebd5bf6cecafab2072d4ec07823adab) + `github-url-from-username-repo@1.0.0`: accept slashes in branch names + ([@robertkowalski](https://github.com/robertkowalski)) +* [`02c85d5`](https://github.com/npm/npm/commit/02c85d592c4058e5d9eafb0be36b6743ae631998) + `async-some@1.0.1` ([@othiym23](https://github.com/othiym23)) +* [`5af493e`](https://github.com/npm/npm/commit/5af493efa8a463cd1acc4a9a394699e2c0793b9c) + ensure lifecycle spawn errors caught properly + ([@isaacs](https://github.com/isaacs)) +* [`60fe012`](https://github.com/npm/npm/commit/60fe012fac9570d6c72554cdf34a6fa95bf0f0a6) + `npmconf@2.0.6`: init.version defaults to 1.0.0 + ([@isaacs](https://github.com/isaacs)) +* [`b4c717b`](https://github.com/npm/npm/commit/b4c717bbf58fb6a0d64ad229036c79a184297ee2) + `npm-registry-client@3.1.4`: properly encode % in passwords + ([@isaacs](https://github.com/isaacs)) +* [`7b55f44`](https://github.com/npm/npm/commit/7b55f44420252baeb3f30da437d22956315c31c9) + doc: Fix 'npm help index' ([@isaacs](https://github.com/isaacs)) + ### v1.4.26 (2014-08-28): * [`eceea95`](https://github.com/npm/npm/commit/eceea95c804fa15b18e91c52c0beb08d42a3e77d) @@ -40,6 +191,51 @@ * [`91cfb58`](https://github.com/npm/npm/commit/91cfb58dda851377ec604782263519f01fd96ad8) doc: Fix 'npm help index' ([@isaacs](https://github.com/isaacs)) +### v2.0.0-beta.0 (2014-08-21): + +* [`685f8be`](https://github.com/npm/npm/commit/685f8be1f2770cc75fd0e519a8d7aac72735a270) + `npm-registry-client@3.1.3`: Print the notification header returned by the + registry, and make sure status codes are printed without gratuitous quotes + around them. ([@isaacs](https://github.com/isaacs) / + [@othiym23](https://github.com/othiym23)) +* [`a8cb676`](https://github.com/npm/npm/commit/a8cb676aef0561eaf04487d2719672b097392c85) + [#5900](https://github.com/npm/npm/issues/5900) remove `npm` from its own + `engines` field in `package.json`. None of us remember why it was there. + ([@timoxley](https://github.com/timoxley)) +* [`6c47201`](https://github.com/npm/npm/commit/6c47201a7d071e8bf091b36933daf4199cc98e80) + [#5752](https://github.com/npm/npm/issues/5752), + [#6013](https://github.com/npm/npm/issues/6013) save git URLs correctly in + `_resolved` fields ([@isaacs](https://github.com/isaacs)) +* [`e4e1223`](https://github.com/npm/npm/commit/e4e1223a91c37688ba3378e1fc9d5ae045654d00) + [#5936](https://github.com/npm/npm/issues/5936) document the use of tags in + `package.json` ([@KenanY](https://github.com/KenanY)) +* [`c92b8d4`](https://github.com/npm/npm/commit/c92b8d4db7bde2a501da5b7d612684de1d629a42) + [#6004](https://github.com/npm/npm/issues/6004) manually installed scoped + packages are tracked correctly ([@dead](https://github.com/dead)-horse) +* [`21ca0aa`](https://github.com/npm/npm/commit/21ca0aaacbcfe2b89b0a439d914da0cae62de550) + [#5945](https://github.com/npm/npm/issues/5945) link scoped packages + correctly ([@dead](https://github.com/dead)-horse) +* [`16bead7`](https://github.com/npm/npm/commit/16bead7f2c82aec35b83ff0ec04df051ba456764) + [#5958](https://github.com/npm/npm/issues/5958) ensure that file streams work + in all versions of node ([@dead](https://github.com/dead)-horse) +* [`dbf0cab`](https://github.com/npm/npm/commit/dbf0cab29d0db43ac95e4b5a1fbdea1e0af75f10) + you can now pass quoted args to `npm run-script` + ([@bcoe](https://github.com/bcoe)) +* [`0583874`](https://github.com/npm/npm/commit/05838743f01ccb8d2432b3858d66847002fb62df) + `tar@1.0.1`: Add test for removing an extract target immediately after + unpacking. + ([@isaacs](https://github.com/isaacs)) +* [`cdf3b04`](https://github.com/npm/npm/commit/cdf3b0428bc0b0183fb41dcde9e34e8f42c5e3a7) + `lockfile@1.0.0`: Fix incorrect interaction between `wait`, `stale`, and + `retries` options. Part 2 of race condition leading to `ENOENT` + ([@isaacs](https://github.com/isaacs)) + errors. +* [`22d72a8`](https://github.com/npm/npm/commit/22d72a87a9e1a9ab56d9585397f63551887d9125) + `fstream@1.0.2`: Fix a double-finish call which can result in excess FS + operations after the `close` event. Part 1 of race condition leading to + `ENOENT` errors. + ([@isaacs](https://github.com/isaacs)) + ### v1.4.25 (2014-08-21): * [`64c0ec2`](https://github.com/npm/npm/commit/64c0ec241ef5d83761ca8de54acb3c41b079956e) @@ -61,6 +257,48 @@ leading to `ENOENT` errors. ([@isaacs](https://github.com/isaacs)) +### v2.0.0-alpha.7 (2014-08-14): + +* [`f23f1d8`](https://github.com/npm/npm/commit/f23f1d8e8f86ec1b7ab8dad68250bccaa67d61b1) + doc: update version doc to include `pre-*` increment args + ([@isaacs](https://github.com/isaacs)) +* [`b6bb746`](https://github.com/npm/npm/commit/b6bb7461824d4dc1c0936f46bd7929b5cd597986) + build: add 'make tag' to tag current release as latest + ([@isaacs](https://github.com/isaacs)) +* [`27c4bb6`](https://github.com/npm/npm/commit/27c4bb606e46e5eaf604b19fe8477bc6567f8b2e) + build: publish with `--tag=v1.4-next` ([@isaacs](https://github.com/isaacs)) +* [`cff66c3`](https://github.com/npm/npm/commit/cff66c3bf2850880058ebe2a26655dafd002495e) + build: add script to output `v1.4-next` publish tag + ([@isaacs](https://github.com/isaacs)) +* [`22abec8`](https://github.com/npm/npm/commit/22abec8833474879ac49b9604c103bc845dad779) + build: remove outdated `docpublish` make target + ([@isaacs](https://github.com/isaacs)) +* [`1be4de5`](https://github.com/npm/npm/commit/1be4de51c3976db8564f72b00d50384c921f0917) + build: remove `unpublish` step from `make publish` + ([@isaacs](https://github.com/isaacs)) +* [`e429e20`](https://github.com/npm/npm/commit/e429e2011f4d78e398f2461bca3e5a9a146fbd0c) + doc: add new changelog ([@othiym23](https://github.com/othiym23)) +* [`9243d20`](https://github.com/npm/npm/commit/9243d207896ea307082256604c10817f7c318d68) + lifecycle: test lifecycle path modification + ([@isaacs](https://github.com/isaacs)) +* [`021770b`](https://github.com/npm/npm/commit/021770b9cb07451509f0a44afff6c106311d8cf6) + lifecycle: BREAKING CHANGE do not add the directory containing node executable + ([@chulkilee](https://github.com/chulkilee)) +* [`1d5c41d`](https://github.com/npm/npm/commit/1d5c41dd0d757bce8b87f10c4135f04ece55aeb9) + install: rename .gitignore when unpacking foreign tarballs + ([@isaacs](https://github.com/isaacs)) +* [`9aac267`](https://github.com/npm/npm/commit/9aac2670a73423544d92b27cc301990a16a9563b) + cache: detect non-gzipped tar files more reliably + ([@isaacs](https://github.com/isaacs)) +* [`3f24755`](https://github.com/npm/npm/commit/3f24755c8fce3c7ab11ed1dc632cc40d7ef42f62) + `readdir-scoped-modules@1.0.0` ([@isaacs](https://github.com/isaacs)) +* [`151cd2f`](https://github.com/npm/npm/commit/151cd2ff87b8ac2fc9ea366bc9b7f766dc5b9684) + `read-installed@3.1.0` ([@isaacs](https://github.com/isaacs)) +* [`f5a9434`](https://github.com/npm/npm/commit/f5a94343a8ebe4a8cd987320b55137aef53fb3fd) + test: fix Travis timeouts ([@dylang](https://github.com/dylang)) +* [`126cafc`](https://github.com/npm/npm/commit/126cafcc6706814c88af3042f2ffff408747bff4) + `npm-registry-couchapp@2.5.0` ([@othiym23](https://github.com/othiym23)) + ### v1.4.24 (2014-08-14): * [`9344bd9`](https://github.com/npm/npm/commit/9344bd9b2929b5c399a0e0e0b34d45bce7bc24bb) @@ -89,7 +327,15 @@ cache: detect non-gzipped tar files more reliably ([@isaacs](https://github.com/isaacs)) -### v2.0.0-alpha-6 (2014-07-31): +### v2.0.0-alpha.6 (2014-08-07): + +BREAKING CHANGE: + +* [`ea547e2`](https://github.com/npm/npm/commit/ea547e2) Bump semver to + version 3: `^0.x.y` is now functionally the same as `=0.x.y`. + ([@isaacs](https://github.com/isaacs)) + +Other changes: * [`d987707`](https://github.com/npm/npm/commit/d987707) move fetch into npm-registry-client ([@othiym23](https://github.com/othiym23)) @@ -97,8 +343,6 @@ ([@isaacs](https://github.com/isaacs)) * [`9d73de7`](https://github.com/npm/npm/commit/9d73de7) remove unnecessary mkdirps ([@isaacs](https://github.com/isaacs)) -* [`ea547e2`](https://github.com/npm/npm/commit/ea547e2) Bump semver to version 3 - ([@isaacs](https://github.com/isaacs)) * [`33ccd13`](https://github.com/npm/npm/commit/33ccd13) Don't squash execute perms in `_git-remotes/` dir ([@adammeadows](https://github.com/adammeadows)) * [`48fd233`](https://github.com/npm/npm/commit/48fd233) `npm-package-arg@2.0.1` @@ -270,7 +514,7 @@ Other changes: ([@othiym23](https://github.com/othiym23)) * Allow to build all the docs OOTB. ([@GeJ](https://github.com/GeJ)) * Use core.longpaths on win32 git - fixes - [#5525](https://github.com/npm/npm/issues/5525) (Bradley Meck) + [#5525](https://github.com/npm/npm/issues/5525) ([@bmeck](https://github.com/bmeck)) * `npmconf@1.1.2` ([@isaacs](https://github.com/isaacs)) * Consolidate color sniffing in config/log loading process ([@isaacs](https://github.com/isaacs)) diff --git a/deps/npm/Makefile b/deps/npm/Makefile index 540e2da05b..fe2d963bba 100644 --- a/deps/npm/Makefile +++ b/deps/npm/Makefile @@ -72,7 +72,7 @@ dev: install link: uninstall node cli.js link -f -clean: markedclean ronnclean doc-clean uninstall +clean: markedclean marked-manclean doc-clean uninstall rm -rf npmrc node cli.js cache clean @@ -84,19 +84,19 @@ doc: $(mandocs) $(htmldocs) markedclean: rm -rf node_modules/marked node_modules/.bin/marked .building_marked -ronnclean: - rm -rf node_modules/ronn node_modules/.bin/ronn .building_ronn +marked-manclean: + rm -rf node_modules/marked-man node_modules/.bin/marked-man .building_marked-man docclean: doc-clean doc-clean: rm -rf \ .building_marked \ - .building_ronn \ + .building_marked-man \ html/doc \ html/api \ man -# use `npm install ronn` for this to work. +# use `npm install marked-man` for this to work. man/man1/npm-README.1: README.md scripts/doc-build.sh package.json @[ -d man/man1 ] || mkdir -p man/man1 scripts/doc-build.sh $< $@ @@ -161,10 +161,10 @@ marked: node_modules/.bin/marked node_modules/.bin/marked: node cli.js install marked --no-global -ronn: node_modules/.bin/ronn +marked-man: node_modules/.bin/marked-man -node_modules/.bin/ronn: - node cli.js install ronn --no-global +node_modules/.bin/marked-man: + node cli.js install marked-man --no-global doc: man diff --git a/deps/npm/README.md b/deps/npm/README.md index 0c08862fce..19ced3a81f 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -16,15 +16,15 @@ and prior, clone the git repo and dig through the old tags and branches. ## Super Easy Install -npm comes with node now. +npm comes with [node](http://nodejs.org/download/) now. ### Windows Computers -Get the MSI. npm is in it. +[Get the MSI](http://nodejs.org/download/). npm is in it. ### Apple Macintosh Computers -Get the pkg. npm is in it. +[Get the pkg](http://nodejs.org/download/). npm is in it. ### Other Sorts of Unices diff --git a/deps/npm/bin/npm-cli.js b/deps/npm/bin/npm-cli.js index ef8873542b..ed81a989a3 100755 --- a/deps/npm/bin/npm-cli.js +++ b/deps/npm/bin/npm-cli.js @@ -19,8 +19,7 @@ var log = require("npmlog") log.pause() // will be unpaused when config is loaded. log.info("it worked if it ends with", "ok") -var fs = require("graceful-fs") - , path = require("path") +var path = require("path") , npm = require("../lib/npm.js") , npmconf = require("npmconf") , errorHandler = require("../lib/utils/error-handler.js") @@ -58,16 +57,6 @@ if (conf.versions) { log.info("using", "npm@%s", npm.version) log.info("using", "node@%s", process.version) -// make sure that this version of node works with this version of npm. -var semver = require("semver") - , nodeVer = process.version - , reqVer = npm.nodeVersionRequired -if (reqVer && !semver.satisfies(nodeVer, reqVer)) { - return errorHandler(new Error( - "npm doesn't work with node " + nodeVer - + "\nRequired: node@" + reqVer), true) -} - process.on("uncaughtException", errorHandler) if (conf.usage && npm.command !== "help") { diff --git a/deps/npm/doc/cli/npm-adduser.md b/deps/npm/doc/cli/npm-adduser.md index 68f3a3c008..d60d6e9a07 100644 --- a/deps/npm/doc/cli/npm-adduser.md +++ b/deps/npm/doc/cli/npm-adduser.md @@ -3,30 +3,47 @@ npm-adduser(1) -- Add a registry user account ## SYNOPSIS - npm adduser + npm adduser [--registry=url] [--scope=@orgname] ## DESCRIPTION -Create or verify a user named `` in the npm registry, and -save the credentials to the `.npmrc` file. +Create or verify a user named `` in the specified registry, and +save the credentials to the `.npmrc` file. If no registry is specified, +the default registry will be used (see `npm-config(7)`). The username, password, and email are read in from prompts. You may use this command to change your email address, but not username or password. -To reset your password, go to +To reset your password, go to You may use this command multiple times with the same user account to authorize on a new machine. +`npm login` is an alias to `adduser` and behaves exactly the same way. + ## CONFIGURATION ### registry Default: http://registry.npmjs.org/ -The base URL of the npm package registry. +The base URL of the npm package registry. If `scope` is also specified, +this registry will only be used for packages with that scope. See `npm-scope(7)`. + +### scope + +Default: none + +If specified, the user and login credentials given will be associated +with the specified scope. See `npm-scope(7)`. You can use both at the same time, +e.g. + + npm adduser --registry=http://myregistry.example.com --scope=@myco + +This will set a registry for the given scope and login or create a user for +that registry at the same time. ## SEE ALSO diff --git a/deps/npm/doc/cli/npm-install.md b/deps/npm/doc/cli/npm-install.md index 62eec2d8e3..2d42716373 100644 --- a/deps/npm/doc/cli/npm-install.md +++ b/deps/npm/doc/cli/npm-install.md @@ -7,10 +7,10 @@ npm-install(1) -- Install a package npm install npm install npm install - npm install [--save|--save-dev|--save-optional] [--save-exact] - npm install @ - npm install @ - npm install @ + npm install [@/] [--save|--save-dev|--save-optional] [--save-exact] + npm install [@/]@ + npm install [@/]@ + npm install [@/]@ npm i (with any of the previous argument usage) ## DESCRIPTION @@ -70,7 +70,7 @@ after packing it up into a tarball (b). npm install https://github.com/indexzero/forever/tarball/v0.5.6 -* `npm install [--save|--save-dev|--save-optional]`: +* `npm install [@/] [--save|--save-dev|--save-optional]`: Do a `@` install, where `` is the "tag" config. (See `npm-config(7)`.) @@ -98,9 +98,19 @@ after packing it up into a tarball (b). exact version rather than using npm's default semver range operator. + `` is optional. The package will be downloaded from the registry + associated with the specified scope. If no registry is associated with + the given scope the default registry is assumed. See `npm-scope(7)`. + + Note: if you do not include the @-symbol on your scope name, npm will + interpret this as a GitHub repository instead, see below. Scopes names + must also be followed by a slash. + Examples: npm install sax --save + npm install githubname/reponame + npm install @myorg/privatepackage npm install node-tap --save-dev npm install dtrace-provider --save-optional npm install readable-stream --save --save-exact @@ -110,7 +120,7 @@ after packing it up into a tarball (b). working directory, then it will try to install that, and only try to fetch the package by name if it is not valid. -* `npm install @`: +* `npm install [@/]@`: Install the version of the package that is referenced by the specified tag. If the tag does not exist in the registry data for that package, then this @@ -119,17 +129,19 @@ after packing it up into a tarball (b). Example: npm install sax@latest + npm install @myorg/mypackage@latest -* `npm install @`: +* `npm install [@/]@`: - Install the specified version of the package. This will fail if the version - has not been published to the registry. + Install the specified version of the package. This will fail if the + version has not been published to the registry. Example: npm install sax@0.1.1 + npm install @myorg/privatepackage@1.5.0 -* `npm install @`: +* `npm install [@/]@`: Install a version of the package matching the specified version range. This will follow the same rules for resolving dependencies described in `package.json(5)`. @@ -140,6 +152,19 @@ after packing it up into a tarball (b). Example: npm install sax@">=0.1.0 <0.2.0" + npm install @myorg/privatepackage@">=0.1.0 <0.2.0" + +* `npm install /`: + + Install the package at `https://github.com/githubname/githubrepo" by + attempting to clone it using `git`. + + Example: + + npm install mygithubuser/myproject + + To reference a package in a git repo that is not on GitHub, see git + remote urls below. * `npm install `: diff --git a/deps/npm/doc/cli/npm-link.md b/deps/npm/doc/cli/npm-link.md index c0fc01eb26..a6c2747900 100644 --- a/deps/npm/doc/cli/npm-link.md +++ b/deps/npm/doc/cli/npm-link.md @@ -4,7 +4,7 @@ npm-link(1) -- Symlink a package folder ## SYNOPSIS npm link (in package folder) - npm link + npm link [@/] npm ln (with any of the previous argument usage) ## DESCRIPTION @@ -12,7 +12,8 @@ npm-link(1) -- Symlink a package folder Package linking is a two-step process. First, `npm link` in a package folder will create a globally-installed -symbolic link from `prefix/package-name` to the current folder. +symbolic link from `prefix/package-name` to the current folder (see +`npm-config(7)` for the value of `prefix`). Next, in some other location, `npm link package-name` will create a symlink from the local `node_modules` folder to the global symlink. @@ -20,12 +21,14 @@ symlink from the local `node_modules` folder to the global symlink. Note that `package-name` is taken from `package.json`, not from directory name. +The package name can be optionally prefixed with a scope. See `npm-scope(7)`. +The scope must by preceded by an @-symbol and followed by a slash. + When creating tarballs for `npm publish`, the linked packages are "snapshotted" to their current state by resolving the symbolic links. -This is -handy for installing your own stuff, so that you can work on it and test it -iteratively without having to continually rebuild. +This is handy for installing your own stuff, so that you can work on it and +test it iteratively without having to continually rebuild. For example: @@ -51,6 +54,11 @@ The second line is the equivalent of doing: That is, it first creates a global link, and then links the global installation target into your project's `node_modules` folder. +If your linked package is scoped (see `npm-scope(7)`) your link command must +include that scope, e.g. + + npm link @myorg/privatepackage + ## SEE ALSO * npm-developers(7) diff --git a/deps/npm/doc/cli/npm-ls.md b/deps/npm/doc/cli/npm-ls.md index 21f54264c7..0f0d79489a 100644 --- a/deps/npm/doc/cli/npm-ls.md +++ b/deps/npm/doc/cli/npm-ls.md @@ -3,10 +3,10 @@ npm-ls(1) -- List installed packages ## SYNOPSIS - npm list [ ...] - npm ls [ ...] - npm la [ ...] - npm ll [ ...] + npm list [[@/] ...] + npm ls [[@/] ...] + npm la [[@/] ...] + npm ll [[@/] ...] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-prefix.md b/deps/npm/doc/cli/npm-prefix.md index f99a401d14..f262a36a75 100644 --- a/deps/npm/doc/cli/npm-prefix.md +++ b/deps/npm/doc/cli/npm-prefix.md @@ -3,11 +3,15 @@ npm-prefix(1) -- Display prefix ## SYNOPSIS - npm prefix + npm prefix [-g] ## DESCRIPTION -Print the prefix to standard out. +Print the local prefix to standard out. This is the closest parent directory +to contain a package.json file unless `-g` is also specified. + +If `-g` is specified, this will be the value of the global prefix. See +`npm-config(7)` for more detail. ## SEE ALSO diff --git a/deps/npm/doc/cli/npm-publish.md b/deps/npm/doc/cli/npm-publish.md index 338728e3e4..8860b88fc7 100644 --- a/deps/npm/doc/cli/npm-publish.md +++ b/deps/npm/doc/cli/npm-publish.md @@ -11,6 +11,10 @@ npm-publish(1) -- Publish a package Publishes a package to the registry so that it can be installed by name. +By default npm will publish to the public registry. This can be overridden by +specifying a different default registry or using a `npm-scope(7)` in the name +(see `package.json(5)`). + * ``: A folder containing a package.json file @@ -24,7 +28,7 @@ Publishes a package to the registry so that it can be installed by name. and `npm install` installs the `latest` tag. Fails if the package name and version combination already exists in -the registry. +the specified registry. Once a package is published with a given name and version, that specific name and version combination can never be used again, even if diff --git a/deps/npm/doc/cli/npm-restart.md b/deps/npm/doc/cli/npm-restart.md index 4661d6b23b..7b039a8f8f 100644 --- a/deps/npm/doc/cli/npm-restart.md +++ b/deps/npm/doc/cli/npm-restart.md @@ -3,7 +3,7 @@ npm-restart(1) -- Start a package ## SYNOPSIS - npm restart + npm restart [-- ] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-run-script.md b/deps/npm/doc/cli/npm-run-script.md index 835dbf5df7..09a546b9a8 100644 --- a/deps/npm/doc/cli/npm-run-script.md +++ b/deps/npm/doc/cli/npm-run-script.md @@ -3,8 +3,8 @@ npm-run-script(1) -- Run arbitrary package scripts ## SYNOPSIS - npm run-script [] [command] - npm run [] [command] + npm run-script [command] [-- ] + npm run [command] [-- ] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-start.md b/deps/npm/doc/cli/npm-start.md index 01347d2e46..759de221f3 100644 --- a/deps/npm/doc/cli/npm-start.md +++ b/deps/npm/doc/cli/npm-start.md @@ -3,7 +3,7 @@ npm-start(1) -- Start a package ## SYNOPSIS - npm start + npm start [-- ] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-stop.md b/deps/npm/doc/cli/npm-stop.md index bda5cc8f47..92b14b4179 100644 --- a/deps/npm/doc/cli/npm-stop.md +++ b/deps/npm/doc/cli/npm-stop.md @@ -3,7 +3,7 @@ npm-stop(1) -- Stop a package ## SYNOPSIS - npm stop + npm stop [-- ] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-test.md b/deps/npm/doc/cli/npm-test.md index 800f3ae104..c2267082df 100644 --- a/deps/npm/doc/cli/npm-test.md +++ b/deps/npm/doc/cli/npm-test.md @@ -3,8 +3,8 @@ npm-test(1) -- Test a package ## SYNOPSIS - npm test - npm tst + npm test [-- ] + npm tst [-- ] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-uninstall.md b/deps/npm/doc/cli/npm-uninstall.md index e24815bec7..bfa667c3e2 100644 --- a/deps/npm/doc/cli/npm-uninstall.md +++ b/deps/npm/doc/cli/npm-uninstall.md @@ -3,7 +3,7 @@ npm-rm(1) -- Remove a package ## SYNOPSIS - npm uninstall [--save|--save-dev|--save-optional] + npm uninstall [@/] [--save|--save-dev|--save-optional] npm rm (with any of the previous argument usage) ## DESCRIPTION @@ -27,9 +27,12 @@ the package version in your main package.json: * `--save-optional`: Package will be removed from your `optionalDependencies`. +Scope is optional and follows the usual rules for `npm-scope(7)`. + Examples: npm uninstall sax --save + npm uninstall @myorg/privatepackage --save npm uninstall node-tap --save-dev npm uninstall dtrace-provider --save-optional diff --git a/deps/npm/doc/cli/npm-unpublish.md b/deps/npm/doc/cli/npm-unpublish.md index 45026197e1..1d5fe92878 100644 --- a/deps/npm/doc/cli/npm-unpublish.md +++ b/deps/npm/doc/cli/npm-unpublish.md @@ -3,7 +3,7 @@ npm-unpublish(1) -- Remove a package from the registry ## SYNOPSIS - npm unpublish [@] + npm unpublish [@/][@] ## WARNING @@ -27,6 +27,8 @@ Even if a package version is unpublished, that specific name and version combination can never be reused. In order to publish the package again, a new version number must be used. +The scope is optional and follows the usual rules for `npm-scope(7)`. + ## SEE ALSO * npm-deprecate(1) diff --git a/deps/npm/doc/cli/npm-update.md b/deps/npm/doc/cli/npm-update.md index 1ea6b62756..a53d294592 100644 --- a/deps/npm/doc/cli/npm-update.md +++ b/deps/npm/doc/cli/npm-update.md @@ -12,8 +12,11 @@ This command will update all the packages listed to the latest version It will also install missing packages. -If the `-g` flag is specified, this command will update globally installed packages. -If no package name is specified, all packages in the specified location (global or local) will be updated. +If the `-g` flag is specified, this command will update globally installed +packages. + +If no package name is specified, all packages in the specified location (global +or local) will be updated. ## SEE ALSO diff --git a/deps/npm/doc/cli/npm-view.md b/deps/npm/doc/cli/npm-view.md index 1d19fe88d4..8f52a85a92 100644 --- a/deps/npm/doc/cli/npm-view.md +++ b/deps/npm/doc/cli/npm-view.md @@ -3,8 +3,8 @@ npm-view(1) -- View registry info ## SYNOPSIS - npm view [@] [[.]...] - npm v [@] [[.]...] + npm view [@/][@] [[.]...] + npm v [@/][@] [[.]...] ## DESCRIPTION diff --git a/deps/npm/doc/files/npm-folders.md b/deps/npm/doc/files/npm-folders.md index 1b1485d5ed..1fb21b1a31 100644 --- a/deps/npm/doc/files/npm-folders.md +++ b/deps/npm/doc/files/npm-folders.md @@ -42,6 +42,12 @@ Global installs on Unix systems go to `{prefix}/lib/node_modules`. Global installs on Windows go to `{prefix}/node_modules` (that is, no `lib` folder.) +Scoped packages are installed the same way, except they are grouped together +in a sub-folder of the relevant `node_modules` folder with the name of that +scope prefix by the @ symbol, e.g. `npm install @myorg/package` would place +the package in `{prefix}/node_modules/@myorg/package`. See `scopes(7)` for +more details. + If you wish to `require()` a package, then install it locally. ### Executables diff --git a/deps/npm/doc/files/package.json.md b/deps/npm/doc/files/package.json.md index b9b05d4d4d..82b9405224 100644 --- a/deps/npm/doc/files/package.json.md +++ b/deps/npm/doc/files/package.json.md @@ -30,6 +30,9 @@ The name is what your thing is called. Some tips: * You may want to check the npm registry to see if there's something by that name already, before you get too attached to it. http://registry.npmjs.org/ +A name can be optionally prefixed by a scope, e.g. `@myorg/mypackage`. See +`npm-scope(7)` for more detail. + ## version The *most* important things in your package.json are the name and version fields. @@ -320,6 +323,8 @@ See semver(7) for more details about specifying version ranges. * `range1 || range2` Passes if either range1 or range2 are satisfied. * `git...` See 'Git URLs as Dependencies' below * `user/repo` See 'GitHub URLs' below +* `tag` A specific version tagged and published as `tag` See `npm-tag(1)` +* `path/path/path` See Local Paths below For example, these are all valid: @@ -334,6 +339,8 @@ For example, these are all valid: , "elf" : "~1.2.3" , "two" : "2.x" , "thr" : "3.3.x" + , "lat" : "latest" + , "dyl" : "~/projects/dyl" } } @@ -369,6 +376,21 @@ As of version 1.1.65, you can refer to GitHub urls as just "foo": "user/foo-proj } } +## Local Paths + +As of version 2.0.0 you can provide a path to a local directory that +contains a package. Local paths can be in the form: + + ../foo/bar + ~/foo/bar + ./foo/bar + /foo/bar + +This feature is helpful for local offline development and creating +tests that require npm installing where you don't want to hit an +external server, but should not be used when publishing packages +to the public registry. + ## devDependencies If someone is planning on downloading and using your module in their diff --git a/deps/npm/doc/misc/npm-config.md b/deps/npm/doc/misc/npm-config.md index 035923fa6f..8b5ae12c0d 100644 --- a/deps/npm/doc/misc/npm-config.md +++ b/deps/npm/doc/misc/npm-config.md @@ -50,6 +50,7 @@ The following shorthands are parsed on the command-line: * `-dd`, `--verbose`: `--loglevel verbose` * `-ddd`: `--loglevel silly` * `-g`: `--global` +* `-C`: `--prefix` * `-l`: `--long` * `-m`: `--message` * `-p`, `--porcelain`: `--parseable` @@ -253,12 +254,6 @@ set. The command to run for `npm edit` or `npm config edit`. -### email - -The email of the logged-in user. - -Set by the `npm adduser` command. Should not be set explicitly. - ### engine-strict * Default: false @@ -417,6 +412,14 @@ The value `npm init` should use by default for the package author's homepage. The value `npm init` should use by default for the package license. +### init.version + +* Default: "0.0.0" +* Type: semver + +The value that `npm init` should use by default for the package +version number, if not already set in package.json. + ### json * Default: false @@ -463,7 +466,7 @@ to the npm registry. Must be IPv4 in versions of Node prior to 0.12. * Default: "http" * Type: String -* Values: "silent", "win", "error", "warn", "http", "info", "verbose", "silly" +* Values: "silent", "error", "warn", "http", "info", "verbose", "silly" What level of logs to report. On failure, *all* logs are written to `npm-debug.log` in the current working directory. @@ -663,14 +666,25 @@ Only works if there is already a package.json file present. * Default: '^' * Type: String -Configure how versions of packages installed to a package.json file via +Configure how versions of packages installed to a package.json file via `--save` or `--save-dev` get prefixed. For example if a package has version `1.2.3`, by default it's version is -set to `^1.2.3` which allows minor upgrades for that package, but after +set to `^1.2.3` which allows minor upgrades for that package, but after `npm config set save-prefix='~'` it would be set to `~1.2.3` which only allows patch upgrades. +### scope + +* Default: "" +* Type: String + +Associate an operation with a scope for a scoped registry. Useful when logging +in to a private registry for the first time: +`npm login --scope=@organization --registry=registry.organization.com`, which +will cause `@organization` to be mapped to the registry for future installation +of packages specified according to the pattern `@organization/package`. + ### searchopts * Default: "" @@ -794,13 +808,6 @@ instead of complete help when doing `npm-help(1)`. The UID to set to when running package scripts as root. -### username - -* Default: null -* Type: String - -The username on the npm registry. Set with `npm adduser` - ### userconfig * Default: ~/.npmrc diff --git a/deps/npm/doc/misc/npm-faq.md b/deps/npm/doc/misc/npm-faq.md index 53fa03d629..4dca3cd71e 100644 --- a/deps/npm/doc/misc/npm-faq.md +++ b/deps/npm/doc/misc/npm-faq.md @@ -75,18 +75,20 @@ npm will not help you do something that is known to be a bad idea. ## Should I check my `node_modules` folder into git? -Mikeal Rogers answered this question very well: +Usually, no. Allow npm to resolve dependencies for your packages. - +For packages you **deploy**, such as websites and apps, +you should use npm shrinkwrap to lock down your full dependency tree: -tl;dr +https://www.npmjs.org/doc/cli/npm-shrinkwrap.html -* Check `node_modules` into git for things you **deploy**, such as - websites and apps. -* Do not check `node_modules` into git for libraries and modules - intended to be reused. -* Use npm to manage dependencies in your dev environment, but not in - your deployment scripts. +If you are paranoid about depending on the npm ecosystem, +you should run a private npm mirror or a private cache. + +If you want 100% confidence in being able to reproduce the specific bytes +included in a deployment, you should use an additional mechanism that can +verify contents rather than versions. For example, +Amazon machine images, DigitalOcean snapshots, Heroku slugs, or simple tarballs. ## Is it 'npm' or 'NPM' or 'Npm'? diff --git a/deps/npm/doc/misc/npm-index.md b/deps/npm/doc/misc/npm-index.md index 4e9f70c99e..cf969868f9 100644 --- a/deps/npm/doc/misc/npm-index.md +++ b/deps/npm/doc/misc/npm-index.md @@ -409,6 +409,10 @@ Index of all npm documentation The JavaScript Package Registry +### npm-scope(7) + +Scoped packages + ### npm-scripts(7) How npm handles the "scripts" field diff --git a/deps/npm/doc/misc/npm-registry.md b/deps/npm/doc/misc/npm-registry.md index a8c4b0200d..42cec59448 100644 --- a/deps/npm/doc/misc/npm-registry.md +++ b/deps/npm/doc/misc/npm-registry.md @@ -12,15 +12,14 @@ write APIs as well, to allow for publishing packages and managing user account information. The official public npm registry is at . It -is powered by a CouchDB database at -. The code for the couchapp is -available at . npm user accounts -are CouchDB users, stored in the -database. - -The registry URL is supplied by the `registry` config parameter. See -`npm-config(1)`, `npmrc(5)`, and `npm-config(7)` for more on managing -npm's configuration. +is powered by a CouchDB database, of which there is a public mirror at +. The code for the couchapp is +available at . + +The registry URL used is determined by the scope of the package (see +`npm-scope(7)`). If no scope is specified, the default registry is used, which is +supplied by the `registry` config parameter. See `npm-config(1)`, +`npmrc(5)`, and `npm-config(7)` for more on managing npm's configuration. ## Can I run my own private registry? diff --git a/deps/npm/doc/misc/npm-scope.md b/deps/npm/doc/misc/npm-scope.md new file mode 100644 index 0000000000..a4ee1a0825 --- /dev/null +++ b/deps/npm/doc/misc/npm-scope.md @@ -0,0 +1,84 @@ +npm-scope(7) -- Scoped packages +=============================== + +## DESCRIPTION + +All npm packages have a name. Some package names also have a scope. A scope +follows the usual rules for package names (url-safe characters, no leading dots +or underscores). When used in package names, preceded by an @-symbol and +followed by a slash, e.g. + + @somescope/somepackagename + +Scopes are a way of grouping related packages together, and also affect a few +things about the way npm treats the package. + +**As of 2014-09-03, scoped packages are not supported by the public npm registry**. +However, the npm client is backwards-compatible with un-scoped registries, so +it can be used to work with scoped and un-scoped registries at the same time. + +## Installing scoped packages + +Scoped packages are installed to a sub-folder of the regular installation +folder, e.g. if your other packages are installed in `node_modules/packagename`, +scoped modules will be in `node_modules/@myorg/packagename`. The scope folder +(`@myorg`) is simply the name of the scope preceded by an @-symbol, and can +contain any number of scoped packages. + +A scoped package is install by referencing it by name, preceded by an @-symbol, +in `npm install`: + + npm install @myorg/mypackage + +Or in `package.json`: + + "dependencies": { + "@myorg/mypackage": "^1.3.0" + } + +Note that if the @-symbol is omitted in either case npm will instead attempt to +install from GitHub; see `npm-install(1)`. + +## Requiring scoped packages + +Because scoped packages are installed into a scope folder, you have to +include the name of the scope when requiring them in your code, e.g. + + require('@myorg/mypackage') + +There is nothing special about the way Node treats scope folders, this is +just specifying to require the module `mypackage` in the folder called `@myorg`. + +## Publishing scoped packages + +Scoped packages can be published to any registry that supports them. +*As of 2014-09-03, the public npm registry does not support scoped packages*, +so attempting to publish a scoped package to the registry will fail unless +you have associated that scope with a different registry, see below. + +## Associating a scope with a registry + +Scopes can be associated with a separate registry. This allows you to +seamlessly use a mix of packages from the public npm registry and one or more +private registries, such as npm Enterprise. + +You can associate a scope with a registry at login, e.g. + + npm login --registry=http://reg.example.com --scope=@myco + +Scopes have a many-to-one relationship with registries: one registry can +host multiple scopes, but a scope only ever points to one registry. + +You can also associate a scope with a registry using `npm config`: + + npm config set @myco:registry http://reg.example.com + +Once a scope is associated with a registry, any `npm install` for a package +with that scope will request packages from that registry instead. Any +`npm publish` for a package name that contains the scope will be published to +that registry instead. + +## SEE ALSO + +* npm-install(1) +* npm-publish(1) \ No newline at end of file diff --git a/deps/npm/doc/misc/npm-scripts.md b/deps/npm/doc/misc/npm-scripts.md index b49d9e23d1..7ef8fb10d1 100644 --- a/deps/npm/doc/misc/npm-scripts.md +++ b/deps/npm/doc/misc/npm-scripts.md @@ -33,8 +33,9 @@ following scripts: Run by the `npm restart` command. Note: `npm restart` will run the stop and start scripts if no `restart` script is provided. -Additionally, arbitrary scripts can be run by doing -`npm run-script `. +Additionally, arbitrary scripts can be executed by running `npm run-script + `. *Pre* and *post* commands with matching names will be run for +those as well (e.g. `premyscript`, `myscript`, `postmyscript`). ## NOTE: INSTALL SCRIPTS ARE AN ANTIPATTERN diff --git a/deps/npm/doc/misc/semver.md b/deps/npm/doc/misc/semver.md index 6c7d28061c..af83d717c9 100644 --- a/deps/npm/doc/misc/semver.md +++ b/deps/npm/doc/misc/semver.md @@ -41,53 +41,170 @@ A leading `"="` or `"v"` character is stripped off and ignored. ## Ranges -The following range styles are supported: - -* `1.2.3` A specific version. When nothing else will do. Must be a full - version number, with major, minor, and patch versions specified. - Note that build metadata is still ignored, so `1.2.3+build2012` will - satisfy this range. -* `>1.2.3` Greater than a specific version. -* `<1.2.3` Less than a specific version. If there is no prerelease - tag on the version range, then no prerelease version will be allowed - either, even though these are technically "less than". -* `>=1.2.3` Greater than or equal to. Note that prerelease versions - are NOT equal to their "normal" equivalents, so `1.2.3-beta` will - not satisfy this range, but `2.3.0-beta` will. -* `<=1.2.3` Less than or equal to. In this case, prerelease versions - ARE allowed, so `1.2.3-beta` would satisfy. +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + * `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` -* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` "Reasonably close to `1.2.3`". When - using tilde operators, prerelease versions are supported as well, - but a prerelease of the next significant digit will NOT be - satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`. -* `^1.2.3` := `>=1.2.3-0 <2.0.0-0` "Compatible with `1.2.3`". When - using caret operators, anything from the specified version (including - prerelease) will be supported up to, but not including, the next - major version (or its prereleases). `1.5.1` will satisfy `^1.2.3`, - while `1.2.2` and `2.0.0-beta` will not. -* `^0.1.3` := `>=0.1.3-0 <0.2.0-0` "Compatible with `0.1.3`". `0.x.x` versions are - special: the first non-zero component indicates potentially breaking changes, - meaning the caret operator matches any version with the same first non-zero - component starting at the specified version. -* `^0.0.2` := `=0.0.2` "Only the version `0.0.2` is considered compatible" -* `~1.2` := `>=1.2.0-0 <1.3.0-0` "Any version starting with `1.2`" -* `^1.2` := `>=1.2.0-0 <2.0.0-0` "Any version compatible with `1.2`" -* `1.2.x` := `>=1.2.0-0 <1.3.0-0` "Any version starting with `1.2`" -* `1.2.*` Same as `1.2.x`. -* `1.2` Same as `1.2.x`. -* `~1` := `>=1.0.0-0 <2.0.0-0` "Any version starting with `1`" -* `^1` := `>=1.0.0-0 <2.0.0-0` "Any version compatible with `1`" -* `1.x` := `>=1.0.0-0 <2.0.0-0` "Any version starting with `1`" -* `1.*` Same as `1.x`. -* `1` Same as `1.x`. -* `*` Any version whatsoever. -* `x` Same as `*`. -* `""` (just an empty string) Same as `*`. - - -Ranges can be joined with either a space (which implies "and") or a -`||` (which implies "or"). + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +Note: this is the same as the `~>` operator in rubygems. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero digit in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` ## Functions diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html index 6a4832313b..64bb15f319 100644 --- a/deps/npm/html/doc/README.html +++ b/deps/npm/html/doc/README.html @@ -19,11 +19,11 @@

To install an old and unsupported version of npm that works on node 0.3 and prior, clone the git repo and dig through the old tags and branches.

Super Easy Install

-

npm comes with node now.

+

npm comes with node now.

Windows Computers

-

Get the MSI. npm is in it.

+

Get the MSI. npm is in it.

Apple Macintosh Computers

-

Get the pkg. npm is in it.

+

Get the pkg. npm is in it.

Other Sorts of Unices

Run make install. npm will be installed with node.

If you want a more fancy pants install (a different version, customized @@ -141,7 +141,7 @@ specific purpose, or lack of malice in any given npm package.

If you have a complaint about a package in the public npm registry, and cannot resolve it with the package owner, please email -support@npmjs.com and explain the situation.

+support@npmjs.com and explain the situation.

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.

@@ -161,7 +161,7 @@ ban your account in extreme cases. So don't do that.

  • web: https://github.com/npm/npm/issues
  • email: -npm-@googlegroups.com
  • +npm-@googlegroups.com

    Be sure to include all of the output from the npm command that didn't work as expected. The npm-debug.log file is also helpful to provide.

    @@ -186,5 +186,5 @@ will no doubt tell you to put the output in a gist or email.

           - + diff --git a/deps/npm/html/doc/api/npm-bin.html b/deps/npm/html/doc/api/npm-bin.html index 3a170b0244..ec775346b5 100644 --- a/deps/npm/html/doc/api/npm-bin.html +++ b/deps/npm/html/doc/api/npm-bin.html @@ -28,5 +28,5 @@ to the npm.bin member.

           - + diff --git a/deps/npm/html/doc/api/npm-bugs.html b/deps/npm/html/doc/api/npm-bugs.html index 1ab1393fff..cc941e0233 100644 --- a/deps/npm/html/doc/api/npm-bugs.html +++ b/deps/npm/html/doc/api/npm-bugs.html @@ -33,5 +33,5 @@ friendly for programmatic use.

           - + diff --git a/deps/npm/html/doc/api/npm-cache.html b/deps/npm/html/doc/api/npm-cache.html index ed67808303..2bd5bb527c 100644 --- a/deps/npm/html/doc/api/npm-cache.html +++ b/deps/npm/html/doc/api/npm-cache.html @@ -42,5 +42,5 @@ incrementation.

           - + diff --git a/deps/npm/html/doc/api/npm-commands.html b/deps/npm/html/doc/api/npm-commands.html index 9ab89fb5cd..577eae8d06 100644 --- a/deps/npm/html/doc/api/npm-commands.html +++ b/deps/npm/html/doc/api/npm-commands.html @@ -36,5 +36,5 @@ usage, or man 3 npm-<command> for programmatic usage.

           - + diff --git a/deps/npm/html/doc/api/npm-config.html b/deps/npm/html/doc/api/npm-config.html index 2fe37f217c..37313a90ba 100644 --- a/deps/npm/html/doc/api/npm-config.html +++ b/deps/npm/html/doc/api/npm-config.html @@ -57,5 +57,5 @@ functions instead.

           - + diff --git a/deps/npm/html/doc/api/npm-deprecate.html b/deps/npm/html/doc/api/npm-deprecate.html index 557d2efe3c..dda88578a8 100644 --- a/deps/npm/html/doc/api/npm-deprecate.html +++ b/deps/npm/html/doc/api/npm-deprecate.html @@ -47,5 +47,5 @@ a deprecation warning to all who attempt to install it.

           - + diff --git a/deps/npm/html/doc/api/npm-docs.html b/deps/npm/html/doc/api/npm-docs.html index d42b27b037..076e9b4f82 100644 --- a/deps/npm/html/doc/api/npm-docs.html +++ b/deps/npm/html/doc/api/npm-docs.html @@ -33,5 +33,5 @@ friendly for programmatic use.

           - + diff --git a/deps/npm/html/doc/api/npm-edit.html b/deps/npm/html/doc/api/npm-edit.html index f6f4617e12..c9702a0b46 100644 --- a/deps/npm/html/doc/api/npm-edit.html +++ b/deps/npm/html/doc/api/npm-edit.html @@ -36,5 +36,5 @@ and how this is used.

           - + diff --git a/deps/npm/html/doc/api/npm-explore.html b/deps/npm/html/doc/api/npm-explore.html index 0136e705a2..be8556656f 100644 --- a/deps/npm/html/doc/api/npm-explore.html +++ b/deps/npm/html/doc/api/npm-explore.html @@ -31,5 +31,5 @@ sure to use npm rebuild <pkg> if you make any changes.

           - + diff --git a/deps/npm/html/doc/api/npm-help-search.html b/deps/npm/html/doc/api/npm-help-search.html index e2bb08abbd..852f0bc46e 100644 --- a/deps/npm/html/doc/api/npm-help-search.html +++ b/deps/npm/html/doc/api/npm-help-search.html @@ -44,5 +44,5 @@ Name of the file that matched        - + diff --git a/deps/npm/html/doc/api/npm-init.html b/deps/npm/html/doc/api/npm-init.html index ca23df8f48..dac576d345 100644 --- a/deps/npm/html/doc/api/npm-init.html +++ b/deps/npm/html/doc/api/npm-init.html @@ -39,5 +39,5 @@ then go ahead and use this programmatically.

           - + diff --git a/deps/npm/html/doc/api/npm-install.html b/deps/npm/html/doc/api/npm-install.html index c0e0eb78bf..204f1dfb89 100644 --- a/deps/npm/html/doc/api/npm-install.html +++ b/deps/npm/html/doc/api/npm-install.html @@ -32,5 +32,5 @@ installed or when an error has been encountered.

           - + diff --git a/deps/npm/html/doc/api/npm-link.html b/deps/npm/html/doc/api/npm-link.html index aff1250a4c..4eef789e6b 100644 --- a/deps/npm/html/doc/api/npm-link.html +++ b/deps/npm/html/doc/api/npm-link.html @@ -42,5 +42,5 @@ the package in the current working directory

           - + diff --git a/deps/npm/html/doc/api/npm-load.html b/deps/npm/html/doc/api/npm-load.html index 7451a75728..64a9bd4b09 100644 --- a/deps/npm/html/doc/api/npm-load.html +++ b/deps/npm/html/doc/api/npm-load.html @@ -37,5 +37,5 @@ config object.

           - + diff --git a/deps/npm/html/doc/api/npm-ls.html b/deps/npm/html/doc/api/npm-ls.html index f1c2504918..a3807d8fd3 100644 --- a/deps/npm/html/doc/api/npm-ls.html +++ b/deps/npm/html/doc/api/npm-ls.html @@ -63,5 +63,5 @@ dependency will only be output once.

           - + diff --git a/deps/npm/html/doc/api/npm-outdated.html b/deps/npm/html/doc/api/npm-outdated.html index a7e88b882c..c566630a40 100644 --- a/deps/npm/html/doc/api/npm-outdated.html +++ b/deps/npm/html/doc/api/npm-outdated.html @@ -28,5 +28,5 @@ currently outdated.

           - + diff --git a/deps/npm/html/doc/api/npm-owner.html b/deps/npm/html/doc/api/npm-owner.html index eb8f9abafa..d2b336bd95 100644 --- a/deps/npm/html/doc/api/npm-owner.html +++ b/deps/npm/html/doc/api/npm-owner.html @@ -47,5 +47,5 @@ that is not implemented at this time.

           - + diff --git a/deps/npm/html/doc/api/npm-pack.html b/deps/npm/html/doc/api/npm-pack.html index c2476f20e0..1adb04959b 100644 --- a/deps/npm/html/doc/api/npm-pack.html +++ b/deps/npm/html/doc/api/npm-pack.html @@ -33,5 +33,5 @@ overwritten the second time.

           - + diff --git a/deps/npm/html/doc/api/npm-prefix.html b/deps/npm/html/doc/api/npm-prefix.html index 583079e336..605bc49704 100644 --- a/deps/npm/html/doc/api/npm-prefix.html +++ b/deps/npm/html/doc/api/npm-prefix.html @@ -29,5 +29,5 @@        - + diff --git a/deps/npm/html/doc/api/npm-prune.html b/deps/npm/html/doc/api/npm-prune.html index fabfab57d3..d85c01e42a 100644 --- a/deps/npm/html/doc/api/npm-prune.html +++ b/deps/npm/html/doc/api/npm-prune.html @@ -30,5 +30,5 @@ package's dependencies list.

           - + diff --git a/deps/npm/html/doc/api/npm-publish.html b/deps/npm/html/doc/api/npm-publish.html index 9d338cebbd..ae352eb565 100644 --- a/deps/npm/html/doc/api/npm-publish.html +++ b/deps/npm/html/doc/api/npm-publish.html @@ -46,5 +46,5 @@ the registry. Overwrites when the "force" environment variable is set        - + diff --git a/deps/npm/html/doc/api/npm-rebuild.html b/deps/npm/html/doc/api/npm-rebuild.html index 821becbf54..1cb5fffc23 100644 --- a/deps/npm/html/doc/api/npm-rebuild.html +++ b/deps/npm/html/doc/api/npm-rebuild.html @@ -30,5 +30,5 @@ the new binary. If no 'packages' parameter is specify, every package wil        - + diff --git a/deps/npm/html/doc/api/npm-repo.html b/deps/npm/html/doc/api/npm-repo.html index d624659c15..2c40c8ed1f 100644 --- a/deps/npm/html/doc/api/npm-repo.html +++ b/deps/npm/html/doc/api/npm-repo.html @@ -33,5 +33,5 @@ friendly for programmatic use.

           - + diff --git a/deps/npm/html/doc/api/npm-restart.html b/deps/npm/html/doc/api/npm-restart.html index 67729df285..382d44ac97 100644 --- a/deps/npm/html/doc/api/npm-restart.html +++ b/deps/npm/html/doc/api/npm-restart.html @@ -36,5 +36,5 @@ in the packages parameter.

           - + diff --git a/deps/npm/html/doc/api/npm-root.html b/deps/npm/html/doc/api/npm-root.html index 4f9b529316..c9d4b17435 100644 --- a/deps/npm/html/doc/api/npm-root.html +++ b/deps/npm/html/doc/api/npm-root.html @@ -29,5 +29,5 @@        - + diff --git a/deps/npm/html/doc/api/npm-run-script.html b/deps/npm/html/doc/api/npm-run-script.html index c7ca613833..b5ef687997 100644 --- a/deps/npm/html/doc/api/npm-run-script.html +++ b/deps/npm/html/doc/api/npm-run-script.html @@ -41,5 +41,5 @@ assumed to be the command to run. All other elements are ignored.

           - + diff --git a/deps/npm/html/doc/api/npm-search.html b/deps/npm/html/doc/api/npm-search.html index 72fa33509d..a4484a3780 100644 --- a/deps/npm/html/doc/api/npm-search.html +++ b/deps/npm/html/doc/api/npm-search.html @@ -53,5 +53,5 @@ like).

           - + diff --git a/deps/npm/html/doc/api/npm-shrinkwrap.html b/deps/npm/html/doc/api/npm-shrinkwrap.html index 172646a9ee..e5bf33ae4c 100644 --- a/deps/npm/html/doc/api/npm-shrinkwrap.html +++ b/deps/npm/html/doc/api/npm-shrinkwrap.html @@ -33,5 +33,5 @@ been saved.

           - + diff --git a/deps/npm/html/doc/api/npm-start.html b/deps/npm/html/doc/api/npm-start.html index 813b28ce2a..fa8a3db835 100644 --- a/deps/npm/html/doc/api/npm-start.html +++ b/deps/npm/html/doc/api/npm-start.html @@ -28,5 +28,5 @@ in the packages parameter.

           - + diff --git a/deps/npm/html/doc/api/npm-stop.html b/deps/npm/html/doc/api/npm-stop.html index 65f5c9f26e..bdcf72bde8 100644 --- a/deps/npm/html/doc/api/npm-stop.html +++ b/deps/npm/html/doc/api/npm-stop.html @@ -28,5 +28,5 @@ in the packages parameter.

           - + diff --git a/deps/npm/html/doc/api/npm-submodule.html b/deps/npm/html/doc/api/npm-submodule.html index 35364403c3..f7dfcca434 100644 --- a/deps/npm/html/doc/api/npm-submodule.html +++ b/deps/npm/html/doc/api/npm-submodule.html @@ -42,5 +42,5 @@ dependencies into the submodule folder.

           - + diff --git a/deps/npm/html/doc/api/npm-tag.html b/deps/npm/html/doc/api/npm-tag.html index cf9c71c3c5..2f94ed7f23 100644 --- a/deps/npm/html/doc/api/npm-tag.html +++ b/deps/npm/html/doc/api/npm-tag.html @@ -36,5 +36,5 @@ used. For more information about how to set this config, check        - + diff --git a/deps/npm/html/doc/api/npm-test.html b/deps/npm/html/doc/api/npm-test.html index f2d37483ac..3247238ef9 100644 --- a/deps/npm/html/doc/api/npm-test.html +++ b/deps/npm/html/doc/api/npm-test.html @@ -30,5 +30,5 @@ in the packages parameter.

           - + diff --git a/deps/npm/html/doc/api/npm-uninstall.html b/deps/npm/html/doc/api/npm-uninstall.html index 2abfd08996..ffd317e484 100644 --- a/deps/npm/html/doc/api/npm-uninstall.html +++ b/deps/npm/html/doc/api/npm-uninstall.html @@ -30,5 +30,5 @@ uninstalled or when an error has been encountered.

           - + diff --git a/deps/npm/html/doc/api/npm-unpublish.html b/deps/npm/html/doc/api/npm-unpublish.html index f6412cf7d1..e35acac1d1 100644 --- a/deps/npm/html/doc/api/npm-unpublish.html +++ b/deps/npm/html/doc/api/npm-unpublish.html @@ -33,5 +33,5 @@ the root package entry is removed from the registry entirely.

           - + diff --git a/deps/npm/html/doc/api/npm-update.html b/deps/npm/html/doc/api/npm-update.html index 60bcde2654..18da44c1ee 100644 --- a/deps/npm/html/doc/api/npm-update.html +++ b/deps/npm/html/doc/api/npm-update.html @@ -27,5 +27,5 @@        - + diff --git a/deps/npm/html/doc/api/npm-version.html b/deps/npm/html/doc/api/npm-version.html index 8985822164..376d8b9807 100644 --- a/deps/npm/html/doc/api/npm-version.html +++ b/deps/npm/html/doc/api/npm-version.html @@ -32,5 +32,5 @@ not have exactly one element. The only element should be a version number.

           - + diff --git a/deps/npm/html/doc/api/npm-view.html b/deps/npm/html/doc/api/npm-view.html index 59f68ee64a..482d912677 100644 --- a/deps/npm/html/doc/api/npm-view.html +++ b/deps/npm/html/doc/api/npm-view.html @@ -81,5 +81,5 @@ the field name.

           - + diff --git a/deps/npm/html/doc/api/npm-whoami.html b/deps/npm/html/doc/api/npm-whoami.html index 9380f8664a..1a41af4ef6 100644 --- a/deps/npm/html/doc/api/npm-whoami.html +++ b/deps/npm/html/doc/api/npm-whoami.html @@ -29,5 +29,5 @@        - + diff --git a/deps/npm/html/doc/api/npm.html b/deps/npm/html/doc/api/npm.html index 2335b7a226..72265ec71a 100644 --- a/deps/npm/html/doc/api/npm.html +++ b/deps/npm/html/doc/api/npm.html @@ -23,7 +23,7 @@ npm.load([configObject, ]function (er, npm) { npm.commands.install(["package"], cb) })

    VERSION

    -

    1.4.28

    +

    2.0.0

    DESCRIPTION

    This is the API documentation for npm. To find documentation of the command line @@ -110,5 +110,5 @@ method names. Use the npm.deref method to find the real name.

           - + diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html index 9a0e55ee60..9c2b20b51e 100644 --- a/deps/npm/html/doc/cli/npm-adduser.html +++ b/deps/npm/html/doc/cli/npm-adduser.html @@ -11,20 +11,31 @@

    npm-adduser

    Add a registry user account

    SYNOPSIS

    -
    npm adduser
    +
    npm adduser [--registry=url] [--scope=@orgname]
     

    DESCRIPTION

    -

    Create or verify a user named <username> in the npm registry, and -save the credentials to the .npmrc file.

    +

    Create or verify a user named <username> in the specified registry, and +save the credentials to the .npmrc file. If no registry is specified, +the default registry will be used (see npm-config(7)).

    The username, password, and email are read in from prompts.

    You may use this command to change your email address, but not username or password.

    -

    To reset your password, go to https://npmjs.org/forgot

    +

    To reset your password, go to https://www.npmjs.org/forgot

    You may use this command multiple times with the same user account to authorize on a new machine.

    +

    npm login is an alias to adduser and behaves exactly the same way.

    CONFIGURATION

    registry

    Default: http://registry.npmjs.org/

    -

    The base URL of the npm package registry.

    +

    The base URL of the npm package registry. If scope is also specified, +this registry will only be used for packages with that scope. See npm-scope(7).

    +

    scope

    +

    Default: none

    +

    If specified, the user and login credentials given will be associated +with the specified scope. See npm-scope(7). You can use both at the same time, +e.g.

    +
    npm adduser --registry=http://myregistry.example.com --scope=@myco
    +

    This will set a registry for the given scope and login or create a user for +that registry at the same time.

    SEE ALSO

    • npm-registry(7)
    • @@ -46,5 +57,5 @@ authorize on a new machine.

             - + diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html index d6e055aaa3..e3c993f506 100644 --- a/deps/npm/html/doc/cli/npm-bin.html +++ b/deps/npm/html/doc/cli/npm-bin.html @@ -35,5 +35,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html index 8693485aa3..e7ce93bc9d 100644 --- a/deps/npm/html/doc/cli/npm-bugs.html +++ b/deps/npm/html/doc/cli/npm-bugs.html @@ -54,5 +54,5 @@ a package.json in the current folder and use the name        - + diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html index 58dfd36fde..e2f60bb118 100644 --- a/deps/npm/html/doc/cli/npm-build.html +++ b/deps/npm/html/doc/cli/npm-build.html @@ -38,5 +38,5 @@ A folder containing a package.json file in its root.        - + diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html index 47355abbf2..0bdbb1ef97 100644 --- a/deps/npm/html/doc/cli/npm-bundle.html +++ b/deps/npm/html/doc/cli/npm-bundle.html @@ -31,5 +31,5 @@ install packages into the local space.

             - + diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html index 3b84f979dc..a384b71b2f 100644 --- a/deps/npm/html/doc/cli/npm-cache.html +++ b/deps/npm/html/doc/cli/npm-cache.html @@ -81,5 +81,5 @@ they do not make an HTTP request to the registry.

             - + diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html index cc56d45623..2d0dae8c8d 100644 --- a/deps/npm/html/doc/cli/npm-completion.html +++ b/deps/npm/html/doc/cli/npm-completion.html @@ -42,5 +42,5 @@ completions based on the arguments.

             - + diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html index 52efed825b..cf19f65265 100644 --- a/deps/npm/html/doc/cli/npm-config.html +++ b/deps/npm/html/doc/cli/npm-config.html @@ -66,5 +66,5 @@ global config.

             - + diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html index f2d9794de9..0e40c7e30e 100644 --- a/deps/npm/html/doc/cli/npm-dedupe.html +++ b/deps/npm/html/doc/cli/npm-dedupe.html @@ -63,5 +63,5 @@ versions.

             - + diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html index 01640248b5..f4c568cc6d 100644 --- a/deps/npm/html/doc/cli/npm-deprecate.html +++ b/deps/npm/html/doc/cli/npm-deprecate.html @@ -38,5 +38,5 @@ something like this:

             - + diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html index 05b445cdae..14f447987c 100644 --- a/deps/npm/html/doc/cli/npm-docs.html +++ b/deps/npm/html/doc/cli/npm-docs.html @@ -56,5 +56,5 @@ the current folder and use the name property.

             - + diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html index 50d21486a0..542404cd91 100644 --- a/deps/npm/html/doc/cli/npm-edit.html +++ b/deps/npm/html/doc/cli/npm-edit.html @@ -49,5 +49,5 @@ or "notepad" on Windows.        - + diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html index c3c3127de6..15d7761ce0 100644 --- a/deps/npm/html/doc/cli/npm-explore.html +++ b/deps/npm/html/doc/cli/npm-explore.html @@ -50,5 +50,5 @@ Windows        - + diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html index d09aecf8c1..22ddb9dd51 100644 --- a/deps/npm/html/doc/cli/npm-help-search.html +++ b/deps/npm/html/doc/cli/npm-help-search.html @@ -46,5 +46,5 @@ where the terms were found in the documentation.

             - + diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html index bb5a2e1667..52096aa57e 100644 --- a/deps/npm/html/doc/cli/npm-help.html +++ b/deps/npm/html/doc/cli/npm-help.html @@ -52,5 +52,5 @@ matches are equivalent to specifying a topic name.

             - + diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html index ec53ca2567..6b4bfe10cb 100644 --- a/deps/npm/html/doc/cli/npm-init.html +++ b/deps/npm/html/doc/cli/npm-init.html @@ -38,5 +38,5 @@ without a really good reason to do so.

             - + diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html index 28b6afe39d..38d160fac2 100644 --- a/deps/npm/html/doc/cli/npm-install.html +++ b/deps/npm/html/doc/cli/npm-install.html @@ -15,10 +15,10 @@ npm install <tarball file> npm install <tarball url> npm install <folder> -npm install <name> [--save|--save-dev|--save-optional] [--save-exact] -npm install <name>@<tag> -npm install <name>@<version> -npm install <name>@<version range> +npm install [@<scope>/]<name> [--save|--save-dev|--save-optional] [--save-exact] +npm install [@<scope>/]<name>@<tag> +npm install [@<scope>/]<name>@<version> +npm install [@<scope>/]<name>@<version range> npm i (with any of the previous argument usage)

    DESCRIPTION

    This command installs a package, and any packages that it depends on. If the @@ -64,7 +64,7 @@ after packing it up into a tarball (b).

    Example:

        npm install https://github.com/indexzero/forever/tarball/v0.5.6
     
    -
  • npm install <name> [--save|--save-dev|--save-optional]:

    +
  • npm install [@<scope>/]<name> [--save|--save-dev|--save-optional]:

    Do a <name>@<tag> install, where <tag> is the "tag" config. (See npm-config(7).)

    In most cases, this will install the latest version @@ -85,8 +85,16 @@ package.json, there is an additional, optional flag:

  • --save-exact: Saved dependencies will be configured with an exact version rather than using npm's default semver range operator.

    +

    <scope> is optional. The package will be downloaded from the registry +associated with the specified scope. If no registry is associated with +the given scope the default registry is assumed. See npm-scope(7).

    +

    Note: if you do not include the @-symbol on your scope name, npm will +interpret this as a GitHub repository instead, see below. Scopes names +must also be followed by a slash.

    Examples:

    npm install sax --save
    +npm install githubname/reponame
    +npm install @myorg/privatepackage
     npm install node-tap --save-dev
     npm install dtrace-provider --save-optional
     npm install readable-stream --save --save-exact
    @@ -98,27 +106,38 @@ npm install readable-stream --save --save-exact
     working directory, then it will try to install that, and only try to
     fetch the package by name if it is not valid.
     
      -
    • npm install <name>@<tag>:

      +
    • npm install [@<scope>/]<name>@<tag>:

      Install the version of the package that is referenced by the specified tag. If the tag does not exist in the registry data for that package, then this will fail.

      Example:

          npm install sax@latest
      +    npm install @myorg/mypackage@latest
       
    • -
    • npm install <name>@<version>:

      -

      Install the specified version of the package. This will fail if the version - has not been published to the registry.

      +
    • npm install [@<scope>/]<name>@<version>:

      +

      Install the specified version of the package. This will fail if the + version has not been published to the registry.

      Example:

          npm install sax@0.1.1
      +    npm install @myorg/privatepackage@1.5.0
       
    • -
    • npm install <name>@<version range>:

      +
    • npm install [@<scope>/]<name>@<version range>:

      Install a version of the package matching the specified version range. This will follow the same rules for resolving dependencies described in package.json(5).

      Note that most version ranges must be put in quotes so that your shell will treat it as a single argument.

      Example:

          npm install sax@">=0.1.0 <0.2.0"
      +    npm install @myorg/privatepackage@">=0.1.0 <0.2.0"
       
    • +
    • npm install <githubname>/<githubrepo>:

      +

      Install the package at https://github.com/githubname/githubrepo" by + attempting to clone it usinggit`.

      +

      Example:

      +
          npm install mygithubuser/myproject
      +

      To reference a package in a git repo that is not on GitHub, see git + remote urls below.

      +
    • npm install <git remote url>:

      Install a package by cloning a git remote url. The format of the git url is:

      @@ -220,5 +239,5 @@ affects a real use-case, it will be investigated.

             - + diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html index 0324ca130e..0d28a7ddf8 100644 --- a/deps/npm/html/doc/cli/npm-link.html +++ b/deps/npm/html/doc/cli/npm-link.html @@ -12,21 +12,23 @@

      npm-link

      Symlink a package folder

      SYNOPSIS

      npm link (in package folder)
      -npm link <pkgname>
      +npm link [@<scope>/]<pkgname>
       npm ln (with any of the previous argument usage)
       

      DESCRIPTION

      Package linking is a two-step process.

      First, npm link in a package folder will create a globally-installed -symbolic link from prefix/package-name to the current folder.

      +symbolic link from prefix/package-name to the current folder (see +npm-config(7) for the value of prefix).

      Next, in some other location, npm link package-name will create a symlink from the local node_modules folder to the global symlink.

      Note that package-name is taken from package.json, not from directory name.

      +

      The package name can be optionally prefixed with a scope. See npm-scope(7). +The scope must by preceded by an @-symbol and followed by a slash.

      When creating tarballs for npm publish, the linked packages are "snapshotted" to their current state by resolving the symbolic links.

      -

      This is -handy for installing your own stuff, so that you can work on it and test it -iteratively without having to continually rebuild.

      +

      This is handy for installing your own stuff, so that you can work on it and +test it iteratively without having to continually rebuild.

      For example:

      cd ~/projects/node-redis    # go into the package directory
       npm link                    # creates global link
      @@ -43,7 +45,10 @@ npm link ../node-redis     # link the dir of your dependency
       npm link redis
       

      That is, it first creates a global link, and then links the global installation target into your project's node_modules folder.

      -

      SEE ALSO

      +

      If your linked package is scoped (see npm-scope(7)) your link command must +include that scope, e.g.

      +
      npm link @myorg/privatepackage
      +

      SEE ALSO

      • npm-developers(7)
      • npm-faq(7)
      • @@ -66,5 +71,5 @@ installation target into your project's node_modules folder.

               - + diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html index 0e1fe6f358..a52b117c33 100644 --- a/deps/npm/html/doc/cli/npm-ls.html +++ b/deps/npm/html/doc/cli/npm-ls.html @@ -11,10 +11,10 @@

        npm-ls

        List installed packages

        SYNOPSIS

        -
        npm list [<pkg> ...]
        -npm ls [<pkg> ...]
        -npm la [<pkg> ...]
        -npm ll [<pkg> ...]
        +
        npm list [[@<scope>/]<pkg> ...]
        +npm ls [[@<scope>/]<pkg> ...]
        +npm la [[@<scope>/]<pkg> ...]
        +npm ll [[@<scope>/]<pkg> ...]
         

        DESCRIPTION

        This command will print to stdout all the versions of packages that are installed, as well as their dependencies, in a tree-structure.

        @@ -22,7 +22,7 @@ installed, as well as their dependencies, in a tree-structure.

        limit the results to only the paths to the packages named. Note that nested packages will also show the paths to the specified packages. For example, running npm ls promzard in npm's source tree will show:

        -
        npm@1.4.28 /path/to/npm
        +
        npm@2.0.0 /path/to/npm
         └─┬ init-package-json@0.0.4
           └── promzard@0.1.5
         

        It will print out extraneous, missing, and invalid packages.

        @@ -85,5 +85,5 @@ project.

               - + diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html index f4b3e1307e..6d12d1a337 100644 --- a/deps/npm/html/doc/cli/npm-outdated.html +++ b/deps/npm/html/doc/cli/npm-outdated.html @@ -67,5 +67,5 @@ project.

               - + diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html index 4dd7b386d6..b2f8f84e57 100644 --- a/deps/npm/html/doc/cli/npm-owner.html +++ b/deps/npm/html/doc/cli/npm-owner.html @@ -49,5 +49,5 @@ that is not implemented at this time.

               - + diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html index b5a68f27b7..5518eb188d 100644 --- a/deps/npm/html/doc/cli/npm-pack.html +++ b/deps/npm/html/doc/cli/npm-pack.html @@ -41,5 +41,5 @@ overwritten the second time.

               - + diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html index 56ef84cbc9..95780b9b10 100644 --- a/deps/npm/html/doc/cli/npm-prefix.html +++ b/deps/npm/html/doc/cli/npm-prefix.html @@ -11,9 +11,12 @@

        npm-prefix

        Display prefix

        SYNOPSIS

        -
        npm prefix
        +
        npm prefix [-g]
         

        DESCRIPTION

        -

        Print the prefix to standard out.

        +

        Print the local prefix to standard out. This is the closest parent directory +to contain a package.json file unless -g is also specified.

        +

        If -g is specified, this will be the value of the global prefix. See +npm-config(7) for more detail.

        SEE ALSO

        • npm-root(1)
        • @@ -35,5 +38,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html index 9db5665b33..49bb31e37a 100644 --- a/deps/npm/html/doc/cli/npm-prune.html +++ b/deps/npm/html/doc/cli/npm-prune.html @@ -39,5 +39,5 @@ packages specified in your devDependencies.

                 - + diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html index 573f72314f..3969f35040 100644 --- a/deps/npm/html/doc/cli/npm-publish.html +++ b/deps/npm/html/doc/cli/npm-publish.html @@ -15,6 +15,9 @@ npm publish <folder> [--tag <tag>]

        DESCRIPTION

        Publishes a package to the registry so that it can be installed by name.

        +

        By default npm will publish to the public registry. This can be overridden by +specifying a different default registry or using a npm-scope(7) in the name +(see package.json(5)).

        • <folder>: A folder containing a package.json file

          @@ -30,7 +33,7 @@ and npm install installs the latest tag.

        Fails if the package name and version combination already exists in -the registry.

        +the specified registry.

        Once a package is published with a given name and version, that specific name and version combination can never be used again, even if it is removed with npm-unpublish(1).

        @@ -54,5 +57,5 @@ it is removed with npm-unpublish(1).

               - + diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html index 3334c695f8..01d0f33eaf 100644 --- a/deps/npm/html/doc/cli/npm-rebuild.html +++ b/deps/npm/html/doc/cli/npm-rebuild.html @@ -38,5 +38,5 @@ the new binary.

               - + diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html index 3ad91979de..350f2fd9c0 100644 --- a/deps/npm/html/doc/cli/npm-repo.html +++ b/deps/npm/html/doc/cli/npm-repo.html @@ -42,5 +42,5 @@ a package.json in the current folder and use the name        - + diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html index 115765cb07..c4a0acefd3 100644 --- a/deps/npm/html/doc/cli/npm-restart.html +++ b/deps/npm/html/doc/cli/npm-restart.html @@ -11,7 +11,7 @@

        npm-restart

        Start a package

        SYNOPSIS

        -
        npm restart <name>
        +
        npm restart [-- <args>]
         

        DESCRIPTION

        This runs a package's "restart" script, if one was provided. Otherwise it runs package's "stop" script, if one was provided, and then @@ -37,5 +37,5 @@ the "start" script.

               - + diff --git a/deps/npm/html/doc/cli/npm-rm.html b/deps/npm/html/doc/cli/npm-rm.html index 8622174552..188cb517c8 100644 --- a/deps/npm/html/doc/cli/npm-rm.html +++ b/deps/npm/html/doc/cli/npm-rm.html @@ -39,5 +39,5 @@ on its behalf.

               - + diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html index b7be0eab40..4eeb0ae2a5 100644 --- a/deps/npm/html/doc/cli/npm-root.html +++ b/deps/npm/html/doc/cli/npm-root.html @@ -35,5 +35,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html index efaed0d945..dec511ccbc 100644 --- a/deps/npm/html/doc/cli/npm-run-script.html +++ b/deps/npm/html/doc/cli/npm-run-script.html @@ -11,8 +11,8 @@

        npm-run-script

        Run arbitrary package scripts

        SYNOPSIS

        -
        npm run-script [<pkg>] [command]
        -npm run [<pkg>] [command]
        +
        npm run-script [command] [-- <args>]
        +npm run [command] [-- <args>]
         

        DESCRIPTION

        This runs an arbitrary command from a package's "scripts" object. If no package name is provided, it will search for a package.json @@ -40,5 +40,5 @@ called directly, as well.

               - + diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html index cbed488646..fac2fac7d7 100644 --- a/deps/npm/html/doc/cli/npm-search.html +++ b/deps/npm/html/doc/cli/npm-search.html @@ -49,5 +49,5 @@ fall on multiple lines.

               - + diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html index 37c8c9c05c..ec54bc8eb7 100644 --- a/deps/npm/html/doc/cli/npm-shrinkwrap.html +++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html @@ -164,5 +164,5 @@ contents rather than versions.

               - + diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html index 5e98d0f272..9b7035784b 100644 --- a/deps/npm/html/doc/cli/npm-star.html +++ b/deps/npm/html/doc/cli/npm-star.html @@ -36,5 +36,5 @@ a vaguely positive way to show that you care.

               - + diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html index c13ede22b8..9c3b24da52 100644 --- a/deps/npm/html/doc/cli/npm-stars.html +++ b/deps/npm/html/doc/cli/npm-stars.html @@ -37,5 +37,5 @@ you will most certainly enjoy this command.

               - + diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html index 305050e41a..8e98cc3b04 100644 --- a/deps/npm/html/doc/cli/npm-start.html +++ b/deps/npm/html/doc/cli/npm-start.html @@ -11,7 +11,7 @@

        npm-start

        Start a package

        SYNOPSIS

        -
        npm start <name>
        +
        npm start [-- <args>]
         

        DESCRIPTION

        This runs a package's "start" script, if one was provided.

        SEE ALSO

        @@ -34,5 +34,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html index 519fa856ce..9526880781 100644 --- a/deps/npm/html/doc/cli/npm-stop.html +++ b/deps/npm/html/doc/cli/npm-stop.html @@ -11,7 +11,7 @@

        npm-stop

        Stop a package

        SYNOPSIS

        -
        npm stop <name>
        +
        npm stop [-- <args>]
         

        DESCRIPTION

        This runs a package's "stop" script, if one was provided.

        SEE ALSO

        @@ -34,5 +34,5 @@        - + diff --git a/deps/npm/html/doc/cli/npm-submodule.html b/deps/npm/html/doc/cli/npm-submodule.html index 6716c4a11c..899005f061 100644 --- a/deps/npm/html/doc/cli/npm-submodule.html +++ b/deps/npm/html/doc/cli/npm-submodule.html @@ -42,5 +42,5 @@ dependencies into the submodule folder.

               - + diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html index 40a2ffe89f..7dfbd1849f 100644 --- a/deps/npm/html/doc/cli/npm-tag.html +++ b/deps/npm/html/doc/cli/npm-tag.html @@ -44,5 +44,5 @@ of using a specific version number:

               - + diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html index cc3d56d010..4d9779e826 100644 --- a/deps/npm/html/doc/cli/npm-test.html +++ b/deps/npm/html/doc/cli/npm-test.html @@ -11,8 +11,8 @@

        npm-test

        Test a package

        SYNOPSIS

        -
          npm test <name>
        -  npm tst <name>
        +
          npm test [-- <args>]
        +  npm tst [-- <args>]
         

        DESCRIPTION

        This runs a package's "test" script, if one was provided.

        To run tests as a condition of installation, set the npat config to @@ -37,5 +37,5 @@ true.

               - + diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html index 4f5a064606..c4e7858ebf 100644 --- a/deps/npm/html/doc/cli/npm-uninstall.html +++ b/deps/npm/html/doc/cli/npm-uninstall.html @@ -11,7 +11,7 @@

        npm-rm

        Remove a package

        SYNOPSIS

        -
        npm uninstall <name> [--save|--save-dev|--save-optional]
        +
        npm uninstall [@<scope>/]<package> [--save|--save-dev|--save-optional]
         npm rm (with any of the previous argument usage)
         

        DESCRIPTION

        This uninstalls a package, completely removing everything npm installed @@ -30,8 +30,10 @@ the package version in your main package.json:

      • --save-optional: Package will be removed from your optionalDependencies.

      +

      Scope is optional and follows the usual rules for npm-scope(7).

      Examples:

      npm uninstall sax --save
      +npm uninstall @myorg/privatepackage --save
       npm uninstall node-tap --save-dev
       npm uninstall dtrace-provider --save-optional
       

      SEE ALSO

      @@ -55,5 +57,5 @@ npm uninstall dtrace-provider --save-optional        - + diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html index be9430a15c..eb175920eb 100644 --- a/deps/npm/html/doc/cli/npm-unpublish.html +++ b/deps/npm/html/doc/cli/npm-unpublish.html @@ -11,7 +11,7 @@

      npm-unpublish

      Remove a package from the registry

      SYNOPSIS

      -
      npm unpublish <name>[@<version>]
      +
      npm unpublish [@<scope>/]<name>[@<version>]
       

      WARNING

      It is generally considered bad behavior to remove versions of a library that others are depending on!

      @@ -26,6 +26,7 @@ the root package entry is removed from the registry entirely.

      Even if a package version is unpublished, that specific name and version combination can never be reused. In order to publish the package again, a new version number must be used.

      +

      The scope is optional and follows the usual rules for npm-scope(7).

      SEE ALSO

      For example, these are all valid:

      { "dependencies" :
      @@ -247,6 +251,8 @@ a tarball or git URL.

      , "elf" : "~1.2.3" , "two" : "2.x" , "thr" : "3.3.x" + , "lat" : "latest" + , "dyl" : "~/projects/dyl" } }

      URLs as Dependencies

      @@ -271,7 +277,18 @@ an argument to git checkout. The default is master.

      devDependencies

      +

      Local Paths

      +

      As of version 2.0.0 you can provide a path to a local directory that +contains a package. Local paths can be in the form:

      +
      ../foo/bar
      +~/foo/bar
      +./foo/bar
      +/foo/bar
      +

      This feature is helpful for local offline development and creating +tests that require npm installing where you don't want to hit an +external server, but should not be used when publishing packages +to the public registry.

      +

      devDependencies

      If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the external test or documentation framework that you use.

      @@ -459,5 +476,5 @@ ignored.

             - + diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html index ee029cfe8f..f1f4817eb3 100644 --- a/deps/npm/html/doc/files/npmrc.html +++ b/deps/npm/html/doc/files/npmrc.html @@ -73,5 +73,5 @@ manner.

             - + diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html index 129661d526..b00032dba9 100644 --- a/deps/npm/html/doc/files/package.json.html +++ b/deps/npm/html/doc/files/package.json.html @@ -34,6 +34,8 @@ be something short, but also reasonably descriptive.
    • You may want to check the npm registry to see if there's something by that name already, before you get too attached to it. http://registry.npmjs.org/
    +

    A name can be optionally prefixed by a scope, e.g. @myorg/mypackage. See +npm-scope(7) for more detail.

    version

    The most important things in your package.json are the name and version fields. Those are actually required, and your package won't install without @@ -234,6 +236,8 @@ a tarball or git URL.

  • range1 || range2 Passes if either range1 or range2 are satisfied.
  • git... See 'Git URLs as Dependencies' below
  • user/repo See 'GitHub URLs' below
  • +
  • tag A specific version tagged and published as tag See npm-tag(1)
  • +
  • path/path/path See Local Paths below
  • For example, these are all valid:

    { "dependencies" :
    @@ -247,6 +251,8 @@ a tarball or git URL.

    , "elf" : "~1.2.3" , "two" : "2.x" , "thr" : "3.3.x" + , "lat" : "latest" + , "dyl" : "~/projects/dyl" } }

    URLs as Dependencies

    @@ -271,7 +277,18 @@ an argument to git checkout. The default is master.

    devDependencies

    +

    Local Paths

    +

    As of version 2.0.0 you can provide a path to a local directory that +contains a package. Local paths can be in the form:

    +
    ../foo/bar
    +~/foo/bar
    +./foo/bar
    +/foo/bar
    +

    This feature is helpful for local offline development and creating +tests that require npm installing where you don't want to hit an +external server, but should not be used when publishing packages +to the public registry.

    +

    devDependencies

    If someone is planning on downloading and using your module in their program, then they probably don't want or need to download and build the external test or documentation framework that you use.

    @@ -459,5 +476,5 @@ ignored.

           - + diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html index 90c300c88f..bae8566262 100644 --- a/deps/npm/html/doc/index.html +++ b/deps/npm/html/doc/index.html @@ -214,6 +214,8 @@

    Index of all npm documentation

    npm-registry(7)

    The JavaScript Package Registry

    +

    npm-scope(7)

    +

    Scoped packages

    npm-scripts(7)

    How npm handles the "scripts" field

    removing-npm(7)

    @@ -232,5 +234,5 @@        - + diff --git a/deps/npm/html/doc/misc/index.html b/deps/npm/html/doc/misc/index.html deleted file mode 100644 index 4db393c7c4..0000000000 --- a/deps/npm/html/doc/misc/index.html +++ /dev/null @@ -1,438 +0,0 @@ - - - index - - - - -
    -

    npm-index

    Index of all npm documentation

    - -

    README

    - -

    node package manager

    - -

    Command Line Documentation

    - -

    npm(1)

    - -

    node package manager

    - -

    npm-adduser(1)

    - -

    Add a registry user account

    - -

    npm-bin(1)

    - -

    Display npm bin folder

    - -

    npm-bugs(1)

    - -

    Bugs for a package in a web browser maybe

    - -

    npm-build(1)

    - -

    Build a package

    - -

    npm-bundle(1)

    - -

    REMOVED

    - -

    npm-cache(1)

    - -

    Manipulates packages cache

    - -

    npm-completion(1)

    - -

    Tab Completion for npm

    - -

    npm-config(1)

    - -

    Manage the npm configuration files

    - -

    npm-dedupe(1)

    - -

    Reduce duplication

    - -

    npm-deprecate(1)

    - -

    Deprecate a version of a package

    - -

    npm-docs(1)

    - -

    Docs for a package in a web browser maybe

    - -

    npm-edit(1)

    - -

    Edit an installed package

    - -

    npm-explore(1)

    - -

    Browse an installed package

    - -

    npm-help-search(1)

    - -

    Search npm help documentation

    - -

    npm-help(1)

    - -

    Get help on npm

    - -

    npm-init(1)

    - -

    Interactively create a package.json file

    - -

    npm-install(1)

    - -

    Install a package

    - - - -

    Symlink a package folder

    - -

    npm-ls(1)

    - -

    List installed packages

    - -

    npm-outdated(1)

    - -

    Check for outdated packages

    - -

    npm-owner(1)

    - -

    Manage package owners

    - -

    npm-pack(1)

    - -

    Create a tarball from a package

    - -

    npm-prefix(1)

    - -

    Display prefix

    - -

    npm-prune(1)

    - -

    Remove extraneous packages

    - -

    npm-publish(1)

    - -

    Publish a package

    - -

    npm-rebuild(1)

    - -

    Rebuild a package

    - -

    npm-restart(1)

    - -

    Start a package

    - -

    npm-rm(1)

    - -

    Remove a package

    - -

    npm-root(1)

    - -

    Display npm root

    - -

    npm-run-script(1)

    - -

    Run arbitrary package scripts

    - -

    npm-search(1)

    - -

    Search for packages

    - -

    npm-shrinkwrap(1)

    - -

    Lock down dependency versions

    - -

    npm-star(1)

    - -

    Mark your favorite packages

    - -

    npm-stars(1)

    - -

    View packages marked as favorites

    - -

    npm-start(1)

    - -

    Start a package

    - -

    npm-stop(1)

    - -

    Stop a package

    - -

    npm-submodule(1)

    - -

    Add a package as a git submodule

    - -

    npm-tag(1)

    - -

    Tag a published version

    - -

    npm-test(1)

    - -

    Test a package

    - -

    npm-uninstall(1)

    - -

    Remove a package

    - -

    npm-unpublish(1)

    - -

    Remove a package from the registry

    - -

    npm-update(1)

    - -

    Update a package

    - -

    npm-version(1)

    - -

    Bump a package version

    - -

    npm-view(1)

    - -

    View registry info

    - -

    npm-whoami(1)

    - -

    Display npm username

    - -

    API Documentation

    - -

    npm(3)

    - -

    node package manager

    - -

    npm-bin(3)

    - -

    Display npm bin folder

    - -

    npm-bugs(3)

    - -

    Bugs for a package in a web browser maybe

    - -

    npm-commands(3)

    - -

    npm commands

    - -

    npm-config(3)

    - -

    Manage the npm configuration files

    - -

    npm-deprecate(3)

    - -

    Deprecate a version of a package

    - -

    npm-docs(3)

    - -

    Docs for a package in a web browser maybe

    - -

    npm-edit(3)

    - -

    Edit an installed package

    - -

    npm-explore(3)

    - -

    Browse an installed package

    - -

    npm-help-search(3)

    - -

    Search the help pages

    - -

    npm-init(3)

    - -

    Interactively create a package.json file

    - -

    npm-install(3)

    - -

    install a package programmatically

    - - - -

    Symlink a package folder

    - -

    npm-load(3)

    - -

    Load config settings

    - -

    npm-ls(3)

    - -

    List installed packages

    - -

    npm-outdated(3)

    - -

    Check for outdated packages

    - -

    npm-owner(3)

    - -

    Manage package owners

    - -

    npm-pack(3)

    - -

    Create a tarball from a package

    - -

    npm-prefix(3)

    - -

    Display prefix

    - -

    npm-prune(3)

    - -

    Remove extraneous packages

    - -

    npm-publish(3)

    - -

    Publish a package

    - -

    npm-rebuild(3)

    - -

    Rebuild a package

    - -

    npm-restart(3)

    - -

    Start a package

    - -

    npm-root(3)

    - -

    Display npm root

    - -

    npm-run-script(3)

    - -

    Run arbitrary package scripts

    - -

    npm-search(3)

    - -

    Search for packages

    - -

    npm-shrinkwrap(3)

    - -

    programmatically generate package shrinkwrap file

    - -

    npm-start(3)

    - -

    Start a package

    - -

    npm-stop(3)

    - -

    Stop a package

    - -

    npm-submodule(3)

    - -

    Add a package as a git submodule

    - -

    npm-tag(3)

    - -

    Tag a published version

    - -

    npm-test(3)

    - -

    Test a package

    - -

    npm-uninstall(3)

    - -

    uninstall a package programmatically

    - -

    npm-unpublish(3)

    - -

    Remove a package from the registry

    - -

    npm-update(3)

    - -

    Update a package

    - -

    npm-version(3)

    - -

    Bump a package version

    - -

    npm-view(3)

    - -

    View registry info

    - -

    npm-whoami(3)

    - -

    Display npm username

    - -

    Files

    - -

    npm-folders(5)

    - -

    Folder Structures Used by npm

    - -

    npmrc(5)

    - -

    The npm config files

    - -

    package.json(5)

    - -

    Specifics of npm's package.json handling

    - -

    Misc

    - -

    npm-coding-style(7)

    - -

    npm's "funny" coding style

    - -

    npm-config(7)

    - -

    More than you probably want to know about npm configuration

    - -

    npm-developers(7)

    - -

    Developer Guide

    - -

    npm-disputes(7)

    - -

    Handling Module Name Disputes

    - -

    npm-faq(7)

    - -

    Frequently Asked Questions

    - -

    npm-registry(7)

    - -

    The JavaScript Package Registry

    - -

    npm-scripts(7)

    - -

    How npm handles the "scripts" field

    - -

    removing-npm(7)

    - -

    Cleaning the Slate

    - -

    semver(7)

    - -

    The semantic versioner for npm

    -
    - - diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html index cd523ac910..5d94f84bf0 100644 --- a/deps/npm/html/doc/misc/npm-coding-style.html +++ b/deps/npm/html/doc/misc/npm-coding-style.html @@ -147,5 +147,5 @@ set to anything."

           - + diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html index aa4c300bfa..e7696f491e 100644 --- a/deps/npm/html/doc/misc/npm-config.html +++ b/deps/npm/html/doc/misc/npm-config.html @@ -48,6 +48,7 @@ defaults if nothing else is specified.

  • -dd, --verbose: --loglevel verbose
  • -ddd: --loglevel silly
  • -g: --global
  • +
  • -C: --prefix
  • -l: --long
  • -m: --message
  • -p, --porcelain: --parseable
  • @@ -215,9 +216,6 @@ or "notepad" on Windows.
  • Type: path
  • The command to run for npm edit or npm config edit.

    -

    email

    -

    The email of the logged-in user.

    -

    Set by the npm adduser command. Should not be set explicitly.

    engine-strict

    • Default: false
    • @@ -359,6 +357,13 @@ for more information, or npm-init(1).

    • Type: String

    The value npm init should use by default for the package license.

    +

    init.version

    +
      +
    • Default: "0.0.0"
    • +
    • Type: semver
    • +
    +

    The value that npm init should use by default for the package +version number, if not already set in package.json.

    json

    • Default: false
    • @@ -400,7 +405,7 @@ to the npm registry. Must be IPv4 in versions of Node prior to 0.12.

      • Default: "http"
      • Type: String
      • -
      • Values: "silent", "win", "error", "warn", "http", "info", "verbose", "silly"
      • +
      • Values: "silent", "error", "warn", "http", "info", "verbose", "silly"

      What level of logs to report. On failure, all logs are written to npm-debug.log in the current working directory.

      @@ -568,11 +573,22 @@ devDependencies hash.

    • Default: '^'
    • Type: String
    -

    Configure how versions of packages installed to a package.json file via +

    Configure how versions of packages installed to a package.json file via --save or --save-dev get prefixed.

    For example if a package has version 1.2.3, by default it's version is -set to ^1.2.3 which allows minor upgrades for that package, but after
    npm config set save-prefix='~' it would be set to ~1.2.3 which only allows +set to ^1.2.3 which allows minor upgrades for that package, but after +npm config set save-prefix='~' it would be set to ~1.2.3 which only allows patch upgrades.

    +

    scope

    +
      +
    • Default: ""
    • +
    • Type: String
    • +
    +

    Associate an operation with a scope for a scoped registry. Useful when logging +in to a private registry for the first time: +npm login --scope=@organization --registry=registry.organization.com, which +will cause @organization to be mapped to the registry for future installation +of packages specified according to the pattern @organization/package.

    searchopts

    The UID to set to when running package scripts as root.

    -

    username

    -
      -
    • Default: null
    • -
    • Type: String
    • -
    -

    The username on the npm registry. Set with npm adduser

    userconfig

    -

    Additionally, arbitrary scripts can be run by doing -npm run-script <pkg> <stage>.

    +

    Additionally, arbitrary scripts can be executed by running `npm run-script

    +

    . *Pre* and *post* commands with matching names will be run for +those as well (e.g.premyscript,myscript,postmyscript`).

    NOTE: INSTALL SCRIPTS ARE AN ANTIPATTERN

    tl;dr Don't use install. Use a .gyp file for compilation, and prepublish for anything else.

    @@ -218,5 +219,5 @@ the user will sudo the npm command in question.        - + diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html index afd747c956..576c734347 100644 --- a/deps/npm/html/doc/misc/removing-npm.html +++ b/deps/npm/html/doc/misc/removing-npm.html @@ -57,5 +57,5 @@ modules. To track those down, you can do the following:

           - + diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html index 5ab35fa819..2a360ea08f 100644 --- a/deps/npm/html/doc/misc/semver.html +++ b/deps/npm/html/doc/misc/semver.html @@ -42,52 +42,150 @@ multiple versions to the utility will just sort them. http://semver.org/.

    A leading "=" or "v" character is stripped off and ignored.

    Ranges

    -

    The following range styles are supported:

    +

    A version range is a set of comparators which specify versions +that satisfy the range.

    +

    A comparator is composed of an operator and a version. The set +of primitive operators is:

    +
      +
    • < Less than
    • +
    • <= Less than or equal to
    • +
    • > Greater than
    • +
    • >= Greater than or equal to
    • +
    • = Equal. If no operator is specified, then equality is assumed, +so this operator is optional, but MAY be included.
    • +
    +

    For example, the comparator >=1.2.7 would match the versions +1.2.7, 1.2.8, 2.5.3, and 1.3.9, but not the versions 1.2.6 +or 1.1.0.

    +

    Comparators can be joined by whitespace to form a comparator set, +which is satisfied by the intersection of all of the comparators +it includes.

    +

    A range is composed of one or more comparator sets, joined by ||. A +version matches a range if and only if every comparator in at least +one of the ||-separated comparator sets is satisfied by the version.

    +

    For example, the range >=1.2.7 <1.3.0 would match the versions +1.2.7, 1.2.8, and 1.2.99, but not the versions 1.2.6, 1.3.0, +or 1.1.0.

    +

    The range 1.2.7 || >=1.2.9 <2.0.0 would match the versions 1.2.7, +1.2.9, and 1.4.6, but not the versions 1.2.8 or 2.0.0.

    +

    Prerelease Tags

    +

    If a version has a prerelease tag (for example, 1.2.3-alpha.3) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same [major, minor, patch] tuple also has a +prerelease tag.

    +

    For example, the range >1.2.3-alpha.3 would be allowed to match the +version 1.2.3-alpha.7, but it would not be satisfied by +3.4.5-alpha.9, even though 3.4.5-alpha.9 is technically "greater +than" 1.2.3-alpha.3 according to the SemVer sort rules. The version +range only accepts prerelease tags on the 1.2.3 version. The +version 3.4.5 would satisfy the range, because it does not have a +prerelease flag, and 3.4.5 is greater than 1.2.3-alpha.7.

    +

    The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics.

    +

    Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use that specific set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the next set of prerelease versions.

    +

    Advanced Range Syntax

    +

    Advanced range syntax desugars to primitive comparators in +deterministic ways.

    +

    Advanced ranges may be combined in the same way as primitive +comparators using white space or ||.

    +

    Hyphen Ranges X.Y.Z - A.B.C

    +

    Specifies an inclusive set.

      -
    • 1.2.3 A specific version. When nothing else will do. Must be a full -version number, with major, minor, and patch versions specified. -Note that build metadata is still ignored, so 1.2.3+build2012 will -satisfy this range.
    • -
    • >1.2.3 Greater than a specific version.
    • -
    • <1.2.3 Less than a specific version. If there is no prerelease -tag on the version range, then no prerelease version will be allowed -either, even though these are technically "less than".
    • -
    • >=1.2.3 Greater than or equal to. Note that prerelease versions -are NOT equal to their "normal" equivalents, so 1.2.3-beta will -not satisfy this range, but 2.3.0-beta will.
    • -
    • <=1.2.3 Less than or equal to. In this case, prerelease versions -ARE allowed, so 1.2.3-beta would satisfy.
    • 1.2.3 - 2.3.4 := >=1.2.3 <=2.3.4
    • -
    • ~1.2.3 := >=1.2.3-0 <1.3.0-0 "Reasonably close to 1.2.3". When -using tilde operators, prerelease versions are supported as well, -but a prerelease of the next significant digit will NOT be -satisfactory, so 1.3.0-beta will not satisfy ~1.2.3.
    • -
    • ^1.2.3 := >=1.2.3-0 <2.0.0-0 "Compatible with 1.2.3". When -using caret operators, anything from the specified version (including -prerelease) will be supported up to, but not including, the next -major version (or its prereleases). 1.5.1 will satisfy ^1.2.3, -while 1.2.2 and 2.0.0-beta will not.
    • -
    • ^0.1.3 := >=0.1.3-0 <0.2.0-0 "Compatible with 0.1.3". 0.x.x versions are -special: the first non-zero component indicates potentially breaking changes, -meaning the caret operator matches any version with the same first non-zero -component starting at the specified version.
    • -
    • ^0.0.2 := =0.0.2 "Only the version 0.0.2 is considered compatible"
    • -
    • ~1.2 := >=1.2.0-0 <1.3.0-0 "Any version starting with 1.2"
    • -
    • ^1.2 := >=1.2.0-0 <2.0.0-0 "Any version compatible with 1.2"
    • -
    • 1.2.x := >=1.2.0-0 <1.3.0-0 "Any version starting with 1.2"
    • -
    • 1.2.* Same as 1.2.x.
    • -
    • 1.2 Same as 1.2.x.
    • -
    • ~1 := >=1.0.0-0 <2.0.0-0 "Any version starting with 1"
    • -
    • ^1 := >=1.0.0-0 <2.0.0-0 "Any version compatible with 1"
    • -
    • 1.x := >=1.0.0-0 <2.0.0-0 "Any version starting with 1"
    • -
    • 1.* Same as 1.x.
    • -
    • 1 Same as 1.x.
    • -
    • * Any version whatsoever.
    • -
    • x Same as *.
    • -
    • "" (just an empty string) Same as *.
    -

    Ranges can be joined with either a space (which implies "and") or a -|| (which implies "or").

    +

    If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes.

    +
      +
    • 1.2 - 2.3.4 := >=1.2.0 <=2.3.4
    • +
    +

    If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts.

    +
      +
    • 1.2.3 - 2.3 := >=1.2.3 <2.4.0
    • +
    • 1.2.3 - 2 := >=1.2.3 <3.0.0
    • +
    +

    X-Ranges 1.2.x 1.X 1.2.* *

    +

    Any of X, x, or * may be used to "stand in" for one of the +numeric values in the [major, minor, patch] tuple.

    +
      +
    • * := >=0.0.0 (Any version satisfies)
    • +
    • 1.x := >=1.0.0 <2.0.0 (Matching major version)
    • +
    • 1.2.x := >=1.2.0 <1.3.0 (Matching major and minor versions)
    • +
    +

    A partial version range is treated as an X-Range, so the special +character is in fact optional.

    +
      +
    • ` (empty string) :=*:=>=0.0.0`
    • +
    • 1 := 1.x.x := >=1.0.0 <2.0.0
    • +
    • 1.2 := 1.2.x := >=1.2.0 <1.3.0
    • +
    +

    Tilde Ranges ~1.2.3 ~1.2 ~1

    +

    Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not.

    +
      +
    • ~1.2.3 := >=1.2.3 <1.(2+1).0 := >=1.2.3 <1.3.0
    • +
    • ~1.2 := >=1.2.0 <1.(2+1).0 := >=1.2.0 <1.3.0 (Same as 1.2.x)
    • +
    • ~1 := >=1.0.0 <(1+1).0.0 := >=1.0.0 <2.0.0 (Same as 1.x)
    • +
    • ~0.2.3 := >=0.2.3 <0.(2+1).0 := >=0.2.3 <0.3.0
    • +
    • ~0.2 := >=0.2.0 <0.(2+1).0 := >=0.2.0 <0.3.0 (Same as 0.2.x)
    • +
    • ~0 := >=0.0.0 <(0+1).0.0 := >=0.0.0 <1.0.0 (Same as 0.x)
    • +
    • ~1.2.3-beta.2 := >=1.2.3-beta.2 <1.3.0 Note that prereleases in +the 1.2.3 version will be allowed, if they are greater than or +equal to beta.2. So, 1.2.3-beta.4 would be allowed, but +1.2.4-beta.2 would not, because it is a prerelease of a +different [major, minor, patch] tuple.
    • +
    +

    Note: this is the same as the ~> operator in rubygems.

    +

    Caret Ranges ^1.2.3 ^0.2.5 ^0.0.4

    +

    Allows changes that do not modify the left-most non-zero digit in the +[major, minor, patch] tuple. In other words, this allows patch and +minor updates for versions 1.0.0 and above, patch updates for +versions 0.X >=0.1.0, and no updates for versions 0.0.X.

    +

    Many authors treat a 0.x version as if the x were the major +"breaking-change" indicator.

    +

    Caret ranges are ideal when an author may make breaking changes +between 0.2.4 and 0.3.0 releases, which is a common practice. +However, it presumes that there will not be breaking changes between +0.2.4 and 0.2.5. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices.

    +
      +
    • ^1.2.3 := >=1.2.3 <2.0.0
    • +
    • ^0.2.3 := >=0.2.3 <0.3.0
    • +
    • ^0.0.3 := >=0.0.3 <0.0.4
    • +
    • ^1.2.3-beta.2 := >=1.2.3-beta.2 <2.0.0 Note that prereleases in +the 1.2.3 version will be allowed, if they are greater than or +equal to beta.2. So, 1.2.3-beta.4 would be allowed, but +1.2.4-beta.2 would not, because it is a prerelease of a +different [major, minor, patch] tuple.
    • +
    • ^0.0.3-beta := >=0.0.3-beta <0.0.4 Note that prereleases in the +0.0.3 version only will be allowed, if they are greater than or +equal to beta. So, 0.0.3-pr.2 would be allowed.
    • +
    +

    When parsing caret ranges, a missing patch value desugars to the +number 0, but will allow flexibility within that value, even if the +major and minor versions are both 0.

    +
      +
    • ^1.2.x := >=1.2.0 <2.0.0
    • +
    • ^0.0.x := >=0.0.0 <0.1.0
    • +
    • ^0.0 := >=0.0.0 <0.1.0
    • +
    +

    A missing minor and patch values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero.

    +
      +
    • ^1.x := >=1.0.0 <2.0.0
    • +
    • ^0.x := >=0.0.0 <1.0.0
    • +

    Functions

    All methods and classes take a final loose boolean argument that, if true, will be more forgiving about not-quite-valid semver strings. @@ -165,5 +263,5 @@ range, use the satisfies(version, range) function.

           - + diff --git a/deps/npm/lib/adduser.js b/deps/npm/lib/adduser.js index 579ecb0a9f..7e933ea7df 100644 --- a/deps/npm/lib/adduser.js +++ b/deps/npm/lib/adduser.js @@ -19,9 +19,10 @@ function adduser (args, cb) { if (!crypto) return cb(new Error( "You must compile node with ssl support to use the adduser feature")) - var c = { u : npm.config.get("username") || "" - , p : npm.config.get("_password") || "" - , e : npm.config.get("email") || "" + var creds = npm.config.getCredentialsByURI(npm.config.get("registry")) + var c = { u : creds.username || "" + , p : creds.password || "" + , e : creds.email || "" } , u = {} , fns = [readUsername, readPassword, readEmail, save] @@ -94,7 +95,7 @@ function readPassword (c, u, cb) { return readPassword(c, u, cb) } - c.changed = c.changed || c.p != pw + c.changed = c.changed || c.p !== pw u.p = pw cb(er) }) @@ -132,17 +133,45 @@ function save (c, u, cb) { registry.password = u.p } npm.spinner.start() + // save existing configs, but yank off for this PUT - registry.adduser(npm.config.get("registry"), u.u, u.p, u.e, function (er) { + var uri = npm.config.get("registry") + var scope = npm.config.get("scope") + + // there may be a saved scope and no --registry (for login) + if (scope) { + if (scope.charAt(0) !== "@") scope = "@" + scope + + var scopedRegistry = npm.config.get(scope + ":registry") + if (scopedRegistry) uri = scopedRegistry + } + + registry.adduser(uri, u.u, u.p, u.e, function (er, doc) { npm.spinner.stop() if (er) return cb(er) + registry.username = u.u registry.password = u.p registry.email = u.e - npm.config.set("username", u.u, "user") - npm.config.set("_password", u.p, "user") - npm.config.set("email", u.e, "user") + + // don't want this polluting the configuration npm.config.del("_token", "user") + + if (scope) npm.config.set(scope + ":registry", uri, "user") + + if (doc && doc.token) { + npm.config.setCredentialsByURI(uri, { + token : doc.token + }) + } + else { + npm.config.setCredentialsByURI(uri, { + username : u.u, + password : u.p, + email : u.e + }) + } + log.info("adduser", "Authorized user %s", u.u) npm.config.save("user", cb) }) diff --git a/deps/npm/lib/bugs.js b/deps/npm/lib/bugs.js index b3022bf2a2..16744cd5c8 100644 --- a/deps/npm/lib/bugs.js +++ b/deps/npm/lib/bugs.js @@ -9,19 +9,23 @@ var npm = require("./npm.js") , opener = require("opener") , path = require("path") , readJson = require("read-package-json") + , npa = require("npm-package-arg") , fs = require("fs") - , url = require("url") + , mapToRegistry = require("./utils/map-to-registry.js") bugs.completion = function (opts, cb) { if (opts.conf.argv.remain.length > 2) return cb() - var uri = url.resolve(npm.config.get("registry"), "-/short") - registry.get(uri, { timeout : 60000 }, function (er, list) { - return cb(null, list || []) + mapToRegistry("-/short", npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri, { timeout : 60000 }, function (er, list) { + return cb(null, list || []) + }) }) } function bugs (args, cb) { - var n = args.length && args[0].split("@").shift() || '.' + var n = args.length && npa(args[0]).name || '.' fs.stat(n, function (er, s) { if (er && er.code === "ENOENT") return callRegistry(n, cb) else if (er) return cb (er) @@ -56,9 +60,13 @@ function getUrlAndOpen (d, cb) { } function callRegistry (n, cb) { - var uri = url.resolve(npm.config.get("registry"), n + "/latest") - registry.get(uri, { timeout : 3600 }, function (er, d) { + mapToRegistry(n, npm.config, function (er, uri) { if (er) return cb(er) - getUrlAndOpen (d, cb) + + registry.get(uri + "/latest", { timeout : 3600 }, function (er, d) { + if (er) return cb(er) + + getUrlAndOpen (d, cb) + }) }) } diff --git a/deps/npm/lib/build.js b/deps/npm/lib/build.js index 350774a453..f1c61bdb8c 100644 --- a/deps/npm/lib/build.js +++ b/deps/npm/lib/build.js @@ -75,7 +75,7 @@ function linkStuff (pkg, folder, global, didRB, cb) { // if it's global, and folder is in {prefix}/node_modules, // then bins are in {prefix}/bin // otherwise, then bins are in folder/../.bin - var parent = path.dirname(folder) + var parent = pkg.name[0] === "@" ? path.dirname(path.dirname(folder)) : path.dirname(folder) , gnm = global && npm.globalDir , gtop = parent === gnm @@ -95,7 +95,7 @@ function linkStuff (pkg, folder, global, didRB, cb) { function shouldWarn(pkg, folder, global, cb) { var parent = path.dirname(folder) , top = parent === npm.dir - , cwd = process.cwd() + , cwd = npm.localPrefix readJson(path.resolve(cwd, "package.json"), function(er, topPkg) { if (er) return cb(er) diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js index 37bba5a065..281d6100a9 100644 --- a/deps/npm/lib/cache.js +++ b/deps/npm/lib/cache.js @@ -47,9 +47,15 @@ adding a name@range: adding a local tarball: 1. untar to tmp/random/{blah} 2. goto folder(2) + +adding a namespaced package: +1. lookup registry for @namespace +2. namespace_registry.get('name') +3. add url(namespace/latest.tarball) */ exports = module.exports = cache + cache.unpack = unpack cache.clean = clean cache.read = read @@ -61,17 +67,18 @@ var npm = require("./npm.js") , readJson = require("read-package-json") , log = require("npmlog") , path = require("path") - , url = require("url") , asyncMap = require("slide").asyncMap , tar = require("./utils/tar.js") , fileCompletion = require("./utils/completion/file-completion.js") - , isGitUrl = require("./utils/is-git-url.js") , deprCheck = require("./utils/depr-check.js") , addNamed = require("./cache/add-named.js") , 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") + , npa = require("npm-package-arg") + , getStat = require("./cache/get-stat.js") cache.usage = "npm cache add " + "\nnpm cache add " @@ -108,9 +115,8 @@ function cache (args, cb) { switch (cmd) { case "rm": case "clear": case "clean": return clean(args, cb) case "list": case "sl": case "ls": return ls(args, cb) - case "add": return add(args, cb) - default: return cb(new Error( - "Invalid cache action: "+cmd)) + case "add": return add(args, npm.prefix, cb) + default: return cb("Usage: "+cache.usage) } } @@ -147,15 +153,30 @@ function read (name, ver, forceBypass, cb) { }) } +function normalize (args) { + var normalized = "" + if (args.length > 0) { + var a = npa(args[0]) + if (a.name) normalized = a.name + if (a.rawSpec) normalized = [normalized, a.rawSpec].join("/") + if (args.length > 1) normalized = [normalized].concat(args.slice(1)).join("/") + } + + if (normalized.substr(-1) === "/") { + normalized = normalized.substr(0, normalized.length - 1) + } + log.silly("ls", "normalized", normalized) + + return normalized +} + // npm cache ls [] function ls (args, cb) { - args = args.join("/").split("@").join("/") - if (args.substr(-1) === "/") args = args.substr(0, args.length - 1) var prefix = npm.config.get("cache") - if (0 === prefix.indexOf(process.env.HOME)) { + if (prefix.indexOf(process.env.HOME) === 0) { prefix = "~" + prefix.substr(process.env.HOME.length) } - ls_(args, npm.config.get("depth"), function (er, files) { + ls_(normalize(args), npm.config.get("depth"), function (er, files) { console.log(files.map(function (f) { return path.join(prefix, f) }).join("\n").trim()) @@ -174,9 +195,7 @@ function clean (args, cb) { if (!args) args = [] - args = args.join("/").split("@").join("/") - if (args.substr(-1) === "/") args = args.substr(0, args.length - 1) - var f = path.join(npm.cache, path.normalize(args)) + var f = path.join(npm.cache, path.normalize(normalize(args))) if (f === npm.cache) { fs.readdir(npm.cache, function (er, files) { if (er) return cb() @@ -187,30 +206,30 @@ function clean (args, cb) { }) , rm, cb ) }) - } else rm(path.join(npm.cache, path.normalize(args)), cb) + } else rm(path.join(npm.cache, path.normalize(normalize(args))), cb) } // npm cache add // npm cache add // npm cache add // npm cache add -cache.add = function (pkg, ver, scrub, cb) { +cache.add = function (pkg, ver, where, scrub, cb) { assert(typeof pkg === "string", "must include name of package to install") assert(typeof cb === "function", "must include callback") if (scrub) { return clean([], function (er) { if (er) return cb(er) - add([pkg, ver], cb) + add([pkg, ver], where, cb) }) } log.verbose("cache add", [pkg, ver]) - return add([pkg, ver], cb) + return add([pkg, ver], where, cb) } var adding = 0 -function add (args, cb) { +function add (args, where, cb) { // this is hot code. almost everything passes through here. // the args can be any of: // ["url"] @@ -226,60 +245,69 @@ function add (args, cb) { + " npm cache add @\n" + " npm cache add \n" + " npm cache add \n" - , name , spec + , p if (args[1] === undefined) args[1] = null // at this point the args length must ==2 if (args[1] !== null) { - name = args[0] - spec = args[1] + spec = args[0]+"@"+args[1] } else if (args.length === 2) { spec = args[0] } - log.verbose("cache add", "name=%j spec=%j args=%j", name, spec, args) + log.verbose("cache add", "spec=%j args=%j", spec, args) - if (!name && !spec) return cb(usage) + if (!spec) return cb(usage) if (adding <= 0) { npm.spinner.start() } adding ++ - cb = afterAdd([name, spec], cb) - - // see if the spec is a url - // otherwise, treat as name@version - var p = url.parse(spec) || {} - log.verbose("parsed url", p) - - // If there's a /, and it's a path, then install the path. - // If not, and there's a @, it could be that we got name@http://blah - // in that case, we will not have a protocol now, but if we - // split and check, we will. - if (!name && !p.protocol) { - return maybeFile(spec, cb) - } - else { - switch (p.protocol) { - case "http:": - case "https:": - return addRemoteTarball(spec, { name: name }, null, cb) + cb = afterAdd(cb) + + // package.json can have local URI ("file:") dependencies which require + // normalization + p = npa(spec) + if (p.type === "local" && where) spec = path.resolve(where, p.spec) + log.verbose("parsed spec", p) + + // short-circuit local installs + fs.stat(spec, function (er, s) { + if (er) return addNonLocal(spec, cb) + if (!s.isDirectory()) return addAndLogLocal(spec, cb) + fs.stat(path.join(spec, "package.json"), function (er) { + if (er) return addNonLocal(spec, cb) + addAndLogLocal(spec, cb) + }) + }) +} + +function addAndLogLocal (spec, cb) { + log.verbose("cache add", "local package", path.resolve(spec)) + return addLocal(spec, null, cb) +} +function addNonLocal (spec, cb) { + var p = npa(spec) + log.verbose("parsed spec", p) + + switch (p.type) { + case "remote": + addRemoteTarball(p.spec, {name : p.name}, null, cb) + break + case "git": + addRemoteGit(p.spec, false, cb) + break + case "github": + maybeGithub(p.spec, cb) + break default: - if (isGitUrl(p)) return addRemoteGit(spec, p, false, cb) + if (p.name) return addNamed(p.name, p.spec, null, cb) - // if we have a name and a spec, then try name@spec - if (name) { - addNamed(name, spec, null, cb) - } - // if not, then try just spec (which may try name@"" if not found) - else { - addLocal(spec, {}, cb) - } + cb(new Error("couldn't figure out how to install " + spec)) } - } } function unpack (pkg, ver, unpackTarget, dMode, fMode, uid, gid, cb) { @@ -304,7 +332,7 @@ function unpack (pkg, ver, unpackTarget, dMode, fMode, uid, gid, cb) { }) } -function afterAdd (arg, cb) { return function (er, data) { +function afterAdd (cb) { return function (er, data) { adding -- if (adding <= 0) { npm.spinner.stop() @@ -322,49 +350,32 @@ function afterAdd (arg, cb) { return function (er, data) { var done = inflight(pj, cb) - if (!done) return + if (!done) return undefined fs.writeFile(tmp, JSON.stringify(data), "utf8", function (er) { if (er) return done(er) - fs.rename(tmp, pj, function (er) { - done(er, data) + getStat(function (er, cs) { + if (er) return done(er) + fs.rename(tmp, pj, function (er) { + if (cs.uid && cs.gid) { + fs.chown(pj, cs.uid, cs.gid, function (er) { + return done(er, data) + }) + } else { + done(er, data) + } + }) }) }) }} -function maybeFile (spec, cb) { - // split name@2.3.4 only if name is a valid package name, - // don't split in case of "./test@example.com/" (local path) - fs.stat(spec, function (er) { - if (!er) { - // definitely a local thing - return addLocal(spec, {}, cb) - } - - maybeAt(spec, cb) - }) -} - -function maybeAt (spec, cb) { - if (spec.indexOf("@") !== -1) { - var tmp = spec.split("@") - - var name = tmp.shift() - spec = tmp.join("@") - add([name, spec], cb) - } else { - // already know it's not a url, so must be local - addLocal(spec, {}, cb) - } -} - -function needName(er, data) { +function needName (er, data) { return er ? er : (data && !data.name) ? new Error("No name provided") : null } -function needVersion(er, data) { +function needVersion (er, data) { return er ? er : (data && !data.version) ? new Error("No version provided") : null diff --git a/deps/npm/lib/cache/add-local-tarball.js b/deps/npm/lib/cache/add-local-tarball.js index bcb938fa97..f7cd761037 100644 --- a/deps/npm/lib/cache/add-local-tarball.js +++ b/deps/npm/lib/cache/add-local-tarball.js @@ -191,7 +191,15 @@ function addTmpTarball_ (tgz, data, shasum, cb) { var target = path.resolve(root, "package.tgz") getCacheStat(function (er, cs) { if (er) return cb(er) - mkdir(pkg, function (er) { + mkdir(pkg, function (er, created) { + + // chown starting from the first dir created by mkdirp, + // or the root dir, if none had to be created, so that + // we know that we get all the children. + function chown (er) { + chownr(created || root, cs.uid, cs.gid, done) + } + if (er) return cb(er) var read = fs.createReadStream(tgz) var write = fs.createWriteStream(target) @@ -199,9 +207,6 @@ function addTmpTarball_ (tgz, data, shasum, cb) { read.on("error", cb).pipe(write).on("error", cb).on("close", fin) }) - function chown () { - chownr(root, cs.uid, cs.gid, done) - } }) function done() { diff --git a/deps/npm/lib/cache/add-local.js b/deps/npm/lib/cache/add-local.js index 2a6d8cf884..bedf34bac1 100644 --- a/deps/npm/lib/cache/add-local.js +++ b/deps/npm/lib/cache/add-local.js @@ -13,9 +13,7 @@ var fs = require("graceful-fs") , lock = locker.lock , unlock = locker.unlock , getCacheStat = require("./get-stat.js") - , addNamed = require("./add-named.js") , addLocalTarball = require("./add-local-tarball.js") - , maybeGithub = require("./maybe-github.js") , sha = require("sha") module.exports = addLocal @@ -29,16 +27,12 @@ function addLocal (p, pkgData, cb_) { function cb (er, data) { unlock(p, function () { if (er) { - // if it doesn't have a / in it, it might be a - // remote thing. - if (p.indexOf("/") === -1 && p.charAt(0) !== "." - && (process.platform !== "win32" || p.indexOf("\\") === -1)) { - return addNamed(p, "", null, cb_) - } log.error("addLocal", "Could not install %s", p) return cb_(er) } - if (data && !data._fromGithub) data._from = p + if (data && !data._fromGithub) { + data._from = path.relative(npm.prefix, p) || "." + } return cb_(er, data) }) } @@ -47,14 +41,8 @@ function addLocal (p, pkgData, cb_) { if (er) return cb(er) // figure out if this is a folder or file. fs.stat(p, function (er, s) { - if (er) { - // might be username/project - // in that case, try it as a github url. - if (p.split("/").length === 2) { - return maybeGithub(p, er, cb) - } - return cb(er) - } + if (er) return cb(er) + if (s.isDirectory()) addLocalDirectory(p, pkgData, null, cb) else addLocalTarball(p, pkgData, null, cb) }) diff --git a/deps/npm/lib/cache/add-named.js b/deps/npm/lib/cache/add-named.js index 7137cc9b56..091d43c016 100644 --- a/deps/npm/lib/cache/add-named.js +++ b/deps/npm/lib/cache/add-named.js @@ -13,8 +13,8 @@ var path = require("path") , locker = require("../utils/locker.js") , lock = locker.lock , unlock = locker.unlock - , maybeGithub = require("./maybe-github.js") , addRemoteTarball = require("./add-remote-tarball.js") + , mapToRegistry = require("../utils/map-to-registry.js") module.exports = addNamed @@ -48,7 +48,7 @@ function addNamed (name, version, data, cb_) { }) } -function addNameTag (name, tag, data, cb_) { +function addNameTag (name, tag, data, cb) { log.info("addNameTag", [name, tag]) var explicit = true if (!tag) { @@ -56,17 +56,13 @@ function addNameTag (name, tag, data, cb_) { tag = npm.config.get("tag") } - function cb(er, data) { - // might be username/project - // in that case, try it as a github url. - if (er && tag.split("/").length === 2) { - return maybeGithub(tag, er, cb_) - } - return cb_(er, data) - } + mapToRegistry(name, npm.config, function (er, uri) { + if (er) return cb(er) - var uri = url.resolve(npm.config.get("registry"), name) - registry.get(uri, null, function (er, data, json, resp) { + registry.get(uri, null, next) + }) + + function next (er, data, json, resp) { if (!er) { er = errorResponse(name, resp) } @@ -83,7 +79,7 @@ function addNameTag (name, tag, data, cb_) { er = installTargetsError(tag, data) return cb(er) - }) + } } function engineFilter (data) { @@ -114,22 +110,28 @@ function addNameVersion (name, v, data, cb) { response = null return next() } - var uri = url.resolve(npm.config.get("registry"), name) - registry.get(uri, null, function (er, d, json, resp) { + + mapToRegistry(name, npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri, null, setData) + }) + + function setData (er, d, json, resp) { if (!er) { er = errorResponse(name, resp) } if (er) return cb(er) data = d && d.versions[ver] if (!data) { - er = new Error('version not found: ' + name + '@' + ver) + er = new Error("version not found: "+name+"@"+ver) er.package = name er.statusCode = 404 return cb(er) } response = resp next() - }) + } function next () { deprCheck(data) @@ -166,10 +168,9 @@ function addNameVersion (name, v, data, cb) { return cb(new Error("Cannot fetch: "+dist.tarball)) } - // use the same protocol as the registry. - // https registry --> https tarballs, but - // only if they're the same hostname, or else - // detached tarballs may not work. + // Use the same protocol as the registry. https registry --> https + // tarballs, but only if they're the same hostname, or else detached + // tarballs may not work. var tb = url.parse(dist.tarball) var rp = url.parse(npm.config.get("registry")) if (tb.hostname === rp.hostname @@ -179,8 +180,8 @@ function addNameVersion (name, v, data, cb) { } tb = url.format(tb) - // only add non-shasum'ed packages if --forced. - // only ancient things would lack this for good reasons nowadays. + // Only add non-shasum'ed packages if --forced. Only ancient things + // would lack this for good reasons nowadays. if (!dist.shasum && !npm.config.get("force")) { return cb(new Error("package lacks shasum: " + data._id)) } @@ -197,15 +198,21 @@ function addNameRange (name, range, data, cb) { log.silly("addNameRange", {name:name, range:range, hasData:!!data}) if (data) return next() - var uri = url.resolve(npm.config.get("registry"), name) - registry.get(uri, null, function (er, d, json, resp) { + + mapToRegistry(name, npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri, null, setData) + }) + + function setData (er, d, json, resp) { if (!er) { er = errorResponse(name, resp) } if (er) return cb(er) data = d next() - }) + } function next () { log.silly( "addNameRange", "number 2" diff --git a/deps/npm/lib/cache/add-remote-git.js b/deps/npm/lib/cache/add-remote-git.js index 7743aa4a45..304d2f3f0e 100644 --- a/deps/npm/lib/cache/add-remote-git.js +++ b/deps/npm/lib/cache/add-remote-git.js @@ -8,9 +8,7 @@ var mkdir = require("mkdirp") , url = require("url") , chownr = require("chownr") , zlib = require("zlib") - , which = require("which") , crypto = require("crypto") - , chmodr = require("chmodr") , npm = require("../npm.js") , rm = require("../utils/gently-rm.js") , inflight = require("inflight") @@ -28,9 +26,8 @@ var mkdir = require("mkdirp") // 5. git archive /tmp/random.tgz // 6. addLocalTarball(/tmp/random.tgz) --format=tar --prefix=package/ // silent flag is used if this should error quietly -module.exports = function addRemoteGit (u, parsed, silent, cb_) { +module.exports = function addRemoteGit (u, silent, cb_) { assert(typeof u === "string", "must have git URL") - assert(typeof parsed === "object", "must have parsed query") assert(typeof cb_ === "function", "must have callback") function cb (er, data) { @@ -41,6 +38,10 @@ module.exports = function addRemoteGit (u, parsed, silent, cb_) { if (!cb_) return + log.verbose("addRemoteGit", "u=%j silent=%j", u, silent) + var parsed = url.parse(u, true) + log.silly("addRemoteGit", "parsed", parsed) + // git is so tricky! // if the path is like ssh://foo:22/some/path then it works, but // it needs the ssh:// @@ -62,16 +63,16 @@ module.exports = function addRemoteGit (u, parsed, silent, cb_) { var co = parsed.hash && parsed.hash.substr(1) || "master" var v = crypto.createHash("sha1").update(u).digest("hex").slice(0, 8) - v = u.replace(/[^a-zA-Z0-9]+/g, '-') + '-' + v + v = u.replace(/[^a-zA-Z0-9]+/g, "-")+"-"+v log.verbose("addRemoteGit", [u, co]) var p = path.join(npm.config.get("cache"), "_git-remotes", v) checkGitDir(p, u, co, origUrl, silent, function(er, data) { - chmodr(p, npm.modes.file, function(erChmod) { + addModeRecursive(p, npm.modes.file, function(erAddMode) { if (er) return cb(er, data) - return cb(erChmod, data) + return cb(erAddMode, data) }) }) }) @@ -181,16 +182,20 @@ function archiveGitRemote (p, u, co, origUrl, cb) { parsed.hash = stdout resolved = url.format(parsed) + if (parsed.protocol !== "git:") { + resolved = "git+" + resolved + } + // https://github.com/npm/npm/issues/3224 // node incorrectly sticks a / at the start of the path // We know that the host won't change, so split and detect this var spo = origUrl.split(parsed.host) var spr = resolved.split(parsed.host) - if (spo[1].charAt(0) === ':' && spr[1].charAt(0) === '/') + if (spo[1].charAt(0) === ":" && spr[1].charAt(0) === "/") spr[1] = spr[1].slice(1) resolved = spr.join(parsed.host) - log.verbose('resolved git url', resolved) + log.verbose("resolved git url", resolved) next() }) } @@ -226,8 +231,48 @@ function gitEnv () { if (gitEnv_) return gitEnv_ gitEnv_ = {} for (var k in process.env) { - if (!~['GIT_PROXY_COMMAND','GIT_SSH','GIT_SSL_NO_VERIFY'].indexOf(k) && k.match(/^GIT/)) continue + if (!~["GIT_PROXY_COMMAND","GIT_SSH","GIT_SSL_NO_VERIFY"].indexOf(k) && k.match(/^GIT/)) continue gitEnv_[k] = process.env[k] } return gitEnv_ } + +// similar to chmodr except it add permissions rather than overwriting them +// adapted from https://github.com/isaacs/chmodr/blob/master/chmodr.js +function addModeRecursive(p, mode, cb) { + fs.readdir(p, function (er, children) { + // Any error other than ENOTDIR means it's not readable, or doesn't exist. + // Give up. + if (er && er.code !== "ENOTDIR") return cb(er) + if (er || !children.length) return addMode(p, mode, cb) + + var len = children.length + var errState = null + children.forEach(function (child) { + addModeRecursive(path.resolve(p, child), mode, then) + }) + + function then (er) { + if (errState) return undefined + if (er) return cb(errState = er) + if (--len === 0) return addMode(p, dirMode(mode), cb) + } + }) +} + +function addMode(p, mode, cb) { + fs.stat(p, function (er, stats) { + if (er) return cb(er) + mode = stats.mode | mode + fs.chmod(p, mode, cb) + }) +} + +// taken from https://github.com/isaacs/chmodr/blob/master/chmodr.js +function dirMode(mode) { + if (mode & parseInt("0400", 8)) mode |= parseInt("0100", 8) + if (mode & parseInt( "040", 8)) mode |= parseInt( "010", 8) + if (mode & parseInt( "04", 8)) mode |= parseInt( "01", 8) + return mode +} + diff --git a/deps/npm/lib/cache/add-remote-tarball.js b/deps/npm/lib/cache/add-remote-tarball.js index db9a05d825..2c7d013039 100644 --- a/deps/npm/lib/cache/add-remote-tarball.js +++ b/deps/npm/lib/cache/add-remote-tarball.js @@ -4,8 +4,9 @@ var mkdir = require("mkdirp") , path = require("path") , sha = require("sha") , retry = require("retry") + , createWriteStream = require("graceful-fs").createWriteStream , npm = require("../npm.js") - , fetch = require("../utils/fetch.js") + , registry = npm.registry , inflight = require("inflight") , locker = require("../utils/locker.js") , lock = locker.lock @@ -80,27 +81,39 @@ function addRemoteTarball_(u, tmp, shasum, cb) { } function fetchAndShaCheck (u, tmp, shasum, cb) { - fetch(u, tmp, function (er, response) { + registry.fetch(u, null, function (er, response) { if (er) { log.error("fetch failed", u) return cb(er, response) } - if (!shasum) { - // Well, we weren't given a shasum, so at least sha what we have - // in case we want to compare it to something else later - return sha.get(tmp, function (er, shasum) { - cb(er, response, shasum) - }) - } + var tarball = createWriteStream(tmp, { mode : npm.modes.file }) + tarball.on("error", function (er) { + cb(er) + tarball.destroy() + }) - // validate that the url we just downloaded matches the expected shasum. - sha.check(tmp, shasum, function (er) { - if (er && er.message) { - // add original filename for better debuggability - er.message = er.message + '\n' + 'From: ' + u + tarball.on("finish", function () { + if (!shasum) { + // Well, we weren't given a shasum, so at least sha what we have + // in case we want to compare it to something else later + return sha.get(tmp, function (er, shasum) { + log.silly("fetchAndShaCheck", "shasum", shasum) + cb(er, response, shasum) + }) } - return cb(er, response, shasum) + + // validate that the url we just downloaded matches the expected shasum. + log.silly("fetchAndShaCheck", "shasum", shasum) + sha.check(tmp, shasum, function (er) { + if (er && er.message) { + // add original filename for better debuggability + er.message = er.message + "\n" + "From: " + u + } + return cb(er, response, shasum) + }) }) + + response.pipe(tarball) }) } diff --git a/deps/npm/lib/cache/get-stat.js b/deps/npm/lib/cache/get-stat.js index 913f5af851..372a86d61f 100644 --- a/deps/npm/lib/cache/get-stat.js +++ b/deps/npm/lib/cache/get-stat.js @@ -24,7 +24,9 @@ module.exports = function getCacheStat (cb) { } function makeCacheDir (cb) { - if (!process.getuid) return mkdir(npm.cache, cb) + if (!process.getuid) return mkdir(npm.cache, function (er) { + return cb(er, {}) + }) var uid = +process.getuid() , gid = +process.getgid() diff --git a/deps/npm/lib/cache/maybe-github.js b/deps/npm/lib/cache/maybe-github.js index fee64c5dfd..5ecdb69155 100644 --- a/deps/npm/lib/cache/maybe-github.js +++ b/deps/npm/lib/cache/maybe-github.js @@ -1,29 +1,26 @@ -var url = require("url") - , assert = require("assert") +var assert = require("assert") , log = require("npmlog") , addRemoteGit = require("./add-remote-git.js") -module.exports = function maybeGithub (p, er, cb) { +module.exports = function maybeGithub (p, cb) { assert(typeof p === "string", "must pass package name") - assert(er instanceof Error, "must include error") assert(typeof cb === "function", "must pass callback") var u = "git://github.com/" + p - , up = url.parse(u) log.info("maybeGithub", "Attempting %s from %s", p, u) - return addRemoteGit(u, up, true, function (er2, data) { - if (er2) { + return addRemoteGit(u, true, function (er, data) { + if (er) { var upriv = "git+ssh://git@github.com:" + p - , uppriv = url.parse(upriv) - log.info("maybeGithub", "Attempting %s from %s", p, upriv) - return addRemoteGit(upriv, uppriv, false, function (er3, data) { - if (er3) return cb(er) + return addRemoteGit(upriv, false, function (er, data) { + if (er) return cb(er) + success(upriv, data) }) } + success(u, data) }) diff --git a/deps/npm/lib/dedupe.js b/deps/npm/lib/dedupe.js index e6762e15bc..74397d0cb9 100644 --- a/deps/npm/lib/dedupe.js +++ b/deps/npm/lib/dedupe.js @@ -7,7 +7,6 @@ // much better "put pkg X at folder Y" abstraction. Oh well, // whatever. Perfect enemy of the good, and all that. -var url = require("url") var fs = require("fs") var asyncMap = require("slide").asyncMap var path = require("path") @@ -16,6 +15,7 @@ var semver = require("semver") var rm = require("./utils/gently-rm.js") var log = require("npmlog") var npm = require("./npm.js") +var mapToRegistry = require("./utils/map-to-registry.js") module.exports = dedupe @@ -61,7 +61,7 @@ function dedupe_ (dir, filter, unavoidable, dryrun, silent, cb) { Object.keys(obj.children).forEach(function (k) { U(obj.children[k]) }) - }) + })(data) // then collect them up and figure out who needs them ;(function C (obj) { @@ -240,13 +240,19 @@ function findVersions (npm, summary, cb) { var versions = data.versions var ranges = data.ranges - var uri = url.resolve(npm.config.get("registry"), name) - npm.registry.get(uri, null, function (er, data) { + mapToRegistry(name, npm.config, function (er, uri) { + if (er) return cb(er) + + npm.registry.get(uri, null, next) + }) + + function next (er, data) { var regVersions = er ? [] : Object.keys(data.versions) var locMatch = bestMatch(versions, ranges) - var regMatch; var tag = npm.config.get("tag") var distTag = data["dist-tags"] && data["dist-tags"][tag] + + var regMatch if (distTag && data.versions[distTag] && matches(distTag, ranges)) { regMatch = distTag } else { @@ -254,7 +260,7 @@ function findVersions (npm, summary, cb) { } cb(null, [[name, has, loc, locMatch, regMatch, locs]]) - }) + } }, cb) } diff --git a/deps/npm/lib/deprecate.js b/deps/npm/lib/deprecate.js index 175b69ceb1..17dd4eab0c 100644 --- a/deps/npm/lib/deprecate.js +++ b/deps/npm/lib/deprecate.js @@ -1,5 +1,6 @@ -var url = require("url") - , npm = require("./npm.js") +var npm = require("./npm.js") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") module.exports = deprecate @@ -8,16 +9,20 @@ deprecate.usage = "npm deprecate [@] " deprecate.completion = function (opts, cb) { // first, get a list of remote packages this user owns. // once we have a user account, then don't complete anything. - var un = npm.config.get("username") - if (!npm.config.get("username")) return cb() if (opts.conf.argv.remain.length > 2) return cb() // get the list of packages by user - var path = "/-/by-user/"+encodeURIComponent(un) - , uri = url.resolve(npm.config.get("registry"), path) - npm.registry.get(uri, { timeout : 60000 }, function (er, list) { - if (er) return cb() - console.error(list) - return cb(null, list[un]) + var path = "/-/by-user/" + mapToRegistry(path, npm.config, function (er, uri) { + if (er) return cb(er) + + var c = npm.config.getCredentialsByURI(uri) + if (!(c && c.username)) return cb() + + npm.registry.get(uri + c.username, { timeout : 60000 }, function (er, list) { + if (er) return cb() + console.error(list) + return cb(null, list[c.username]) + }) }) } @@ -25,11 +30,15 @@ function deprecate (args, cb) { var pkg = args[0] , msg = args[1] if (msg === undefined) return cb("Usage: " + deprecate.usage) + // fetch the data and make sure it exists. - pkg = pkg.split(/@/) - var name = pkg.shift() - , ver = pkg.join("@") - , uri = url.resolve(npm.config.get("registry"), name) + var p = npa(pkg) + + mapToRegistry(p.name, npm.config, next) + + function next (er, uri) { + if (er) return cb(er) - npm.registry.deprecate(uri, ver, msg, cb) + npm.registry.deprecate(uri, p.spec, msg, cb) + } } diff --git a/deps/npm/lib/docs.js b/deps/npm/lib/docs.js index 77073fbb9c..dead3f7551 100644 --- a/deps/npm/lib/docs.js +++ b/deps/npm/lib/docs.js @@ -5,18 +5,21 @@ docs.usage += "\n" docs.usage += "npm docs ." docs.completion = function (opts, cb) { - var uri = url_.resolve(npm.config.get("registry"), "/-/short") - registry.get(uri, { timeout : 60000 }, function (er, list) { - return cb(null, list || []) + mapToRegistry("/-/short", npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri, { timeout : 60000 }, function (er, list) { + return cb(null, list || []) + }) }) } -var url_ = require("url") - , npm = require("./npm.js") +var npm = require("./npm.js") , registry = npm.registry , opener = require("opener") , path = require("path") , log = require("npmlog") + , mapToRegistry = require("./utils/map-to-registry.js") function url (json) { return json.homepage ? json.homepage : "https://npmjs.org/package/" + json.name @@ -38,7 +41,7 @@ function docs (args, cb) { function getDoc (project, cb) { project = project || '.' - var package = path.resolve(process.cwd(), "package.json") + var package = path.resolve(npm.localPrefix, "package.json") if (project === '.' || project === './') { var json @@ -54,8 +57,13 @@ function getDoc (project, cb) { return opener(url(json), { command: npm.config.get("browser") }, cb) } - var uri = url_.resolve(npm.config.get("registry"), project + "/latest") - registry.get(uri, { timeout : 3600 }, function (er, json) { + mapToRegistry(project, npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri + "/latest", { timeout : 3600 }, next) + }) + + function next (er, json) { var github = "https://github.com/" + project + "#readme" if (er) { @@ -64,5 +72,5 @@ function getDoc (project, cb) { } return opener(url(json), { command: npm.config.get("browser") }, cb) - }) + } } diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 9d2c2cfa27..82d872525a 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -34,28 +34,34 @@ install.completion = function (opts, cb) { // if it starts with https?://, then just give up, because it's a url // for now, not yet implemented. var registry = npm.registry - , uri = url.resolve(npm.config.get("registry"), "-/short") - registry.get(uri, null, function (er, pkgs) { - if (er) return cb() - if (!opts.partialWord) return cb(null, pkgs) + mapToRegistry("-/short", npm.config, function (er, uri) { + if (er) return cb(er) - var name = opts.partialWord.split("@").shift() - pkgs = pkgs.filter(function (p) { - return p.indexOf(name) === 0 - }) + registry.get(uri, null, function (er, pkgs) { + if (er) return cb() + if (!opts.partialWord) return cb(null, pkgs) - if (pkgs.length !== 1 && opts.partialWord === name) { - return cb(null, pkgs) - } + var name = npa(opts.partialWord).name + pkgs = pkgs.filter(function (p) { + return p.indexOf(name) === 0 + }) - uri = url.resolve(npm.config.get("registry"), pkgs[0]) - registry.get(uri, null, function (er, d) { - if (er) return cb() - return cb(null, Object.keys(d["dist-tags"] || {}) - .concat(Object.keys(d.versions || {})) - .map(function (t) { - return pkgs[0] + "@" + t - })) + if (pkgs.length !== 1 && opts.partialWord === name) { + return cb(null, pkgs) + } + + mapToRegistry(pkgs[0], npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri, null, function (er, d) { + if (er) return cb() + return cb(null, Object.keys(d["dist-tags"] || {}) + .concat(Object.keys(d.versions || {})) + .map(function (t) { + return pkgs[0] + "@" + t + })) + }) + }) }) }) } @@ -74,9 +80,10 @@ var npm = require("./npm.js") , mkdir = require("mkdirp") , lifecycle = require("./utils/lifecycle.js") , archy = require("archy") - , isGitUrl = require("./utils/is-git-url.js") , npmInstallChecks = require("npm-install-checks") , sortedObject = require("sorted-object") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") function install (args, cb_) { var hasArguments = !!args.length @@ -112,7 +119,7 @@ function install (args, cb_) { where = args args = [].concat(cb_) // pass in [] to do default dep-install cb_ = arguments[2] - log.verbose("install", "where,what", [where, args]) + log.verbose("install", "where, what", [where, args]) } if (!npm.config.get("global")) { @@ -206,7 +213,7 @@ function findPeerInvalid_ (packageMap, fpiList) { var pkg = packageMap[packageName] if (pkg.peerInvalid) { - var peersDepending = {}; + var peersDepending = {} for (var peerName in packageMap) { var peer = packageMap[peerName] if (peer.peerDependencies && peer.peerDependencies[packageName]) { @@ -338,21 +345,33 @@ function save (where, installed, tree, pretty, hasArguments, cb) { return cb(null, installed, tree, pretty) } - var saveBundle = npm.config.get('save-bundle') - var savePrefix = npm.config.get('save-prefix') || "^"; + var saveBundle = npm.config.get("save-bundle") + var savePrefix = npm.config.get("save-prefix") || "^" // each item in the tree is a top-level thing that should be saved // to the package.json file. // The relevant tree shape is { : {what:} } var saveTarget = path.resolve(where, "package.json") - , things = Object.keys(tree).map(function (k) { - // if "what" was a url, then save that instead. - var t = tree[k] - , u = url.parse(t.from) - , w = t.what.split("@") - if (u && u.protocol) w[1] = t.from - return w - }).reduce(function (set, k) { + + asyncMap(Object.keys(tree), function (k, cb) { + // if "what" was a url, then save that instead. + var t = tree[k] + , u = url.parse(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) { + w[1] = t.from + } + cb(null, [w]) + }) + } + , function (er, arr) { + var things = arr.reduce(function (set, k) { var rangeDescriptor = semver.valid(k[1], true) && semver.gte(k[1], "0.1.0", true) && !npm.config.get("save-exact") @@ -361,47 +380,49 @@ function save (where, installed, tree, pretty, hasArguments, cb) { return set }, {}) - // don't use readJson, because we don't want to do all the other - // tricky npm-specific stuff that's in there. - fs.readFile(saveTarget, function (er, data) { - // ignore errors here, just don't save it. - try { - data = JSON.parse(data.toString("utf8")) - } catch (ex) { - er = ex - } - if (er) { - return cb(null, installed, tree, pretty) - } + // don't use readJson, because we don't want to do all the other + // tricky npm-specific stuff that's in there. + fs.readFile(saveTarget, function (er, data) { + // ignore errors here, just don't save it. + try { + data = JSON.parse(data.toString("utf8")) + } catch (ex) { + er = ex + } - var deps = npm.config.get("save-optional") ? "optionalDependencies" - : npm.config.get("save-dev") ? "devDependencies" - : "dependencies" + if (er) { + return cb(null, installed, tree, pretty) + } - if (saveBundle) { - var bundle = data.bundleDependencies || data.bundledDependencies - delete data.bundledDependencies - if (!Array.isArray(bundle)) bundle = [] - data.bundleDependencies = bundle.sort() - } + var deps = npm.config.get("save-optional") ? "optionalDependencies" + : npm.config.get("save-dev") ? "devDependencies" + : "dependencies" - log.verbose('saving', things) - data[deps] = data[deps] || {} - Object.keys(things).forEach(function (t) { - data[deps][t] = things[t] if (saveBundle) { - var i = bundle.indexOf(t) - if (i === -1) bundle.push(t) + var bundle = data.bundleDependencies || data.bundledDependencies + delete data.bundledDependencies + if (!Array.isArray(bundle)) bundle = [] data.bundleDependencies = bundle.sort() } - }) - data[deps] = sortedObject(data[deps]) + log.verbose("saving", things) + data[deps] = data[deps] || {} + Object.keys(things).forEach(function (t) { + data[deps][t] = things[t] + if (saveBundle) { + var i = bundle.indexOf(t) + if (i === -1) bundle.push(t) + data.bundleDependencies = bundle.sort() + } + }) - data = JSON.stringify(data, null, 2) + "\n" - fs.writeFile(saveTarget, data, function (er) { - cb(er, installed, tree, pretty) + data[deps] = sortedObject(data[deps]) + + data = JSON.stringify(data, null, 2) + "\n" + fs.writeFile(saveTarget, data, function (er) { + cb(er, installed, tree, pretty) + }) }) }) } @@ -412,22 +433,22 @@ function save (where, installed, tree, pretty, hasArguments, cb) { // that the submodules are not immediately require()able. // TODO: Show the complete tree, ls-style, but only if --long is provided function prettify (tree, installed) { - if (npm.config.get("json")) { - function red (set, kv) { - set[kv[0]] = kv[1] - return set - } + function red (set, kv) { + set[kv[0]] = kv[1] + return set + } + if (npm.config.get("json")) { tree = Object.keys(tree).map(function (p) { if (!tree[p]) return null - var what = tree[p].what.split("@") - , name = what.shift() - , version = what.join("@") + var what = npa(tree[p].what) + , name = what.name + , version = what.spec , o = { name: name, version: version, from: tree[p].from } o.dependencies = tree[p].children.map(function P (dep) { - var what = dep.what.split("@") - , name = what.shift() - , version = what.join("@") + var what = npa(dep.what) + , name = what.name + , version = what.spec , o = { version: version, from: dep.from } o.dependencies = dep.children.map(P).reduce(red, {}) return [name, o] @@ -615,60 +636,70 @@ function installMany (what, where, context, cb) { } function targetResolver (where, context, deps) { - var alreadyInstalledManually = context.explicit ? [] : null + var alreadyInstalledManually = [] + , resolveLeft = 0 , nm = path.resolve(where, "node_modules") , parent = context.parent , wrap = context.wrap - if (!context.explicit) fs.readdir(nm, function (er, inst) { - if (er) return alreadyInstalledManually = [] + if (!context.explicit) readdir(nm) - // don't even mess with non-package looking things - inst = inst.filter(function (p) { - return !p.match(/^[\._-]/) - }) + function readdir(name) { + resolveLeft++ + fs.readdir(name, function (er, inst) { + if (er) return resolveLeft-- - asyncMap(inst, function (pkg, cb) { - readJson(path.resolve(nm, pkg, "package.json"), log.warn, function (er, d) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - // error means it's not a package, most likely. - if (er) return cb(null, []) - - // if it's a bundled dep, then assume that anything there is valid. - // otherwise, make sure that it's a semver match with what we want. - var bd = parent.bundleDependencies - if (bd && bd.indexOf(d.name) !== -1 || - semver.satisfies(d.version, deps[d.name] || "*", true) || - deps[d.name] === d._resolved) { - return cb(null, d.name) - } + // don't even mess with non-package looking things + inst = inst.filter(function (p) { + if (!p.match(/^[@\._-]/)) return true + // scope pacakges + var scopepath = path.join(name, p) + readdir(scopepath) + }) - // see if the package had been previously linked - fs.lstat(path.resolve(nm, pkg), function(err, s) { - if (err) return cb(null, []) - if (s.isSymbolicLink()) { + asyncMap(inst, function (pkg, cb) { + readJson(path.resolve(name, pkg, "package.json"), log.warn, function (er, d) { + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + // error means it's not a package, most likely. + if (er) return cb(null, []) + + // if it's a bundled dep, then assume that anything there is valid. + // otherwise, make sure that it's a semver match with what we want. + var bd = parent.bundleDependencies + if (bd && bd.indexOf(d.name) !== -1 || + semver.satisfies(d.version, deps[d.name] || "*", true) || + deps[d.name] === d._resolved) { return cb(null, d.name) } - // something is there, but it's not satisfactory. Clobber it. - return cb(null, []) + // see if the package had been previously linked + fs.lstat(path.resolve(nm, pkg), function(err, s) { + if (err) return cb(null, []) + if (s.isSymbolicLink()) { + return cb(null, d.name) + } + + // something is there, but it's not satisfactory. Clobber it. + return cb(null, []) + }) }) + }, function (er, inst) { + // this is the list of things that are valid and should be ignored. + alreadyInstalledManually = alreadyInstalledManually.concat(inst) + resolveLeft-- }) - }, function (er, inst) { - // this is the list of things that are valid and should be ignored. - alreadyInstalledManually = inst }) - }) + } var to = 0 return function resolver (what, cb) { - if (!alreadyInstalledManually) return setTimeout(function () { + if (resolveLeft) return setTimeout(function () { resolver(what, cb) }, to++) // now we know what's been installed here manually, // or tampered with in some way that npm doesn't want to overwrite. - if (alreadyInstalledManually.indexOf(what.split("@").shift()) !== -1) { + if (alreadyInstalledManually.indexOf(npa(what).name) !== -1) { log.verbose("already installed", "skipping %s %s", what, where) return cb(null, []) } @@ -692,7 +723,7 @@ function targetResolver (where, context, deps) { } if (wrap) { - var name = what.split(/@/).shift() + var name = npa(what).name if (wrap[name]) { var wrapTarget = readWrap(wrap[name]) what = name + "@" + wrapTarget @@ -709,19 +740,16 @@ function targetResolver (where, context, deps) { // already has a matching copy. // If it's not a git repo, and the parent already has that pkg, then // we can skip installing it again. - cache.add(what, null, false, function (er, data) { + var pkgroot = path.resolve(npm.prefix, (parent && parent._from) || "") + cache.add(what, null, pkgroot, false, function (er, data) { if (er && parent && parent.optionalDependencies && - parent.optionalDependencies.hasOwnProperty(what.split("@")[0])) { + parent.optionalDependencies.hasOwnProperty(npa(what).name)) { log.warn("optional dep failed, continuing", what) log.verbose("optional dep failed, continuing", [what, er]) return cb(null, []) } - var isGit = false - , maybeGit = what.split("@").slice(1).join() - - if (maybeGit) - isGit = isGitUrl(url.parse(maybeGit)) + var isGit = npa(what).type === "git" if (!er && data && @@ -733,6 +761,7 @@ function targetResolver (where, context, deps) { return cb(null, []) } + if (data && !data._from) data._from = what if (er && parent && parent.name) er.parent = parent.name return cb(er, data || []) @@ -771,6 +800,13 @@ function localLink (target, where, context, cb) { , parent = context.parent readJson(jsonFile, log.warn, function (er, data) { + function thenLink () { + npm.commands.link([target.name], function (er, d) { + log.silly("localLink", "back from link", [er, d]) + cb(er, [resultList(target, where, parent && parent._id)]) + }) + } + if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) if (er || data._id === target._id) { if (er) { @@ -781,14 +817,6 @@ function localLink (target, where, context, cb) { thenLink() }) } else thenLink() - - function thenLink () { - npm.commands.link([target.name], function (er, d) { - log.silly("localLink", "back from link", [er, d]) - cb(er, [resultList(target, where, parent && parent._id)]) - }) - } - } else { log.verbose("localLink", "install locally (no link)", target._id) installOne_(target, where, context, cb) diff --git a/deps/npm/lib/link.js b/deps/npm/lib/link.js index 8022fc78df..8c6a930290 100644 --- a/deps/npm/lib/link.js +++ b/deps/npm/lib/link.js @@ -10,6 +10,7 @@ var npm = require("./npm.js") , path = require("path") , rm = require("./utils/gently-rm.js") , build = require("./build.js") + , npa = require("npm-package-arg") module.exports = link @@ -49,25 +50,26 @@ function link (args, cb) { function linkInstall (pkgs, cb) { asyncMap(pkgs, function (pkg, cb) { + var t = path.resolve(npm.globalDir, "..") + , pp = path.resolve(npm.globalDir, pkg) + , rp = null + , target = path.resolve(npm.dir, pkg) + function n (er, data) { if (er) return cb(er, data) // install returns [ [folder, pkgId], ... ] // but we definitely installed just one thing. var d = data.filter(function (d) { return !d[3] }) + var what = npa(d[0][0]) pp = d[0][1] - pkg = path.basename(pp) + pkg = what.name target = path.resolve(npm.dir, pkg) next() } - var t = path.resolve(npm.globalDir, "..") - , pp = path.resolve(npm.globalDir, pkg) - , rp = null - , target = path.resolve(npm.dir, pkg) - - // if it's a folder or a random not-installed thing, then - // link or install it first - if (pkg.indexOf("/") !== -1 || pkg.indexOf("\\") !== -1) { + // if it's a folder, a random not-installed thing, or not a scoped package, + // then link or install it first + if (pkg[0] !== "@" && (pkg.indexOf("/") !== -1 || pkg.indexOf("\\") !== -1)) { return fs.lstat(path.resolve(pkg), function (er, st) { if (er || !st.isDirectory()) { npm.commands.install(t, pkg, n) diff --git a/deps/npm/lib/ls.js b/deps/npm/lib/ls.js index 781b6443b9..ed329d19e1 100644 --- a/deps/npm/lib/ls.js +++ b/deps/npm/lib/ls.js @@ -14,8 +14,8 @@ var npm = require("./npm.js") , archy = require("archy") , semver = require("semver") , url = require("url") - , isGitUrl = require("./utils/is-git-url.js") , color = require("ansicolors") + , npa = require("npm-package-arg") ls.usage = "npm ls" @@ -29,9 +29,9 @@ function ls (args, silent, cb) { // npm ls 'foo@~1.3' bar 'baz@<2' if (!args) args = [] else args = args.map(function (a) { - var nv = a.split("@") - , name = nv.shift() - , ver = semver.validRange(nv.join("@")) || "" + var p = npa(a) + , name = p.name + , ver = semver.validRange(p.rawSpec) || "" return [ name, ver ] }) @@ -39,6 +39,7 @@ function ls (args, silent, cb) { var depth = npm.config.get("depth") var opt = { depth: depth, log: log.warn, dev: true } readInstalled(dir, opt, function (er, data) { + pruneNestedExtraneous(data) var bfs = bfsify(data, args) , lite = getLite(bfs) @@ -75,6 +76,18 @@ function ls (args, silent, cb) { }) } +function pruneNestedExtraneous (data, visited) { + visited = visited || [] + visited.push(data) + for (var i in data.dependencies) { + if (data.dependencies[i].extraneous) { + data.dependencies[i].dependencies = {} + } else if (visited.indexOf(data.dependencies[i]) === -1) { + pruneNestedExtraneous(data.dependencies[i], visited) + } + } +} + function alphasort (a, b) { a = a.toLowerCase() b = b.toLowerCase() @@ -265,7 +278,7 @@ function makeArchy_ (data, long, dir, depth, parent, d) { // add giturl to name@version if (data._resolved) { - if (isGitUrl(url.parse(data._resolved))) + if (npa(data._resolved).type === "git") out.label += " (" + data._resolved + ")" } diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index 3139b1d145..c811be5a96 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -46,16 +46,6 @@ try { var j = JSON.parse(fs.readFileSync( path.join(__dirname, "../package.json"))+"") npm.version = j.version - npm.nodeVersionRequired = j.engines.node - if (!semver.satisfies(pv, j.engines.node)) { - log.warn("unsupported version", ["" - ,"npm requires node version: "+j.engines.node - ,"And you have: "+pv - ,"which is not satisfactory." - ,"" - ,"Bad things will likely happen. You have been warned." - ,""].join("\n")) - } } catch (ex) { try { log.info("error reading version", ex) @@ -153,6 +143,7 @@ var commandCache = {} ] , plumbing = [ "build" , "unbuild" + , "isntall" , "xmas" , "substack" , "visnup" diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js index a71df7fe76..fdfd7624db 100644 --- a/deps/npm/lib/outdated.js +++ b/deps/npm/lib/outdated.js @@ -28,12 +28,13 @@ var path = require("path") , asyncMap = require("slide").asyncMap , npm = require("./npm.js") , url = require("url") - , isGitUrl = require("./utils/is-git-url.js") , color = require("ansicolors") , styles = require("ansistyles") , table = require("text-table") , semver = require("semver") , os = require("os") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") function outdated (args, silent, cb) { if (typeof cb !== "function") cb = silent, silent = false @@ -43,7 +44,7 @@ function outdated (args, silent, cb) { if (npm.config.get("json")) { console.log(makeJSON(list)) } else if (npm.config.get("parseable")) { - console.log(makeParseable(list)); + console.log(makeParseable(list)) } else { var outList = list.map(makePretty) var outTable = [[ "Package" @@ -99,7 +100,7 @@ function makePretty (p) { function ansiTrim (str) { var r = new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|" + - "\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g"); + "\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g") return str.replace(r, "") } @@ -114,7 +115,7 @@ function makeParseable (list) { , dir = path.resolve(p[0], "node_modules", dep) , has = p[2] , want = p[3] - , latest = p[4]; + , latest = p[4] return [ dir , dep + "@" + want @@ -264,20 +265,25 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb) { return skip() } - if (isGitUrl(url.parse(req))) + if (npa(req).type === "git") return doIt("git", "git") // search for the latest package - var uri = url.resolve(npm.config.get("registry"), dep) - npm.registry.get(uri, null, function (er, d) { + mapToRegistry(dep, npm.config, function (er, uri) { + if (er) return cb(er) + + npm.registry.get(uri, null, updateDeps) + }) + + function updateDeps (er, d) { if (er) return cb() - if (!d || !d['dist-tags'] || !d.versions) return cb() - var l = d.versions[d['dist-tags'].latest] + if (!d || !d["dist-tags"] || !d.versions) return cb() + var l = d.versions[d["dist-tags"].latest] if (!l) return cb() var r = req - if (d['dist-tags'][req]) - r = d['dist-tags'][req] + if (d["dist-tags"][req]) + r = d["dist-tags"][req] if (semver.validRange(r, true)) { // some kind of semver range. @@ -290,13 +296,13 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb) { } // We didn't find the version in the doc. See if cache can find it. - cache.add(dep, req, false, onCacheAdd) + cache.add(dep, req, null, false, onCacheAdd) function onCacheAdd(er, d) { // if this fails, then it means we can't update this thing. // it's probably a thing that isn't published. if (er) { - if (er.code && er.code === 'ETARGET') { + if (er.code && er.code === "ETARGET") { // no viable version found return skip(er) } @@ -315,6 +321,5 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb) { else skip() } - - }) + } } diff --git a/deps/npm/lib/owner.js b/deps/npm/lib/owner.js index 34dbbc2472..2fdee7adb6 100644 --- a/deps/npm/lib/owner.js +++ b/deps/npm/lib/owner.js @@ -5,6 +5,12 @@ owner.usage = "npm owner add " + "\nnpm owner rm " + "\nnpm owner ls " +var npm = require("./npm.js") + , registry = npm.registry + , log = require("npmlog") + , readJson = require("read-package-json") + , mapToRegistry = require("./utils/map-to-registry.js") + owner.completion = function (opts, cb) { var argv = opts.conf.argv.remain if (argv.length > 4) return cb() @@ -14,65 +20,78 @@ owner.completion = function (opts, cb) { else subs.push("ls", "list") return cb(null, subs) } - var un = encodeURIComponent(npm.config.get("username")) - var theUser, uri - switch (argv[2]) { - case "ls": - if (argv.length > 3) return cb() - uri = url.resolve(npm.config.get("registry"), "-/short") - return registry.get(uri, null, cb) - - case "rm": - if (argv.length > 3) { - theUser = encodeURIComponent(argv[3]) - uri = url.resolve(npm.config.get("registry"), "-/by-user/"+theUser+"|"+un) - console.error(uri) - return registry.get(uri, null, function (er, d) { + + npm.commands.whoami([], true, function (er, username) { + if (er) return cb() + + var un = encodeURIComponent(username) + var byUser, theUser + switch (argv[2]) { + case "ls": + if (argv.length > 3) return cb() + return mapToRegistry("-/short", npm.config, function (er, uri) { if (er) return cb(er) - // return the intersection - return cb(null, d[theUser].filter(function (p) { - // kludge for server adminery. - return un === "isaacs" || d[un].indexOf(p) === -1 - })) + + registry.get(uri, null, cb) }) - } - // else fallthrough - case "add": - if (argv.length > 3) { - theUser = encodeURIComponent(argv[3]) - uri = url.resolve(npm.config.get("registry"), "-/by-user/"+theUser+"|"+un) - console.error(uri) - return registry.get(uri, null, function (er, d) { - console.error(uri, er || d) - // return mine that they're not already on. + + case "rm": + if (argv.length > 3) { + theUser = encodeURIComponent(argv[3]) + byUser = "-/by-user/" + theUser + "|" + un + return mapToRegistry(byUser, npm.config, function (er, uri) { + if (er) return cb(er) + + console.error(uri) + registry.get(uri, null, function (er, d) { + if (er) return cb(er) + // return the intersection + return cb(null, d[theUser].filter(function (p) { + // kludge for server adminery. + return un === "isaacs" || d[un].indexOf(p) === -1 + })) + }) + }) + } + // else fallthrough + case "add": + if (argv.length > 3) { + theUser = encodeURIComponent(argv[3]) + byUser = "-/by-user/" + theUser + "|" + un + return mapToRegistry(byUser, npm.config, function (er, uri) { + if (er) return cb(er) + + console.error(uri) + registry.get(uri, null, function (er, d) { + console.error(uri, er || d) + // return mine that they're not already on. + if (er) return cb(er) + var mine = d[un] || [] + , theirs = d[theUser] || [] + return cb(null, mine.filter(function (p) { + return theirs.indexOf(p) === -1 + })) + }) + }) + } + // just list all users who aren't me. + return mapToRegistry("-/users", npm.config, function (er, uri) { if (er) return cb(er) - var mine = d[un] || [] - , theirs = d[theUser] || [] - return cb(null, mine.filter(function (p) { - return theirs.indexOf(p) === -1 - })) + + registry.get(uri, null, function (er, list) { + if (er) return cb() + return cb(null, Object.keys(list).filter(function (n) { + return n !== un + })) + }) }) - } - // just list all users who aren't me. - uri = url.resolve(npm.config.get("registry"), "-/users") - return registry.get(uri, null, function (er, list) { - if (er) return cb() - return cb(null, Object.keys(list).filter(function (n) { - return n !== un - })) - }) - default: - return cb() - } + default: + return cb() + } + }) } -var npm = require("./npm.js") - , registry = npm.registry - , log = require("npmlog") - , readJson = require("read-package-json") - , url = require("url") - function owner (args, cb) { var action = args.shift() switch (action) { @@ -90,18 +109,23 @@ function ls (pkg, cb) { ls(pkg, cb) }) - var uri = url.resolve(npm.config.get("registry"), pkg) - registry.get(uri, null, function (er, data) { - var msg = "" - if (er) { - log.error("owner ls", "Couldn't get owner data", pkg) - return cb(er) - } - var owners = data.maintainers - if (!owners || !owners.length) msg = "admin party!" - else msg = owners.map(function (o) { return o.name +" <"+o.email+">" }).join("\n") - console.log(msg) - cb(er, owners) + mapToRegistry(pkg, npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri, null, function (er, data) { + var msg = "" + if (er) { + log.error("owner ls", "Couldn't get owner data", pkg) + return cb(er) + } + var owners = data.maintainers + if (!owners || !owners.length) msg = "admin party!" + else msg = owners.map(function (o) { + return o.name + " <" + o.email + ">" + }).join("\n") + console.log(msg) + cb(er, owners) + }) }) } @@ -120,7 +144,7 @@ function add (user, pkg, cb) { var o = owners[i] if (o.name === u.name) { log.info( "owner add" - , "Already a package owner: "+o.name+" <"+o.email+">") + , "Already a package owner: " + o.name + " <" + o.email + ">") return false } } @@ -145,7 +169,7 @@ function rm (user, pkg, cb) { return !match }) if (!found) { - log.info("owner rm", "Not a package owner: "+user) + log.info("owner rm", "Not a package owner: " + user) return false } if (!m.length) return new Error( @@ -156,15 +180,19 @@ function rm (user, pkg, cb) { function mutate (pkg, user, mutation, cb) { if (user) { - var uri = url.resolve(npm.config.get("registry"), "-/user/org.couchdb.user:"+user) - registry.get(uri, null, mutate_) + var byUser = "-/user/org.couchdb.user:" + user + mapToRegistry(byUser, npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri, null, mutate_) + }) } else { mutate_(null, null) } function mutate_ (er, u) { if (!er && user && (!u || u.error)) er = new Error( - "Couldn't get user data for "+user+": "+JSON.stringify(u)) + "Couldn't get user data for " + user + ": " + JSON.stringify(u)) if (er) { log.error("owner mutate", "Error getting user data for %s", user) @@ -172,27 +200,34 @@ function mutate (pkg, user, mutation, cb) { } if (u) u = { "name" : u.name, "email" : u.email } - var uri = url.resolve(npm.config.get("registry"), pkg) - registry.get(uri, null, function (er, data) { - if (er) { - log.error("owner mutate", "Error getting package data for %s", pkg) - return cb(er) - } - var m = mutation(u, data.maintainers) - if (!m) return cb() // handled - if (m instanceof Error) return cb(m) // error - data = { _id : data._id - , _rev : data._rev - , maintainers : m - } - var uri = url.resolve(npm.config.get("registry"), pkg+"/-rev/"+data._rev) - registry.request("PUT", uri, { body : data }, function (er, data) { - if (!er && data.error) er = new Error( - "Failed to update package metadata: "+JSON.stringify(data)) + mapToRegistry(pkg, npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri, null, function (er, data) { if (er) { - log.error("owner mutate", "Failed to update package metadata") + log.error("owner mutate", "Error getting package data for %s", pkg) + return cb(er) } - cb(er, data) + var m = mutation(u, data.maintainers) + if (!m) return cb() // handled + if (m instanceof Error) return cb(m) // error + data = { _id : data._id + , _rev : data._rev + , maintainers : m + } + var dataPath = pkg + "/-rev/" + data._rev + mapToRegistry(dataPath, npm.config, function (er, uri) { + if (er) return cb(er) + + registry.request("PUT", uri, { body : data }, function (er, data) { + if (!er && data.error) er = new Error( + "Failed to update package metadata: " + JSON.stringify(data)) + if (er) { + log.error("owner mutate", "Failed to update package metadata") + } + cb(er, data) + }) + }) }) }) } @@ -207,5 +242,5 @@ function readLocalPkg (cb) { } function unknown (action, cb) { - cb("Usage: \n"+owner.usage) + cb("Usage: \n" + owner.usage) } diff --git a/deps/npm/lib/pack.js b/deps/npm/lib/pack.js index ea94dd1542..f955cb71a8 100644 --- a/deps/npm/lib/pack.js +++ b/deps/npm/lib/pack.js @@ -40,9 +40,14 @@ function printFiles (files, cb) { // add to cache, then cp to the cwd function pack_ (pkg, cb) { - cache.add(pkg, null, false, function (er, data) { + cache.add(pkg, null, null, false, function (er, data) { if (er) return cb(er) - var fname = path.resolve(data._id.replace(/@/g, "-") + ".tgz") + + var name = data.name + // scoped packages get special treatment + if (name[0] === "@") name = name.substr(1).replace(/\//g, "-") + + var fname = name + "-" + data.version + ".tgz" , cached = path.resolve( npm.cache , data.name , data.version diff --git a/deps/npm/lib/publish.js b/deps/npm/lib/publish.js index ccad3ea827..701dc2b92e 100644 --- a/deps/npm/lib/publish.js +++ b/deps/npm/lib/publish.js @@ -1,7 +1,8 @@ module.exports = publish -var npm = require("./npm.js") +var url = require("url") + , npm = require("./npm.js") , log = require("npmlog") , path = require("path") , readJson = require("read-package-json") @@ -9,6 +10,7 @@ var npm = require("./npm.js") , chain = require("slide").chain , Conf = require("npmconf").Conf , RegClient = require("npm-registry-client") + , mapToRegistry = require("./utils/map-to-registry.js") publish.usage = "npm publish " + "\nnpm publish " @@ -22,7 +24,10 @@ publish.completion = function (opts, cb) { } function publish (args, isRetry, cb) { - if (typeof cb !== "function") cb = isRetry, isRetry = false + if (typeof cb !== "function") { + cb = isRetry + isRetry = false + } if (args.length === 0) args = ["."] if (args.length !== 1) return cb(publish.usage) @@ -47,15 +52,15 @@ function publish (args, isRetry, cb) { // That means that we can run publish/postpublish in the dir, rather than // in the cache dir. function cacheAddPublish (dir, didPre, isRetry, cb) { - npm.commands.cache.add(dir, null, false, function (er, data) { + npm.commands.cache.add(dir, null, null, false, function (er, data) { if (er) return cb(er) log.silly("publish", data) var cachedir = path.resolve( npm.cache , data.name , data.version , "package" ) - chain - ( [ !didPre && [lifecycle, data, "prepublish", cachedir] + chain([ !didPre && + [lifecycle, data, "prepublish", cachedir] , [publish_, dir, data, isRetry, cachedir] , [lifecycle, data, "publish", didPre ? dir : cachedir] , [lifecycle, data, "postpublish", didPre ? dir : cachedir] ] @@ -66,48 +71,61 @@ function cacheAddPublish (dir, didPre, isRetry, cb) { function publish_ (arg, data, isRetry, cachedir, cb) { if (!data) return cb(new Error("no package.json file found")) - // check for publishConfig hash var registry = npm.registry - var registryURI = npm.config.get("registry") + var config = npm.config + + // check for publishConfig hash if (data.publishConfig) { - var pubConf = new Conf(npm.config) - pubConf.save = npm.config.save.bind(npm.config) + config = new Conf(npm.config) + config.save = npm.config.save.bind(npm.config) // don't modify the actual publishConfig object, in case we have // to set a login token or some other data. - pubConf.unshift(Object.keys(data.publishConfig).reduce(function (s, k) { + config.unshift(Object.keys(data.publishConfig).reduce(function (s, k) { s[k] = data.publishConfig[k] return s }, {})) - registry = new RegClient(pubConf) - registryURI = pubConf.get("registry") + registry = new RegClient(config) } data._npmVersion = npm.version - data._npmUser = { name: npm.config.get("username") - , email: npm.config.get("email") } delete data.modules - if (data.private) return cb(new Error - ("This package has been marked as private\n" - +"Remove the 'private' field from the package.json to publish it.")) - - var tarball = cachedir + ".tgz" - registry.publish(registryURI, data, tarball, function (er) { - if (er && er.code === "EPUBLISHCONFLICT" - && npm.config.get("force") && !isRetry) { - log.warn("publish", "Forced publish over "+data._id) - return npm.commands.unpublish([data._id], function (er) { - // ignore errors. Use the force. Reach out with your feelings. - // but if it fails again, then report the first error. - publish([arg], er || true, cb) - }) - } - // report the unpublish error if this was a retry and unpublish failed - if (er && isRetry && isRetry !== true) return cb(isRetry) + if (data.private) return cb( + new Error( + "This package has been marked as private\n" + + "Remove the 'private' field from the package.json to publish it." + ) + ) + + mapToRegistry(data.name, config, function (er, registryURI) { if (er) return cb(er) - console.log("+ " + data._id) - cb() + + var tarball = cachedir + ".tgz" + + // we just want the base registry URL in this case + var registryBase = url.resolve(registryURI, ".") + log.verbose("publish", "registryBase", registryBase) + + var c = config.getCredentialsByURI(registryBase) + data._npmUser = {name: c.username, email: c.email} + + registry.publish(registryBase, data, tarball, function (er) { + if (er && er.code === "EPUBLISHCONFLICT" + && npm.config.get("force") && !isRetry) { + log.warn("publish", "Forced publish over " + data._id) + return npm.commands.unpublish([data._id], function (er) { + // ignore errors. Use the force. Reach out with your feelings. + // but if it fails again, then report the first error. + publish([arg], er || true, cb) + }) + } + // report the unpublish error if this was a retry and unpublish failed + if (er && isRetry && isRetry !== true) return cb(isRetry) + if (er) return cb(er) + console.log("+ " + data._id) + cb() + }) }) } diff --git a/deps/npm/lib/rebuild.js b/deps/npm/lib/rebuild.js index e296451b70..ab372c6ec0 100644 --- a/deps/npm/lib/rebuild.js +++ b/deps/npm/lib/rebuild.js @@ -5,6 +5,7 @@ var readInstalled = require("read-installed") , semver = require("semver") , log = require("npmlog") , npm = require("./npm.js") + , npa = require("npm-package-arg") rebuild.usage = "npm rebuild [[@] [name[@] ...]]" @@ -46,9 +47,9 @@ function filter (data, args, set, seen) { else if (data.name && data._id) { for (var i = 0, l = args.length; i < l; i ++) { var arg = args[i] - , nv = arg.split("@") - , n = nv.shift() - , v = nv.join("@") + , nv = npa(arg) + , n = nv.name + , v = nv.rawSpec if (n !== data.name) continue if (!semver.satisfies(data.version, v, true)) continue pass = true diff --git a/deps/npm/lib/repo.js b/deps/npm/lib/repo.js index d209c3ca83..c6db8e37b0 100644 --- a/deps/npm/lib/repo.js +++ b/deps/npm/lib/repo.js @@ -5,9 +5,12 @@ repo.usage = "npm repo " repo.completion = function (opts, cb) { if (opts.conf.argv.remain.length > 2) return cb() - var uri = url_.resolve(npm.config.get("registry"), "/-/short") - registry.get(uri, { timeout : 60000 }, function (er, list) { - return cb(null, list || []) + mapToRegistry("/-/short", npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri, { timeout : 60000 }, function (er, list) { + return cb(null, list || []) + }) }) } @@ -19,10 +22,12 @@ var npm = require("./npm.js") , path = require("path") , readJson = require("read-package-json") , fs = require("fs") - , url_ = require('url') + , url_ = require("url") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") function repo (args, cb) { - var n = args.length && args[0].split("@").shift() || '.' + var n = args.length && npa(args[0]).name || "." fs.stat(n, function (er, s) { if (er && er.code === "ENOENT") return callRegistry(n, cb) else if (er) return cb(er) @@ -35,8 +40,8 @@ function repo (args, cb) { } function getUrlAndOpen (d, cb) { - var r = d.repository; - if (!r) return cb(new Error('no repository')); + var r = d.repository + if (!r) return cb(new Error('no repository')) // XXX remove this when npm@v1.3.10 from node 0.10 is deprecated // from https://github.com/npm/npm-www/issues/418 if (githubUserRepo(r.url)) @@ -52,10 +57,13 @@ function getUrlAndOpen (d, cb) { } function callRegistry (n, cb) { - var uri = url_.resolve(npm.config.get("registry"), n + "/latest") - registry.get(uri, { timeout : 3600 }, function (er, d) { + mapToRegistry(n, npm.config, function (er, uri) { if (er) return cb(er) - getUrlAndOpen(d, cb) + + registry.get(uri + "/latest", { timeout : 3600 }, function (er, d) { + if (er) return cb(er) + getUrlAndOpen(d, cb) + }) }) } diff --git a/deps/npm/lib/run-script.js b/deps/npm/lib/run-script.js index 25e98f01d6..6cb7bf7fb9 100644 --- a/deps/npm/lib/run-script.js +++ b/deps/npm/lib/run-script.js @@ -8,7 +8,7 @@ var lifecycle = require("./utils/lifecycle.js") , log = require("npmlog") , chain = require("slide").chain -runScript.usage = "npm run-script [] " +runScript.usage = "npm run-script [-- ]" runScript.completion = function (opts, cb) { @@ -21,7 +21,7 @@ runScript.completion = function (opts, cb) { if (argv.length === 3) { // either specified a script locally, in which case, done, // or a package, in which case, complete against its scripts - var json = path.join(npm.prefix, "package.json") + var json = path.join(npm.localPrefix, "package.json") return readJson(json, function (er, d) { if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) if (er) d = {} @@ -30,7 +30,7 @@ runScript.completion = function (opts, cb) { if (scripts.indexOf(argv[2]) !== -1) return cb() // ok, try to find out which package it was, then var pref = npm.config.get("global") ? npm.config.get("prefix") - : npm.prefix + : npm.localPrefix var pkgDir = path.resolve( pref, "node_modules" , argv[2], "package.json" ) readJson(pkgDir, function (er, d) { @@ -54,7 +54,7 @@ runScript.completion = function (opts, cb) { }) if (npm.config.get("global")) scripts = [], next() - else readJson(path.join(npm.prefix, "package.json"), function (er, d) { + else readJson(path.join(npm.localPrefix, "package.json"), function (er, d) { if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) d = d || {} scripts = Object.keys(d.scripts || {}) @@ -69,18 +69,18 @@ runScript.completion = function (opts, cb) { function runScript (args, cb) { if (!args.length) return list(cb) - var pkgdir = args.length === 1 ? process.cwd() - : path.resolve(npm.dir, args[0]) - , cmd = args.pop() + + var pkgdir = npm.localPrefix + , cmd = args.shift() readJson(path.resolve(pkgdir, "package.json"), function (er, d) { if (er) return cb(er) - run(d, pkgdir, cmd, cb) + run(d, pkgdir, cmd, args, cb) }) } function list(cb) { - var json = path.join(npm.prefix, 'package.json') + var json = path.join(npm.localPrefix, 'package.json') return readJson(json, function(er, d) { if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) if (er) d = {} @@ -109,7 +109,7 @@ function list(cb) { }) } -function run (pkg, wd, cmd, cb) { +function run (pkg, wd, cmd, args, cb) { var cmds = [] if (!pkg.scripts) pkg.scripts = {} if (cmd === "restart") { @@ -124,7 +124,21 @@ function run (pkg, wd, cmd, cb) { } log.verbose("run-script", cmds) chain(cmds.map(function (c) { + // pass cli arguments after -- to script. + if (pkg.scripts[c]) pkg.scripts[c] = pkg.scripts[c] + joinArgs(args) + // when running scripts explicitly, assume that they're trusted. return [lifecycle, pkg, c, wd, true] }), cb) } + +// join arguments after '--' and pass them to script, +// handle special characters such as ', ", ' '. +function joinArgs (args) { + var joinedArgs = '' + args.forEach(function(arg, i) { + if (arg.match(/[ '"]/)) arg = '"' + arg.replace(/"/g, '\\"') + '"' + joinedArgs += ' ' + arg + }) + return joinedArgs +} diff --git a/deps/npm/lib/search.js b/deps/npm/lib/search.js index e7892350ca..3be8b0d27d 100644 --- a/deps/npm/lib/search.js +++ b/deps/npm/lib/search.js @@ -1,10 +1,10 @@ module.exports = exports = search -var url = require("url") - , npm = require("./npm.js") +var npm = require("./npm.js") , registry = npm.registry , columnify = require('columnify') + , mapToRegistry = require("./utils/map-to-registry.js") search.usage = "npm search [some search terms ...]" @@ -63,10 +63,13 @@ function getFilteredData (staleness, args, notArgs, cb) { follow : true, staleOk : true } - var uri = url.resolve(npm.config.get("registry"), "-/all") - registry.get(uri, opts, function (er, data) { + mapToRegistry("-/all", npm.config, function (er, uri) { if (er) return cb(er) - return cb(null, filter(data, args, notArgs)) + + registry.get(uri, opts, function (er, data) { + if (er) return cb(er) + return cb(null, filter(data, args, notArgs)) + }) }) } diff --git a/deps/npm/lib/star.js b/deps/npm/lib/star.js index 9c0b4ea9ed..123c4ebbb4 100644 --- a/deps/npm/lib/star.js +++ b/deps/npm/lib/star.js @@ -1,19 +1,22 @@ module.exports = star -var url = require("url") - , npm = require("./npm.js") +var npm = require("./npm.js") , registry = npm.registry , log = require("npmlog") , asyncMap = require("slide").asyncMap + , mapToRegistry = require("./utils/map-to-registry.js") star.usage = "npm star [pkg, pkg, ...]\n" + "npm unstar [pkg, pkg, ...]" star.completion = function (opts, cb) { - var uri = url.resolve(npm.config.get("registry"), "-/short") - registry.get(uri, { timeout : 60000 }, function (er, list) { - return cb(null, list || []) + mapToRegistry("-/short", npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri, { timeout : 60000 }, function (er, list) { + return cb(null, list || []) + }) }) } @@ -24,13 +27,16 @@ function star (args, cb) { , using = !(npm.command.match(/^un/)) if (!using) s = u asyncMap(args, function (pkg, cb) { - var uri = url.resolve(npm.config.get("registry"), pkg) - registry.star(uri, using, function (er, data, raw, req) { - if (!er) { - console.log(s + " "+pkg) - log.verbose("star", data) - } - cb(er, data, raw, req) + mapToRegistry(pkg, npm.config, function (er, uri) { + if (er) return cb(er) + + registry.star(uri, using, function (er, data, raw, req) { + if (!er) { + console.log(s + " "+pkg) + log.verbose("star", data) + } + cb(er, data, raw, req) + }) }) }, cb) } diff --git a/deps/npm/lib/stars.js b/deps/npm/lib/stars.js index f0d2ef73ae..dee5c152af 100644 --- a/deps/npm/lib/stars.js +++ b/deps/npm/lib/stars.js @@ -2,23 +2,26 @@ module.exports = stars stars.usage = "npm stars [username]" -var url = require("url") - , npm = require("./npm.js") +var npm = require("./npm.js") , registry = npm.registry , log = require("npmlog") + , mapToRegistry = require("./utils/map-to-registry.js") function stars (args, cb) { - var name = args.length === 1 ? args[0] : npm.config.get("username") - , uri = url.resolve(npm.config.get("registry"), name) - registry.stars(uri, showstars) + npm.commands.whoami([], true, function (er, username) { + var name = args.length === 1 ? args[0] : username + mapToRegistry("", npm.config, function (er, uri) { + if (er) return cb(er) + + registry.stars(uri, name, showstars) + }) + }) function showstars (er, data) { - if (er) { - return cb(er) - } + if (er) return cb(er) if (data.rows.length === 0) { - log.warn('stars', 'user has not starred any packages.') + log.warn("stars", "user has not starred any packages.") } else { data.rows.forEach(function(a) { console.log(a.value) diff --git a/deps/npm/lib/submodule.js b/deps/npm/lib/submodule.js index 2231ced9cf..eab4d21b05 100644 --- a/deps/npm/lib/submodule.js +++ b/deps/npm/lib/submodule.js @@ -9,7 +9,6 @@ var npm = require("./npm.js") , git = require("./utils/git.js") , asyncMap = require("slide").asyncMap , chain = require("slide").chain - , which = require("which") submodule.usage = "npm submodule " @@ -23,7 +22,7 @@ function submodule (args, cb) { if (args.length === 0) return cb(submodule.usage) asyncMap(args, function (arg, cb) { - cache.add(arg, null, false, cb) + cache.add(arg, null, null, false, cb) }, function (er, pkgs) { if (er) return cb(er) chain(pkgs.map(function (pkg) { return function (cb) { @@ -71,7 +70,7 @@ function addSubmodule (name, url, cb) { var getSubmodules = function (cb) { var args = [ "submodule", "status" ] - + git.whichAndExec(args, function _(er, stdout) { if (er) return cb(er) var res = stdout.trim().split(/\n/).map(function (line) { diff --git a/deps/npm/lib/tag.js b/deps/npm/lib/tag.js index 1d04ad1f7e..47e9a8c0ac 100644 --- a/deps/npm/lib/tag.js +++ b/deps/npm/lib/tag.js @@ -5,16 +5,30 @@ tag.usage = "npm tag @ []" tag.completion = require("./unpublish.js").completion -var url = require("url") - , npm = require("./npm.js") +var npm = require("./npm.js") , registry = npm.registry + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") + , semver = require("semver") function tag (args, cb) { - var thing = (args.shift() || "").split("@") - , project = thing.shift() - , version = thing.join("@") + var thing = npa(args.shift() || "") + , project = thing.name + , version = thing.rawSpec , t = args.shift() || npm.config.get("tag") + + t = t.trim() + if (!project || !version || !t) return cb("Usage:\n"+tag.usage) - var uri = url.resolve(npm.config.get("registry"), project) - registry.tag(uri, version, t, cb) + + if (semver.validRange(t)) { + var er = new Error("Tag name must not be a valid SemVer range: " + t) + return cb(er) + } + + mapToRegistry(project, npm.config, function (er, uri) { + if (er) return cb(er) + + registry.tag(uri, version, t, cb) + }) } diff --git a/deps/npm/lib/unbuild.js b/deps/npm/lib/unbuild.js index b594f28a9b..797762436b 100644 --- a/deps/npm/lib/unbuild.js +++ b/deps/npm/lib/unbuild.js @@ -2,7 +2,6 @@ module.exports = unbuild unbuild.usage = "npm unbuild \n(this is plumbing)" var readJson = require("read-package-json") - , rm = require("./utils/gently-rm.js") , gentlyRm = require("./utils/gently-rm.js") , npm = require("./npm.js") , path = require("path") @@ -15,7 +14,7 @@ var readJson = require("read-package-json") // args is a list of folders. // remove any bins/etc, and then delete the folder. function unbuild (args, silent, cb) { - if (typeof silent === 'function') cb = silent, silent = false + if (typeof silent === "function") cb = silent, silent = false asyncMap(args, unbuild_(silent), cb) } @@ -28,7 +27,7 @@ function unbuild_ (silent) { return function (folder, cb_) { log.verbose(folder.substr(npm.prefix.length + 1), "unbuild") readJson(path.resolve(folder, "package.json"), function (er, pkg) { // if no json, then just trash it, but no scripts or whatever. - if (er) return rm(folder, cb) + if (er) return gentlyRm(folder, false, cb) readJson.cache.del(folder) chain ( [ [lifecycle, pkg, "preuninstall", folder, false, true] @@ -39,7 +38,7 @@ function unbuild_ (silent) { return function (folder, cb_) { } , [rmStuff, pkg, folder] , [lifecycle, pkg, "postuninstall", folder, false, true] - , [rm, folder] ] + , [gentlyRm, folder, undefined] ] , cb ) }) }} @@ -66,8 +65,8 @@ function rmBins (pkg, folder, parent, top, cb) { log.verbose([binRoot, pkg.bin], "binRoot") asyncMap(Object.keys(pkg.bin), function (b, cb) { if (process.platform === "win32") { - chain([ [rm, path.resolve(binRoot, b) + ".cmd"] - , [rm, path.resolve(binRoot, b) ] ], cb) + chain([ [gentlyRm, path.resolve(binRoot, b) + ".cmd", undefined] + , [gentlyRm, path.resolve(binRoot, b), undefined] ], cb) } else { gentlyRm( path.resolve(binRoot, b) , !npm.config.get("force") && folder diff --git a/deps/npm/lib/unpublish.js b/deps/npm/lib/unpublish.js index 225c1c3c45..2566cd5ae6 100644 --- a/deps/npm/lib/unpublish.js +++ b/deps/npm/lib/unpublish.js @@ -1,40 +1,51 @@ module.exports = unpublish -var url = require("url") - , log = require("npmlog") +var log = require("npmlog") , npm = require("./npm.js") , registry = npm.registry , readJson = require("read-package-json") , path = require("path") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") unpublish.usage = "npm unpublish [@]" unpublish.completion = function (opts, cb) { if (opts.conf.argv.remain.length >= 3) return cb() - var un = encodeURIComponent(npm.config.get("username")) - if (!un) return cb() - var uri = url.resolve(npm.config.get("registry"), "-/by-user/"+un) - registry.get(uri, null, function (er, pkgs) { - // do a bit of filtering at this point, so that we don't need - // to fetch versions for more than one thing, but also don't - // accidentally a whole project. - pkgs = pkgs[un] - if (!pkgs || !pkgs.length) return cb() - var partial = opts.partialWord.split("@") - , pp = partial.shift() - pkgs = pkgs.filter(function (p) { - return p.indexOf(pp) === 0 - }) - if (pkgs.length > 1) return cb(null, pkgs) - var uri = url.resolve(npm.config.get("registry"), pkgs[0]) - registry.get(uri, null, function (er, d) { + npm.commands.whoami([], true, function (er, username) { + if (er) return cb() + + var un = encodeURIComponent(username) + if (!un) return cb() + var byUser = "-/by-user/" + un + mapToRegistry(byUser, npm.config, function (er, uri) { if (er) return cb(er) - var vers = Object.keys(d.versions) - if (!vers.length) return cb(null, pkgs) - return cb(null, vers.map(function (v) { - return pkgs[0]+"@"+v - })) + + registry.get(uri, null, function (er, pkgs) { + // do a bit of filtering at this point, so that we don't need + // to fetch versions for more than one thing, but also don't + // accidentally a whole project. + pkgs = pkgs[un] + if (!pkgs || !pkgs.length) return cb() + var pp = npa(opts.partialWord).name + pkgs = pkgs.filter(function (p) { + return p.indexOf(pp) === 0 + }) + if (pkgs.length > 1) return cb(null, pkgs) + mapToRegistry(pkgs[0], npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri, null, function (er, d) { + if (er) return cb(er) + var vers = Object.keys(d.versions) + if (!vers.length) return cb(null, pkgs) + return cb(null, vers.map(function (v) { + return pkgs[0] + "@" + v + })) + }) + }) + }) }) }) } @@ -42,23 +53,25 @@ unpublish.completion = function (opts, cb) { function unpublish (args, cb) { if (args.length > 1) return cb(unpublish.usage) - var thing = args.length ? args.shift().split("@") : [] - , project = thing.shift() - , version = thing.join("@") + var thing = args.length ? npa(args[0]) : {} + , project = thing.name + , version = thing.rawSpec + log.silly("unpublish", "args[0]", args[0]) + log.silly("unpublish", "thing", thing) if (!version && !npm.config.get("force")) { return cb("Refusing to delete entire project.\n" - +"Run with --force to do this.\n" - +unpublish.usage) + + "Run with --force to do this.\n" + + unpublish.usage) } - if (!project || path.resolve(project) === npm.prefix) { + if (!project || path.resolve(project) === npm.localPrefix) { // if there's a package.json in the current folder, then // read the package name and version out of that. - var cwdJson = path.join(process.cwd(), "package.json") + var cwdJson = path.join(npm.localPrefix, "package.json") return readJson(cwdJson, function (er, data) { if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - if (er) return cb("Usage:\n"+unpublish.usage) + if (er) return cb("Usage:\n" + unpublish.usage) gotProject(data.name, data.version, cb) }) } @@ -79,7 +92,10 @@ function gotProject (project, version, cb_) { return cb(er) } - var uri = url.resolve(npm.config.get("registry"), project) - registry.unpublish(uri, version, cb) + mapToRegistry(project, npm.config, function (er, uri) { + if (er) return cb(er) + + registry.unpublish(uri, version, cb) + }) }) } diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js index 5c4f4c99e8..788d3f8ccc 100644 --- a/deps/npm/lib/utils/error-handler.js +++ b/deps/npm/lib/utils/error-handler.js @@ -24,13 +24,18 @@ process.on("exit", function (code) { } if (wroteLogFile) { - log.error("", ["" - ,"Additional logging details can be found in:" + // just a line break + if (log.levels[log.level] <= log.levels.error) console.error("") + + log.error("", + ["Please include the following file with any support request:" ," " + path.resolve("npm-debug.log") ].join("\n")) wroteLogFile = false } - log.error("not ok", "code", code) + if (code) { + log.error("code", code) + } } var doExit = npm.config.get("_exit") @@ -87,7 +92,6 @@ function exit (code, noLog) { function errorHandler (er) { - var printStack = false // console.error("errorHandler", er) if (!npm.config || !npm.config.loaded) { // logging won't work unless we pretend that it's ready @@ -112,13 +116,55 @@ function errorHandler (er) { var m = er.code || er.message.match(/^(?:Error: )?(E[A-Z]+)/) if (m && !er.code) er.code = m + ; [ "type" + , "fstream_path" + , "fstream_unc_path" + , "fstream_type" + , "fstream_class" + , "fstream_finish_call" + , "fstream_linkpath" + , "stack" + , "fstream_stack" + , "statusCode" + , "pkgid" + ].forEach(function (k) { + var v = er[k] + if (!v) return + if (k === "fstream_stack") v = v.join("\n") + log.verbose(k, v) + }) + + log.verbose("cwd", process.cwd()) + + var os = require("os") + // log.error("System", os.type() + " " + os.release()) + // log.error("command", process.argv.map(JSON.stringify).join(" ")) + // log.error("node -v", process.version) + // log.error("npm -v", npm.version) + log.error("", os.type() + " " + os.release()) + log.error("argv", process.argv.map(JSON.stringify).join(" ")) + log.error("node", process.version) + log.error("npm ", "v" + npm.version) + + ; [ "file" + , "path" + , "code" + , "errno" + , "syscall" + ].forEach(function (k) { + var v = er[k] + if (v) log.error(k, v) + }) + + // just a line break + if (log.levels[log.level] <= log.levels.error) console.error("") + switch (er.code) { case "ECONNREFUSED": log.error("", er) log.error("", ["\nIf you are behind a proxy, please make sure that the" ,"'proxy' config is set properly. See: 'npm help config'" ].join("\n")) - printStack = true break case "EACCES": @@ -126,7 +172,6 @@ function errorHandler (er) { log.error("", er) log.error("", ["\nPlease try running this command again as root/Administrator." ].join("\n")) - printStack = true break case "ELIFECYCLE": @@ -160,24 +205,22 @@ function errorHandler (er) { ].join("\n"), "JSON.parse") break + // TODO(isaacs) + // Add a special case here for E401 and E403 explaining auth issues? + case "E404": var msg = [er.message] if (er.pkgid && er.pkgid !== "-") { msg.push("", "'"+er.pkgid+"' is not in the npm registry." - ,"You should bug the author to publish it") + ,"You should bug the author to publish it (or use the name yourself!)") if (er.parent) { msg.push("It was specified as a dependency of '"+er.parent+"'") } - if (er.pkgid.match(/^node[\.\-]|[\.\-]js$/)) { - var s = er.pkgid.replace(/^node[\.\-]|[\.\-]js$/g, "") - if (s !== er.pkgid) { - s = s.replace(/[^a-z0-9]/g, ' ') - msg.push("\nMaybe try 'npm search " + s + "'") - } - } msg.push("\nNote that you can also install from a" - ,"tarball, folder, or http url, or git url.") + ,"tarball, folder, http url, or git url.") } + // There's no need to have 404 in the message as well. + msg[0] = msg[0].replace(/^404\s+/, "") log.error("404", msg.join("\n")) break @@ -185,9 +228,6 @@ function errorHandler (er) { log.error("publish fail", ["Cannot publish over existing version." ,"Update the 'version' field in package.json and try again." ,"" - ,"If the previous version was published in error, see:" - ," npm help unpublish" - ,"" ,"To automatically increment version numbers, see:" ," npm help version" ].join("\n")) @@ -295,50 +335,13 @@ function errorHandler (er) { break default: - log.error("", er.stack || er.message || er) - log.error("", ["If you need help, you may report this *entire* log," - ,"including the npm and node versions, at:" + log.error("", er.message || er) + log.error("", ["", "If you need help, you may report this error at:" ," " ].join("\n")) - printStack = false break } - var os = require("os") - // just a line break - if (log.levels[log.level] <= log.levels.error) console.error("") - log.error("System", os.type() + " " + os.release()) - log.error("command", process.argv - .map(JSON.stringify).join(" ")) - log.error("cwd", process.cwd()) - log.error("node -v", process.version) - log.error("npm -v", npm.version) - - ; [ "file" - , "path" - , "type" - , "syscall" - , "fstream_path" - , "fstream_unc_path" - , "fstream_type" - , "fstream_class" - , "fstream_finish_call" - , "fstream_linkpath" - , "code" - , "errno" - , "stack" - , "fstream_stack" - ].forEach(function (k) { - var v = er[k] - if (k === "stack") { - if (!printStack) return - if (!v) v = er.message - } - if (!v) return - if (k === "fstream_stack") v = v.join("\n") - log.error(k, v) - }) - exit(typeof er.errno === "number" ? er.errno : 1) } @@ -350,17 +353,16 @@ function writeLogFile (cb) { var fs = require("graceful-fs") , fstr = fs.createWriteStream("npm-debug.log") - , util = require("util") , os = require("os") , out = "" log.record.forEach(function (m) { var pref = [m.id, m.level] if (m.prefix) pref.push(m.prefix) - pref = pref.join(' ') + pref = pref.join(" ") m.message.trim().split(/\r?\n/).map(function (line) { - return (pref + ' ' + line).trim() + return (pref + " " + line).trim() }).forEach(function (line) { out += line + os.EOL }) diff --git a/deps/npm/lib/utils/fetch.js b/deps/npm/lib/utils/fetch.js deleted file mode 100644 index f6e5166ff5..0000000000 --- a/deps/npm/lib/utils/fetch.js +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Fetch an HTTP url to a local file. - **/ - -var request = require("request") - , fs = require("graceful-fs") - , npm = require("../npm.js") - , url = require("url") - , log = require("npmlog") - , path = require("path") - , mkdir = require("mkdirp") - , chownr = require("chownr") - , regHost - , once = require("once") - , crypto = require("crypto") - -module.exports = fetch - -function fetch (remote, local, headers, cb) { - if (typeof cb !== "function") cb = headers, headers = {} - cb = once(cb) - log.verbose("fetch", "to=", local) - mkdir(path.dirname(local), function (er, made) { - if (er) return cb(er) - fetch_(remote, local, headers, cb) - }) -} - -function fetch_ (remote, local, headers, cb) { - var fstr = fs.createWriteStream(local, { mode : npm.modes.file }) - var response = null - - fstr.on("error", function (er) { - cb(er) - fstr.destroy() - }) - - var req = makeRequest(remote, fstr, headers) - req.on("response", function (res) { - log.http(res.statusCode, remote) - response = res - response.resume() - // Work around bug in node v0.10.0 where the CryptoStream - // gets stuck and never starts reading again. - if (process.version === "v0.10.0") { - response.resume = function (orig) { return function() { - var ret = orig.apply(response, arguments) - if (response.socket.encrypted) - response.socket.encrypted.read(0) - return ret - }}(response.resume) - } - }) - - fstr.on("close", function () { - var er - if (response && response.statusCode && response.statusCode >= 400) { - er = new Error(response.statusCode + " " - + require("http").STATUS_CODES[response.statusCode]) - } - cb(er, response) - }) -} - -function makeRequest (remote, fstr, headers) { - remote = url.parse(remote) - log.http("GET", remote.href) - regHost = regHost || url.parse(npm.config.get("registry")).host - - if (remote.host === regHost && npm.config.get("always-auth")) { - remote.auth = new Buffer( npm.config.get("_auth") - , "base64" ).toString("utf8") - if (!remote.auth) return fstr.emit("error", new Error( - "Auth required and none provided. Please run 'npm adduser'")) - } - - var proxy - if (remote.protocol !== "https:" || !(proxy = npm.config.get("https-proxy"))) { - proxy = npm.config.get("proxy") - } - - var sessionToken = npm.registry.sessionToken - if (!sessionToken) { - sessionToken = crypto.randomBytes(8).toString("hex") - npm.registry.sessionToken = sessionToken - } - - var ca = remote.host === regHost ? npm.config.get("ca") : undefined - var opts = { url: remote - , proxy: proxy - , strictSSL: npm.config.get("strict-ssl") - , rejectUnauthorized: npm.config.get("strict-ssl") - , ca: ca - , headers: - { "user-agent": npm.config.get("user-agent") - , "npm-session": sessionToken - , referer: npm.registry.refer - } - } - var req = request(opts) - req.on("error", function (er) { - fstr.emit("error", er) - }) - req.pipe(fstr) - return req -} diff --git a/deps/npm/lib/utils/gently-rm.js b/deps/npm/lib/utils/gently-rm.js index 241740fed6..d43d0725eb 100644 --- a/deps/npm/lib/utils/gently-rm.js +++ b/deps/npm/lib/utils/gently-rm.js @@ -3,54 +3,159 @@ module.exports = gentlyRm -var rimraf = require("rimraf") - , fs = require("graceful-fs") - , npm = require("../npm.js") - , path = require("path") +var npm = require("../npm.js") + , log = require("npmlog") + , resolve = require("path").resolve + , dirname = require("path").dirname + , lstat = require("graceful-fs").lstat + , readlink = require("graceful-fs").readlink + , isInside = require("path-is-inside") + , vacuum = require("fs-vacuum") + , rimraf = require("rimraf") + , some = require("async-some") -function gentlyRm (p, gently, cb) { - if (!cb) cb = gently, gently = null +function gentlyRm (path, gently, cb) { + if (!cb) { + cb = gently + gently = null + } // never rm the root, prefix, or bin dirs. // just a safety precaution. - p = path.resolve(p) - if (p === npm.dir || - p === npm.root || - p === npm.bin || - p === npm.prefix || - p === npm.globalDir || - p === npm.globalRoot || - p === npm.globalBin || - p === npm.globalPrefix) { - return cb(new Error("May not delete: " + p)) + var prefixes = [ + npm.dir, npm.root, npm.bin, npm.prefix, + npm.globalDir, npm.globalRoot, npm.globalBin, npm.globalPrefix + ] + + var resolved = resolve(path) + if (prefixes.indexOf(resolved) !== -1) { + log.verbose("gentlyRm", resolved, "is part of npm and can't be removed") + return cb(new Error("May not delete: "+resolved)) } - if (npm.config.get("force") || !gently) { - return rimraf(p, cb) + var options = {log : log.silly.bind(log, "gentlyRm")} + if (npm.config.get("force") || !gently) options.purge = true + + if (!gently) { + log.verbose("gentlyRm", "vacuuming", resolved) + return vacuum(resolved, options, cb) } - gently = path.resolve(gently) + var parent = resolve(gently) + log.verbose("gentlyRm", "verifying that", parent, "is managed by npm") + some(prefixes, isManaged(parent), function (er, matched) { + if (er) return cb(er) + + if (!matched) { + log.verbose("gentlyRm", parent, "is not managed by npm") + return clobberFail(resolved, parent, cb) + } + + log.silly("gentlyRm", parent, "is managed by npm") + + if (isInside(resolved, parent)) { + log.silly("gentlyRm", resolved, "is under", parent) + log.verbose("gentlyRm", "vacuuming", resolved, "up to", parent) + options.base = parent + return vacuum(resolved, options, cb) + } + + log.silly("gentlyRm", resolved, "is not under", parent) + log.silly("gentlyRm", "checking to see if", resolved, "is a link") + lstat(resolved, function (er, stat) { + if (er) { + if (er.code === "ENOENT") return cb(null) + return cb(er) + } + + if (!stat.isSymbolicLink()) { + log.verbose("gentlyRm", resolved, "is outside", parent, "and not a link") + return clobberFail(resolved, parent, cb) + } + + log.silly("gentlyRm", resolved, "is a link") + readlink(resolved, function (er, link) { + if (er) { + if (er.code === "ENOENT") return cb(null) + return cb(er) + } - // lstat it, see if it's a symlink. - fs.lstat(p, function (er, s) { - if (er) return rimraf(p, cb) - if (!s.isSymbolicLink()) next(null, path.resolve(p)) - realish(p, next) + var source = resolve(dirname(resolved), link) + if (isInside(source, parent)) { + log.silly("gentlyRm", source, "inside", parent) + log.verbose("gentlyRm", "vacuuming", resolved) + return vacuum(resolved, options, cb) + } + + log.silly("gentlyRm", "checking to see if", source, "is managed by npm") + some(prefixes, isManaged(source), function (er, matched) { + if (er) return cb(er) + + if (matched) { + log.silly("gentlyRm", source, "is under", matched) + log.verbose("gentlyRm", "removing", resolved) + rimraf(resolved, cb) + } + + log.verbose("gentlyRm", source, "is not managed by npm") + return clobberFail(path, parent, cb) + }) + }) + }) }) +} - function next (er, rp) { - if (rp && rp.indexOf(gently) !== 0) { - return clobberFail(p, gently, cb) +var resolvedPaths = {} +function isManaged (target) { + return predicate + + function predicate (path, cb) { + if (!path) { + log.verbose("isManaged", "no path") + return cb(null, false) + } + + path = resolve(path) + + // if the path has already been memoized, return immediately + var resolved = resolvedPaths[path] + if (resolved) { + var inside = isInside(target, resolved) + log.silly("isManaged", target, inside ? "is" : "is not", "inside", resolved) + + return cb(null, inside && path) } - rimraf(p, cb) + + // otherwise, check the path + lstat(path, function (er, stat) { + if (er) { + if (er.code === "ENOENT") return cb(null, false) + + return cb(er) + } + + // if it's not a link, cache & test the path itself + if (!stat.isSymbolicLink()) return cacheAndTest(path, path, target, cb) + + // otherwise, cache & test the link's source + readlink(path, function (er, source) { + if (er) { + if (er.code === "ENOENT") return cb(null, false) + + return cb(er) + } + + cacheAndTest(resolve(path, source), path, target, cb) + }) + }) } -} -function realish (p, cb) { - fs.readlink(p, function (er, r) { - if (er) return cb(er) - return cb(null, path.resolve(path.dirname(p), r)) - }) + function cacheAndTest (resolved, source, target, cb) { + resolvedPaths[source] = resolved + var inside = isInside(target, resolved) + log.silly("cacheAndTest", target, inside ? "is" : "is not", "inside", resolved) + cb(null, inside && source) + } } function clobberFail (p, g, cb) { diff --git a/deps/npm/lib/utils/is-git-url.js b/deps/npm/lib/utils/is-git-url.js deleted file mode 100644 index 7ded4b602a..0000000000 --- a/deps/npm/lib/utils/is-git-url.js +++ /dev/null @@ -1,13 +0,0 @@ -module.exports = isGitUrl - -function isGitUrl (url) { - switch (url.protocol) { - case "git:": - case "git+http:": - case "git+https:": - case "git+rsync:": - case "git+ftp:": - case "git+ssh:": - return true - } -} diff --git a/deps/npm/lib/utils/lifecycle.js b/deps/npm/lib/utils/lifecycle.js index 8bcb99689f..c0eb83dfb1 100644 --- a/deps/npm/lib/utils/lifecycle.js +++ b/deps/npm/lib/utils/lifecycle.js @@ -71,11 +71,6 @@ function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) { , p = wd.split("node_modules") , acc = path.resolve(p.shift()) - // first add the directory containing the `node` executable currently - // running, so that any lifecycle script that invoke "node" will execute - // this same one. - pathArr.unshift(path.dirname(process.execPath)) - p.forEach(function (pp) { pathArr.unshift(path.join(acc, "node_modules", ".bin")) acc = path.join(acc, "node_modules", pp) @@ -353,13 +348,9 @@ function makeEnv (data, prefix, env) { function cmd (stage) { function CMD (args, cb) { - if (args.length) { - chain(args.map(function (p) { - return [npm.commands, "run-script", [p, stage]] - }), cb) - } else npm.commands["run-script"]([stage], cb) + npm.commands["run-script"]([stage].concat(args), cb) } - CMD.usage = "npm "+stage+" " + CMD.usage = "npm "+stage+" [-- ]" var installedShallow = require("./completion/installed-shallow.js") CMD.completion = function (opts, cb) { installedShallow(opts, function (d) { diff --git a/deps/npm/lib/utils/map-to-registry.js b/deps/npm/lib/utils/map-to-registry.js new file mode 100644 index 0000000000..cf665e4f65 --- /dev/null +++ b/deps/npm/lib/utils/map-to-registry.js @@ -0,0 +1,54 @@ +var url = require("url") + +var log = require("npmlog") + , npa = require("npm-package-arg") + +module.exports = mapToRegistry + +function mapToRegistry(name, config, cb) { + var uri + var scopedRegistry + + // the name itself takes precedence + var data = npa(name) + if (data.scope) { + // the name is definitely scoped, so escape now + name = name.replace("/", "%2f") + + log.silly("mapToRegistry", "scope", data.scope) + + scopedRegistry = config.get(data.scope + ":registry") + if (scopedRegistry) { + log.silly("mapToRegistry", "scopedRegistry (scoped package)", scopedRegistry) + uri = url.resolve(scopedRegistry, name) + } + else { + log.verbose("mapToRegistry", "no registry URL found for scope", data.scope) + } + } + + // ...then --scope=@scope or --scope=scope + var scope = config.get("scope") + if (!uri && scope) { + // I'm an enabler, sorry + if (scope.charAt(0) !== "@") scope = "@" + scope + + scopedRegistry = config.get(scope + ":registry") + if (scopedRegistry) { + log.silly("mapToRegistry", "scopedRegistry (scope in config)", scopedRegistry) + uri = url.resolve(scopedRegistry, name) + } + else { + log.verbose("mapToRegistry", "no registry URL found for scope", scope) + } + } + + // ...and finally use the default registry + if (!uri) { + uri = url.resolve(config.get("registry"), name) + } + + log.verbose("mapToRegistry", "name", name) + log.verbose("mapToRegistry", "uri", uri) + cb(null, uri) +} diff --git a/deps/npm/lib/version.js b/deps/npm/lib/version.js index 95d5ff2ee2..5091ab9e2d 100644 --- a/deps/npm/lib/version.js +++ b/deps/npm/lib/version.js @@ -23,7 +23,7 @@ version.usage = "npm version [ | major | minor | patch | prerelease function version (args, silent, cb_) { if (typeof cb_ !== "function") cb_ = silent, silent = false if (args.length > 1) return cb_(version.usage) - fs.readFile(path.join(process.cwd(), "package.json"), function (er, data) { + fs.readFile(path.join(npm.localPrefix, "package.json"), function (er, data) { if (!args.length) { var v = {} Object.keys(process.versions).forEach(function (k) { @@ -63,7 +63,7 @@ function version (args, silent, cb_) { if (data.version === newVer) return cb_(new Error("Version not changed")) data.version = newVer - fs.stat(path.join(process.cwd(), ".git"), function (er, s) { + fs.stat(path.join(npm.localPrefix, ".git"), function (er, s) { function cb (er) { if (!er && !silent) console.log("v" + newVer) cb_(er) @@ -111,7 +111,7 @@ function checkGit (data, cb) { } function write (data, cb) { - fs.writeFile( path.join(process.cwd(), "package.json") + fs.writeFile( path.join(npm.localPrefix, "package.json") , new Buffer(JSON.stringify(data, null, 2) + "\n") , cb ) } diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js index 33bf550dd9..43d09cbbcc 100644 --- a/deps/npm/lib/view.js +++ b/deps/npm/lib/view.js @@ -4,21 +4,26 @@ module.exports = view view.usage = "npm view pkg[@version] [[.subfield]...]" view.completion = function (opts, cb) { - var uri if (opts.conf.argv.remain.length <= 2) { - uri = url.resolve(npm.config.get("registry"), "-/short") - return registry.get(uri, null, cb) + return mapToRegistry("-/short", npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri, null, cb) + }) } // have the package, get the fields. var tag = npm.config.get("tag") - uri = url.resolve(npm.config.get("registry"), opts.conf.argv.remain[2]) - registry.get(uri, null, function (er, d) { + mapToRegistry(opts.conf.argv.remain[2], npm.config, function (er, uri) { if (er) return cb(er) - var dv = d.versions[d["dist-tags"][tag]] - , fields = [] - d.versions = Object.keys(d.versions).sort(semver.compareLoose) - fields = getFields(d).concat(getFields(dv)) - cb(null, fields) + + registry.get(uri, null, function (er, d) { + if (er) return cb(er) + var dv = d.versions[d["dist-tags"][tag]] + , fields = [] + d.versions = Object.keys(d.versions).sort(semver.compareLoose) + fields = getFields(d).concat(getFields(dv)) + cb(null, fields) + }) }) function getFields (d, f, pref) { @@ -42,71 +47,75 @@ view.completion = function (opts, cb) { } } -var url = require("url") - , npm = require("./npm.js") +var npm = require("./npm.js") , registry = npm.registry , log = require("npmlog") , util = require("util") , semver = require("semver") + , mapToRegistry = require("./utils/map-to-registry.js") + , npa = require("npm-package-arg") function view (args, silent, cb) { if (typeof cb !== "function") cb = silent, silent = false if (!args.length) return cb("Usage: "+view.usage) var pkg = args.shift() - , nv = pkg.split("@") - , name = nv.shift() - , version = nv.join("@") || npm.config.get("tag") + , nv = npa(pkg) + , name = nv.name + , version = nv.rawSpec || npm.config.get("tag") if (name === ".") return cb(view.usage) // get the data about this package - var uri = url.resolve(npm.config.get("registry"), name) - registry.get(uri, null, function (er, data) { + mapToRegistry(name, npm.config, function (er, uri) { if (er) return cb(er) - if (data["dist-tags"] && data["dist-tags"].hasOwnProperty(version)) { - version = data["dist-tags"][version] - } - if (data.time && data.time.unpublished) { - var u = data.time.unpublished - er = new Error("Unpublished by " + u.name + " on " + u.time) - er.statusCode = 404 - er.code = "E404" - er.pkgid = data._id - return cb(er, data) - } + registry.get(uri, null, function (er, data) { + if (er) return cb(er) + if (data["dist-tags"] && data["dist-tags"].hasOwnProperty(version)) { + version = data["dist-tags"][version] + } + if (data.time && data.time.unpublished) { + var u = data.time.unpublished + er = new Error("Unpublished by " + u.name + " on " + u.time) + er.statusCode = 404 + er.code = "E404" + er.pkgid = data._id + return cb(er, data) + } - var results = [] - , error = null - , versions = data.versions || {} - data.versions = Object.keys(versions).sort(semver.compareLoose) - if (!args.length) args = [""] - // remove readme unless we asked for it - if (-1 === args.indexOf("readme")) { - delete data.readme - } + var results = [] + , error = null + , versions = data.versions || {} + data.versions = Object.keys(versions).sort(semver.compareLoose) + if (!args.length) args = [""] + + // remove readme unless we asked for it + if (-1 === args.indexOf("readme")) { + delete data.readme + } - Object.keys(versions).forEach(function (v) { - if (semver.satisfies(v, version, true)) args.forEach(function (args) { - // remove readme unless we asked for it - if (-1 === args.indexOf("readme")) { - delete versions[v].readme - } - results.push(showFields(data, versions[v], args)) + Object.keys(versions).forEach(function (v) { + if (semver.satisfies(v, version, true)) args.forEach(function (args) { + // remove readme unless we asked for it + if (-1 === args.indexOf("readme")) { + delete versions[v].readme + } + results.push(showFields(data, versions[v], args)) + }) }) - }) - results = results.reduce(reducer, {}) - var retval = results + results = results.reduce(reducer, {}) + var retval = results - if (args.length === 1 && args[0] === "") { - retval = cleanBlanks(retval) - log.silly("cleanup", retval) - } + if (args.length === 1 && args[0] === "") { + retval = cleanBlanks(retval) + log.silly("cleanup", retval) + } - if (error || silent) cb(error, retval) - else printData(results, data._id, cb.bind(null, error, retval)) + if (error || silent) cb(error, retval) + else printData(results, data._id, cb.bind(null, error, retval)) + }) }) } diff --git a/deps/npm/lib/whoami.js b/deps/npm/lib/whoami.js index f1c67e2b0d..b33f93743d 100644 --- a/deps/npm/lib/whoami.js +++ b/deps/npm/lib/whoami.js @@ -1,13 +1,39 @@ -module.exports = whoami - var npm = require("./npm.js") -whoami.usage = "npm whoami\n(just prints the 'username' config)" +module.exports = whoami + +whoami.usage = "npm whoami\n(just prints username according to given registry)" function whoami (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false - var me = npm.config.get("username") - var msg = me ? me : "Not authed. Run 'npm adduser'" + // FIXME: need tighter checking on this, but is a breaking change + if (typeof cb !== "function") { + cb = silent + silent = false + } + + var registry = npm.config.get("registry") + if (!registry) return cb(new Error("no default registry set")) + + var credentials = npm.config.getCredentialsByURI(registry) + if (credentials) { + if (credentials.username) { + if (!silent) console.log(credentials.username) + return process.nextTick(cb.bind(this, null, credentials.username)) + } + else if (credentials.token) { + return npm.registry.whoami(registry, function (er, username) { + if (er) return cb(er) + + if (!silent) console.log(username) + cb(null, username) + }) + } + } + + // At this point, if they have a credentials object, it doesn't + // have a token or auth in it. Probably just the default + // registry. + var msg = "Not authed. Run 'npm adduser'" if (!silent) console.log(msg) - process.nextTick(cb.bind(this, null, me)) + process.nextTick(cb.bind(this, null, msg)) } diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1 index cfa8b45983..8f7d01ba7a 100644 --- a/deps/npm/man/man1/npm-README.1 +++ b/deps/npm/man/man1/npm-README.1 @@ -1,221 +1,177 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm\fR \-\- node package manager![Build Status \fIhttps://img\.shields\.io/travis/npm/npm/master\.svg)](https://travis\-ci\.org/npm/npm\fR -## SYNOPSIS -. +\fBnpm\fR \- node package manager +.P +Build Status \fIhttps://img\.shields\.io/travis/npm/npm/master\.svg\fR \fIhttps://travis\-ci\.org/npm/npm\fR +.SH SYNOPSIS .P This is just enough info to get you up and running\. -. .P -Much more info available via \fBnpm help\fR once it\'s installed\. -. -.SH "IMPORTANT" +Much more info available via \fBnpm help\fR once it's installed\. +.SH IMPORTANT +.P \fBYou need node v0\.8 or higher to run this program\.\fR -. .P To install an old \fBand unsupported\fR version of npm that works on node 0\.3 and prior, clone the git repo and dig through the old tags and branches\. -. -.SH "Super Easy Install" -npm comes with node now\. -. -.SS "Windows Computers" -Get the MSI\. npm is in it\. -. -.SS "Apple Macintosh Computers" -Get the pkg\. npm is in it\. -. -.SS "Other Sorts of Unices" +.SH Super Easy Install +.P +npm comes with node \fIhttp://nodejs\.org/download/\fR now\. +.SS Windows Computers +.P +Get the MSI \fIhttp://nodejs\.org/download/\fR\|\. npm is in it\. +.SS Apple Macintosh Computers +.P +Get the pkg \fIhttp://nodejs\.org/download/\fR\|\. npm is in it\. +.SS Other Sorts of Unices +.P Run \fBmake install\fR\|\. npm will be installed with node\. -. .P If you want a more fancy pants install (a different version, customized paths, etc\.) then read on\. -. -.SH "Fancy Install (Unix)" -There\'s a pretty robust install script at \fIhttps://www\.npmjs\.org/install\.sh\fR\|\. You can download that and run it\. -. -.P -Here\'s an example using curl: -. -.IP "" 4 -. -.nf +.SH Fancy Install (Unix) +.P +There's a pretty robust install script at +https://www\.npmjs\.org/install\.sh\|\. You can download that and run it\. +.P +Here's an example using curl: +.P +.RS 2 +.EX curl \-L https://npmjs\.org/install\.sh | sh -. -.fi -. -.IP "" 0 -. -.SS "Slightly Fancier" +.EE +.RE +.SS Slightly Fancier +.P You can set any npm configuration params with that script: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm_config_prefix=/some/path sh install\.sh -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Or, you can run it in uber\-debuggery mode: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm_debug=1 sh install\.sh -. -.fi -. -.IP "" 0 -. -.SS "Even Fancier" +.EE +.RE +.SS Even Fancier +.P Get the code with git\. Use \fBmake\fR to build the docs and do other stuff\. If you plan on hacking on npm, \fBmake link\fR is your friend\. -. .P -If you\'ve got the npm source code, you can also semi\-permanently set +If you've got the npm source code, you can also semi\-permanently set arbitrary config keys using the \fB\|\./configure \-\-key=val \.\.\.\fR, and then run npm commands by doing \fBnode cli\.js \fR\|\. (This is helpful for testing, or running stuff without actually installing npm itself\.) -. -.SH "Fancy Windows Install" -You can download a zip file from \fIhttps://npmjs\.org/dist/\fR, and unpack it +.SH Fancy Windows Install +.P +You can download a zip file from https://npmjs\.org/dist/, and unpack it in the same folder where node\.exe lives\. -. .P -If that\'s not fancy enough for you, then you can fetch the code with +If that's not fancy enough for you, then you can fetch the code with git, and mess with it directly\. -. -.SH "Installing on Cygwin" +.SH Installing on Cygwin +.P No\. -. -.SH "Permissions when Using npm to Install Other Stuff" +.SH Permissions when Using npm to Install Other Stuff +.P \fBtl;dr\fR -. -.IP "\(bu" 4 -Use \fBsudo\fR for greater safety\. Or don\'t, if you prefer not to\. -. -.IP "\(bu" 4 -npm will downgrade permissions if it\'s root before running any build +.RS 0 +.IP \(bu 2 +Use \fBsudo\fR for greater safety\. Or don't, if you prefer not to\. +.IP \(bu 2 +npm will downgrade permissions if it's root before running any build scripts that package authors specified\. -. -.IP "" 0 -. -.SS "More details\.\.\." + +.RE +.SS More details\.\.\. +.P As of version 0\.3, it is recommended to run npm as root\. This allows npm to change the user identifier to the \fBnobody\fR user prior to running any package build or test commands\. -. .P If you are not the root user, or if you are on a platform that does not support uid switching, then npm will not attempt to change the userid\. -. .P If you would like to ensure that npm \fBalways\fR runs scripts as the "nobody" user, and have it fail if it cannot downgrade permissions, then set the following configuration param: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm config set unsafe\-perm false -. -.fi -. -.IP "" 0 -. +.EE +.RE .P This will prevent running in unsafe mode, even as non\-root users\. -. -.SH "Uninstalling" +.SH Uninstalling +.P So sad to see you go\. -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX sudo npm uninstall npm \-g -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Or, if that fails, -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX sudo make uninstall -. -.fi -. -.IP "" 0 -. -.SH "More Severe Uninstalling" +.EE +.RE +.SH More Severe Uninstalling +.P Usually, the above instructions are sufficient\. That will remove -npm, but leave behind anything you\'ve installed\. -. +npm, but leave behind anything you've installed\. .P If you would like to remove all the packages that you have installed, then you can use the \fBnpm ls\fR command to find them, and then \fBnpm rm\fR to remove them\. -. .P -To remove cruft left behind by npm 0\.x, you can use the included \fBclean\-old\.sh\fR script file\. You can run it conveniently like this: -. -.IP "" 4 -. -.nf +To remove cruft left behind by npm 0\.x, you can use the included +\fBclean\-old\.sh\fR script file\. You can run it conveniently like this: +.P +.RS 2 +.EX npm explore npm \-g \-\- sh scripts/clean\-old\.sh -. -.fi -. -.IP "" 0 -. +.EE +.RE .P npm uses two configuration files, one for per\-user configs, and another for global (every\-user) configs\. You can view them by doing: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm config get userconfig # defaults to ~/\.npmrc npm config get globalconfig # defaults to /usr/local/etc/npmrc -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Uninstalling npm does not remove configuration files by default\. You must remove them yourself manually if you want them gone\. Note that this means that future npm installs will not remember the settings that you have chosen\. -. -.SH "Using npm Programmatically" +.SH Using npm Programmatically +.P If you would like to use npm programmatically, you can do that\. -It\'s not very well documented, but it \fIis\fR rather simple\. -. +It's not very well documented, but it \fIis\fR rather simple\. .P Most of the time, unless you actually want to do all the things that -npm does, you should try using one of npm\'s dependencies rather than +npm does, you should try using one of npm's dependencies rather than using npm itself, if possible\. -. .P Eventually, npm will be just a thin cli wrapper around the modules that it depends on, but for now, there are some things that you must use npm itself to do\. -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX var npm = require("npm") npm\.load(myConfigObject, function (er) { if (er) return handlError(er) @@ -225,117 +181,98 @@ npm\.load(myConfigObject, function (er) { }) npm\.on("log", function (message) { \.\.\.\. }) }) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The \fBload\fR function takes an object hash of the command\-line configs\. The various \fBnpm\.commands\.\fR functions take an \fBarray\fR of -positional argument \fBstrings\fR\|\. The last argument to any \fBnpm\.commands\.\fR function is a callback\. Some commands take other +positional argument \fBstrings\fR\|\. The last argument to any +\fBnpm\.commands\.\fR function is a callback\. Some commands take other optional arguments\. Read the source\. -. .P You cannot set configs individually for any single npm function at this time\. Since \fBnpm\fR is a singleton, any call to \fBnpm\.config\.set\fR will change the value for \fIall\fR npm commands in that process\. -. .P See \fB\|\./bin/npm\-cli\.js\fR for an example of pulling config values off of the command line arguments using nopt\. You may also want to check out \fBnpm help config\fR to learn about all the options you can set there\. -. -.SH "More Docs" +.SH More Docs +.P Check out the docs \fIhttps://www\.npmjs\.org/doc/\fR, especially the faq \fIhttps://www\.npmjs\.org/doc/faq\.html\fR\|\. -. .P You can use the \fBnpm help\fR command to read any of them\. -. .P -If you\'re a developer, and you want to use npm to publish your program, +If you're a developer, and you want to use npm to publish your program, you should read this \fIhttps://www\.npmjs\.org/doc/developers\.html\fR -. -.SH "Legal Stuff" +.SH Legal Stuff +.P "npm" and "The npm Registry" are owned by npm, Inc\. All rights reserved\. See the included LICENSE file for more details\. -. .P "Node\.js" and "node" are trademarks owned by Joyent, Inc\. -. .P Modules published on the npm registry are not officially endorsed by npm, Inc\. or the Node\.js project\. -. .P Data published to the npm registry is not part of npm itself, and is the sole property of the publisher\. While every effort is made to ensure accountability, there is absolutely no guarantee, warrantee, or assertion expressed or implied as to the quality, fitness for a specific purpose, or lack of malice in any given npm package\. -. .P If you have a complaint about a package in the public npm registry, and cannot resolve it with the package -owner \fIhttps://www\.npmjs\.org/doc/misc/npm\-disputes\.html\fR, please email \fIsupport@npmjs\.com\fR and explain the situation\. -. +owner \fIhttps://www\.npmjs\.org/doc/misc/npm\-disputes\.html\fR, please email +support@npmjs\.com and explain the situation\. .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\. -. -.SS "In plainer english" +.SS In plainer english +.P npm is the property of npm, Inc\. -. .P -If you publish something, it\'s yours, and you are solely accountable +If you publish something, it's yours, and you are solely accountable for it\. -. .P -If other people publish something, it\'s theirs\. -. +If other people publish something, it's theirs\. .P Users can publish Bad Stuff\. It will be removed promptly if reported\. But there is no vetting process for published modules, and you use them at your own risk\. Please inspect the source\. -. .P If you publish Bad Stuff, we may delete it from the registry, or even -ban your account in extreme cases\. So don\'t do that\. -. -.SH "BUGS" +ban your account in extreme cases\. So don't do that\. +.SH BUGS +.P When you find issues, please report them: -. -.IP "\(bu" 4 -web: \fIhttps://github\.com/npm/npm/issues\fR -. -.IP "\(bu" 4 -email: \fInpm\-@googlegroups\.com\fR -. -.IP "" 0 -. -.P -Be sure to include \fIall\fR of the output from the npm command that didn\'t work +.RS 0 +.IP \(bu 2 +web: +https://github\.com/npm/npm/issues +.IP \(bu 2 +email: +npm\-@googlegroups\.com + +.RE +.P +Be sure to include \fIall\fR of the output from the npm command that didn't work as expected\. The \fBnpm\-debug\.log\fR file is also helpful to provide\. -. .P You can also look for isaacs in #node\.js on irc://irc\.freenode\.net\. He will no doubt tell you to put the output in a gist or email\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help npm -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 faq -. -.IP "\(bu" 4 +.IP \(bu 2 npm help help -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 index -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index da1dcdbc3f..5db7ee28a7 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,63 +1,67 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-ADDUSER" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-adduser\fR \-\- Add a registry user account -. -.SH "SYNOPSIS" -. -.nf -npm adduser -. -.fi -. -.SH "DESCRIPTION" -Create or verify a user named \fB\fR in the npm registry, and -save the credentials to the \fB\|\.npmrc\fR file\. -. +\fBnpm-adduser\fR \- Add a registry user account +.SH SYNOPSIS +.P +.RS 2 +.EX +npm adduser [\-\-registry=url] [\-\-scope=@orgname] +.EE +.RE +.SH DESCRIPTION +.P +Create or verify a user named \fB\fR in the specified registry, and +save the credentials to the \fB\|\.npmrc\fR file\. If no registry is specified, +the default registry will be used (see npm help 7 \fBnpm\-config\fR)\. .P The username, password, and email are read in from prompts\. -. .P You may use this command to change your email address, but not username or password\. -. .P -To reset your password, go to \fIhttps://npmjs\.org/forgot\fR -. +To reset your password, go to https://www\.npmjs\.org/forgot .P You may use this command multiple times with the same user account to authorize on a new machine\. -. -.SH "CONFIGURATION" -. -.SS "registry" +.P +\fBnpm login\fR is an alias to \fBadduser\fR and behaves exactly the same way\. +.SH CONFIGURATION +.SS registry +.P Default: http://registry\.npmjs\.org/ -. .P -The base URL of the npm package registry\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +The base URL of the npm package registry\. If \fBscope\fR is also specified, +this registry will only be used for packages with that scope\. See npm help 7 \fBnpm\-scope\fR\|\. +.SS scope +.P +Default: none +.P +If specified, the user and login credentials given will be associated +with the specified scope\. See npm help 7 \fBnpm\-scope\fR\|\. You can use both at the same time, +e\.g\. +.P +.RS 2 +.EX +npm adduser \-\-registry=http://myregistry\.example\.com \-\-scope=@myco +.EE +.RE +.P +This will set a registry for the given scope and login or create a user for +that registry at the same time\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help owner -. -.IP "\(bu" 4 +.IP \(bu 2 npm help whoami -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index 548bb6ad34..b4963914e9 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,40 +1,30 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-BIN" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-bin\fR \-\- Display npm bin folder -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-bin\fR \- Display npm bin folder +.SH SYNOPSIS +.P +.RS 2 +.EX npm bin -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Print the folder where npm will install executables\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help prefix -. -.IP "\(bu" 4 +.IP \(bu 2 npm help root -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 328ac30451..67c0a6114b 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,78 +1,59 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-BUGS" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-bugs\fR \-\- Bugs for a package in a web browser maybe -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe +.SH SYNOPSIS +.P +.RS 2 +.EX npm bugs npm bugs (with no args in a package dir) -. -.fi -. -.SH "DESCRIPTION" -This command tries to guess at the likely location of a package\'s +.EE +.RE +.SH DESCRIPTION +.P +This command tries to guess at the likely location of a package's bug tracker URL, and then tries to open it using the \fB\-\-browser\fR config param\. If no package name is provided, it will search for a \fBpackage\.json\fR in the current folder and use the \fBname\fR property\. -. -.SH "CONFIGURATION" -. -.SS "browser" -. -.IP "\(bu" 4 +.SH CONFIGURATION +.SS browser +.RS 0 +.IP \(bu 2 Default: OS X: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg\-open"\fR -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P The browser that is called by the \fBnpm bugs\fR command to open websites\. -. -.SS "registry" -. -.IP "\(bu" 4 +.SS registry +.RS 0 +.IP \(bu 2 Default: https://registry\.npmjs\.org/ -. -.IP "\(bu" 4 +.IP \(bu 2 Type: url -. -.IP "" 0 -. + +.RE .P The base URL of the npm package registry\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help docs -. -.IP "\(bu" 4 +.IP \(bu 2 npm help view -. -.IP "\(bu" 4 +.IP \(bu 2 npm help publish -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1 index cc815b63b5..ed530b3860 100644 --- a/deps/npm/man/man1/npm-build.1 +++ b/deps/npm/man/man1/npm-build.1 @@ -1,43 +1,34 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-BUILD" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-build\fR \-\- Build a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-build\fR \- Build a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm build -. -.fi -. -.IP "\(bu" 4 +.EE +.RE +.RS 0 +.IP \(bu 2 \fB\fR: A folder containing a \fBpackage\.json\fR file in its root\. -. -.IP "" 0 -. -.SH "DESCRIPTION" + +.RE +.SH DESCRIPTION +.P This is the plumbing command called by \fBnpm link\fR and \fBnpm install\fR\|\. -. .P It should generally not be called directly\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help link -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 scripts -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1 index 5799f4b19d..7a8355d888 100644 --- a/deps/npm/man/man1/npm-bundle.1 +++ b/deps/npm/man/man1/npm-bundle.1 @@ -1,23 +1,17 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-BUNDLE" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-bundle\fR \-\- REMOVED -. -.SH "DESCRIPTION" +\fBnpm-bundle\fR \- REMOVED +.SH DESCRIPTION +.P The \fBnpm bundle\fR command has been removed in 1\.0, for the simple reason that it is no longer necessary, as the default behavior is now to install packages into the local space\. -. .P Just use \fBnpm install\fR now to do what \fBnpm bundle\fR used to do\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help install -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index 3977da0b1a..5a99d11a24 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,100 +1,86 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-CACHE" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-cache\fR \-\- Manipulates packages cache -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-cache\fR \- Manipulates packages cache +.SH SYNOPSIS +.P +.RS 2 +.EX npm cache add npm cache add npm cache add npm cache add @ + npm cache ls [] + npm cache clean [] -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Used to add, list, or clear the npm cache folder\. -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 add: Add the specified package to the local cache\. This command is primarily intended to be used internally by npm, but it can provide a way to add data to the local installation cache explicitly\. -. -.IP "\(bu" 4 +.IP \(bu 2 ls: Show the data in the cache\. Argument is a path to show in the cache -folder\. Works a bit like the \fBfind\fR program, but limited by the \fBdepth\fR config\. -. -.IP "\(bu" 4 +folder\. Works a bit like the \fBfind\fR program, but limited by the +\fBdepth\fR config\. +.IP \(bu 2 clean: Delete data out of the cache folder\. If an argument is provided, then it specifies a subpath to delete\. If no argument is provided, then the entire cache is cleared\. -. -.IP "" 0 -. -.SH "DETAILS" + +.RE +.SH DETAILS +.P npm stores cache data in the directory specified in \fBnpm config get cache\fR\|\. For each package that is added to the cache, three pieces of information are stored in \fB{cache}/{name}/{version}\fR: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 \|\.\.\./package/package\.json: The package\.json file, as npm sees it\. -. -.IP "\(bu" 4 +.IP \(bu 2 \|\.\.\./package\.tgz: The tarball for that version\. -. -.IP "" 0 -. + +.RE .P Additionally, whenever a registry request is made, a \fB\|\.cache\.json\fR file is placed at the corresponding URI, to store the ETag and the requested data\. This is stored in \fB{cache}/{hostname}/{path}/\.cache\.json\fR\|\. -. .P -Commands that make non\-essential registry requests (such as \fBsearch\fR and \fBview\fR, or the completion scripts) generally specify a minimum timeout\. +Commands that make non\-essential registry requests (such as \fBsearch\fR and +\fBview\fR, or the completion scripts) generally specify a minimum timeout\. If the \fB\|\.cache\.json\fR file is younger than the specified timeout, then they do not make an HTTP request to the registry\. -. -.SH "CONFIGURATION" -. -.SS "cache" +.SH CONFIGURATION +.SS cache +.P Default: \fB~/\.npm\fR on Posix, or \fB%AppData%/npm\-cache\fR on Windows\. -. .P The root cache folder\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help publish -. -.IP "\(bu" 4 +.IP \(bu 2 npm help pack -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index 2ae25687a6..bbd224f76c 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,47 +1,37 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-COMPLETION" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-completion\fR \-\- Tab Completion for npm -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-completion\fR \- Tab Completion for npm +.SH SYNOPSIS +.P +.RS 2 +.EX \|\. <(npm completion) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Enables tab\-completion in all npm commands\. -. .P The synopsis above loads the completions into your current shell\. Adding it to your ~/\.bashrc or ~/\.zshrc will make the completions available everywhere\. -. .P You may of course also pipe the output of npm completion to a file such as \fB/usr/local/etc/bash_completion\.d/npm\fR if you have a system that will read that file for you\. -. .P When \fBCOMP_CWORD\fR, \fBCOMP_LINE\fR, and \fBCOMP_POINT\fR are defined in the environment, \fBnpm completion\fR acts in "plumbing mode", and outputs completions based on the arguments\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 developers -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 faq -. -.IP "\(bu" 4 +.IP \(bu 2 npm help npm -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index 0b019c7c02..ca7d69d1ba 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,14 +1,10 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-CONFIG" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-config\fR \-\- Manage the npm configuration files -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-config\fR \- Manage the npm configuration files +.SH SYNOPSIS +.P +.RS 2 +.EX npm config set [\-\-global] npm config get npm config delete @@ -17,97 +13,83 @@ npm config edit npm c [set|get|delete|list] npm get npm set [\-\-global] -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P npm gets its config settings from the command line, environment variables, \fBnpmrc\fR files, and in some cases, the \fBpackage\.json\fR file\. -. .P See npm help 5 npmrc for more information about the npmrc files\. -. .P See npm help 7 \fBnpm\-config\fR for a more thorough discussion of the mechanisms involved\. -. .P The \fBnpm config\fR command can be used to update and edit the contents of the user and global npmrc files\. -. -.SH "Sub\-commands" +.SH Sub\-commands +.P Config supports the following sub\-commands: -. -.SS "set" -. -.nf +.SS set +.P +.RS 2 +.EX npm config set key value -. -.fi -. +.EE +.RE .P Sets the config key to the value\. -. .P If value is omitted, then it sets it to "true"\. -. -.SS "get" -. -.nf +.SS get +.P +.RS 2 +.EX npm config get key -. -.fi -. +.EE +.RE .P Echo the config value to stdout\. -. -.SS "list" -. -.nf +.SS list +.P +.RS 2 +.EX npm config list -. -.fi -. +.EE +.RE .P Show all the config settings\. -. -.SS "delete" -. -.nf +.SS delete +.P +.RS 2 +.EX npm config delete key -. -.fi -. +.EE +.RE .P Deletes the key from all configuration files\. -. -.SS "edit" -. -.nf +.SS edit +.P +.RS 2 +.EX npm config edit -. -.fi -. +.EE +.RE .P Opens the config file in an editor\. Use the \fB\-\-global\fR flag to edit the global config\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help npm -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index cdfa3520f6..58c01ca287 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,96 +1,74 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-DEDUPE" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-dedupe\fR \-\- Reduce duplication -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-dedupe\fR \- Reduce duplication +.SH SYNOPSIS +.P +.RS 2 +.EX npm dedupe [package names\.\.\.] npm ddp [package names\.\.\.] -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Searches the local package tree and attempts to simplify the overall structure by moving dependencies further up the tree, where they can be more effectively shared by multiple dependent packages\. -. .P For example, consider this dependency graph: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX a +\-\- b <\-\- depends on c@1\.0\.x | `\-\- c@1\.0\.3 `\-\- d <\-\- depends on c@~1\.0\.9 `\-\- c@1\.0\.10 -. -.fi -. -.IP "" 0 -. +.EE +.RE .P In this case, npm help \fBnpm\-dedupe\fR will transform the tree to: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX a +\-\- b +\-\- d `\-\- c@1\.0\.10 -. -.fi -. -.IP "" 0 -. +.EE +.RE .P -Because of the hierarchical nature of node\'s module lookup, b and d +Because of the hierarchical nature of node's module lookup, b and d will both get their dependency met by the single c package at the root level of the tree\. -. .P If a suitable version exists at the target location in the tree already, then it will be left untouched, but the other duplicates will be deleted\. -. .P If no suitable version can be found, then a warning is printed, and nothing is done\. -. .P If any arguments are supplied, then they are filters, and only the named packages will be touched\. -. .P Note that this operation transforms the dependency tree, and may result in packages getting updated versions, perhaps from the npm registry\. -. .P This feature is experimental, and may change in future versions\. -. .P The \fB\-\-tag\fR argument will apply to all of the affected dependencies\. If a tag with the given name exists, the tagged version is preferred over newer versions\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help ls -. -.IP "\(bu" 4 +.IP \(bu 2 npm help update -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index cc2d18ee52..3ff2f88e9c 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,48 +1,37 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-DEPRECATE" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-deprecate\fR \-\- Deprecate a version of a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-deprecate\fR \- Deprecate a version of a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm deprecate [@] -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This command will update the npm registry entry for a package, providing a deprecation warning to all who attempt to install it\. -. .P It works on version ranges as well as specific versions, so you can do something like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm deprecate my\-thing@"< 0\.2\.3" "critical bug fixed in v0\.2\.3" -. -.fi -. -.IP "" 0 -. +.EE +.RE .P -Note that you must be the package owner to deprecate something\. See the \fBowner\fR and \fBadduser\fR help topics\. -. +Note that you must be the package owner to deprecate something\. See the +\fBowner\fR and \fBadduser\fR help topics\. .P To un\-deprecate a package, specify an empty string (\fB""\fR) for the \fBmessage\fR argument\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help publish -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 registry -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index db3d4e768f..0a55953b0c 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,78 +1,60 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-DOCS" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-docs\fR \-\- Docs for a package in a web browser maybe -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-docs\fR \- Docs for a package in a web browser maybe +.SH SYNOPSIS +.P +.RS 2 +.EX npm docs [ [ \.\.\.]] npm docs (with no args in a package dir) npm home [ [ \.\.\.]] npm home (with no args in a package dir) -. -.fi -. -.SH "DESCRIPTION" -This command tries to guess at the likely location of a package\'s +.EE +.RE +.SH DESCRIPTION +.P +This command tries to guess at the likely location of a package's documentation URL, and then tries to open it using the \fB\-\-browser\fR config param\. You can pass multiple package names at once\. If no package name is provided, it will search for a \fBpackage\.json\fR in the current folder and use the \fBname\fR property\. -. -.SH "CONFIGURATION" -. -.SS "browser" -. -.IP "\(bu" 4 +.SH CONFIGURATION +.SS browser +.RS 0 +.IP \(bu 2 Default: OS X: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg\-open"\fR -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P The browser that is called by the \fBnpm docs\fR command to open websites\. -. -.SS "registry" -. -.IP "\(bu" 4 +.SS registry +.RS 0 +.IP \(bu 2 Default: https://registry\.npmjs\.org/ -. -.IP "\(bu" 4 +.IP \(bu 2 Type: url -. -.IP "" 0 -. + +.RE .P The base URL of the npm package registry\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help view -. -.IP "\(bu" 4 +.IP \(bu 2 npm help publish -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index 036d0715a4..d7f4056154 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,66 +1,50 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-EDIT" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-edit\fR \-\- Edit an installed package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-edit\fR \- Edit an installed package +.SH SYNOPSIS +.P +.RS 2 +.EX npm edit [@] -. -.fi -. -.SH "DESCRIPTION" -Opens the package folder in the default editor (or whatever you\'ve +.EE +.RE +.SH DESCRIPTION +.P +Opens the package folder in the default editor (or whatever you've configured as the npm \fBeditor\fR config \-\- see npm help 7 \fBnpm\-config\fR\|\.) -. .P After it has been edited, the package is rebuilt so as to pick up any changes in compiled packages\. -. .P For instance, you can do \fBnpm install connect\fR to install connect into your package, and then \fBnpm edit connect\fR to make a few changes to your locally installed copy\. -. -.SH "CONFIGURATION" -. -.SS "editor" -. -.IP "\(bu" 4 +.SH CONFIGURATION +.SS editor +.RS 0 +.IP \(bu 2 Default: \fBEDITOR\fR environment variable if set, or \fB"vi"\fR on Posix, or \fB"notepad"\fR on Windows\. -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. + +.RE .P The command to run for \fBnpm edit\fR or \fBnpm config edit\fR\|\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help explore -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index c7d570745c..01f91bff91 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,76 +1,57 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-EXPLORE" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-explore\fR \-\- Browse an installed package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-explore\fR \- Browse an installed package +.SH SYNOPSIS +.P +.RS 2 +.EX npm explore [ \-\- ] -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Spawn a subshell in the directory of the installed package specified\. -. .P If a command is specified, then it is run in the subshell, which then immediately terminates\. -. .P -This is particularly handy in the case of git submodules in the \fBnode_modules\fR folder: -. -.IP "" 4 -. -.nf +This is particularly handy in the case of git submodules in the +\fBnode_modules\fR folder: +.P +.RS 2 +.EX npm explore some\-dependency \-\- git pull origin master -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Note that the package is \fInot\fR automatically rebuilt afterwards, so be sure to use \fBnpm rebuild \fR if you make any changes\. -. -.SH "CONFIGURATION" -. -.SS "shell" -. -.IP "\(bu" 4 +.SH CONFIGURATION +.SS shell +.RS 0 +.IP \(bu 2 Default: SHELL environment variable, or "bash" on Posix, or "cmd" on Windows -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. + +.RE .P The shell to run for the \fBnpm explore\fR command\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help submodule -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help edit -. -.IP "\(bu" 4 +.IP \(bu 2 npm help rebuild -. -.IP "\(bu" 4 +.IP \(bu 2 npm help build -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index 37ba03c796..78864694ac 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,59 +1,45 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-HELP\-SEARCH" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-help-search\fR \-\- Search npm help documentation -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-help-search\fR \- Search npm help documentation +.SH SYNOPSIS +.P +.RS 2 +.EX npm help\-search some search terms -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This command will search the npm markdown documentation files for the terms provided, and then list the results, sorted by relevance\. -. .P If only one result is found, then it will show that help topic\. -. .P If the argument to \fBnpm help\fR is not a known help topic, then it will call \fBhelp\-search\fR\|\. It is rarely if ever necessary to call this command directly\. -. -.SH "CONFIGURATION" -. -.SS "long" -. -.IP "\(bu" 4 +.SH CONFIGURATION +.SS long +.RS 0 +.IP \(bu 2 Type: Boolean -. -.IP "\(bu" 4 +.IP \(bu 2 Default false -. -.IP "" 0 -. + +.RE .P If true, the "long" flag will cause help\-search to output context around where the terms were found in the documentation\. -. .P If false, then help\-search will just list out the help topics found\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help npm -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 faq -. -.IP "\(bu" 4 +.IP \(bu 2 npm help help -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index 7cc361f463..b0456ef22e 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,77 +1,57 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-HELP" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-help\fR \-\- Get help on npm -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-help\fR \- Get help on npm +.SH SYNOPSIS +.P +.RS 2 +.EX npm help npm help some search terms -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P If supplied a topic, then show the appropriate documentation page\. -. .P If the topic does not exist, or if multiple terms are provided, then run the \fBhelp\-search\fR command to find a match\. Note that, if \fBhelp\-search\fR finds a single subject, then it will run \fBhelp\fR on that topic, so unique matches are equivalent to specifying a topic name\. -. -.SH "CONFIGURATION" -. -.SS "viewer" -. -.IP "\(bu" 4 +.SH CONFIGURATION +.SS viewer +.RS 0 +.IP \(bu 2 Default: "man" on Posix, "browser" on Windows -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. + +.RE .P The program to use to view help content\. -. .P Set to \fB"browser"\fR to view html help content in the default web browser\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help npm -. -.IP "\(bu" 4 +.IP \(bu 2 README -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 faq -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 npm help help\-search -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 index -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 5091fdefd8..93e3845754 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,43 +1,33 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-INIT" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-init\fR \-\- Interactively create a package\.json file -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-init\fR \- Interactively create a package\.json file +.SH SYNOPSIS +.P +.RS 2 +.EX npm init -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This will ask you a bunch of questions, and then write a package\.json for you\. -. .P It attempts to make reasonable guesses about what you want things to be set to, -and then writes a package\.json file with the options you\'ve selected\. -. +and then writes a package\.json file with the options you've selected\. .P -If you already have a package\.json file, it\'ll read that first, and default to +If you already have a package\.json file, it'll read that first, and default to the options in there\. -. .P It is strictly additive, so it does not delete options from your package\.json without a really good reason to do so\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 -\fIhttps://github\.com/isaacs/init\-package\-json\fR -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +https://github\.com/isaacs/init\-package\-json +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 npm help version -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index 7e874f3490..ad6bdf55bb 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,335 +1,270 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-INSTALL" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-install\fR \-\- Install a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-install\fR \- Install a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm install (with no args in a package dir) npm install npm install npm install -npm install [\-\-save|\-\-save\-dev|\-\-save\-optional] [\-\-save\-exact] -npm install @ -npm install @ -npm install @ +npm install [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional] [\-\-save\-exact] +npm install [@/]@ +npm install [@/]@ +npm install [@/]@ npm i (with any of the previous argument usage) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This command installs a package, and any packages that it depends on\. If the package has a shrinkwrap file, the installation of dependencies will be driven by that\. See npm help shrinkwrap\. -. .P A \fBpackage\fR is: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 a) a folder containing a program described by a package\.json file -. -.IP "\(bu" 4 +.IP \(bu 2 b) a gzipped tarball containing (a) -. -.IP "\(bu" 4 +.IP \(bu 2 c) a url that resolves to (b) -. -.IP "\(bu" 4 +.IP \(bu 2 d) a \fB@\fR that is published on the registry (see npm help 7 \fBnpm\-registry\fR) with (c) -. -.IP "\(bu" 4 +.IP \(bu 2 e) a \fB@\fR that points to (d) -. -.IP "\(bu" 4 +.IP \(bu 2 f) a \fB\fR that has a "latest" tag satisfying (e) -. -.IP "\(bu" 4 +.IP \(bu 2 g) a \fB\fR that resolves to (b) -. -.IP "" 0 -. + +.RE .P Even if you never publish your package, you can still get a lot of benefits of using npm if you just want to write a node program (a), and perhaps if you also want to be able to easily install it elsewhere after packing it up into a tarball (b)\. -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 \fBnpm install\fR (in package directory, no arguments): -. -.IP -Install the dependencies in the local node_modules folder\. -. -.IP -In global mode (ie, with \fB\-g\fR or \fB\-\-global\fR appended to the command), -it installs the current package context (ie, the current working -directory) as a global package\. -. -.IP -By default, \fBnpm install\fR will install all modules listed as -dependencies\. With the \fB\-\-production\fR flag, -npm will not install modules listed in \fBdevDependencies\fR\|\. -. -.IP "\(bu" 4 + Install the dependencies in the local node_modules folder\. + In global mode (ie, with \fB\-g\fR or \fB\-\-global\fR appended to the command), + it installs the current package context (ie, the current working + directory) as a global package\. + By default, \fBnpm install\fR will install all modules listed as + dependencies\. With the \fB\-\-production\fR flag, + npm will not install modules listed in \fBdevDependencies\fR\|\. +.IP \(bu 2 \fBnpm install \fR: -. -.IP -Install a package that is sitting in a folder on the filesystem\. -. -.IP "\(bu" 4 + Install a package that is sitting in a folder on the filesystem\. +.IP \(bu 2 \fBnpm install \fR: -. -.IP -Install a package that is sitting on the filesystem\. Note: if you just want -to link a dev directory into your npm root, you can do this more easily by -using \fBnpm link\fR\|\. -. -.IP -Example: -. -.IP "" 4 -. -.nf - npm install \./package\.tgz -. -.fi -. -.IP "" 0 - -. -.IP "\(bu" 4 + Install a package that is sitting on the filesystem\. Note: if you just want + to link a dev directory into your npm root, you can do this more easily by + using \fBnpm link\fR\|\. + Example: +.P +.RS 2 +.EX + npm install \./package\.tgz +.EE +.RE +.IP \(bu 2 \fBnpm install \fR: -. -.IP -Fetch the tarball url, and then install it\. In order to distinguish between -this and other options, the argument must start with "http://" or "https://" -. -.IP -Example: -. -.IP "" 4 -. -.nf - npm install https://github\.com/indexzero/forever/tarball/v0\.5\.6 -. -.fi -. -.IP "" 0 - -. -.IP "\(bu" 4 -\fBnpm install [\-\-save|\-\-save\-dev|\-\-save\-optional]\fR: -. -.IP -Do a \fB@\fR install, where \fB\fR is the "tag" config\. (See npm help 7 \fBnpm\-config\fR\|\.) -. -.IP -In most cases, this will install the latest version -of the module published on npm\. -. -.IP -Example: -. -.IP - npm install sax -. -.IP -\fBnpm install\fR takes 3 exclusive, optional flags which save or update -the package version in your main package\.json: -. -.IP "\(bu" 4 + Fetch the tarball url, and then install it\. In order to distinguish between + this and other options, the argument must start with "http://" or "https://" + Example: +.P +.RS 2 +.EX + npm install https://github\.com/indexzero/forever/tarball/v0\.5\.6 +.EE +.RE +.IP \(bu 2 +\fBnpm install [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional]\fR: + Do a \fB@\fR install, where \fB\fR is the "tag" config\. (See + npm help 7 \fBnpm\-config\fR\|\.) + In most cases, this will install the latest version + of the module published on npm\. + Example: +.P +.RS 2 +.EX + npm install sax +.EE +.RE + \fBnpm install\fR takes 3 exclusive, optional flags which save or update + the package version in your main package\.json: +.RS 0 +.IP \(bu 2 \fB\-\-save\fR: Package will appear in your \fBdependencies\fR\|\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-\-save\-dev\fR: Package will appear in your \fBdevDependencies\fR\|\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-\-save\-optional\fR: Package will appear in your \fBoptionalDependencies\fR\|\. -. -.IP When using any of the above options to save dependencies to your package\.json, there is an additional, optional flag: -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-\-save\-exact\fR: Saved dependencies will be configured with an -exact version rather than using npm\'s default semver range +exact version rather than using npm's default semver range operator\. -. -.IP +\fB\fR is optional\. The package will be downloaded from the registry +associated with the specified scope\. If no registry is associated with +the given scope the default registry is assumed\. See npm help 7 \fBnpm\-scope\fR\|\. +Note: if you do not include the @\-symbol on your scope name, npm will +interpret this as a GitHub repository instead, see below\. Scopes names +must also be followed by a slash\. Examples: -. -.IP - npm install sax \-\-save - npm install node\-tap \-\-save\-dev - npm install dtrace\-provider \-\-save\-optional - npm install readable\-stream \-\-save \-\-save\-exact -. -.IP -\fBNote\fR: If there is a file or folder named \fB\fR in the current -working directory, then it will try to install that, and only try to -fetch the package by name if it is not valid\. -. -.IP "" 0 - -. -.IP "\(bu" 4 -\fBnpm install @\fR: -. -.IP -Install the version of the package that is referenced by the specified tag\. -If the tag does not exist in the registry data for that package, then this -will fail\. -. -.IP -Example: -. -.IP "" 4 -. -.nf - npm install sax@latest -. -.fi -. -.IP "" 0 +.P +.RS 2 +.EX +npm install sax \-\-save +npm install githubname/reponame +npm install @myorg/privatepackage +npm install node\-tap \-\-save\-dev +npm install dtrace\-provider \-\-save\-optional +npm install readable\-stream \-\-save \-\-save\-exact +.EE +.RE -. -.IP "\(bu" 4 -\fBnpm install @\fR: -. -.IP -Install the specified version of the package\. This will fail if the version -has not been published to the registry\. -. -.IP -Example: -. -.IP "" 4 -. -.nf - npm install sax@0\.1\.1 -. -.fi -. -.IP "" 0 +.RE -. -.IP "\(bu" 4 -\fBnpm install @\fR: -. -.IP -Install a version of the package matching the specified version range\. This -will follow the same rules for resolving dependencies described in npm help 5 \fBpackage\.json\fR\|\. -. -.IP -Note that most version ranges must be put in quotes so that your shell will -treat it as a single argument\. -. -.IP -Example: -. -.IP - npm install sax@">=0\.1\.0 <0\.2\.0" -. -.IP "\(bu" 4 +.RE +.P +.RS 2 +.EX +**Note**: If there is a file or folder named `` in the current +working directory, then it will try to install that, and only try to +fetch the package by name if it is not valid\. +.EE +.RE +.RS 0 +.IP \(bu 2 +\fBnpm install [@/]@\fR: + Install the version of the package that is referenced by the specified tag\. + If the tag does not exist in the registry data for that package, then this + will fail\. + Example: +.P +.RS 2 +.EX + npm install sax@latest + npm install @myorg/mypackage@latest +.EE +.RE +.IP \(bu 2 +\fBnpm install [@/]@\fR: + Install the specified version of the package\. This will fail if the + version has not been published to the registry\. + Example: +.P +.RS 2 +.EX + npm install sax@0\.1\.1 + npm install @myorg/privatepackage@1\.5\.0 +.EE +.RE +.IP \(bu 2 +\fBnpm install [@/]@\fR: + Install a version of the package matching the specified version range\. This + will follow the same rules for resolving dependencies described in npm help 5 \fBpackage\.json\fR\|\. + Note that most version ranges must be put in quotes so that your shell will + treat it as a single argument\. + Example: +.P +.RS 2 +.EX + npm install sax@">=0\.1\.0 <0\.2\.0" + npm install @myorg/privatepackage@">=0\.1\.0 <0\.2\.0" +.EE +.RE +.IP \(bu 2 +\fBnpm install /\fR: + Install the package at \fBhttps://github\.com/githubname/githubrepo" by + attempting to clone it using\fRgit`\. + Example: +.P +.RS 2 +.EX + npm install mygithubuser/myproject +.EE +.RE + To reference a package in a git repo that is not on GitHub, see git + remote urls below\. +.IP \(bu 2 \fBnpm install \fR: -. -.IP -Install a package by cloning a git remote url\. The format of the git -url is: -. -.IP - ://[@][#] -. -.IP -\fB\fR is one of \fBgit\fR, \fBgit+ssh\fR, \fBgit+http\fR, or \fBgit+https\fR\|\. If no \fB\fR is specified, then \fBmaster\fR is -used\. -. -.IP -Examples: -. -.IP "" 4 -. -.nf - git+ssh://git@github\.com:npm/npm\.git#v1\.0\.27 - git+https://isaacs@github\.com/npm/npm\.git - git://github\.com/npm/npm\.git#v1\.0\.27 -. -.fi -. -.IP "" 0 + Install a package by cloning a git remote url\. The format of the git + url is: +.P +.RS 2 +.EX + ://[@][#] +.EE +.RE + \fB\fR is one of \fBgit\fR, \fBgit+ssh\fR, \fBgit+http\fR, or + \fBgit+https\fR\|\. If no \fB\fR is specified, then \fBmaster\fR is + used\. + Examples: +.P +.RS 2 +.EX + git+ssh://git@github\.com:npm/npm\.git#v1\.0\.27 + git+https://isaacs@github\.com/npm/npm\.git + git://github\.com/npm/npm\.git#v1\.0\.27 +.EE +.RE -. -.IP "" 0 -. +.RE .P You may combine multiple arguments, and even multiple types of arguments\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm install sax@">=0\.1\.0 <0\.2\.0" bench supervisor -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The \fB\-\-tag\fR argument will apply to all of the specified install targets\. If a tag with the given name exists, the tagged version is preferred over newer versions\. -. .P The \fB\-\-force\fR argument will force npm to fetch remote resources even if a local copy exists on disk\. -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm install sax \-\-force -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The \fB\-\-global\fR argument will cause npm to install the package globally rather than locally\. See npm help 5 \fBnpm\-folders\fR\|\. -. .P The \fB\-\-link\fR argument will cause npm to link global installs into the local space in some cases\. -. .P The \fB\-\-no\-bin\-links\fR argument will prevent npm from creating symlinks for any binaries the package might contain\. -. .P The \fB\-\-no\-optional\fR argument will prevent optional dependencies from being installed\. -. .P The \fB\-\-no\-shrinkwrap\fR argument, which will ignore an available shrinkwrap file and use the package\.json instead\. -. .P The \fB\-\-nodedir=/path/to/node/source\fR argument will allow npm to find the node source code so that npm can compile native modules\. -. .P See npm help 7 \fBnpm\-config\fR\|\. Many of the configuration params have some -effect on installation, since that\'s most of what npm does\. -. -.SH "ALGORITHM" +effect on installation, since that's most of what npm does\. +.SH ALGORITHM +.P To install a package, npm uses the following algorithm: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX install(where, what, family, ancestors) fetch what, unpack to /node_modules/ for each dep in what\.dependencies @@ -339,103 +274,78 @@ for each dep@version in what\.dependencies and not in add precise version deps to install(/node_modules/, dep, family) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P For this \fBpackage{dep}\fR structure: \fBA{B,C}, B{C}, C{D}\fR, this algorithm produces: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX A +\-\- B `\-\- C `\-\- D -. -.fi -. -.IP "" 0 -. +.EE +.RE .P That is, the dependency from B to C is satisfied by the fact that A already caused C to be installed at a higher level\. -. .P See npm help 5 folders for a more detailed description of the specific folder structures that npm creates\. -. -.SS "Limitations of npm's Install Algorithm" +.SS Limitations of npm's Install Algorithm +.P There are some very rare and pathological edge\-cases where a cycle can cause npm to try to install a never\-ending tree of packages\. Here is the simplest case: -. -.IP "" 4 -. -.nf -A \-> B \-> A\' \-> B\' \-> A \-> B \-> A\' \-> B\' \-> A \-> \.\.\. -. -.fi -. -.IP "" 0 -. -.P -where \fBA\fR is some version of a package, and \fBA\'\fR is a different version +.P +.RS 2 +.EX +A \-> B \-> A' \-> B' \-> A \-> B \-> A' \-> B' \-> A \-> \.\.\. +.EE +.RE +.P +where \fBA\fR is some version of a package, and \fBA'\fR is a different version of the same package\. Because \fBB\fR depends on a different version of \fBA\fR than the one that is already in the tree, it must install a separate -copy\. The same is true of \fBA\'\fR, which must install \fBB\'\fR\|\. Because \fBB\'\fR +copy\. The same is true of \fBA'\fR, which must install \fBB'\fR\|\. Because \fBB'\fR depends on the original version of \fBA\fR, which has been overridden, the cycle falls into infinite regress\. -. .P -To avoid this situation, npm flat\-out refuses to install any \fBname@version\fR that is already present anywhere in the tree of package +To avoid this situation, npm flat\-out refuses to install any +\fBname@version\fR that is already present anywhere in the tree of package folder ancestors\. A more correct, but more complex, solution would be to symlink the existing version into the new location\. If this ever affects a real use\-case, it will be investigated\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help update -. -.IP "\(bu" 4 +.IP \(bu 2 npm help link -. -.IP "\(bu" 4 +.IP \(bu 2 npm help rebuild -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 scripts -. -.IP "\(bu" 4 +.IP \(bu 2 npm help build -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help tag -. -.IP "\(bu" 4 +.IP \(bu 2 npm help rm -. -.IP "\(bu" 4 +.IP \(bu 2 npm help shrinkwrap -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 15d45e4e07..11ef2dca14 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,119 +1,100 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-LINK" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-link\fR \-\- Symlink a package folder -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-link\fR \- Symlink a package folder +.SH SYNOPSIS +.P +.RS 2 +.EX npm link (in package folder) -npm link +npm link [@/] npm ln (with any of the previous argument usage) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Package linking is a two\-step process\. -. .P First, \fBnpm link\fR in a package folder will create a globally\-installed -symbolic link from \fBprefix/package\-name\fR to the current folder\. -. +symbolic link from \fBprefix/package\-name\fR to the current folder (see +npm help 7 \fBnpm\-config\fR for the value of \fBprefix\fR)\. .P Next, in some other location, \fBnpm link package\-name\fR will create a symlink from the local \fBnode_modules\fR folder to the global symlink\. -. .P Note that \fBpackage\-name\fR is taken from \fBpackage\.json\fR, not from directory name\. -. +.P +The package name can be optionally prefixed with a scope\. See npm help 7 \fBnpm\-scope\fR\|\. +The scope must by preceded by an @\-symbol and followed by a slash\. .P When creating tarballs for \fBnpm publish\fR, the linked packages are "snapshotted" to their current state by resolving the symbolic links\. -. .P -This is -handy for installing your own stuff, so that you can work on it and test it -iteratively without having to continually rebuild\. -. +This is handy for installing your own stuff, so that you can work on it and +test it iteratively without having to continually rebuild\. .P For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX cd ~/projects/node\-redis # go into the package directory npm link # creates global link cd ~/projects/node\-bloggy # go into some other package directory\. npm link redis # link\-install the package -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Now, any changes to ~/projects/node\-redis will be reflected in ~/projects/node\-bloggy/node_modules/redis/ -. .P You may also shortcut the two steps in one\. For example, to do the above use\-case in a shorter way: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX cd ~/projects/node\-bloggy # go into the dir of your main project npm link \.\./node\-redis # link the dir of your dependency -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The second line is the equivalent of doing: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX (cd \.\./node\-redis; npm link) npm link redis -. -.fi -. -.IP "" 0 -. +.EE +.RE .P That is, it first creates a global link, and then links the global -installation target into your project\'s \fBnode_modules\fR folder\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +installation target into your project's \fBnode_modules\fR folder\. +.P +If your linked package is scoped (see npm help 7 \fBnpm\-scope\fR) your link command must +include that scope, e\.g\. +.P +.RS 2 +.EX +npm link @myorg/privatepackage +.EE +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 developers -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 faq -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index 1584fb0f28..64db5a46eb 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,146 +1,111 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-LS" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-ls\fR \-\- List installed packages -. -.SH "SYNOPSIS" -. -.nf -npm list [ \.\.\.] -npm ls [ \.\.\.] -npm la [ \.\.\.] -npm ll [ \.\.\.] -. -.fi -. -.SH "DESCRIPTION" +\fBnpm-ls\fR \- List installed packages +.SH SYNOPSIS +.P +.RS 2 +.EX +npm list [[@/] \.\.\.] +npm ls [[@/] \.\.\.] +npm la [[@/] \.\.\.] +npm ll [[@/] \.\.\.] +.EE +.RE +.SH DESCRIPTION +.P This command will print to stdout all the versions of packages that are installed, as well as their dependencies, in a tree\-structure\. -. .P Positional arguments are \fBname@version\-range\fR identifiers, which will limit the results to only the paths to the packages named\. Note that nested packages will \fIalso\fR show the paths to the specified packages\. -For example, running \fBnpm ls promzard\fR in npm\'s source tree will show: -. -.IP "" 4 -. -.nf -npm@1.4.28 /path/to/npm +For example, running \fBnpm ls promzard\fR in npm's source tree will show: +.P +.RS 2 +.EX +npm@2.0.0 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 -. -.fi -. -.IP "" 0 -. +.EE +.RE .P It will print out extraneous, missing, and invalid packages\. -. .P If a project specifies git urls for dependencies these are shown in parentheses after the name@version to make it easier for users to recognize potential forks of a project\. -. .P When run as \fBll\fR or \fBla\fR, it shows extended information by default\. -. -.SH "CONFIGURATION" -. -.SS "json" -. -.IP "\(bu" 4 +.SH CONFIGURATION +.SS json +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Show information in JSON format\. -. -.SS "long" -. -.IP "\(bu" 4 +.SS long +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Show extended information\. -. -.SS "parseable" -. -.IP "\(bu" 4 +.SS parseable +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Show parseable output instead of tree view\. -. -.SS "global" -. -.IP "\(bu" 4 +.SS global +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P List packages in the global install prefix instead of in the current project\. -. -.SS "depth" -. -.IP "\(bu" 4 +.SS depth +.RS 0 +.IP \(bu 2 Type: Int -. -.IP "" 0 -. + +.RE .P Max display depth of the dependency tree\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help link -. -.IP "\(bu" 4 +.IP \(bu 2 npm help prune -. -.IP "\(bu" 4 +.IP \(bu 2 npm help outdated -. -.IP "\(bu" 4 +.IP \(bu 2 npm help update -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 7376fcd24a..589bd6d527 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,102 +1,79 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-OUTDATED" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-outdated\fR \-\- Check for outdated packages -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-outdated\fR \- Check for outdated packages +.SH SYNOPSIS +.P +.RS 2 +.EX npm outdated [ [ \.\.\.]] -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This command will check the registry to see if any (or, specific) installed packages are currently outdated\. -. .P -The resulting field \'wanted\' shows the latest version according to the -version specified in the package\.json, the field \'latest\' the very latest +The resulting field 'wanted' shows the latest version according to the +version specified in the package\.json, the field 'latest' the very latest version of the package\. -. -.SH "CONFIGURATION" -. -.SS "json" -. -.IP "\(bu" 4 +.SH CONFIGURATION +.SS json +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Show information in JSON format\. -. -.SS "long" -. -.IP "\(bu" 4 +.SS long +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Show extended information\. -. -.SS "parseable" -. -.IP "\(bu" 4 +.SS parseable +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Show parseable output instead of tree view\. -. -.SS "global" -. -.IP "\(bu" 4 +.SS global +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Check packages in the global install prefix instead of in the current project\. -. -.SS "depth" -. -.IP "\(bu" 4 +.SS depth +.RS 0 +.IP \(bu 2 Type: Int -. -.IP "" 0 -. + +.RE .P Max depth for checking dependency tree\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help update -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 folders -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index f204431e5d..c073a8b873 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,58 +1,47 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-OWNER" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-owner\fR \-\- Manage package owners -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-owner\fR \- Manage package owners +.SH SYNOPSIS +.P +.RS 2 +.EX npm owner ls npm owner add npm owner rm -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Manage ownership of published packages\. -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 ls: List all the users who have access to modify a package and push new versions\. Handy when you need to know who to bug for help\. -. -.IP "\(bu" 4 +.IP \(bu 2 add: Add a new user as a maintainer of a package\. This user is enabled to modify metadata, publish new versions, and add other owners\. -. -.IP "\(bu" 4 +.IP \(bu 2 rm: Remove a user from the package owner list\. This immediately revokes their privileges\. -. -.IP "" 0 -. + +.RE .P Note that there is only one level of access\. Either you can modify a package, -or you can\'t\. Future versions may contain more fine\-grained access levels, but +or you can't\. Future versions may contain more fine\-grained access levels, but that is not implemented at this time\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help publish -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help adduser -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 disputes -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index 951d209adb..e90f3789bd 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,48 +1,37 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-PACK" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-pack\fR \-\- Create a tarball from a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-pack\fR \- Create a tarball from a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm pack [ [ \.\.\.]] -. -.fi -. -.SH "DESCRIPTION" -For anything that\'s installable (that is, a package folder, tarball, +.EE +.RE +.SH DESCRIPTION +.P +For anything that's installable (that is, a package folder, tarball, tarball url, name@tag, name@version, or name), this command will fetch it to the cache, and then copy the tarball to the current working directory as \fB\-\.tgz\fR, and then write the filenames out to stdout\. -. .P If the same package is specified multiple times, then the file will be overwritten the second time\. -. .P If no arguments are supplied, then npm packs the current package folder\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help cache -. -.IP "\(bu" 4 +.IP \(bu 2 npm help publish -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index 9cc3f7cadd..373f5e4abe 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,40 +1,34 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-PREFIX" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-prefix\fR \-\- Display prefix -. -.SH "SYNOPSIS" -. -.nf -npm prefix -. -.fi -. -.SH "DESCRIPTION" -Print the prefix to standard out\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +\fBnpm-prefix\fR \- Display prefix +.SH SYNOPSIS +.P +.RS 2 +.EX +npm prefix [\-g] +.EE +.RE +.SH DESCRIPTION +.P +Print the local prefix to standard out\. This is the closest parent directory +to contain a package\.json file unless \fB\-g\fR is also specified\. +.P +If \fB\-g\fR is specified, this will be the value of the global prefix\. See +npm help 7 \fBnpm\-config\fR for more detail\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help root -. -.IP "\(bu" 4 +.IP \(bu 2 npm help bin -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index 71bb77c407..3c8a66a7fc 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,42 +1,33 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-PRUNE" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-prune\fR \-\- Remove extraneous packages -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-prune\fR \- Remove extraneous packages +.SH SYNOPSIS +.P +.RS 2 +.EX npm prune [ [ [ [\-\-tag ] npm publish [\-\-tag ] -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Publishes a package to the registry so that it can be installed by name\. -. -.IP "\(bu" 4 +.P +By default npm will publish to the public registry\. This can be overridden by +specifying a different default registry or using a npm help 7 \fBnpm\-scope\fR in the name +(see npm help 5 \fBpackage\.json\fR)\. +.RS 0 +.IP \(bu 2 \fB\fR: A folder containing a package\.json file -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\fR: A url or file path to a gzipped tar archive containing a single folder with a package\.json file inside\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fB[\-\-tag ]\fR Registers the published package with the given tag, such that \fBnpm install @\fR will install this version\. By default, \fBnpm publish\fR updates and \fBnpm install\fR installs the \fBlatest\fR tag\. -. -.IP "" 0 -. + +.RE .P Fails if the package name and version combination already exists in -the registry\. -. +the specified registry\. .P Once a package is published with a given name and version, that specific name and version combination can never be used again, even if it is removed with npm help unpublish\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help adduser -. -.IP "\(bu" 4 +.IP \(bu 2 npm help owner -. -.IP "\(bu" 4 +.IP \(bu 2 npm help deprecate -. -.IP "\(bu" 4 +.IP \(bu 2 npm help tag -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index 4130eb773f..f8d52a9a1a 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,37 +1,31 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-REBUILD" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-rebuild\fR \-\- Rebuild a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-rebuild\fR \- Rebuild a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm rebuild [ [ \.\.\.]] npm rb [ [ \.\.\.]] -. -.fi -. -.IP "\(bu" 4 +.EE +.RE +.RS 0 +.IP \(bu 2 \fB\fR: The package to rebuild -. -.IP "" 0 -. -.SH "DESCRIPTION" + +.RE +.SH DESCRIPTION +.P This command runs the \fBnpm build\fR command on the matched folders\. This is useful when you install a new version of node, and must recompile all your C++ addons with the new binary\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help build -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 557a3566ea..57c48fb3f5 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,47 +1,37 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-REPO" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-repo\fR \-\- Open package repository page in the browser -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-repo\fR \- Open package repository page in the browser +.SH SYNOPSIS +.P +.RS 2 +.EX npm repo npm repo (with no args in a package dir) -. -.fi -. -.SH "DESCRIPTION" -This command tries to guess at the likely location of a package\'s +.EE +.RE +.SH DESCRIPTION +.P +This command tries to guess at the likely location of a package's repository URL, and then tries to open it using the \fB\-\-browser\fR config param\. If no package name is provided, it will search for a \fBpackage\.json\fR in the current folder and use the \fBname\fR property\. -. -.SH "CONFIGURATION" -. -.SS "browser" -. -.IP "\(bu" 4 +.SH CONFIGURATION +.SS browser +.RS 0 +.IP \(bu 2 Default: OS X: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg\-open"\fR -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P The browser that is called by the \fBnpm repo\fR command to open websites\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help docs -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index 828a43f30f..a4f95db758 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,42 +1,32 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-RESTART" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-restart\fR \-\- Start a package -. -.SH "SYNOPSIS" -. -.nf -npm restart -. -.fi -. -.SH "DESCRIPTION" -This runs a package\'s "restart" script, if one was provided\. -Otherwise it runs package\'s "stop" script, if one was provided, and then +\fBnpm-restart\fR \- Start a package +.SH SYNOPSIS +.P +.RS 2 +.EX +npm restart [\-\- ] +.EE +.RE +.SH DESCRIPTION +.P +This runs a package's "restart" script, if one was provided\. +Otherwise it runs package's "stop" script, if one was provided, and then the "start" script\. -. .P If no version is specified, then it restarts the "active" version\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help run\-script -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 scripts -. -.IP "\(bu" 4 +.IP \(bu 2 npm help test -. -.IP "\(bu" 4 +.IP \(bu 2 npm help start -. -.IP "\(bu" 4 +.IP \(bu 2 npm help stop -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-rm.1 b/deps/npm/man/man1/npm-rm.1 index 424314c7d5..e9df0ff14f 100644 --- a/deps/npm/man/man1/npm-rm.1 +++ b/deps/npm/man/man1/npm-rm.1 @@ -1,44 +1,34 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-RM" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-rm\fR \-\- Remove a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-rm\fR \- Remove a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm rm npm r npm uninstall npm un -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This uninstalls a package, completely removing everything npm installed on its behalf\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help prune -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index 463eeaf934..b80a8550e4 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,40 +1,30 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-ROOT" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-root\fR \-\- Display npm root -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-root\fR \- Display npm root +.SH SYNOPSIS +.P +.RS 2 +.EX npm root -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Print the effective \fBnode_modules\fR folder to standard out\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help prefix -. -.IP "\(bu" 4 +.IP \(bu 2 npm help bin -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index aa2740c119..7ee4fc7912 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,45 +1,35 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-RUN\-SCRIPT" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-run-script\fR \-\- Run arbitrary package scripts -. -.SH "SYNOPSIS" -. -.nf -npm run\-script [] [command] -npm run [] [command] -. -.fi -. -.SH "DESCRIPTION" -This runs an arbitrary command from a package\'s \fB"scripts"\fR object\. +\fBnpm-run-script\fR \- Run arbitrary package scripts +.SH SYNOPSIS +.P +.RS 2 +.EX +npm run\-script [command] [\-\- ] +npm run [command] [\-\- ] +.EE +.RE +.SH DESCRIPTION +.P +This runs an arbitrary command from a package's \fB"scripts"\fR object\. If no package name is provided, it will search for a \fBpackage\.json\fR in the current folder and use its \fB"scripts"\fR object\. If no \fB"command"\fR is provided, it will list the available top level scripts\. -. .P It is used by the test, start, restart, and stop commands, but can be called directly, as well\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 scripts -. -.IP "\(bu" 4 +.IP \(bu 2 npm help test -. -.IP "\(bu" 4 +.IP \(bu 2 npm help start -. -.IP "\(bu" 4 +.IP \(bu 2 npm help restart -. -.IP "\(bu" 4 +.IP \(bu 2 npm help stop -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index 2c7edcd2ad..16b3fa4fff 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,62 +1,48 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-SEARCH" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-search\fR \-\- Search for packages -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-search\fR \- Search for packages +.SH SYNOPSIS +.P +.RS 2 +.EX npm search [\-\-long] [search terms \.\.\.] npm s [search terms \.\.\.] npm se [search terms \.\.\.] -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Search the registry for packages matching the search terms\. -. .P -If a term starts with \fB/\fR, then it\'s interpreted as a regular expression\. +If a term starts with \fB/\fR, then it's interpreted as a regular expression\. A trailing \fB/\fR will be ignored in this case\. (Note that many regular expression characters must be escaped or quoted in most shells\.) -. -.SH "CONFIGURATION" -. -.SS "long" -. -.IP "\(bu" 4 +.SH CONFIGURATION +.SS long +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Display full package descriptions and other long text across multiple lines\. When disabled (default) search results are truncated to fit neatly on a single line\. Modules with extremely long names will fall on multiple lines\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help view -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index 2a053a5b0b..e154851b21 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,44 +1,37 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-SHRINKWRAP" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-shrinkwrap\fR \-\- Lock down dependency versions -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-shrinkwrap\fR \- Lock down dependency versions +.SH SYNOPSIS +.P +.RS 2 +.EX npm shrinkwrap -. -.fi -. -.SH "DESCRIPTION" -This command locks down the versions of a package\'s dependencies so +.EE +.RE +.SH DESCRIPTION +.P +This command locks down the versions of a package's dependencies so that you can control exactly which versions of each dependency will be used when your package is installed\. The "package\.json" file is still required if you want to use "npm install"\. -. .P -By default, "npm install" recursively installs the target\'s +By default, "npm install" recursively installs the target's dependencies (as specified in package\.json), choosing the latest -available version that satisfies the dependency\'s semver pattern\. In +available version that satisfies the dependency's semver pattern\. In some situations, particularly when shipping software where each change -is tightly managed, it\'s desirable to fully specify each version of +is tightly managed, it's desirable to fully specify each version of each dependency recursively so that subsequent builds and deploys do not inadvertently pick up newer versions of a dependency that satisfy the semver pattern\. Specifying specific semver patterns in each -dependency\'s package\.json would facilitate this, but that\'s not always +dependency's package\.json would facilitate this, but that's not always possible or desirable, as when another author owns the npm package\. -It\'s also possible to check dependencies directly into source control, +It's also possible to check dependencies directly into source control, but that may be undesirable for other reasons\. -. .P As an example, consider package A: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "A", "version": "0\.1\.0", @@ -46,17 +39,13 @@ As an example, consider package A: "B": "<0\.1\.0" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P package B: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "B", "version": "0\.0\.1", @@ -64,83 +53,62 @@ package B: "C": "<0\.1\.0" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P and package C: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "C, "version": "0\.0\.1" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P If these are the only versions of A, B, and C available in the registry, then a normal "npm install A" will install: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX A@0\.1\.0 `\-\- B@0\.0\.1 `\-\- C@0\.0\.1 -. -.fi -. -.IP "" 0 -. +.EE +.RE .P However, if B@0\.0\.2 is published, then a fresh "npm install A" will install: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX A@0\.1\.0 `\-\- B@0\.0\.2 `\-\- C@0\.0\.1 -. -.fi -. -.IP "" 0 -. +.EE +.RE .P -assuming the new version did not modify B\'s dependencies\. Of course, +assuming the new version did not modify B's dependencies\. Of course, the new version of B could include a new version of C and any number of new dependencies\. If such changes are undesirable, the author of A -could specify a dependency on B@0\.0\.1\. However, if A\'s author and B\'s -author are not the same person, there\'s no way for A\'s author to say +could specify a dependency on B@0\.0\.1\. However, if A's author and B's +author are not the same person, there's no way for A's author to say that he or she does not want to pull in newly published versions of C -when B hasn\'t changed at all\. -. +when B hasn't changed at all\. +.P +In this case, A's author can run .P -In this case, A\'s author can run -. -.IP "" 4 -. -.nf +.RS 2 +.EX npm shrinkwrap -. -.fi -. -.IP "" 0 -. +.EE +.RE .P This generates npm\-shrinkwrap\.json, which will look something like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "A", "version": "0\.1\.0", @@ -155,79 +123,68 @@ This generates npm\-shrinkwrap\.json, which will look something like this: } } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The shrinkwrap command has locked down the dependencies based on -what\'s currently installed in node_modules\. When "npm install" +what's currently installed in node_modules\. When "npm install" installs a package with a npm\-shrinkwrap\.json file in the package root, the shrinkwrap file (rather than package\.json files) completely drives the installation of that package and all of its dependencies (recursively)\. So now the author publishes A@0\.1\.0, and subsequent installs of this package will use B@0\.0\.1 and C@0\.1\.0, regardless the -dependencies and versions listed in A\'s, B\'s, and C\'s package\.json +dependencies and versions listed in A's, B's, and C's package\.json files\. -. -.SS "Using shrinkwrapped packages" +.SS Using shrinkwrapped packages +.P Using a shrinkwrapped package is no different than using any other package: you can "npm install" it by hand, or add a dependency to your package\.json file and "npm install" it\. -. -.SS "Building shrinkwrapped packages" +.SS Building shrinkwrapped packages +.P To shrinkwrap an existing package: -. -.IP "1" 4 +.RS 0 +.IP 1. 3 Run "npm install" in the package root to install the current versions of all dependencies\. -. -.IP "2" 4 +.IP 2. 3 Validate that the package works as expected with these versions\. -. -.IP "3" 4 +.IP 3. 3 Run "npm shrinkwrap", add npm\-shrinkwrap\.json to git, and publish your package\. -. -.IP "" 0 -. + +.RE .P To add or update a dependency in a shrinkwrapped package: -. -.IP "1" 4 +.RS 0 +.IP 1. 3 Run "npm install" in the package root to install the current versions of all dependencies\. -. -.IP "2" 4 +.IP 2. 3 Add or update dependencies\. "npm install" each new or updated package individually and then update package\.json\. Note that they must be explicitly named in order to be installed: running \fBnpm install\fR with no arguments will merely reproduce the existing shrinkwrap\. -. -.IP "3" 4 +.IP 3. 3 Validate that the package works as expected with the new dependencies\. -. -.IP "4" 4 +.IP 4. 3 Run "npm shrinkwrap", commit the new npm\-shrinkwrap\.json, and publish your package\. -. -.IP "" 0 -. + +.RE .P You can use npm help outdated to view dependencies with newer versions available\. -. -.SS "Other Notes" -A shrinkwrap file must be consistent with the package\'s package\.json +.SS Other Notes +.P +A shrinkwrap file must be consistent with the package's package\.json file\. "npm shrinkwrap" will fail if required dependencies are not already installed, since that would result in a shrinkwrap that -wouldn\'t actually work\. Similarly, the command will fail if there are +wouldn't actually work\. Similarly, the command will fail if there are extraneous packages (not referenced by package\.json), since that would indicate that package\.json is not correct\. -. .P Since "npm shrinkwrap" is intended to lock down your dependencies for production use, \fBdevDependencies\fR will not be included unless you @@ -235,31 +192,27 @@ explicitly set the \fB\-\-dev\fR flag when you run \fBnpm shrinkwrap\fR\|\. If installed \fBdevDependencies\fR are excluded, then npm will print a warning\. If you want them to be installed with your module by default, please consider adding them to \fBdependencies\fR instead\. -. .P -If shrinkwrapped package A depends on shrinkwrapped package B, B\'s +If shrinkwrapped package A depends on shrinkwrapped package B, B's shrinkwrap will not be used as part of the installation of A\. However, -because A\'s shrinkwrap is constructed from a valid installation of B -and recursively specifies all dependencies, the contents of B\'s -shrinkwrap will implicitly be included in A\'s shrinkwrap\. -. -.SS "Caveats" +because A's shrinkwrap is constructed from a valid installation of B +and recursively specifies all dependencies, the contents of B's +shrinkwrap will implicitly be included in A's shrinkwrap\. +.SS Caveats +.P If you wish to lock down the specific bytes included in a package, for example to have 100% confidence in being able to reproduce a deployment or build, then you ought to check your dependencies into source control, or pursue some other mechanism that can verify contents rather than versions\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 npm help ls -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index bbcfee19eb..211225b259 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,39 +1,30 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-STAR" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-star\fR \-\- Mark your favorite packages -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-star\fR \- Mark your favorite packages +.SH SYNOPSIS +.P +.RS 2 +.EX npm star [, \.\.\.] npm unstar [, \.\.\.] -. -.fi -. -.SH "DESCRIPTION" -"Starring" a package means that you have some interest in it\. It\'s +.EE +.RE +.SH DESCRIPTION +.P +"Starring" a package means that you have some interest in it\. It's a vaguely positive way to show that you care\. -. .P "Unstarring" is the same thing, but in reverse\. -. .P -It\'s a boolean thing\. Starring repeatedly has no additional effect\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +It's a boolean thing\. Starring repeatedly has no additional effect\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help view -. -.IP "\(bu" 4 +.IP \(bu 2 npm help whoami -. -.IP "\(bu" 4 +.IP \(bu 2 npm help adduser -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 9b2d6d187e..455cf4fcbc 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,40 +1,31 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-STARS" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-stars\fR \-\- View packages marked as favorites -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-stars\fR \- View packages marked as favorites +.SH SYNOPSIS +.P +.RS 2 +.EX npm stars npm stars [username] -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P If you have starred a lot of neat things and want to find them again quickly this command lets you do just that\. -. .P -You may also want to see your friend\'s favorite packages, in this case +You may also want to see your friend's favorite packages, in this case you will most certainly enjoy this command\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help star -. -.IP "\(bu" 4 +.IP \(bu 2 npm help view -. -.IP "\(bu" 4 +.IP \(bu 2 npm help whoami -. -.IP "\(bu" 4 +.IP \(bu 2 npm help adduser -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index c76e2c92a5..866cfd3a2a 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,37 +1,28 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-START" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-start\fR \-\- Start a package -. -.SH "SYNOPSIS" -. -.nf -npm start -. -.fi -. -.SH "DESCRIPTION" -This runs a package\'s "start" script, if one was provided\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +\fBnpm-start\fR \- Start a package +.SH SYNOPSIS +.P +.RS 2 +.EX +npm start [\-\- ] +.EE +.RE +.SH DESCRIPTION +.P +This runs a package's "start" script, if one was provided\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help run\-script -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 scripts -. -.IP "\(bu" 4 +.IP \(bu 2 npm help test -. -.IP "\(bu" 4 +.IP \(bu 2 npm help restart -. -.IP "\(bu" 4 +.IP \(bu 2 npm help stop -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index 37c1a5fe03..1c4a6a6775 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,37 +1,28 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-STOP" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-stop\fR \-\- Stop a package -. -.SH "SYNOPSIS" -. -.nf -npm stop -. -.fi -. -.SH "DESCRIPTION" -This runs a package\'s "stop" script, if one was provided\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +\fBnpm-stop\fR \- Stop a package +.SH SYNOPSIS +.P +.RS 2 +.EX +npm stop [\-\- ] +.EE +.RE +.SH DESCRIPTION +.P +This runs a package's "stop" script, if one was provided\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help run\-script -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 scripts -. -.IP "\(bu" 4 +.IP \(bu 2 npm help test -. -.IP "\(bu" 4 +.IP \(bu 2 npm help start -. -.IP "\(bu" 4 +.IP \(bu 2 npm help restart -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-submodule.1 b/deps/npm/man/man1/npm-submodule.1 index 71853335c5..bfb210d6eb 100644 --- a/deps/npm/man/man1/npm-submodule.1 +++ b/deps/npm/man/man1/npm-submodule.1 @@ -1,42 +1,35 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-SUBMODULE" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-submodule\fR \-\- Add a package as a git submodule -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-submodule\fR \- Add a package as a git submodule +.SH SYNOPSIS +.P +.RS 2 +.EX npm submodule -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P If the specified package has a git repository url in its package\.json -description, then this command will add it as a git submodule at \fBnode_modules/\fR\|\. -. +description, then this command will add it as a git submodule at +\fBnode_modules/\fR\|\. .P -This is a convenience only\. From then on, it\'s up to you to manage +This is a convenience only\. From then on, it's up to you to manage updates by using the appropriate git commands\. npm will stubbornly refuse to update, modify, or remove anything with a \fB\|\.git\fR subfolder in it\. -. .P This command also does not install missing dependencies, if the package does not include them in its git repository\. If \fBnpm ls\fR reports that things are missing, you can either install, link, or submodule them yourself, or you can do \fBnpm explore \-\- npm install\fR to install the dependencies into the submodule folder\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 git help submodule -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-tag.1 b/deps/npm/man/man1/npm-tag.1 index c1d463f8ce..03fdbdb428 100644 --- a/deps/npm/man/man1/npm-tag.1 +++ b/deps/npm/man/man1/npm-tag.1 @@ -1,74 +1,54 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-TAG" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-tag\fR \-\- Tag a published version -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-tag\fR \- Tag a published version +.SH SYNOPSIS +.P +.RS 2 +.EX npm tag @ [] -. -.fi -. -.SH "DESCRIPTION" -Tags the specified version of the package with the specified tag, or the \fB\-\-tag\fR config if not specified\. -. +.EE +.RE +.SH DESCRIPTION +.P +Tags the specified version of the package with the specified tag, or the +\fB\-\-tag\fR config if not specified\. .P A tag can be used when installing packages as a reference to a version instead of using a specific version number: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm install @ -. -.fi -. -.IP "" 0 -. +.EE +.RE .P When installing dependencies, a preferred tagged version may be specified: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm install \-\-tag -. -.fi -. -.IP "" 0 -. +.EE +.RE .P This also applies to \fBnpm dedupe\fR\|\. -. .P Publishing a package always sets the "latest" tag to the published version\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help publish -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help dedupe -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index 063fc92679..8e92115ac4 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,42 +1,32 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-TEST" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-test\fR \-\- Test a package -. -.SH "SYNOPSIS" -. -.nf - npm test - npm tst -. -.fi -. -.SH "DESCRIPTION" -This runs a package\'s "test" script, if one was provided\. -. +\fBnpm-test\fR \- Test a package +.SH SYNOPSIS +.P +.RS 2 +.EX + npm test [\-\- ] + npm tst [\-\- ] +.EE +.RE +.SH DESCRIPTION +.P +This runs a package's "test" script, if one was provided\. .P To run tests as a condition of installation, set the \fBnpat\fR config to true\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help run\-script -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 scripts -. -.IP "\(bu" 4 +.IP \(bu 2 npm help start -. -.IP "\(bu" 4 +.IP \(bu 2 npm help restart -. -.IP "\(bu" 4 +.IP \(bu 2 npm help stop -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index 364d9c1d7c..2ade4acd03 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,87 +1,68 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-RM" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-rm\fR \-\- Remove a package -. -.SH "SYNOPSIS" -. -.nf -npm uninstall [\-\-save|\-\-save\-dev|\-\-save\-optional] +\fBnpm-rm\fR \- Remove a package +.SH SYNOPSIS +.P +.RS 2 +.EX +npm uninstall [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional] npm rm (with any of the previous argument usage) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This uninstalls a package, completely removing everything npm installed on its behalf\. -. .P Example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm uninstall sax -. -.fi -. -.IP "" 0 -. +.EE +.RE .P In global mode (ie, with \fB\-g\fR or \fB\-\-global\fR appended to the command), it uninstalls the current package context as a global package\. -. .P \fBnpm uninstall\fR takes 3 exclusive, optional flags which save or update the package version in your main package\.json: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 \fB\-\-save\fR: Package will be removed from your \fBdependencies\fR\|\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-\-save\-dev\fR: Package will be removed from your \fBdevDependencies\fR\|\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-\-save\-optional\fR: Package will be removed from your \fBoptionalDependencies\fR\|\. -. -.IP "" 0 -. + +.RE +.P +Scope is optional and follows the usual rules for npm help 7 \fBnpm\-scope\fR\|\. .P Examples: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm uninstall sax \-\-save +npm uninstall @myorg/privatepackage \-\-save npm uninstall node\-tap \-\-save\-dev npm uninstall dtrace\-provider \-\-save\-optional -. -.fi -. -.IP "" 0 -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.EE +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help prune -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index e5b8a65601..9aec7540b0 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,58 +1,47 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-UNPUBLISH" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-unpublish\fR \-\- Remove a package from the registry -. -.SH "SYNOPSIS" -. -.nf -npm unpublish [@] -. -.fi -. -.SH "WARNING" +\fBnpm-unpublish\fR \- Remove a package from the registry +.SH SYNOPSIS +.P +.RS 2 +.EX +npm unpublish [@/][@] +.EE +.RE +.SH WARNING +.P \fBIt is generally considered bad behavior to remove versions of a library that others are depending on!\fR -. .P Consider using the \fBdeprecate\fR command instead, if your intent is to encourage users to upgrade\. -. .P There is plenty of room on the registry\. -. -.SH "DESCRIPTION" +.SH DESCRIPTION +.P This removes a package version from the registry, deleting its entry and removing the tarball\. -. .P If no version is specified, or if all versions are removed then the root package entry is removed from the registry entirely\. -. .P Even if a package version is unpublished, that specific name and version combination can never be reused\. In order to publish the package again, a new version number must be used\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.P +The scope is optional and follows the usual rules for npm help 7 \fBnpm\-scope\fR\|\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help deprecate -. -.IP "\(bu" 4 +.IP \(bu 2 npm help publish -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help adduser -. -.IP "\(bu" 4 +.IP \(bu 2 npm help owner -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index de2201209f..4edfab3206 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,45 +1,37 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-UPDATE" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-update\fR \-\- Update a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-update\fR \- Update a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm update [\-g] [ [ \.\.\.]] -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This command will update all the packages listed to the latest version (specified by the \fBtag\fR config)\. -. .P It will also install missing packages\. -. .P -If the \fB\-g\fR flag is specified, this command will update globally installed packages\. -If no package name is specified, all packages in the specified location (global or local) will be updated\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +If the \fB\-g\fR flag is specified, this command will update globally installed +packages\. +.P +If no package name is specified, all packages in the specified location (global +or local) will be updated\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help outdated -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help ls -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index fc52da6e8f..5c05aab9bd 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,75 +1,61 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-VERSION" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-version\fR \-\- Bump a package version -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-version\fR \- Bump a package version +.SH SYNOPSIS +.P +.RS 2 +.EX npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease] -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Run this in a package directory to bump the version and write the new data back to the package\.json file\. -. .P The \fBnewversion\fR argument should be a valid semver string, \fIor\fR a valid second argument to semver\.inc (one of "patch", "minor", "major", "prepatch", "preminor", "premajor", "prerelease")\. In the second case, the existing version will be incremented by 1 in the specified field\. -. .P If run in a git repo, it will also create a version commit and tag, and fail if the repo is not clean\. -. .P If supplied with \fB\-\-message\fR (shorthand: \fB\-m\fR) config option, npm will -use it as a commit message when creating a version commit\. If the \fBmessage\fR config contains \fB%s\fR then that will be replaced with the +use it as a commit message when creating a version commit\. If the +\fBmessage\fR config contains \fB%s\fR then that will be replaced with the resulting version number\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm version patch \-m "Upgrade to %s for reasons" -. -.fi -. -.IP "" 0 -. +.EE +.RE .P If the \fBsign\-git\-tag\fR config is set, then the tag will be signed using the \fB\-s\fR flag to git\. Note that you must have a default GPG key set up in your git config for this to work properly\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX $ npm config set sign\-git\-tag true $ npm version patch + You need a passphrase to unlock the secret key for user: "isaacs (http://blog\.izs\.me/) " 2048\-bit RSA key, ID 6C481CF6, created 2010\-08\-31 + Enter passphrase: -. -.fi -. -.IP "" 0 -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.EE +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help init -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 semver -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index 44b42b308d..af435f023d 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,186 +1,136 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-VIEW" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-view\fR \-\- View registry info -. -.SH "SYNOPSIS" -. -.nf -npm view [@] [[\.]\.\.\.] -npm v [@] [[\.]\.\.\.] -. -.fi -. -.SH "DESCRIPTION" +\fBnpm-view\fR \- View registry info +.SH SYNOPSIS +.P +.RS 2 +.EX +npm view [@/][@] [[\.]\.\.\.] +npm v [@/][@] [[\.]\.\.\.] +.EE +.RE +.SH DESCRIPTION +.P This command shows data about a package and prints it to the stream referenced by the \fBoutfd\fR config, which defaults to stdout\. -. .P To show the package registry entry for the \fBconnect\fR package, you can do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm view connect -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The default version is "latest" if unspecified\. -. .P Field names can be specified after the package descriptor\. For example, to show the dependencies of the \fBronn\fR package at version 0\.3\.5, you could do the following: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm view ronn@0\.3\.5 dependencies -. -.fi -. -.IP "" 0 -. +.EE +.RE .P You can view child field by separating them with a period\. To view the git repository URL for the latest version of npm, you could do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm view npm repository\.url -. -.fi -. -.IP "" 0 -. +.EE +.RE .P This makes it easy to view information about a dependency with a bit of shell scripting\. For example, to view all the data about the version of opts that ronn depends on, you can do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm view opts@$(npm view ronn dependencies\.opts) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P For fields that are arrays, requesting a non\-numeric field will return all of the values from the objects in the list\. For example, to get all the contributor names for the "express" project, you can do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm view express contributors\.email -. -.fi -. -.IP "" 0 -. +.EE +.RE .P You may also use numeric indices in square braces to specifically select an item in an array field\. To just get the email address of the first contributor in the list, you can do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm view express contributors[0]\.email -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Multiple fields may be specified, and will be printed one after another\. For exampls, to get all the contributor names and email addresses, you can do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm view express contributors\.name contributors\.email -. -.fi -. -.IP "" 0 -. +.EE +.RE .P "Person" fields are shown as a string if they would be shown as an object\. So, for example, this will show the list of npm contributors in the shortened string format\. (See npm help 5 \fBpackage\.json\fR for more on this\.) -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm view npm contributors -. -.fi -. -.IP "" 0 -. +.EE +.RE .P If a version range is provided, then data will be printed for every matching version of the package\. This will show which version of jsdom was required by each matching version of yui3: -. -.IP "" 4 -. -.nf -npm view yui3@\'>0\.5\.4\' dependencies\.jsdom -. -.fi -. -.IP "" 0 -. -.SH "OUTPUT" +.P +.RS 2 +.EX +npm view yui3@'>0\.5\.4' dependencies\.jsdom +.EE +.RE +.SH OUTPUT +.P If only a single string field for a single version is output, then it will not be colorized or quoted, so as to enable piping the output to another command\. If the field is an object, it will be output as a JavaScript object literal\. -. .P If the \-\-json flag is given, the outputted fields will be JSON\. -. .P If the version range matches multiple versions, than each printed value will be prefixed with the version it applies to\. -. .P If multiple fields are requested, than each of them are prefixed with the field name\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help search -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help docs -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index bf43ae7eee..0d44c8b66a 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,34 +1,26 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-WHOAMI" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-whoami\fR \-\- Display npm username -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-whoami\fR \- Display npm username +.SH SYNOPSIS +.P +.RS 2 +.EX npm whoami -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Print the \fBusername\fR config to standard output\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help adduser -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index 5a0f94c740..a44acfeae0 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,244 +1,212 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm\fR \-\- node package manager -. -.SH "SYNOPSIS" -. -.nf +\fBnpm\fR \- node package manager +.SH SYNOPSIS +.P +.RS 2 +.EX npm [args] -. -.fi -. -.SH "VERSION" -1.4.28 -. -.SH "DESCRIPTION" +.EE +.RE +.SH VERSION +.P +2.0.0 +.SH DESCRIPTION +.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 conflicts intelligently\. -. .P It is extremely configurable to support a wide variety of use cases\. Most commonly, it is used to publish, discover, install, and develop node programs\. -. .P Run \fBnpm help\fR to get a list of available commands\. -. -.SH "INTRODUCTION" +.SH INTRODUCTION +.P You probably got npm because you want to install stuff\. -. .P -Use \fBnpm install blerg\fR to install the latest version of "blerg"\. Check out npm help \fBnpm\-install\fR for more info\. It can do a lot of stuff\. -. +Use \fBnpm install blerg\fR to install the latest version of "blerg"\. Check out +npm help \fBnpm\-install\fR for more info\. It can do a lot of stuff\. +.P +Use the \fBnpm search\fR command to show everything that's available\. +Use \fBnpm ls\fR to show everything you've installed\. +.SH DEPENDENCIES .P -Use the \fBnpm search\fR command to show everything that\'s available\. -Use \fBnpm ls\fR to show everything you\'ve installed\. -. -.SH "DEPENDENCIES" If a package references to another package with a git URL, npm depends on a preinstalled git\. -. .P If one of the packages npm tries to install is a native node module and -requires compiling of C++ Code, npm will use node\-gyp \fIhttps://github\.com/TooTallNate/node\-gyp\fR for that task\. +requires compiling of C++ Code, npm will use +node\-gyp \fIhttps://github\.com/TooTallNate/node\-gyp\fR for that task\. For a Unix system, node\-gyp \fIhttps://github\.com/TooTallNate/node\-gyp\fR needs Python, make and a buildchain like GCC\. On Windows, Python and Microsoft Visual Studio C++ is needed\. Python 3 is not supported by node\-gyp \fIhttps://github\.com/TooTallNate/node\-gyp\fR\|\. -For more information visit the node\-gyp repository \fIhttps://github\.com/TooTallNate/node\-gyp\fR and +For more information visit +the node\-gyp repository \fIhttps://github\.com/TooTallNate/node\-gyp\fR and the node\-gyp Wiki \fIhttps://github\.com/TooTallNate/node\-gyp/wiki\fR\|\. -. -.SH "DIRECTORIES" +.SH DIRECTORIES +.P See npm help 5 \fBnpm\-folders\fR to learn about where npm puts stuff\. -. .P In particular, npm has two modes of operation: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 global mode: -. .br -npm installs packages into the install prefix at \fBprefix/lib/node_modules\fR and bins are installed in \fBprefix/bin\fR\|\. -. -.IP "\(bu" 4 +npm installs packages into the install prefix at +\fBprefix/lib/node_modules\fR and bins are installed in \fBprefix/bin\fR\|\. +.IP \(bu 2 local mode: -. .br npm installs packages into the current project directory, which -defaults to the current working directory\. Packages are installed to \fB\|\./node_modules\fR, and bins are installed to \fB\|\./node_modules/\.bin\fR\|\. -. -.IP "" 0 -. +defaults to the current working directory\. Packages are installed to +\fB\|\./node_modules\fR, and bins are installed to \fB\|\./node_modules/\.bin\fR\|\. + +.RE .P Local mode is the default\. Use \fB\-\-global\fR or \fB\-g\fR on any command to operate in global mode instead\. -. -.SH "DEVELOPER USAGE" -If you\'re using npm to develop and publish your code, check out the +.SH DEVELOPER USAGE +.P +If you're using npm to develop and publish your code, check out the following help topics: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 json: Make a package\.json file\. See npm help 5 \fBpackage\.json\fR\|\. -. -.IP "\(bu" 4 +.IP \(bu 2 link: -For linking your current working code into Node\'s path, so that you -don\'t have to reinstall every time you make a change\. Use \fBnpm link\fR to do this\. -. -.IP "\(bu" 4 +For linking your current working code into Node's path, so that you +don't have to reinstall every time you make a change\. Use +\fBnpm link\fR to do this\. +.IP \(bu 2 install: -It\'s a good idea to install things if you don\'t need the symbolic link\. -Especially, installing other peoples code from the registry is done via \fBnpm install\fR -. -.IP "\(bu" 4 +It's a good idea to install things if you don't need the symbolic link\. +Especially, installing other peoples code from the registry is done via +\fBnpm install\fR +.IP \(bu 2 adduser: Create an account or log in\. Credentials are stored in the user config file\. -. -.IP "\(bu" 4 +.IP \(bu 2 publish: Use the \fBnpm publish\fR command to upload your code to the registry\. -. -.IP "" 0 -. -.SH "CONFIGURATION" + +.RE +.SH CONFIGURATION +.P npm is extremely configurable\. It reads its configuration options from 5 places\. -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 Command line switches: -. .br Set a config with \fB\-\-key val\fR\|\. All keys take a value, even if they -are booleans (the config parser doesn\'t know what the options are at +are booleans (the config parser doesn't know what the options are at the time of parsing\.) If no value is provided, then the option is set to boolean \fBtrue\fR\|\. -. -.IP "\(bu" 4 +.IP \(bu 2 Environment Variables: -. .br -Set any config by prefixing the name in an environment variable with \fBnpm_config_\fR\|\. For example, \fBexport npm_config_key=val\fR\|\. -. -.IP "\(bu" 4 +Set any config by prefixing the name in an environment variable with +\fBnpm_config_\fR\|\. For example, \fBexport npm_config_key=val\fR\|\. +.IP \(bu 2 User Configs: -. .br The file at $HOME/\.npmrc is an ini\-formatted list of configs\. If present, it is parsed\. If the \fBuserconfig\fR option is set in the cli or env, then that will be used instead\. -. -.IP "\(bu" 4 +.IP \(bu 2 Global Configs: -. .br The file found at \.\./etc/npmrc (from the node executable, by default this resolves to /usr/local/etc/npmrc) will be parsed if it is found\. If the \fBglobalconfig\fR option is set in the cli, env, or user config, then that file is parsed instead\. -. -.IP "\(bu" 4 +.IP \(bu 2 Defaults: -. .br -npm\'s default configuration options are defined in +npm's default configuration options are defined in lib/utils/config\-defs\.js\. These must not be changed\. -. -.IP "" 0 -. + +.RE .P See npm help 7 \fBnpm\-config\fR for much much more information\. -. -.SH "CONTRIBUTIONS" +.SH CONTRIBUTIONS +.P Patches welcome! -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 code: Read through npm help 7 \fBnpm\-coding\-style\fR if you plan to submit code\. -You don\'t have to agree with it, but you do have to follow it\. -. -.IP "\(bu" 4 +You don't have to agree with it, but you do have to follow it\. +.IP \(bu 2 docs: If you find an error in the documentation, edit the appropriate markdown -file in the "doc" folder\. (Don\'t worry about generating the man page\.) -. -.IP "" 0 -. +file in the "doc" folder\. (Don't worry about generating the man page\.) + +.RE .P -Contributors are listed in npm\'s \fBpackage\.json\fR file\. You can view them +Contributors are listed in npm's \fBpackage\.json\fR file\. You can view them easily by doing \fBnpm view npm contributors\fR\|\. -. .P -If you would like to contribute, but don\'t know what to work on, check +If you would like to contribute, but don't know what to work on, check the issues list or ask on the mailing list\. -. -.IP "\(bu" 4 -\fIhttp://github\.com/npm/npm/issues\fR -. -.IP "\(bu" 4 -\fInpm\-@googlegroups\.com\fR -. -.IP "" 0 -. -.SH "BUGS" +.RS 0 +.IP \(bu 2 +http://github\.com/npm/npm/issues +.IP \(bu 2 +npm\-@googlegroups\.com + +.RE +.SH BUGS +.P When you find issues, please report them: -. -.IP "\(bu" 4 -web: \fIhttp://github\.com/npm/npm/issues\fR -. -.IP "\(bu" 4 -email: \fInpm\-@googlegroups\.com\fR -. -.IP "" 0 -. -.P -Be sure to include \fIall\fR of the output from the npm command that didn\'t work +.RS 0 +.IP \(bu 2 +web: +http://github\.com/npm/npm/issues +.IP \(bu 2 +email: +npm\-@googlegroups\.com + +.RE +.P +Be sure to include \fIall\fR of the output from the npm command that didn't work as expected\. The \fBnpm\-debug\.log\fR file is also helpful to provide\. -. .P You can also look for isaacs in #node\.js on irc://irc\.freenode\.net\. He will no doubt tell you to put the output in a gist or email\. -. -.SH "AUTHOR" -Isaac Z\. Schlueter \fIhttp://blog\.izs\.me/\fR :: isaacs \fIhttps://github\.com/isaacs/\fR :: @izs \fIhttp://twitter\.com/izs\fR :: \fIi@izs\.me\fR -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH AUTHOR +.P +Isaac Z\. Schlueter \fIhttp://blog\.izs\.me/\fR :: +isaacs \fIhttps://github\.com/isaacs/\fR :: +@izs \fIhttp://twitter\.com/izs\fR :: +i@izs\.me +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help help -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 faq -. -.IP "\(bu" 4 +.IP \(bu 2 README -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 index -. -.IP "\(bu" 4 +.IP \(bu 2 npm apihelp npm -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man3/npm-bin.3 b/deps/npm/man/man3/npm-bin.3 index 97de75de85..704b17c761 100644 --- a/deps/npm/man/man3/npm-bin.3 +++ b/deps/npm/man/man3/npm-bin.3 @@ -1,21 +1,17 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-BIN" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-bin\fR \-\- Display npm bin folder -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-bin\fR \- Display npm bin folder +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.bin(args, cb) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Print the folder where npm will install executables\. -. .P This function should not be used programmatically\. Instead, just refer to the \fBnpm\.bin\fR member\. + diff --git a/deps/npm/man/man3/npm-bugs.3 b/deps/npm/man/man3/npm-bugs.3 index bb85060afe..c0809e6596 100644 --- a/deps/npm/man/man3/npm-bugs.3 +++ b/deps/npm/man/man3/npm-bugs.3 @@ -1,28 +1,23 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-BUGS" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-bugs\fR \-\- Bugs for a package in a web browser maybe -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.bugs(package, callback) -. -.fi -. -.SH "DESCRIPTION" -This command tries to guess at the likely location of a package\'s +.EE +.RE +.SH DESCRIPTION +.P +This command tries to guess at the likely location of a package's bug tracker URL, and then tries to open it using the \fB\-\-browser\fR config param\. -. .P Like other commands, the first parameter is an array\. This command only uses the first element, which is expected to be a package name with an optional version number\. -. .P This command will launch a browser, so this command may not be the most friendly for programmatic use\. + diff --git a/deps/npm/man/man3/npm-cache.3 b/deps/npm/man/man3/npm-cache.3 index b3396446ff..125fcf7396 100644 --- a/deps/npm/man/man3/npm-cache.3 +++ b/deps/npm/man/man3/npm-cache.3 @@ -1,40 +1,34 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-CACHE" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-cache\fR \-\- manage the npm cache programmatically -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-cache\fR \- manage the npm cache programmatically +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.cache([args], callback) + // helpers npm\.commands\.cache\.clean([args], callback) npm\.commands\.cache\.add([args], callback) npm\.commands\.cache\.read(name, version, forceBypass, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This acts much the same ways as the npm help cache command line functionality\. -. .P The callback is called with the package\.json data of the thing that is eventually added to or read from the cache\. -. .P The top level \fBnpm\.commands\.cache(\.\.\.)\fR functionality is a public interface, and like all commands on the \fBnpm\.commands\fR object, it will match the command line behavior exactly\. -. .P However, the cache folder structure and the cache helper functions are considered \fBinternal\fR API surface, and as such, may change in future releases of npm, potentially without warning or significant version incrementation\. -. .P Use at your own risk\. + diff --git a/deps/npm/man/man3/npm-commands.3 b/deps/npm/man/man3/npm-commands.3 index 003f5e5ab4..396b1c76f5 100644 --- a/deps/npm/man/man3/npm-commands.3 +++ b/deps/npm/man/man3/npm-commands.3 @@ -1,35 +1,28 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-COMMANDS" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-commands\fR \-\- npm commands -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-commands\fR \- npm commands +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands[](args, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P npm comes with a full set of commands, and each of the commands takes a similar set of arguments\. -. .P In general, all commands on the command object take an \fBarray\fR of positional argument \fBstrings\fR\|\. The last argument to any function is a callback\. Some commands are special and take other optional arguments\. -. .P All commands have their own man page\. See \fBman npm\-\fR for command\-line usage, or \fBman 3 npm\-\fR for programmatic usage\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 index -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man3/npm-config.3 b/deps/npm/man/man3/npm-config.3 index 578b939a63..0e8e3641a4 100644 --- a/deps/npm/man/man3/npm-config.3 +++ b/deps/npm/man/man3/npm-config.3 @@ -1,69 +1,49 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-CONFIG" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-config\fR \-\- Manage the npm configuration files -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-config\fR \- Manage the npm configuration files +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.config(args, callback) var val = npm\.config\.get(key) npm\.config\.set(key, val) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This function acts much the same way as the command\-line version\. The first element in the array tells config what to do\. Possible values are: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 \fBset\fR -. -.IP -Sets a config parameter\. The second element in \fBargs\fR is interpreted as the -key, and the third element is interpreted as the value\. -. -.IP "\(bu" 4 + Sets a config parameter\. The second element in \fBargs\fR is interpreted as the + key, and the third element is interpreted as the value\. +.IP \(bu 2 \fBget\fR -. -.IP -Gets the value of a config parameter\. The second element in \fBargs\fR is the -key to get the value of\. -. -.IP "\(bu" 4 + Gets the value of a config parameter\. The second element in \fBargs\fR is the + key to get the value of\. +.IP \(bu 2 \fBdelete\fR (\fBrm\fR or \fBdel\fR) -. -.IP -Deletes a parameter from the config\. The second element in \fBargs\fR is the -key to delete\. -. -.IP "\(bu" 4 + Deletes a parameter from the config\. The second element in \fBargs\fR is the + key to delete\. +.IP \(bu 2 \fBlist\fR (\fBls\fR) -. -.IP -Show all configs that aren\'t secret\. No parameters necessary\. -. -.IP "\(bu" 4 + Show all configs that aren't secret\. No parameters necessary\. +.IP \(bu 2 \fBedit\fR: -. -.IP -Opens the config file in the default editor\. This command isn\'t very useful -programmatically, but it is made available\. -. -.IP "" 0 -. + Opens the config file in the default editor\. This command isn't very useful + programmatically, but it is made available\. + +.RE .P To programmatically access npm configuration settings, or set them for the duration of a program, use the \fBnpm\.config\.set\fR and \fBnpm\.config\.get\fR functions instead\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm apihelp npm -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man3/npm-deprecate.3 b/deps/npm/man/man3/npm-deprecate.3 index 29e4c34515..ba5ffbdf27 100644 --- a/deps/npm/man/man3/npm-deprecate.3 +++ b/deps/npm/man/man3/npm-deprecate.3 @@ -1,57 +1,43 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-DEPRECATE" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-deprecate\fR \-\- Deprecate a version of a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-deprecate\fR \- Deprecate a version of a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.deprecate(args, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This command will update the npm registry entry for a package, providing a deprecation warning to all who attempt to install it\. -. .P -The \'args\' parameter must have exactly two elements: -. -.IP "\(bu" 4 +The 'args' parameter must have exactly two elements: +.RS 0 +.IP \(bu 2 \fBpackage[@version]\fR -. -.IP -The \fBversion\fR portion is optional, and may be either a range, or a -specific version, or a tag\. -. -.IP "\(bu" 4 + The \fBversion\fR portion is optional, and may be either a range, or a + specific version, or a tag\. +.IP \(bu 2 \fBmessage\fR -. -.IP -The warning message that will be printed whenever a user attempts to -install the package\. -. -.IP "" 0 -. + The warning message that will be printed whenever a user attempts to + install the package\. + +.RE .P -Note that you must be the package owner to deprecate something\. See the \fBowner\fR and \fBadduser\fR help topics\. -. +Note that you must be the package owner to deprecate something\. See the +\fBowner\fR and \fBadduser\fR help topics\. .P To un\-deprecate a package, specify an empty string (\fB""\fR) for the \fBmessage\fR argument\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm apihelp publish -. -.IP "\(bu" 4 +.IP \(bu 2 npm apihelp unpublish -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 registry -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man3/npm-docs.3 b/deps/npm/man/man3/npm-docs.3 index e3039c2ef5..6aec6d76ab 100644 --- a/deps/npm/man/man3/npm-docs.3 +++ b/deps/npm/man/man3/npm-docs.3 @@ -1,28 +1,23 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-DOCS" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-docs\fR \-\- Docs for a package in a web browser maybe -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-docs\fR \- Docs for a package in a web browser maybe +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.docs(package, callback) -. -.fi -. -.SH "DESCRIPTION" -This command tries to guess at the likely location of a package\'s +.EE +.RE +.SH DESCRIPTION +.P +This command tries to guess at the likely location of a package's documentation URL, and then tries to open it using the \fB\-\-browser\fR config param\. -. .P Like other commands, the first parameter is an array\. This command only uses the first element, which is expected to be a package name with an optional version number\. -. .P This command will launch a browser, so this command may not be the most friendly for programmatic use\. + diff --git a/deps/npm/man/man3/npm-edit.3 b/deps/npm/man/man3/npm-edit.3 index bcdabb6f23..0c52d96429 100644 --- a/deps/npm/man/man3/npm-edit.3 +++ b/deps/npm/man/man3/npm-edit.3 @@ -1,35 +1,28 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-EDIT" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-edit\fR \-\- Edit an installed package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-edit\fR \- Edit an installed package +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.edit(package, callback) -. -.fi -. -.SH "DESCRIPTION" -Opens the package folder in the default editor (or whatever you\'ve +.EE +.RE +.SH DESCRIPTION +.P +Opens the package folder in the default editor (or whatever you've configured as the npm \fBeditor\fR config \-\- see \fBnpm help config\fR\|\.) -. .P After it has been edited, the package is rebuilt so as to pick up any changes in compiled packages\. -. .P For instance, you can do \fBnpm install connect\fR to install connect into your package, and then \fBnpm\.commands\.edit(["connect"], callback)\fR to make a few changes to your locally installed copy\. -. .P The first parameter is a string array with a single element, the package to open\. The package can optionally have a version number attached\. -. .P Since this command opens an editor in a new process, be careful about where and how this is used\. + diff --git a/deps/npm/man/man3/npm-explore.3 b/deps/npm/man/man3/npm-explore.3 index 0918dae972..8b0cb72bf4 100644 --- a/deps/npm/man/man3/npm-explore.3 +++ b/deps/npm/man/man3/npm-explore.3 @@ -1,28 +1,22 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-EXPLORE" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-explore\fR \-\- Browse an installed package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-explore\fR \- Browse an installed package +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.explore(args, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Spawn a subshell in the directory of the installed package specified\. -. .P If a command is specified, then it is run in the subshell, which then immediately terminates\. -. .P Note that the package is \fInot\fR automatically rebuilt afterwards, so be sure to use \fBnpm rebuild \fR if you make any changes\. -. .P -The first element in the \'args\' parameter must be a package name\. After that is the optional command, which can be any number of strings\. All of the strings will be combined into one, space\-delimited command\. +The first element in the 'args' parameter must be a package name\. After that is the optional command, which can be any number of strings\. All of the strings will be combined into one, space\-delimited command\. + diff --git a/deps/npm/man/man3/npm-help-search.3 b/deps/npm/man/man3/npm-help-search.3 index 2c39f5c7b4..8b92f90b5e 100644 --- a/deps/npm/man/man3/npm-help-search.3 +++ b/deps/npm/man/man3/npm-help-search.3 @@ -1,51 +1,41 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-HELP\-SEARCH" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-help-search\fR \-\- Search the help pages -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-help-search\fR \- Search the help pages +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.helpSearch(args, [silent,] callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This command is rarely useful, but it exists in the rare case that it is\. -. .P This command takes an array of search terms and returns the help pages that match in order of best match\. -. .P If there is only one match, then npm displays that help section\. If there are multiple results, the results are printed to the screen formatted and the array of results is returned\. Each result is an object with these properties: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 hits: A map of args to number of hits on that arg\. For example, {"npm": 3} -. -.IP "\(bu" 4 +.IP \(bu 2 found: Total number of unique args that matched\. -. -.IP "\(bu" 4 +.IP \(bu 2 totalHits: Total number of hits\. -. -.IP "\(bu" 4 +.IP \(bu 2 lines: An array of all matching lines (and some adjacent lines)\. -. -.IP "\(bu" 4 +.IP \(bu 2 file: Name of the file that matched -. -.IP "" 0 -. + +.RE .P The silent parameter is not neccessary not used, but it may in the future\. + diff --git a/deps/npm/man/man3/npm-init.3 b/deps/npm/man/man3/npm-init.3 index d4eba22052..87059d957b 100644 --- a/deps/npm/man/man3/npm-init.3 +++ b/deps/npm/man/man3/npm-init.3 @@ -1,39 +1,32 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. -.TH "INIT" "3" "September 2014" "" "" -. +.TH "NPM" "" "September 2014" "" "" .SH "NAME" -\fBinit\fR \-\- Interactively create a package\.json file -. -.SH "SYNOPSIS" -. -.nf +\fBnpm\fR +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.init(args, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This will ask you a bunch of questions, and then write a package\.json for you\. -. .P It attempts to make reasonable guesses about what you want things to be set to, -and then writes a package\.json file with the options you\'ve selected\. -. +and then writes a package\.json file with the options you've selected\. .P -If you already have a package\.json file, it\'ll read that first, and default to +If you already have a package\.json file, it'll read that first, and default to the options in there\. -. .P It is strictly additive, so it does not delete options from your package\.json without a really good reason to do so\. -. .P -Since this function expects to be run on the command\-line, it doesn\'t work very +Since this function expects to be run on the command\-line, it doesn't work very well as a programmatically\. The best option is to roll your own, and since JavaScript makes it stupid simple to output formatted JSON, that is the -preferred method\. If you\'re sure you want to handle command\-line prompting, +preferred method\. If you're sure you want to handle command\-line prompting, then go ahead and use this programmatically\. -. -.SH "SEE ALSO" +.SH SEE ALSO +.P npm help 5 package\.json + diff --git a/deps/npm/man/man3/npm-install.3 b/deps/npm/man/man3/npm-install.3 index 4b09fbe80f..3202bdffe7 100644 --- a/deps/npm/man/man3/npm-install.3 +++ b/deps/npm/man/man3/npm-install.3 @@ -1,29 +1,23 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-INSTALL" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-install\fR \-\- install a package programmatically -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-install\fR \- install a package programmatically +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.install([where,] packages, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This acts much the same ways as installing on the command\-line\. -. .P -The \'where\' parameter is optional and only used internally, and it specifies +The 'where' parameter is optional and only used internally, and it specifies where the packages should be installed to\. -. .P -The \'packages\' parameter is an array of strings\. Each element in the array is +The 'packages' parameter is an array of strings\. Each element in the array is the name of a package to be installed\. -. .P -Finally, \'callback\' is a function that will be called when all packages have been +Finally, 'callback' is a function that will be called when all packages have been installed or when an error has been encountered\. + diff --git a/deps/npm/man/man3/npm-link.3 b/deps/npm/man/man3/npm-link.3 index dbecc0edb7..ff5ea0f799 100644 --- a/deps/npm/man/man3/npm-link.3 +++ b/deps/npm/man/man3/npm-link.3 @@ -1,53 +1,41 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-LINK" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-link\fR \-\- Symlink a package folder -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-link\fR \- Symlink a package folder +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.link(callback) npm\.commands\.link(packages, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Package linking is a two\-step process\. -. .P Without parameters, link will create a globally\-installed symbolic link from \fBprefix/package\-name\fR to the current folder\. -. .P With a parameters, link will create a symlink from the local \fBnode_modules\fR folder to the global symlink\. -. .P When creating tarballs for \fBnpm publish\fR, the linked packages are "snapshotted" to their current state by resolving the symbolic links\. -. .P This is handy for installing your own stuff, so that you can work on it and test it iteratively without having to continually rebuild\. -. .P For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm\.commands\.link(cb) # creates global link from the cwd # (say redis package) -npm\.commands\.link(\'redis\', cb) # link\-install the package -. -.fi -. -.IP "" 0 -. +npm\.commands\.link('redis', cb) # link\-install the package +.EE +.RE .P Now, any changes to the redis package will be reflected in the package in the current working directory + diff --git a/deps/npm/man/man3/npm-load.3 b/deps/npm/man/man3/npm-load.3 index 4180127d7e..8189b5abcf 100644 --- a/deps/npm/man/man3/npm-load.3 +++ b/deps/npm/man/man3/npm-load.3 @@ -1,44 +1,34 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-LOAD" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-load\fR \-\- Load config settings -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-load\fR \- Load config settings +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.load(conf, cb) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P npm\.load() must be called before any other function call\. Both parameters are optional, but the second is recommended\. -. .P The first parameter is an object hash of command\-line config params, and the second parameter is a callback that will be called when npm is loaded and ready to serve\. -. .P The first parameter should follow a similar structure as the package\.json config object\. -. .P For example, to emulate the \-\-dev flag, pass an object that looks like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "dev": true } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P For a list of all the available command\-line configs, see \fBnpm help config\fR + diff --git a/deps/npm/man/man3/npm-ls.3 b/deps/npm/man/man3/npm-ls.3 index 723e2bc45b..a8ce7f7117 100644 --- a/deps/npm/man/man3/npm-ls.3 +++ b/deps/npm/man/man3/npm-ls.3 @@ -1,86 +1,68 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-LS" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-ls\fR \-\- List installed packages -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-ls\fR \- List installed packages +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.ls(args, [silent,] callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This command will print to stdout all the versions of packages that are installed, as well as their dependencies, in a tree\-structure\. It will also return that data using the callback\. -. .P This command does not take any arguments, but args must be defined\. Beyond that, if any arguments are passed in, npm will politely warn that it does not take positional arguments, though you may set config flags like with any other command, such as \fBglobal\fR to list global packages\. -. .P It will print out extraneous, missing, and invalid packages\. -. .P If the silent parameter is set to true, nothing will be output to the screen, but the data will still be returned\. -. .P Callback is provided an error if one occurred, the full data about which packages are installed and which dependencies they will receive, and a "lite" data object which just shows which versions are installed where\. Note that the full data object is a circular structure, so care must be taken if it is serialized to JSON\. -. -.SH "CONFIGURATION" -. -.SS "long" -. -.IP "\(bu" 4 +.SH CONFIGURATION +.SS long +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Show extended information\. -. -.SS "parseable" -. -.IP "\(bu" 4 +.SS parseable +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Show parseable output instead of tree view\. -. -.SS "global" -. -.IP "\(bu" 4 +.SS global +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P List packages in the global install prefix instead of in the current project\. -. .P -Note, if parseable is set or long isn\'t set, then duplicates will be trimmed\. +Note, if parseable is set or long isn't set, then duplicates will be trimmed\. This means that if a submodule a same dependency as a parent module, then the dependency will only be output once\. + diff --git a/deps/npm/man/man3/npm-outdated.3 b/deps/npm/man/man3/npm-outdated.3 index 3da841dc3d..ac653f9259 100644 --- a/deps/npm/man/man3/npm-outdated.3 +++ b/deps/npm/man/man3/npm-outdated.3 @@ -1,21 +1,17 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-OUTDATED" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-outdated\fR \-\- Check for outdated packages -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-outdated\fR \- Check for outdated packages +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.outdated([packages,] callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This command will check the registry to see if the specified packages are currently outdated\. -. .P -If the \'packages\' parameter is left out, npm will check all packages\. +If the 'packages' parameter is left out, npm will check all packages\. + diff --git a/deps/npm/man/man3/npm-owner.3 b/deps/npm/man/man3/npm-owner.3 index 38cc42d699..ac4ad14259 100644 --- a/deps/npm/man/man3/npm-owner.3 +++ b/deps/npm/man/man3/npm-owner.3 @@ -1,52 +1,43 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-OWNER" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-owner\fR \-\- Manage package owners -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-owner\fR \- Manage package owners +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.owner(args, callback) -. -.fi -. -.SH "DESCRIPTION" -The first element of the \'args\' parameter defines what to do, and the subsequent +.EE +.RE +.SH DESCRIPTION +.P +The first element of the 'args' parameter defines what to do, and the subsequent elements depend on the action\. Possible values for the action are (order of parameters are given in parenthesis): -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 ls (package): List all the users who have access to modify a package and push new versions\. Handy when you need to know who to bug for help\. -. -.IP "\(bu" 4 +.IP \(bu 2 add (user, package): Add a new user as a maintainer of a package\. This user is enabled to modify metadata, publish new versions, and add other owners\. -. -.IP "\(bu" 4 +.IP \(bu 2 rm (user, package): Remove a user from the package owner list\. This immediately revokes their privileges\. -. -.IP "" 0 -. + +.RE .P Note that there is only one level of access\. Either you can modify a package, -or you can\'t\. Future versions may contain more fine\-grained access levels, but +or you can't\. Future versions may contain more fine\-grained access levels, but that is not implemented at this time\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm apihelp publish -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 registry -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man3/npm-pack.3 b/deps/npm/man/man3/npm-pack.3 index a7ccab0a73..07b6399482 100644 --- a/deps/npm/man/man3/npm-pack.3 +++ b/deps/npm/man/man3/npm-pack.3 @@ -1,28 +1,23 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-PACK" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-pack\fR \-\- Create a tarball from a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-pack\fR \- Create a tarball from a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.pack([packages,] callback) -. -.fi -. -.SH "DESCRIPTION" -For anything that\'s installable (that is, a package folder, tarball, +.EE +.RE +.SH DESCRIPTION +.P +For anything that's installable (that is, a package folder, tarball, tarball url, name@tag, name@version, or name), this command will fetch it to the cache, and then copy the tarball to the current working directory as \fB\-\.tgz\fR, and then write the filenames out to stdout\. -. .P If the same package is specified multiple times, then the file will be overwritten the second time\. -. .P If no arguments are supplied, then npm packs the current package folder\. + diff --git a/deps/npm/man/man3/npm-prefix.3 b/deps/npm/man/man3/npm-prefix.3 index 3e80055657..d83aea1ef2 100644 --- a/deps/npm/man/man3/npm-prefix.3 +++ b/deps/npm/man/man3/npm-prefix.3 @@ -1,24 +1,19 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-PREFIX" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-prefix\fR \-\- Display prefix -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-prefix\fR \- Display prefix +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.prefix(args, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Print the prefix to standard out\. -. .P -\'args\' is never used and callback is never called with data\. -\'args\' must be present or things will break\. -. +\|'args' is never used and callback is never called with data\. +\|'args' must be present or things will break\. .P This function is not useful programmatically + diff --git a/deps/npm/man/man3/npm-prune.3 b/deps/npm/man/man3/npm-prune.3 index f9aff4ad32..7ad7ebc053 100644 --- a/deps/npm/man/man3/npm-prune.3 +++ b/deps/npm/man/man3/npm-prune.3 @@ -1,27 +1,21 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-PRUNE" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-prune\fR \-\- Remove extraneous packages -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-prune\fR \- Remove extraneous packages +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.prune([packages,] callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This command removes "extraneous" packages\. -. .P The first parameter is optional, and it specifies packages to be removed\. -. .P No packages are specified, then all packages will be checked\. -. .P Extraneous packages are packages that are not listed on the parent -package\'s dependencies list\. +package's dependencies list\. + diff --git a/deps/npm/man/man3/npm-publish.3 b/deps/npm/man/man3/npm-publish.3 index 842da1bb80..877ab41d2f 100644 --- a/deps/npm/man/man3/npm-publish.3 +++ b/deps/npm/man/man3/npm-publish.3 @@ -1,51 +1,41 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-PUBLISH" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-publish\fR \-\- Publish a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-publish\fR \- Publish a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.publish([packages,] callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Publishes a package to the registry so that it can be installed by name\. -Possible values in the \'packages\' array are: -. -.IP "\(bu" 4 +Possible values in the 'packages' array are: +.RS 0 +.IP \(bu 2 \fB\fR: A folder containing a package\.json file -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\fR: A url or file path to a gzipped tar archive containing a single folder with a package\.json file inside\. -. -.IP "" 0 -. + +.RE .P If the package array is empty, npm will try to publish something in the current working directory\. -. .P This command could fails if one of the packages specified already exists in the registry\. Overwrites when the "force" environment variable is set\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help adduser -. -.IP "\(bu" 4 +.IP \(bu 2 npm apihelp owner -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man3/npm-rebuild.3 b/deps/npm/man/man3/npm-rebuild.3 index f6233c2f29..1a0387f6e2 100644 --- a/deps/npm/man/man3/npm-rebuild.3 +++ b/deps/npm/man/man3/npm-rebuild.3 @@ -1,22 +1,19 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-REBUILD" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-rebuild\fR \-\- Rebuild a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-rebuild\fR \- Rebuild a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.rebuild([packages,] callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This command runs the \fBnpm build\fR command on each of the matched packages\. This is useful when you install a new version of node, and must recompile all your C++ addons with -the new binary\. If no \'packages\' parameter is specify, every package will be rebuilt\. -. -.SH "CONFIGURATION" +the new binary\. If no 'packages' parameter is specify, every package will be rebuilt\. +.SH CONFIGURATION +.P See \fBnpm help build\fR + diff --git a/deps/npm/man/man3/npm-repo.3 b/deps/npm/man/man3/npm-repo.3 index 06db0d50a2..e88952853a 100644 --- a/deps/npm/man/man3/npm-repo.3 +++ b/deps/npm/man/man3/npm-repo.3 @@ -1,28 +1,23 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-REPO" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-repo\fR \-\- Open package repository page in the browser -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-repo\fR \- Open package repository page in the browser +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.repo(package, callback) -. -.fi -. -.SH "DESCRIPTION" -This command tries to guess at the likely location of a package\'s +.EE +.RE +.SH DESCRIPTION +.P +This command tries to guess at the likely location of a package's repository URL, and then tries to open it using the \fB\-\-browser\fR config param\. -. .P Like other commands, the first parameter is an array\. This command only uses the first element, which is expected to be a package name with an optional version number\. -. .P This command will launch a browser, so this command may not be the most friendly for programmatic use\. + diff --git a/deps/npm/man/man3/npm-restart.3 b/deps/npm/man/man3/npm-restart.3 index 5c0ed9ca0e..90854364d7 100644 --- a/deps/npm/man/man3/npm-restart.3 +++ b/deps/npm/man/man3/npm-restart.3 @@ -1,37 +1,29 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-RESTART" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-restart\fR \-\- Start a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-restart\fR \- Start a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.restart(packages, callback) -. -.fi -. -.SH "DESCRIPTION" -This runs a package\'s "restart" script, if one was provided\. -Otherwise it runs package\'s "stop" script, if one was provided, and then +.EE +.RE +.SH DESCRIPTION +.P +This runs a package's "restart" script, if one was provided\. +Otherwise it runs package's "stop" script, if one was provided, and then the "start" script\. -. .P If no version is specified, then it restarts the "active" version\. -. .P npm can run tests on multiple packages\. Just specify multiple packages in the \fBpackages\fR parameter\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm apihelp start -. -.IP "\(bu" 4 +.IP \(bu 2 npm apihelp stop -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man3/npm-root.3 b/deps/npm/man/man3/npm-root.3 index 5772cb40d3..36ce0019d9 100644 --- a/deps/npm/man/man3/npm-root.3 +++ b/deps/npm/man/man3/npm-root.3 @@ -1,24 +1,19 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-ROOT" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-root\fR \-\- Display npm root -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-root\fR \- Display npm root +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.root(args, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Print the effective \fBnode_modules\fR folder to standard out\. -. .P -\'args\' is never used and callback is never called with data\. -\'args\' must be present or things will break\. -. +\|'args' is never used and callback is never called with data\. +\|'args' must be present or things will break\. .P This function is not useful programmatically\. + diff --git a/deps/npm/man/man3/npm-run-script.3 b/deps/npm/man/man3/npm-run-script.3 index 5c5d435a30..2ec3a679a3 100644 --- a/deps/npm/man/man3/npm-run-script.3 +++ b/deps/npm/man/man3/npm-run-script.3 @@ -1,48 +1,37 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-RUN\-SCRIPT" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-run-script\fR \-\- Run arbitrary package scripts -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-run-script\fR \- Run arbitrary package scripts +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.run\-script(args, callback) -. -.fi -. -.SH "DESCRIPTION" -This runs an arbitrary command from a package\'s "scripts" object\. -. +.EE +.RE +.SH DESCRIPTION +.P +This runs an arbitrary command from a package's "scripts" object\. .P It is used by the test, start, restart, and stop commands, but can be called directly, as well\. -. .P -The \'args\' parameter is an array of strings\. Behavior depends on the number +The 'args' parameter is an array of strings\. Behavior depends on the number of elements\. If there is only one element, npm assumes that the element represents a command to be run on the local repository\. If there is more than one element, then the first is assumed to be the package and the second is assumed to be the command to run\. All other elements are ignored\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 scripts -. -.IP "\(bu" 4 +.IP \(bu 2 npm apihelp test -. -.IP "\(bu" 4 +.IP \(bu 2 npm apihelp start -. -.IP "\(bu" 4 +.IP \(bu 2 npm apihelp restart -. -.IP "\(bu" 4 +.IP \(bu 2 npm apihelp stop -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man3/npm-search.3 b/deps/npm/man/man3/npm-search.3 index f7692a637c..e508a01630 100644 --- a/deps/npm/man/man3/npm-search.3 +++ b/deps/npm/man/man3/npm-search.3 @@ -1,64 +1,52 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-SEARCH" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-search\fR \-\- Search for packages -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-search\fR \- Search for packages +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.search(searchTerms, [silent,] [staleness,] callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Search the registry for packages matching the search terms\. The available parameters are: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 searchTerms: Array of search terms\. These terms are case\-insensitive\. -. -.IP "\(bu" 4 +.IP \(bu 2 silent: If true, npm will not log anything to the console\. -. -.IP "\(bu" 4 +.IP \(bu 2 staleness: This is the threshold for stale packages\. "Fresh" packages are not refreshed from the registry\. This value is measured in seconds\. -. -.IP "\(bu" 4 +.IP \(bu 2 callback: Returns an object where each key is the name of a package, and the value -is information about that package along with a \'words\' property, which is +is information about that package along with a 'words' property, which is a space\-delimited string of all of the interesting words in that package\. The only properties included are those that are searched, which generally include: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 name -. -.IP "\(bu" 4 +.IP \(bu 2 description -. -.IP "\(bu" 4 +.IP \(bu 2 maintainers -. -.IP "\(bu" 4 +.IP \(bu 2 url -. -.IP "\(bu" 4 +.IP \(bu 2 keywords -. -.IP "" 0 -. -.IP "" 0 -. +.RE + +.RE .P A search on the registry excludes any result that does not match all of the search terms\. It also removes any items from the results that contain an excluded term (the "searchexclude" config)\. The search is case insensitive -and doesn\'t try to read your mind (it doesn\'t do any verb tense matching or the +and doesn't try to read your mind (it doesn't do any verb tense matching or the like)\. + diff --git a/deps/npm/man/man3/npm-shrinkwrap.3 b/deps/npm/man/man3/npm-shrinkwrap.3 index e5cdb59d9c..d7e4ba84f7 100644 --- a/deps/npm/man/man3/npm-shrinkwrap.3 +++ b/deps/npm/man/man3/npm-shrinkwrap.3 @@ -1,30 +1,24 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-SHRINKWRAP" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-shrinkwrap\fR \-\- programmatically generate package shrinkwrap file -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-shrinkwrap\fR \- programmatically generate package shrinkwrap file +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.shrinkwrap(args, [silent,] callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This acts much the same ways as shrinkwrapping on the command\-line\. -. .P -This command does not take any arguments, but \'args\' must be defined\. +This command does not take any arguments, but 'args' must be defined\. Beyond that, if any arguments are passed in, npm will politely warn that it does not take positional arguments\. -. .P -If the \'silent\' parameter is set to true, nothing will be output to the screen, +If the 'silent' parameter is set to true, nothing will be output to the screen, but the shrinkwrap file will still be written\. -. .P -Finally, \'callback\' is a function that will be called when the shrinkwrap has +Finally, 'callback' is a function that will be called when the shrinkwrap has been saved\. + diff --git a/deps/npm/man/man3/npm-start.3 b/deps/npm/man/man3/npm-start.3 index 6e2cb64771..7942fbd3e9 100644 --- a/deps/npm/man/man3/npm-start.3 +++ b/deps/npm/man/man3/npm-start.3 @@ -1,21 +1,17 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-START" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-start\fR \-\- Start a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-start\fR \- Start a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.start(packages, callback) -. -.fi -. -.SH "DESCRIPTION" -This runs a package\'s "start" script, if one was provided\. -. +.EE +.RE +.SH DESCRIPTION +.P +This runs a package's "start" script, if one was provided\. .P npm can run tests on multiple packages\. Just specify multiple packages in the \fBpackages\fR parameter\. + diff --git a/deps/npm/man/man3/npm-stop.3 b/deps/npm/man/man3/npm-stop.3 index b1f4ee7503..b7d2d6d796 100644 --- a/deps/npm/man/man3/npm-stop.3 +++ b/deps/npm/man/man3/npm-stop.3 @@ -1,21 +1,17 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-STOP" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-stop\fR \-\- Stop a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-stop\fR \- Stop a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.stop(packages, callback) -. -.fi -. -.SH "DESCRIPTION" -This runs a package\'s "stop" script, if one was provided\. -. +.EE +.RE +.SH DESCRIPTION +.P +This runs a package's "stop" script, if one was provided\. .P npm can run stop on multiple packages\. Just specify multiple packages in the \fBpackages\fR parameter\. + diff --git a/deps/npm/man/man3/npm-submodule.3 b/deps/npm/man/man3/npm-submodule.3 index 95739ce3b0..7ade6d2ab8 100644 --- a/deps/npm/man/man3/npm-submodule.3 +++ b/deps/npm/man/man3/npm-submodule.3 @@ -1,42 +1,35 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-SUBMODULE" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-submodule\fR \-\- Add a package as a git submodule -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-submodule\fR \- Add a package as a git submodule +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.submodule(packages, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P For each package specified, npm will check if it has a git repository url -in its package\.json description then add it as a git submodule at \fBnode_modules/\fR\|\. -. +in its package\.json description then add it as a git submodule at +\fBnode_modules/\fR\|\. .P -This is a convenience only\. From then on, it\'s up to you to manage +This is a convenience only\. From then on, it's up to you to manage updates by using the appropriate git commands\. npm will stubbornly refuse to update, modify, or remove anything with a \fB\|\.git\fR subfolder in it\. -. .P This command also does not install missing dependencies, if the package does not include them in its git repository\. If \fBnpm ls\fR reports that things are missing, you can either install, link, or submodule them yourself, or you can do \fBnpm explore \-\- npm install\fR to install the dependencies into the submodule folder\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help json -. -.IP "\(bu" 4 +.IP \(bu 2 git help submodule -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man3/npm-tag.3 b/deps/npm/man/man3/npm-tag.3 index fe00dbcc2e..a6d34762fb 100644 --- a/deps/npm/man/man3/npm-tag.3 +++ b/deps/npm/man/man3/npm-tag.3 @@ -1,31 +1,27 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-TAG" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-tag\fR \-\- Tag a published version -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-tag\fR \- Tag a published version +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.tag(package@version, tag, callback) -. -.fi -. -.SH "DESCRIPTION" -Tags the specified version of the package with the specified tag, or the \fB\-\-tag\fR config if not specified\. -. +.EE +.RE +.SH DESCRIPTION +.P +Tags the specified version of the package with the specified tag, or the +\fB\-\-tag\fR config if not specified\. .P -The \'package@version\' is an array of strings, but only the first two elements are +The 'package@version' is an array of strings, but only the first two elements are currently used\. -. .P The first element must be in the form package@version, where package is the package name and version is the version number (much like installing a specific version)\. -. .P The second element is the name of the tag to tag this version with\. If this parameter is missing or falsey (empty), the default froom the config will be -used\. For more information about how to set this config, check \fBman 3 npm\-config\fR for programmatic usage or \fBman npm\-config\fR for cli usage\. +used\. For more information about how to set this config, check +\fBman 3 npm\-config\fR for programmatic usage or \fBman npm\-config\fR for cli usage\. + diff --git a/deps/npm/man/man3/npm-test.3 b/deps/npm/man/man3/npm-test.3 index 86aa780ac1..02f4de01ff 100644 --- a/deps/npm/man/man3/npm-test.3 +++ b/deps/npm/man/man3/npm-test.3 @@ -1,25 +1,20 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-TEST" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-test\fR \-\- Test a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-test\fR \- Test a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.test(packages, callback) -. -.fi -. -.SH "DESCRIPTION" -This runs a package\'s "test" script, if one was provided\. -. +.EE +.RE +.SH DESCRIPTION +.P +This runs a package's "test" script, if one was provided\. .P To run tests as a condition of installation, set the \fBnpat\fR config to true\. -. .P npm can run tests on multiple packages\. Just specify multiple packages in the \fBpackages\fR parameter\. + diff --git a/deps/npm/man/man3/npm-uninstall.3 b/deps/npm/man/man3/npm-uninstall.3 index 7ae1368423..883deaf4ac 100644 --- a/deps/npm/man/man3/npm-uninstall.3 +++ b/deps/npm/man/man3/npm-uninstall.3 @@ -1,25 +1,20 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-UNINSTALL" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-uninstall\fR \-\- uninstall a package programmatically -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-uninstall\fR \- uninstall a package programmatically +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.uninstall(packages, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This acts much the same ways as uninstalling on the command\-line\. -. .P -The \'packages\' parameter is an array of strings\. Each element in the array is +The 'packages' parameter is an array of strings\. Each element in the array is the name of a package to be uninstalled\. -. .P -Finally, \'callback\' is a function that will be called when all packages have been +Finally, 'callback' is a function that will be called when all packages have been uninstalled or when an error has been encountered\. + diff --git a/deps/npm/man/man3/npm-unpublish.3 b/deps/npm/man/man3/npm-unpublish.3 index 63be8506ee..8420247493 100644 --- a/deps/npm/man/man3/npm-unpublish.3 +++ b/deps/npm/man/man3/npm-unpublish.3 @@ -1,30 +1,24 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-UNPUBLISH" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-unpublish\fR \-\- Remove a package from the registry -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-unpublish\fR \- Remove a package from the registry +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.unpublish(package, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This removes a package version from the registry, deleting its entry and removing the tarball\. -. .P The package parameter must be defined\. -. .P Only the first element in the package parameter is used\. If there is no first element, then npm assumes that the package at the current working directory is what is meant\. -. .P If no version is specified, or if all versions are removed then the root package entry is removed from the registry entirely\. + diff --git a/deps/npm/man/man3/npm-update.3 b/deps/npm/man/man3/npm-update.3 index 740038b419..55fb3d1a37 100644 --- a/deps/npm/man/man3/npm-update.3 +++ b/deps/npm/man/man3/npm-update.3 @@ -1,18 +1,18 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-UPDATE" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-update\fR \-\- Update a package -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-update\fR \- Update a package +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.update(packages, callback) -. -.fi +.EE +.RE +.TH "DESCRIPTION" "" "September 2014" "" "" +.SH "NAME" +\fBDESCRIPTION\fR +.P Updates a package, upgrading it to the latest version\. It also installs any missing packages\. -. .P -The \'packages\' argument is an array of packages to update\. The \'callback\' parameter will be called when done or when an error occurs\. +The 'packages' argument is an array of packages to update\. The 'callback' parameter will be called when done or when an error occurs\. + diff --git a/deps/npm/man/man3/npm-version.3 b/deps/npm/man/man3/npm-version.3 index 2c79f3782f..0cbf79c909 100644 --- a/deps/npm/man/man3/npm-version.3 +++ b/deps/npm/man/man3/npm-version.3 @@ -1,27 +1,22 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-VERSION" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-version\fR \-\- Bump a package version -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-version\fR \- Bump a package version +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.version(newversion, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Run this in a package directory to bump the version and write the new data back to the package\.json file\. -. .P If run in a git repo, it will also create a version commit and tag, and fail if the repo is not clean\. -. .P Like all other commands, this function takes a string array as its first parameter\. The difference, however, is this function will fail if it does not have exactly one element\. The only element should be a version number\. + diff --git a/deps/npm/man/man3/npm-view.3 b/deps/npm/man/man3/npm-view.3 index 3e91ce6716..2201f54544 100644 --- a/deps/npm/man/man3/npm-view.3 +++ b/deps/npm/man/man3/npm-view.3 @@ -1,176 +1,131 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-VIEW" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-view\fR \-\- View registry info -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-view\fR \- View registry info +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.view(args, [silent,] callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P This command shows data about a package and prints it to the stream referenced by the \fBoutfd\fR config, which defaults to stdout\. -. .P The "args" parameter is an ordered list that closely resembles the command\-line usage\. The elements should be ordered such that the first element is the package and version (package@version)\. The version is optional\. After that, the rest of the parameters are fields with optional subfields ("field\.subfield") which can be used to get only the information desired from the registry\. -. .P The callback will be passed all of the data returned by the query\. -. .P For example, to get the package registry entry for the \fBconnect\fR package, you can do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm\.commands\.view(["connect"], callback) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P If no version is specified, "latest" is assumed\. -. .P Field names can be specified after the package descriptor\. For example, to show the dependencies of the \fBronn\fR package at version 0\.3\.5, you could do the following: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm\.commands\.view(["ronn@0\.3\.5", "dependencies"], callback) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P You can view child field by separating them with a period\. To view the git repository URL for the latest version of npm, you could do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm\.commands\.view(["npm", "repository\.url"], callback) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P For fields that are arrays, requesting a non\-numeric field will return all of the values from the objects in the list\. For example, to get all the contributor names for the "express" project, you can do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm\.commands\.view(["express", "contributors\.email"], callback) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P You may also use numeric indices in square braces to specifically select an item in an array field\. To just get the email address of the first contributor in the list, you can do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm\.commands\.view(["express", "contributors[0]\.email"], callback) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Multiple fields may be specified, and will be printed one after another\. For exampls, to get all the contributor names and email addresses, you can do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm\.commands\.view(["express", "contributors\.name", "contributors\.email"], callback) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P "Person" fields are shown as a string if they would be shown as an object\. So, for example, this will show the list of npm contributors in the shortened string format\. (See \fBnpm help json\fR for more on this\.) -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm\.commands\.view(["npm", "contributors"], callback) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P If a version range is provided, then data will be printed for every matching version of the package\. This will show which version of jsdom was required by each matching version of yui3: -. -.IP "" 4 -. -.nf -npm\.commands\.view(["yui3@\'>0\.5\.4\'", "dependencies\.jsdom"], callback) -. -.fi -. -.IP "" 0 -. -.SH "OUTPUT" +.P +.RS 2 +.EX +npm\.commands\.view(["yui3@'>0\.5\.4'", "dependencies\.jsdom"], callback) +.EE +.RE +.SH OUTPUT +.P If only a single string field for a single version is output, then it will not be colorized or quoted, so as to enable piping the output to another command\. -. .P If the version range matches multiple versions, than each printed value will be prefixed with the version it applies to\. -. .P If multiple fields are requested, than each of them are prefixed with the field name\. -. .P -Console output can be disabled by setting the \'silent\' parameter to true\. -. -.SH "RETURN VALUE" +Console output can be disabled by setting the 'silent' parameter to true\. +.SH RETURN VALUE +.P The data returned will be an object in this formation: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { : { : , \.\.\. } , \.\.\. } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P corresponding to the list of fields selected\. + diff --git a/deps/npm/man/man3/npm-whoami.3 b/deps/npm/man/man3/npm-whoami.3 index 1a0a43cf51..272d6b16bf 100644 --- a/deps/npm/man/man3/npm-whoami.3 +++ b/deps/npm/man/man3/npm-whoami.3 @@ -1,24 +1,19 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-WHOAMI" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm-whoami\fR \-\- Display npm username -. -.SH "SYNOPSIS" -. -.nf +\fBnpm-whoami\fR \- Display npm username +.SH SYNOPSIS +.P +.RS 2 +.EX npm\.commands\.whoami(args, callback) -. -.fi -. -.SH "DESCRIPTION" +.EE +.RE +.SH DESCRIPTION +.P Print the \fBusername\fR config to standard output\. -. .P -\'args\' is never used and callback is never called with data\. -\'args\' must be present or things will break\. -. +\|'args' is never used and callback is never called with data\. +\|'args' must be present or things will break\. .P This function is not useful programmatically + diff --git a/deps/npm/man/man3/npm.3 b/deps/npm/man/man3/npm.3 index e762dc4851..41103a0c52 100644 --- a/deps/npm/man/man3/npm.3 +++ b/deps/npm/man/man3/npm.3 @@ -1,162 +1,125 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM" "3" "September 2014" "" "" -. .SH "NAME" -\fBnpm\fR \-\- node package manager -. -.SH "SYNOPSIS" -. -.nf +\fBnpm\fR \- node package manager +.SH SYNOPSIS +.P +.RS 2 +.EX var npm = require("npm") npm\.load([configObject, ]function (er, npm) { - // use the npm object, now that it\'s loaded\. + // use the npm object, now that it's loaded\. + npm\.config\.set(key, val) val = npm\.config\.get(key) + console\.log("prefix = %s", npm\.prefix) + npm\.commands\.install(["package"], cb) }) -. -.fi -. -.SH "VERSION" -1.4.28 -. -.SH "DESCRIPTION" +.EE +.RE +.SH VERSION +.P +2.0.0 +.SH DESCRIPTION +.P This is the API documentation for npm\. To find documentation of the command line client, see npm help \fBnpm\fR\|\. -. .P -Prior to using npm\'s commands, \fBnpm\.load()\fR must be called\. +Prior to using npm's commands, \fBnpm\.load()\fR must be called\. If you provide \fBconfigObject\fR as an object hash of top\-level configs, they override the values stored in the various config locations\. In the npm command line client, this set of configs is parsed from the command line options\. Additional configuration -params are loaded from two configuration files\. See npm help \fBnpm\-config\fR, npm help 7 \fBnpm\-config\fR, and npm help 5 \fBnpmrc\fR for more information\. -. +params are loaded from two configuration files\. See npm help \fBnpm\-config\fR, +npm help 7 \fBnpm\-config\fR, and npm help 5 \fBnpmrc\fR for more information\. .P After that, each of the functions are accessible in the commands object: \fBnpm\.commands\.\fR\|\. See npm help 7 \fBnpm\-index\fR for a list of all possible commands\. -. .P -All commands on the command object take an \fBarray\fR of positional argument \fBstrings\fR\|\. The last argument to any function is a callback\. Some +All commands on the command object take an \fBarray\fR of positional argument +\fBstrings\fR\|\. The last argument to any function is a callback\. Some commands take other optional arguments\. -. .P Configs cannot currently be set on a per function basis, as each call to npm\.config\.set will change the value for \fIall\fR npm commands in that process\. -. .P To find API documentation for a specific command, run the \fBnpm apihelp\fR command\. -. -.SH "METHODS AND PROPERTIES" -. -.IP "\(bu" 4 +.SH METHODS AND PROPERTIES +.RS 0 +.IP \(bu 2 \fBnpm\.load(configs, cb)\fR -. -.IP -Load the configuration params, and call the \fBcb\fR function once the -globalconfig and userconfig files have been loaded as well, or on -nextTick if they\'ve already been loaded\. -. -.IP "\(bu" 4 + Load the configuration params, and call the \fBcb\fR function once the + globalconfig and userconfig files have been loaded as well, or on + nextTick if they've already been loaded\. +.IP \(bu 2 \fBnpm\.config\fR -. -.IP -An object for accessing npm configuration parameters\. -. -.IP "\(bu" 4 + An object for accessing npm configuration parameters\. +.RS 0 +.IP \(bu 2 \fBnpm\.config\.get(key)\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fBnpm\.config\.set(key, val)\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fBnpm\.config\.del(key)\fR -. -.IP "" 0 -. -.IP "\(bu" 4 +.RE +.IP \(bu 2 \fBnpm\.dir\fR or \fBnpm\.root\fR -. -.IP -The \fBnode_modules\fR directory where npm will operate\. -. -.IP "\(bu" 4 + The \fBnode_modules\fR directory where npm will operate\. +.IP \(bu 2 \fBnpm\.prefix\fR -. -.IP -The prefix where npm is operating\. (Most often the current working -directory\.) -. -.IP "\(bu" 4 + The prefix where npm is operating\. (Most often the current working + directory\.) +.IP \(bu 2 \fBnpm\.cache\fR -. -.IP -The place where npm keeps JSON and tarballs it fetches from the -registry (or uploads to the registry)\. -. -.IP "\(bu" 4 + The place where npm keeps JSON and tarballs it fetches from the + registry (or uploads to the registry)\. +.IP \(bu 2 \fBnpm\.tmp\fR -. -.IP -npm\'s temporary working directory\. -. -.IP "\(bu" 4 + npm's temporary working directory\. +.IP \(bu 2 \fBnpm\.deref\fR -. -.IP -Get the "real" name for a command that has either an alias or -abbreviation\. -. -.IP "" 0 -. -.SH "MAGIC" + Get the "real" name for a command that has either an alias or + abbreviation\. + +.RE +.SH MAGIC +.P For each of the methods in the \fBnpm\.commands\fR hash, a method is added to the npm object, which takes a set of positional string arguments rather than an array and a callback\. -. .P If the last argument is a callback, then it will use the supplied callback\. However, if no callback is provided, then it will print out the error or results\. -. .P For example, this would work in a node repl: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX > npm = require("npm") > npm\.load() // wait a sec\.\.\. > npm\.install("dnode", "express") -. -.fi -. -.IP "" 0 -. +.EE +.RE .P -Note that that \fIwon\'t\fR work in a node program, since the \fBinstall\fR +Note that that \fIwon't\fR work in a node program, since the \fBinstall\fR method will get called before the configuration load is completed\. -. -.SH "ABBREVS" -In order to support \fBnpm ins foo\fR instead of \fBnpm install foo\fR, the \fBnpm\.commands\fR object has a set of abbreviations as well as the full +.SH ABBREVS +.P +In order to support \fBnpm ins foo\fR instead of \fBnpm install foo\fR, the +\fBnpm\.commands\fR object has a set of abbreviations as well as the full method names\. Use the \fBnpm\.deref\fR method to find the real name\. -. .P For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX var cmd = npm\.deref("unp") // cmd === "unpublish" -. -.fi -. -.IP "" 0 +.EE +.RE diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5 index d349c1f43a..4f4d2cc325 100644 --- a/deps/npm/man/man5/npm-folders.5 +++ b/deps/npm/man/man5/npm-folders.5 @@ -1,141 +1,132 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-FOLDERS" "5" "September 2014" "" "" -. .SH "NAME" -\fBnpm-folders\fR \-\- Folder Structures Used by npm -. -.SH "DESCRIPTION" -npm puts various things on your computer\. That\'s its job\. -. +\fBnpm-folders\fR \- Folder Structures Used by npm +.SH DESCRIPTION +.P +npm puts various things on your computer\. That's its job\. .P This document will tell you what it puts where\. -. -.SS "tl;dr" -. -.IP "\(bu" 4 +.SS tl;dr +.RS 0 +.IP \(bu 2 Local install (default): puts stuff in \fB\|\./node_modules\fR of the current package root\. -. -.IP "\(bu" 4 +.IP \(bu 2 Global install (with \fB\-g\fR): puts stuff in /usr/local or wherever node is installed\. -. -.IP "\(bu" 4 -Install it \fBlocally\fR if you\'re going to \fBrequire()\fR it\. -. -.IP "\(bu" 4 -Install it \fBglobally\fR if you\'re going to run it on the command line\. -. -.IP "\(bu" 4 +.IP \(bu 2 +Install it \fBlocally\fR if you're going to \fBrequire()\fR it\. +.IP \(bu 2 +Install it \fBglobally\fR if you're going to run it on the command line\. +.IP \(bu 2 If you need both, then install it in both places, or use \fBnpm link\fR\|\. -. -.IP "" 0 -. -.SS "prefix Configuration" + +.RE +.SS prefix Configuration +.P The \fBprefix\fR config defaults to the location where node is installed\. On most systems, this is \fB/usr/local\fR, and most of the time is the same -as node\'s \fBprocess\.installPrefix\fR\|\. -. +as node's \fBprocess\.installPrefix\fR\|\. .P On windows, this is the exact location of the node\.exe binary\. On Unix -systems, it\'s one level up, since node is typically installed at \fB{prefix}/bin/node\fR rather than \fB{prefix}/node\.exe\fR\|\. -. +systems, it's one level up, since node is typically installed at +\fB{prefix}/bin/node\fR rather than \fB{prefix}/node\.exe\fR\|\. .P When the \fBglobal\fR flag is set, npm installs things into this prefix\. When it is not set, it uses the root of the current package, or the current working directory if not in a package already\. -. -.SS "Node Modules" +.SS Node Modules +.P Packages are dropped into the \fBnode_modules\fR folder under the \fBprefix\fR\|\. -When installing locally, this means that you can \fBrequire("packagename")\fR to load its main module, or \fBrequire("packagename/lib/path/to/sub/module")\fR to load other modules\. -. +When installing locally, this means that you can +\fBrequire("packagename")\fR to load its main module, or +\fBrequire("packagename/lib/path/to/sub/module")\fR to load other modules\. .P Global installs on Unix systems go to \fB{prefix}/lib/node_modules\fR\|\. -Global installs on Windows go to \fB{prefix}/node_modules\fR (that is, no \fBlib\fR folder\.) -. +Global installs on Windows go to \fB{prefix}/node_modules\fR (that is, no +\fBlib\fR folder\.) +.P +Scoped packages are installed the same way, except they are grouped together +in a sub\-folder of the relevant \fBnode_modules\fR folder with the name of that +scope prefix by the @ symbol, e\.g\. \fBnpm install @myorg/package\fR would place +the package in \fB{prefix}/node_modules/@myorg/package\fR\|\. See npm help 7 \fBscopes\fR for +more details\. .P If you wish to \fBrequire()\fR a package, then install it locally\. -. -.SS "Executables" +.SS Executables +.P When in global mode, executables are linked into \fB{prefix}/bin\fR on Unix, or directly into \fB{prefix}\fR on Windows\. -. .P -When in local mode, executables are linked into \fB\|\./node_modules/\.bin\fR so that they can be made available to scripts run +When in local mode, executables are linked into +\fB\|\./node_modules/\.bin\fR so that they can be made available to scripts run through npm\. (For example, so that a test runner will be in the path when you run \fBnpm test\fR\|\.) -. -.SS "Man Pages" +.SS Man Pages +.P When in global mode, man pages are linked into \fB{prefix}/share/man\fR\|\. -. .P When in local mode, man pages are not installed\. -. .P Man pages are not installed on Windows systems\. -. -.SS "Cache" -See npm help \fBnpm\-cache\fR\|\. Cache files are stored in \fB~/\.npm\fR on Posix, or \fB~/npm\-cache\fR on Windows\. -. +.SS Cache +.P +See npm help \fBnpm\-cache\fR\|\. Cache files are stored in \fB~/\.npm\fR on Posix, or +\fB~/npm\-cache\fR on Windows\. .P This is controlled by the \fBcache\fR configuration param\. -. -.SS "Temp Files" -Temporary files are stored by default in the folder specified by the \fBtmp\fR config, which defaults to the TMPDIR, TMP, or TEMP environment +.SS Temp Files +.P +Temporary files are stored by default in the folder specified by the +\fBtmp\fR config, which defaults to the TMPDIR, TMP, or TEMP environment variables, or \fB/tmp\fR on Unix and \fBc:\\windows\\temp\fR on Windows\. -. .P Temp files are given a unique folder under this root for each run of the program, and are deleted upon successful exit\. -. -.SH "More Information" -When installing locally, npm first tries to find an appropriate \fBprefix\fR folder\. This is so that \fBnpm install foo@1\.2\.3\fR will install +.SH More Information +.P +When installing locally, npm first tries to find an appropriate +\fBprefix\fR folder\. This is so that \fBnpm install foo@1\.2\.3\fR will install to the sensible root of your package, even if you happen to have \fBcd\fRed into some other folder\. -. .P Starting at the $PWD, npm will walk up the folder tree checking for a folder that contains either a \fBpackage\.json\fR file, or a \fBnode_modules\fR folder\. If such a thing is found, then that is treated as the effective "current directory" for the purpose of running npm commands\. (This -behavior is inspired by and similar to git\'s \.git\-folder seeking +behavior is inspired by and similar to git's \.git\-folder seeking logic when running git commands in a working dir\.) -. .P If no package root is found, then the current folder is used\. -. .P When you run \fBnpm install foo@1\.2\.3\fR, then the package is loaded into the cache, and then unpacked into \fB\|\./node_modules/foo\fR\|\. Then, any of -foo\'s dependencies are similarly unpacked into \fB\|\./node_modules/foo/node_modules/\.\.\.\fR\|\. -. +foo's dependencies are similarly unpacked into +\fB\|\./node_modules/foo/node_modules/\.\.\.\fR\|\. .P Any bin files are symlinked to \fB\|\./node_modules/\.bin/\fR, so that they may be found by npm scripts when necessary\. -. -.SS "Global Installation" +.SS Global Installation +.P If the \fBglobal\fR configuration is set to true, then npm will install packages "globally"\. -. .P For global installation, packages are installed roughly the same way, but using the folders described above\. -. -.SS "Cycles, Conflicts, and Folder Parsimony" -Cycles are handled using the property of node\'s module system that it +.SS Cycles, Conflicts, and Folder Parsimony +.P +Cycles are handled using the property of node's module system that it walks up the directories looking for \fBnode_modules\fR folders\. So, at every stage, if a package is already installed in an ancestor \fBnode_modules\fR folder, then it is not installed at the current location\. -. .P Consider the case above, where \fBfoo \-> bar \-> baz\fR\|\. Imagine if, in -addition to that, baz depended on bar, so you\'d have: \fBfoo \-> bar \-> baz \-> bar \-> baz \.\.\.\fR\|\. However, since the folder -structure is: \fBfoo/node_modules/bar/node_modules/baz\fR, there\'s no need to +addition to that, baz depended on bar, so you'd have: +\fBfoo \-> bar \-> baz \-> bar \-> baz \.\.\.\fR\|\. However, since the folder +structure is: \fBfoo/node_modules/bar/node_modules/baz\fR, there's no need to put another copy of bar into \fB\|\.\.\./baz/node_modules\fR, since when it calls -require("bar"), it will get the copy that is installed in \fBfoo/node_modules/bar\fR\|\. -. +require("bar"), it will get the copy that is installed in +\fBfoo/node_modules/bar\fR\|\. .P This shortcut is only used if the exact same version would be installed in multiple nested \fBnode_modules\fR folders\. It @@ -143,17 +134,15 @@ is still possible to have \fBa/node_modules/b/node_modules/a\fR if the two "a" packages are different versions\. However, without repeating the exact same package multiple times, an infinite regress will always be prevented\. -. .P Another optimization can be made by installing dependencies at the highest level possible, below the localized "target" folder\. -. -.SS "\fIExample\fR" +.SS Example +.P Consider this dependency graph: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX foo +\-\- blerg@1\.2\.5 +\-\- bar@1\.2\.3 @@ -165,17 +154,13 @@ foo `\-\- baz@1\.2\.3 `\-\- quux@3\.x `\-\- bar -. -.fi -. -.IP "" 0 -. +.EE +.RE .P In this case, we might expect a folder structure like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX foo +\-\- node_modules +\-\- blerg (1\.2\.5) <\-\-\-[A] @@ -188,77 +173,59 @@ foo `\-\- baz (1\.2\.3) <\-\-\-[D] `\-\- node_modules `\-\- quux (3\.2\.0) <\-\-\-[E] -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Since foo depends directly on \fBbar@1\.2\.3\fR and \fBbaz@1\.2\.3\fR, those are -installed in foo\'s \fBnode_modules\fR folder\. -. +installed in foo's \fBnode_modules\fR folder\. .P Even though the latest copy of blerg is 1\.3\.7, foo has a specific dependency on version 1\.2\.5\. So, that gets installed at [A]\. Since the -parent installation of blerg satisfies bar\'s dependency on \fBblerg@1\.x\fR, +parent installation of blerg satisfies bar's dependency on \fBblerg@1\.x\fR, it does not install another copy under [B]\. -. .P Bar [B] also has dependencies on baz and asdf, so those are installed in -bar\'s \fBnode_modules\fR folder\. Because it depends on \fBbaz@2\.x\fR, it cannot +bar's \fBnode_modules\fR folder\. Because it depends on \fBbaz@2\.x\fR, it cannot re\-use the \fBbaz@1\.2\.3\fR installed in the parent \fBnode_modules\fR folder [D], and must install its own copy [C]\. -. .P Underneath bar, the \fBbaz \-> quux \-> bar\fR dependency creates a cycle\. -However, because bar is already in quux\'s ancestry [B], it does not +However, because bar is already in quux's ancestry [B], it does not unpack another copy of bar into that folder\. -. .P -Underneath \fBfoo \-> baz\fR [D], quux\'s [E] folder tree is empty, because its +Underneath \fBfoo \-> baz\fR [D], quux's [E] folder tree is empty, because its dependency on bar is satisfied by the parent folder copy installed at [B]\. -. .P For a graphical breakdown of what is installed where, use \fBnpm ls\fR\|\. -. -.SS "Publishing" +.SS Publishing +.P Upon publishing, npm will look in the \fBnode_modules\fR folder\. If any of the items there are not in the \fBbundledDependencies\fR array, then they will not be included in the package tarball\. -. .P This allows a package maintainer to install all of their dependencies (and dev dependencies) locally, but only re\-publish those items that cannot be found elsewhere\. See npm help 5 \fBpackage\.json\fR for more information\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 faq -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help pack -. -.IP "\(bu" 4 +.IP \(bu 2 npm help cache -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help publish -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5 index d349c1f43a..4f4d2cc325 100644 --- a/deps/npm/man/man5/npm-global.5 +++ b/deps/npm/man/man5/npm-global.5 @@ -1,141 +1,132 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-FOLDERS" "5" "September 2014" "" "" -. .SH "NAME" -\fBnpm-folders\fR \-\- Folder Structures Used by npm -. -.SH "DESCRIPTION" -npm puts various things on your computer\. That\'s its job\. -. +\fBnpm-folders\fR \- Folder Structures Used by npm +.SH DESCRIPTION +.P +npm puts various things on your computer\. That's its job\. .P This document will tell you what it puts where\. -. -.SS "tl;dr" -. -.IP "\(bu" 4 +.SS tl;dr +.RS 0 +.IP \(bu 2 Local install (default): puts stuff in \fB\|\./node_modules\fR of the current package root\. -. -.IP "\(bu" 4 +.IP \(bu 2 Global install (with \fB\-g\fR): puts stuff in /usr/local or wherever node is installed\. -. -.IP "\(bu" 4 -Install it \fBlocally\fR if you\'re going to \fBrequire()\fR it\. -. -.IP "\(bu" 4 -Install it \fBglobally\fR if you\'re going to run it on the command line\. -. -.IP "\(bu" 4 +.IP \(bu 2 +Install it \fBlocally\fR if you're going to \fBrequire()\fR it\. +.IP \(bu 2 +Install it \fBglobally\fR if you're going to run it on the command line\. +.IP \(bu 2 If you need both, then install it in both places, or use \fBnpm link\fR\|\. -. -.IP "" 0 -. -.SS "prefix Configuration" + +.RE +.SS prefix Configuration +.P The \fBprefix\fR config defaults to the location where node is installed\. On most systems, this is \fB/usr/local\fR, and most of the time is the same -as node\'s \fBprocess\.installPrefix\fR\|\. -. +as node's \fBprocess\.installPrefix\fR\|\. .P On windows, this is the exact location of the node\.exe binary\. On Unix -systems, it\'s one level up, since node is typically installed at \fB{prefix}/bin/node\fR rather than \fB{prefix}/node\.exe\fR\|\. -. +systems, it's one level up, since node is typically installed at +\fB{prefix}/bin/node\fR rather than \fB{prefix}/node\.exe\fR\|\. .P When the \fBglobal\fR flag is set, npm installs things into this prefix\. When it is not set, it uses the root of the current package, or the current working directory if not in a package already\. -. -.SS "Node Modules" +.SS Node Modules +.P Packages are dropped into the \fBnode_modules\fR folder under the \fBprefix\fR\|\. -When installing locally, this means that you can \fBrequire("packagename")\fR to load its main module, or \fBrequire("packagename/lib/path/to/sub/module")\fR to load other modules\. -. +When installing locally, this means that you can +\fBrequire("packagename")\fR to load its main module, or +\fBrequire("packagename/lib/path/to/sub/module")\fR to load other modules\. .P Global installs on Unix systems go to \fB{prefix}/lib/node_modules\fR\|\. -Global installs on Windows go to \fB{prefix}/node_modules\fR (that is, no \fBlib\fR folder\.) -. +Global installs on Windows go to \fB{prefix}/node_modules\fR (that is, no +\fBlib\fR folder\.) +.P +Scoped packages are installed the same way, except they are grouped together +in a sub\-folder of the relevant \fBnode_modules\fR folder with the name of that +scope prefix by the @ symbol, e\.g\. \fBnpm install @myorg/package\fR would place +the package in \fB{prefix}/node_modules/@myorg/package\fR\|\. See npm help 7 \fBscopes\fR for +more details\. .P If you wish to \fBrequire()\fR a package, then install it locally\. -. -.SS "Executables" +.SS Executables +.P When in global mode, executables are linked into \fB{prefix}/bin\fR on Unix, or directly into \fB{prefix}\fR on Windows\. -. .P -When in local mode, executables are linked into \fB\|\./node_modules/\.bin\fR so that they can be made available to scripts run +When in local mode, executables are linked into +\fB\|\./node_modules/\.bin\fR so that they can be made available to scripts run through npm\. (For example, so that a test runner will be in the path when you run \fBnpm test\fR\|\.) -. -.SS "Man Pages" +.SS Man Pages +.P When in global mode, man pages are linked into \fB{prefix}/share/man\fR\|\. -. .P When in local mode, man pages are not installed\. -. .P Man pages are not installed on Windows systems\. -. -.SS "Cache" -See npm help \fBnpm\-cache\fR\|\. Cache files are stored in \fB~/\.npm\fR on Posix, or \fB~/npm\-cache\fR on Windows\. -. +.SS Cache +.P +See npm help \fBnpm\-cache\fR\|\. Cache files are stored in \fB~/\.npm\fR on Posix, or +\fB~/npm\-cache\fR on Windows\. .P This is controlled by the \fBcache\fR configuration param\. -. -.SS "Temp Files" -Temporary files are stored by default in the folder specified by the \fBtmp\fR config, which defaults to the TMPDIR, TMP, or TEMP environment +.SS Temp Files +.P +Temporary files are stored by default in the folder specified by the +\fBtmp\fR config, which defaults to the TMPDIR, TMP, or TEMP environment variables, or \fB/tmp\fR on Unix and \fBc:\\windows\\temp\fR on Windows\. -. .P Temp files are given a unique folder under this root for each run of the program, and are deleted upon successful exit\. -. -.SH "More Information" -When installing locally, npm first tries to find an appropriate \fBprefix\fR folder\. This is so that \fBnpm install foo@1\.2\.3\fR will install +.SH More Information +.P +When installing locally, npm first tries to find an appropriate +\fBprefix\fR folder\. This is so that \fBnpm install foo@1\.2\.3\fR will install to the sensible root of your package, even if you happen to have \fBcd\fRed into some other folder\. -. .P Starting at the $PWD, npm will walk up the folder tree checking for a folder that contains either a \fBpackage\.json\fR file, or a \fBnode_modules\fR folder\. If such a thing is found, then that is treated as the effective "current directory" for the purpose of running npm commands\. (This -behavior is inspired by and similar to git\'s \.git\-folder seeking +behavior is inspired by and similar to git's \.git\-folder seeking logic when running git commands in a working dir\.) -. .P If no package root is found, then the current folder is used\. -. .P When you run \fBnpm install foo@1\.2\.3\fR, then the package is loaded into the cache, and then unpacked into \fB\|\./node_modules/foo\fR\|\. Then, any of -foo\'s dependencies are similarly unpacked into \fB\|\./node_modules/foo/node_modules/\.\.\.\fR\|\. -. +foo's dependencies are similarly unpacked into +\fB\|\./node_modules/foo/node_modules/\.\.\.\fR\|\. .P Any bin files are symlinked to \fB\|\./node_modules/\.bin/\fR, so that they may be found by npm scripts when necessary\. -. -.SS "Global Installation" +.SS Global Installation +.P If the \fBglobal\fR configuration is set to true, then npm will install packages "globally"\. -. .P For global installation, packages are installed roughly the same way, but using the folders described above\. -. -.SS "Cycles, Conflicts, and Folder Parsimony" -Cycles are handled using the property of node\'s module system that it +.SS Cycles, Conflicts, and Folder Parsimony +.P +Cycles are handled using the property of node's module system that it walks up the directories looking for \fBnode_modules\fR folders\. So, at every stage, if a package is already installed in an ancestor \fBnode_modules\fR folder, then it is not installed at the current location\. -. .P Consider the case above, where \fBfoo \-> bar \-> baz\fR\|\. Imagine if, in -addition to that, baz depended on bar, so you\'d have: \fBfoo \-> bar \-> baz \-> bar \-> baz \.\.\.\fR\|\. However, since the folder -structure is: \fBfoo/node_modules/bar/node_modules/baz\fR, there\'s no need to +addition to that, baz depended on bar, so you'd have: +\fBfoo \-> bar \-> baz \-> bar \-> baz \.\.\.\fR\|\. However, since the folder +structure is: \fBfoo/node_modules/bar/node_modules/baz\fR, there's no need to put another copy of bar into \fB\|\.\.\./baz/node_modules\fR, since when it calls -require("bar"), it will get the copy that is installed in \fBfoo/node_modules/bar\fR\|\. -. +require("bar"), it will get the copy that is installed in +\fBfoo/node_modules/bar\fR\|\. .P This shortcut is only used if the exact same version would be installed in multiple nested \fBnode_modules\fR folders\. It @@ -143,17 +134,15 @@ is still possible to have \fBa/node_modules/b/node_modules/a\fR if the two "a" packages are different versions\. However, without repeating the exact same package multiple times, an infinite regress will always be prevented\. -. .P Another optimization can be made by installing dependencies at the highest level possible, below the localized "target" folder\. -. -.SS "\fIExample\fR" +.SS Example +.P Consider this dependency graph: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX foo +\-\- blerg@1\.2\.5 +\-\- bar@1\.2\.3 @@ -165,17 +154,13 @@ foo `\-\- baz@1\.2\.3 `\-\- quux@3\.x `\-\- bar -. -.fi -. -.IP "" 0 -. +.EE +.RE .P In this case, we might expect a folder structure like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX foo +\-\- node_modules +\-\- blerg (1\.2\.5) <\-\-\-[A] @@ -188,77 +173,59 @@ foo `\-\- baz (1\.2\.3) <\-\-\-[D] `\-\- node_modules `\-\- quux (3\.2\.0) <\-\-\-[E] -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Since foo depends directly on \fBbar@1\.2\.3\fR and \fBbaz@1\.2\.3\fR, those are -installed in foo\'s \fBnode_modules\fR folder\. -. +installed in foo's \fBnode_modules\fR folder\. .P Even though the latest copy of blerg is 1\.3\.7, foo has a specific dependency on version 1\.2\.5\. So, that gets installed at [A]\. Since the -parent installation of blerg satisfies bar\'s dependency on \fBblerg@1\.x\fR, +parent installation of blerg satisfies bar's dependency on \fBblerg@1\.x\fR, it does not install another copy under [B]\. -. .P Bar [B] also has dependencies on baz and asdf, so those are installed in -bar\'s \fBnode_modules\fR folder\. Because it depends on \fBbaz@2\.x\fR, it cannot +bar's \fBnode_modules\fR folder\. Because it depends on \fBbaz@2\.x\fR, it cannot re\-use the \fBbaz@1\.2\.3\fR installed in the parent \fBnode_modules\fR folder [D], and must install its own copy [C]\. -. .P Underneath bar, the \fBbaz \-> quux \-> bar\fR dependency creates a cycle\. -However, because bar is already in quux\'s ancestry [B], it does not +However, because bar is already in quux's ancestry [B], it does not unpack another copy of bar into that folder\. -. .P -Underneath \fBfoo \-> baz\fR [D], quux\'s [E] folder tree is empty, because its +Underneath \fBfoo \-> baz\fR [D], quux's [E] folder tree is empty, because its dependency on bar is satisfied by the parent folder copy installed at [B]\. -. .P For a graphical breakdown of what is installed where, use \fBnpm ls\fR\|\. -. -.SS "Publishing" +.SS Publishing +.P Upon publishing, npm will look in the \fBnode_modules\fR folder\. If any of the items there are not in the \fBbundledDependencies\fR array, then they will not be included in the package tarball\. -. .P This allows a package maintainer to install all of their dependencies (and dev dependencies) locally, but only re\-publish those items that cannot be found elsewhere\. See npm help 5 \fBpackage\.json\fR for more information\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 faq -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help pack -. -.IP "\(bu" 4 +.IP \(bu 2 npm help cache -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help publish -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5 index 8233dc1731..8ab713ccc0 100644 --- a/deps/npm/man/man5/npm-json.5 +++ b/deps/npm/man/man5/npm-json.5 @@ -1,466 +1,385 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "PACKAGE\.JSON" "5" "September 2014" "" "" -. .SH "NAME" -\fBpackage.json\fR \-\- Specifics of npm\'s package\.json handling -. -.SH "DESCRIPTION" -This document is all you need to know about what\'s required in your package\.json +\fBpackage.json\fR \- Specifics of npm's package\.json handling +.SH DESCRIPTION +.P +This document is all you need to know about what's required in your package\.json file\. It must be actual JSON, not just a JavaScript object literal\. -. .P A lot of the behavior described in this document is affected by the config settings described in npm help 7 \fBnpm\-config\fR\|\. -. -.SH "name" +.SH name +.P The \fImost\fR important things in your package\.json are the name and version fields\. -Those are actually required, and your package won\'t install without +Those are actually required, and your package won't install without them\. The name and version together form an identifier that is assumed to be completely unique\. Changes to the package should come along with changes to the version\. -. .P The name is what your thing is called\. Some tips: -. -.IP "\(bu" 4 -Don\'t put "js" or "node" in the name\. It\'s assumed that it\'s js, since you\'re +.RS 0 +.IP \(bu 2 +Don't put "js" or "node" in the name\. It's assumed that it's js, since you're writing a package\.json file, and you can specify the engine using the "engines" field\. (See below\.) -. -.IP "\(bu" 4 +.IP \(bu 2 The name ends up being part of a URL, an argument on the command line, and a folder name\. Any name with non\-url\-safe characters will be rejected\. -Also, it can\'t start with a dot or an underscore\. -. -.IP "\(bu" 4 +Also, it can't start with a dot or an underscore\. +.IP \(bu 2 The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive\. -. -.IP "\(bu" 4 -You may want to check the npm registry to see if there\'s something by that name +.IP \(bu 2 +You may want to check the npm registry to see if there's something by that name already, before you get too attached to it\. http://registry\.npmjs\.org/ -. -.IP "" 0 -. -.SH "version" + +.RE +.P +A name can be optionally prefixed by a scope, e\.g\. \fB@myorg/mypackage\fR\|\. See +npm help 7 \fBnpm\-scope\fR for more detail\. +.SH version +.P The \fImost\fR important things in your package\.json are the name and version fields\. -Those are actually required, and your package won\'t install without +Those are actually required, and your package won't install without them\. The name and version together form an identifier that is assumed to be completely unique\. Changes to the package should come along with changes to the version\. -. .P -Version must be parseable by node\-semver \fIhttps://github\.com/isaacs/node\-semver\fR, which is bundled +Version must be parseable by +node\-semver \fIhttps://github\.com/isaacs/node\-semver\fR, which is bundled with npm as a dependency\. (\fBnpm install semver\fR to use it yourself\.) -. .P More on version numbers and ranges at npm help 7 semver\. -. -.SH "description" -Put a description in it\. It\'s a string\. This helps people discover your -package, as it\'s listed in \fBnpm search\fR\|\. -. -.SH "keywords" -Put keywords in it\. It\'s an array of strings\. This helps people -discover your package as it\'s listed in \fBnpm search\fR\|\. -. -.SH "homepage" +.SH description +.P +Put a description in it\. It's a string\. This helps people discover your +package, as it's listed in \fBnpm search\fR\|\. +.SH keywords +.P +Put keywords in it\. It's an array of strings\. This helps people +discover your package as it's listed in \fBnpm search\fR\|\. +.SH homepage +.P The url to the project homepage\. -. .P \fBNOTE\fR: This is \fInot\fR the same as "url"\. If you put a "url" field, -then the registry will think it\'s a redirection to your package that has +then the registry will think it's a redirection to your package that has been published somewhere else, and spit at you\. -. .P -Literally\. Spit\. I\'m so not kidding\. -. -.SH "bugs" -The url to your project\'s issue tracker and / or the email address to which +Literally\. Spit\. I'm so not kidding\. +.SH bugs +.P +The url to your project's issue tracker and / or the email address to which issues should be reported\. These are helpful for people who encounter issues with your package\. -. .P It should look like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "url" : "http://github\.com/owner/project/issues" , "email" : "project@hostname\.com" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P You can specify either one or both values\. If you want to provide only a url, you can specify the value for "bugs" as a simple string instead of an object\. -. .P If a url is provided, it will be used by the \fBnpm bugs\fR command\. -. -.SH "license" +.SH license +.P You should specify a license for your package so that people know how they are -permitted to use it, and any restrictions you\'re placing on it\. -. +permitted to use it, and any restrictions you're placing on it\. .P -The simplest way, assuming you\'re using a common license such as BSD\-3\-Clause -or MIT, is to just specify the standard SPDX ID of the license you\'re using, +The simplest way, assuming you're using a common license such as BSD\-3\-Clause +or MIT, is to just specify the standard SPDX ID of the license you're using, like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "license" : "BSD\-3\-Clause" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P You can check the full list of SPDX license IDs \fIhttps://spdx\.org/licenses/\fR\|\. -Ideally you should pick one that is OSI \fIhttp://opensource\.org/licenses/alphabetical\fR approved\. -. +Ideally you should pick one that is +OSI \fIhttp://opensource\.org/licenses/alphabetical\fR approved\. .P -It\'s also a good idea to include a LICENSE file at the top level in +It's also a good idea to include a LICENSE file at the top level in your package\. -. -.SH "people fields: author, contributors" +.SH people fields: author, contributors +.P The "author" is one person\. "contributors" is an array of people\. A "person" is an object with a "name" field and optionally "url" and "email", like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name" : "Barney Rubble" , "email" : "b@rubble\.com" , "url" : "http://barnyrubble\.tumblr\.com/" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Or you can shorten that all into a single string, and npm will parse it for you: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX "Barney Rubble (http://barnyrubble\.tumblr\.com/) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Both email and url are optional either way\. -. .P npm also sets a top\-level "maintainers" field with your npm user info\. -. -.SH "files" +.SH files +.P The "files" field is an array of files to include in your project\. If you name a folder in the array, then it will also include the files inside that folder\. (Unless they would be ignored by another rule\.) -. .P You can also provide a "\.npmignore" file in the root of your package, which will keep files from being included, even if they would be picked up by the files array\. The "\.npmignore" file works just like a "\.gitignore"\. -. -.SH "main" +.SH main +.P The main field is a module ID that is the primary entry point to your program\. -That is, if your package is named \fBfoo\fR, and a user installs it, and then does \fBrequire("foo")\fR, then your main module\'s exports object will be returned\. -. +That is, if your package is named \fBfoo\fR, and a user installs it, and then does +\fBrequire("foo")\fR, then your main module's exports object will be returned\. .P This should be a module ID relative to the root of your package folder\. -. .P For most modules, it makes the most sense to have a main script and often not much else\. -. -.SH "bin" -A lot of packages have one or more executable files that they\'d like to +.SH bin +.P +A lot of packages have one or more executable files that they'd like to install into the PATH\. npm makes this pretty easy (in fact, it uses this feature to install the "npm" executable\.) -. .P To use this, supply a \fBbin\fR field in your package\.json which is a map of -command name to local file name\. On install, npm will symlink that file into \fBprefix/bin\fR for global installs, or \fB\|\./node_modules/\.bin/\fR for local +command name to local file name\. On install, npm will symlink that file into +\fBprefix/bin\fR for global installs, or \fB\|\./node_modules/\.bin/\fR for local installs\. -. .P For example, npm has this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "bin" : { "npm" : "\./cli\.js" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P -So, when you install npm, it\'ll create a symlink from the \fBcli\.js\fR script to \fB/usr/local/bin/npm\fR\|\. -. +So, when you install npm, it'll create a symlink from the \fBcli\.js\fR script to +\fB/usr/local/bin/npm\fR\|\. .P If you have a single executable, and its name should be the name of the package, then you can just supply it as a string\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "my\-program" , "version": "1\.2\.5" , "bin": "\./path/to/program" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P would be the same as this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "my\-program" , "version": "1\.2\.5" , "bin" : { "my\-program" : "\./path/to/program" } } -. -.fi -. -.IP "" 0 -. -.SH "man" -Specify either a single file or an array of filenames to put in place for the \fBman\fR program to find\. -. -.P -If only a single file is provided, then it\'s installed such that it is the +.EE +.RE +.SH man +.P +Specify either a single file or an array of filenames to put in place for the +\fBman\fR program to find\. +.P +If only a single file is provided, then it's installed such that it is the result from \fBman \fR, regardless of its actual filename\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name" : "foo" , "version" : "1\.2\.3" , "description" : "A packaged foo fooer for fooing foos" , "main" : "foo\.js" , "man" : "\./man/doc\.1" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P would link the \fB\|\./man/doc\.1\fR file in such that it is the target for \fBman foo\fR -. .P -If the filename doesn\'t start with the package name, then it\'s prefixed\. +If the filename doesn't start with the package name, then it's prefixed\. So, this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name" : "foo" , "version" : "1\.2\.3" , "description" : "A packaged foo fooer for fooing foos" , "main" : "foo\.js" , "man" : [ "\./man/foo\.1", "\./man/bar\.1" ] } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P will create files to do \fBman foo\fR and \fBman foo\-bar\fR\|\. -. .P Man files must end with a number, and optionally a \fB\|\.gz\fR suffix if they are compressed\. The number dictates which man section the file is installed into\. -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name" : "foo" , "version" : "1\.2\.3" , "description" : "A packaged foo fooer for fooing foos" , "main" : "foo\.js" , "man" : [ "\./man/foo\.1", "\./man/foo\.2" ] } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P will create entries for \fBman foo\fR and \fBman 2 foo\fR -. -.SH "directories" +.SH directories +.P The CommonJS Packages \fIhttp://wiki\.commonjs\.org/wiki/Packages/1\.0\fR spec details a few ways that you can indicate the structure of your package using a \fBdirectories\fR -hash\. If you look at npm\'s package\.json \fIhttp://registry\.npmjs\.org/npm/latest\fR, -you\'ll see that it has directories for doc, lib, and man\. -. +hash\. If you look at npm's package\.json \fIhttp://registry\.npmjs\.org/npm/latest\fR, +you'll see that it has directories for doc, lib, and man\. .P In the future, this information may be used in other creative ways\. -. -.SS "directories\.lib" +.SS directories\.lib +.P Tell people where the bulk of your library is\. Nothing special is done -with the lib folder in any way, but it\'s useful meta info\. -. -.SS "directories\.bin" +with the lib folder in any way, but it's useful meta info\. +.SS directories\.bin +.P If you specify a "bin" directory, then all the files in that folder will be used as the "bin" hash\. -. .P If you have a "bin" hash already, then this has no effect\. -. -.SS "directories\.man" +.SS directories\.man +.P A folder that is full of man pages\. Sugar to generate a "man" array by walking the folder\. -. -.SS "directories\.doc" +.SS directories\.doc +.P Put markdown files in here\. Eventually, these will be displayed nicely, maybe, someday\. -. -.SS "directories\.example" +.SS directories\.example +.P Put example scripts in here\. Someday, it might be exposed in some clever way\. -. -.SH "repository" +.SH repository +.P Specify the place where your code lives\. This is helpful for people who want to contribute\. If the git repo is on github, then the \fBnpm docs\fR command will be able to find you\. -. .P Do it like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX "repository" : { "type" : "git" , "url" : "http://github\.com/npm/npm\.git" } + "repository" : { "type" : "svn" , "url" : "http://v8\.googlecode\.com/svn/trunk/" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .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\. -. -.SH "scripts" +html project page that you put in your browser\. It's for computers\. +.SH scripts +.P The "scripts" member is an object hash of script commands that are run at various times in the lifecycle of your package\. The key is the lifecycle event, and the value is the command to run at that point\. -. .P See npm help 7 \fBnpm\-scripts\fR to find out more about writing package scripts\. -. -.SH "config" +.SH config +.P A "config" hash can be used to set configuration parameters used in package scripts that persist across upgrades\. For instance, if a package had the following: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name" : "foo" , "config" : { "port" : "8080" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P -and then had a "start" command that then referenced the \fBnpm_package_config_port\fR environment variable, then the user could +and then had a "start" command that then referenced the +\fBnpm_package_config_port\fR environment variable, then the user could override that by doing \fBnpm config set foo:port 8001\fR\|\. -. .P See npm help 7 \fBnpm\-config\fR and npm help 7 \fBnpm\-scripts\fR for more on package configs\. -. -.SH "dependencies" +.SH dependencies +.P Dependencies are specified with a simple hash of package name to version range\. The version range is a string which has one or more space\-separated descriptors\. Dependencies can also be identified with a tarball or git URL\. -. .P -\fBPlease do not put test harnesses or transpilers in your \fBdependencies\fR hash\.\fR See \fBdevDependencies\fR, below\. -. +\fBPlease do not put test harnesses or transpilers in your +\fBdependencies\fR hash\.\fR See \fBdevDependencies\fR, below\. .P See npm help 7 semver for more details about specifying version ranges\. -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 \fBversion\fR Must match \fBversion\fR exactly -. -.IP "\(bu" 4 +.IP \(bu 2 \fB>version\fR Must be greater than \fBversion\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB>=version\fR etc -. -.IP "\(bu" 4 +.IP \(bu 2 \fB=version1 <=version2\fR\|\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fBrange1 || range2\fR Passes if either range1 or range2 are satisfied\. -. -.IP "\(bu" 4 -\fBgit\.\.\.\fR See \'Git URLs as Dependencies\' below -. -.IP "\(bu" 4 -\fBuser/repo\fR See \'GitHub URLs\' below -. -.IP "" 0 -. +.IP \(bu 2 +\fBgit\.\.\.\fR See 'Git URLs as Dependencies' below +.IP \(bu 2 +\fBuser/repo\fR See 'GitHub URLs' below +.IP \(bu 2 +\fBtag\fR A specific version tagged and published as \fBtag\fR See npm help \fBnpm\-tag\fR +.IP \(bu 2 +\fBpath/path/path\fR See Local Paths below + +.RE .P For example, these are all valid: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "dependencies" : { "foo" : "1\.0\.0 \- 2\.9999\.9999" , "bar" : ">=1\.0\.2 <2\.1\.2" @@ -472,46 +391,40 @@ For example, these are all valid: , "elf" : "~1\.2\.3" , "two" : "2\.x" , "thr" : "3\.3\.x" + , "lat" : "latest" + , "dyl" : "~/projects/dyl" } } -. -.fi -. -.IP "" 0 -. -.SS "URLs as Dependencies" +.EE +.RE +.SS URLs as Dependencies +.P You may specify a tarball URL in place of a version range\. -. .P This tarball will be downloaded and installed locally to your package at install time\. -. -.SS "Git URLs as Dependencies" +.SS Git URLs as Dependencies +.P Git urls can be of the form: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX git://github\.com/user/project\.git#commit\-ish git+ssh://user@hostname:project\.git#commit\-ish git+ssh://user@hostname/project\.git#commit\-ish git+http://user@hostname/project/blah\.git#commit\-ish git+https://user@hostname/project/blah\.git#commit\-ish -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The \fBcommit\-ish\fR can be any tag, sha, or branch which can be supplied as an argument to \fBgit checkout\fR\|\. The default is \fBmaster\fR\|\. -. -.SH "GitHub URLs" +.SH GitHub URLs +.P As of version 1\.1\.65, you can refer to GitHub urls as just "foo": "user/foo\-project"\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "foo", "version": "0\.0\.0", @@ -519,35 +432,47 @@ As of version 1\.1\.65, you can refer to GitHub urls as just "foo": "user/foo\-p "express": "visionmedia/express" } } -. -.fi -. -.IP "" 0 -. -.SH "devDependencies" +.EE +.RE +.SH Local Paths +.P +As of version 2\.0\.0 you can provide a path to a local directory that +contains a package\. Local paths can be in the form: +.P +.RS 2 +.EX +\|\.\./foo/bar +~/foo/bar +\|\./foo/bar +/foo/bar +.EE +.RE +.P +This feature is helpful for local offline development and creating +tests that require npm installing where you don't want to hit an +external server, but should not be used when publishing packages +to the public registry\. +.SH devDependencies +.P If someone is planning on downloading and using your module in their -program, then they probably don\'t want or need to download and build +program, then they probably don't want or need to download and build the external test or documentation framework that you use\. -. .P -In this case, it\'s best to list these additional items in a \fBdevDependencies\fR hash\. -. +In this case, it's best to list these additional items in a +\fBdevDependencies\fR hash\. .P These things will be installed when doing \fBnpm link\fR or \fBnpm install\fR from the root of a package, and can be managed like any other npm configuration param\. See npm help 7 \fBnpm\-config\fR for more on the topic\. -. .P For build steps that are not platform\-specific, such as compiling CoffeeScript or other languages to JavaScript, use the \fBprepublish\fR script to do this, and make the required package a devDependency\. -. .P For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "ethopia\-waza", "description": "a delightfully fruity coffee varietal", "version": "1\.2\.3", @@ -559,29 +484,24 @@ For example: }, "main": "lib/waza\.js" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The \fBprepublish\fR script will be run before publishing, so that users can consume the functionality without requiring them to compile it -themselves\. In dev mode (ie, locally running \fBnpm install\fR), it\'ll +themselves\. In dev mode (ie, locally running \fBnpm install\fR), it'll run this script as well, so that you can test it easily\. -. -.SH "peerDependencies" +.SH peerDependencies +.P In some cases, you want to express the compatibility of your package with an host tool or library, while not necessarily doing a \fBrequire\fR of this host\. This is usually refered to as a \fIplugin\fR\|\. Notably, your module may be exposing a specific interface, expected and specified by the host documentation\. -. .P For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "tea\-latte", "version": "1\.3\.5" @@ -589,283 +509,223 @@ For example: "tea": "2\.x" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P This ensures your package \fBtea\-latte\fR can be installed \fIalong\fR with the second major version of the host package \fBtea\fR only\. The host package is automatically installed if needed\. \fBnpm install tea\-latte\fR could possibly yield the following dependency graph: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX ├── tea\-latte@1\.3\.5 └── tea@2\.2\.0 -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Trying to install another plugin with a conflicting requirement will cause an error\. For this reason, make sure your plugin requirement is as broad as possible, and not to lock it down to specific patch versions\. -. .P Assuming the host complies with semver \fIhttp://semver\.org/\fR, only changes in -the host package\'s major version will break your plugin\. Thus, if you\'ve worked +the host package's major version will break your plugin\. Thus, if you've worked with every 1\.x version of the host package, use \fB"^1\.0"\fR or \fB"1\.x"\fR to express this\. If you depend on features introduced in 1\.5\.2, use \fB">= 1\.5\.2 < 2"\fR\|\. -. -.SH "bundledDependencies" +.SH bundledDependencies +.P Array of package names that will be bundled when publishing the package\. -. .P If this is spelled \fB"bundleDependencies"\fR, then that is also honorable\. -. -.SH "optionalDependencies" +.SH optionalDependencies +.P If a dependency can be used, but you would like npm to proceed if it -cannot be found or fails to install, then you may put it in the \fBoptionalDependencies\fR hash\. This is a map of package name to version +cannot be found or fails to install, then you may put it in the +\fBoptionalDependencies\fR hash\. This is a map of package name to version or url, just like the \fBdependencies\fR hash\. The difference is that failure is tolerated\. -. .P -It is still your program\'s responsibility to handle the lack of the +It is still your program's responsibility to handle the lack of the dependency\. For example, something like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX try { - var foo = require(\'foo\') - var fooVersion = require(\'foo/package\.json\')\.version + var foo = require('foo') + var fooVersion = require('foo/package\.json')\.version } catch (er) { foo = null } if ( notGoodFooVersion(fooVersion) ) { foo = null } + // \.\. then later in your program \.\. + if (foo) { foo\.doFooThings() } -. -.fi -. -.IP "" 0 -. -.P -Entries in \fBoptionalDependencies\fR will override entries of the same name in \fBdependencies\fR, so it\'s usually best to only put in one place\. -. -.SH "engines" +.EE +.RE +.P +Entries in \fBoptionalDependencies\fR will override entries of the same name in +\fBdependencies\fR, so it's usually best to only put in one place\. +.SH engines +.P You can specify the version of node that your stuff works on: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "engines" : { "node" : ">=0\.10\.3 <0\.12" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P -And, like with dependencies, if you don\'t specify the version (or if you +And, like with dependencies, if you don't specify the version (or if you specify "*" as the version), then any version of node will do\. -. .P If you specify an "engines" field, then npm will require that "node" be somewhere on that list\. If "engines" is omitted, then npm will just assume that it works on node\. -. .P You can also use the "engines" field to specify which versions of npm are capable of properly installing your program\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "engines" : { "npm" : "~1\.0\.20" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Note that, unless the user has set the \fBengine\-strict\fR config flag, this field is advisory only\. -. -.SH "engineStrict" +.SH engineStrict +.P If you are sure that your module will \fIdefinitely not\fR run properly on versions of Node/npm other than those specified in the \fBengines\fR hash, then you can set \fB"engineStrict": true\fR in your package\.json file\. -This will override the user\'s \fBengine\-strict\fR config setting\. -. +This will override the user's \fBengine\-strict\fR config setting\. .P Please do not do this unless you are really very very sure\. If your engines hash is something overly restrictive, you can quite easily and inadvertently lock yourself into obscurity and prevent your users from updating to new versions of Node\. Consider this choice carefully\. If people abuse it, it will be removed in a future version of npm\. -. -.SH "os" +.SH os +.P You can specify which operating systems your module will run on: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX "os" : [ "darwin", "linux" ] -. -.fi -. -.IP "" 0 -. +.EE +.RE .P You can also blacklist instead of whitelist operating systems, -just prepend the blacklisted os with a \'!\': -. -.IP "" 4 -. -.nf +just prepend the blacklisted os with a '!': +.P +.RS 2 +.EX "os" : [ "!win32" ] -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The host operating system is determined by \fBprocess\.platform\fR -. .P -It is allowed to both blacklist, and whitelist, although there isn\'t any +It is allowed to both blacklist, and whitelist, although there isn't any good reason to do this\. -. -.SH "cpu" +.SH cpu +.P If your code only runs on certain cpu architectures, you can specify which ones\. -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX "cpu" : [ "x64", "ia32" ] -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Like the \fBos\fR option, you can also blacklist architectures: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX "cpu" : [ "!arm", "!mips" ] -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The host architecture is determined by \fBprocess\.arch\fR -. -.SH "preferGlobal" +.SH preferGlobal +.P If your package is primarily a command\-line application that should be installed globally, then set this value to \fBtrue\fR to provide a warning if it is installed locally\. -. .P -It doesn\'t actually prevent users from installing it locally, but it -does help prevent some confusion if it doesn\'t work as expected\. -. -.SH "private" +It doesn't actually prevent users from installing it locally, but it +does help prevent some confusion if it doesn't work as expected\. +.SH private +.P If you set \fB"private": true\fR in your package\.json, then npm will refuse to publish it\. -. .P This is a way to prevent accidental publication of private repositories\. If you would like to ensure that a given package is only ever published to a specific registry (for example, an internal registry), then use the \fBpublishConfig\fR hash described below to override the \fBregistry\fR config param at publish\-time\. -. -.SH "publishConfig" -This is a set of config values that will be used at publish\-time\. It\'s +.SH publishConfig +.P +This is a set of config values that will be used at publish\-time\. It's especially handy if you want to set the tag or registry, so that you can ensure that a given package is not tagged with "latest" or published to the global public registry by default\. -. .P Any config values can be overridden, but of course only "tag" and "registry" probably matter for the purposes of publishing\. -. .P See npm help 7 \fBnpm\-config\fR to see the list of config options that can be overridden\. -. -.SH "DEFAULT VALUES" +.SH DEFAULT VALUES +.P npm will default some values based on package contents\. -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 \fB"scripts": {"start": "node server\.js"}\fR -. -.IP If there is a \fBserver\.js\fR file in the root of your package, then npm will default the \fBstart\fR command to \fBnode server\.js\fR\|\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fB"scripts":{"preinstall": "node\-gyp rebuild"}\fR -. -.IP If there is a \fBbinding\.gyp\fR file in the root of your package, npm will default the \fBpreinstall\fR command to compile using node\-gyp\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fB"contributors": [\.\.\.]\fR -. -.IP If there is an \fBAUTHORS\fR file in the root of your package, npm will treat each line as a \fBName (url)\fR format, where email and url are optional\. Lines which start with a \fB#\fR or are blank, will be ignored\. -. -.IP "" 0 -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 + +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 semver -. -.IP "\(bu" 4 +.IP \(bu 2 npm help init -. -.IP "\(bu" 4 +.IP \(bu 2 npm help version -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help help -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 faq -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help publish -. -.IP "\(bu" 4 +.IP \(bu 2 npm help rm -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index d0b6323657..569b7c5c6b 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,103 +1,83 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPMRC" "5" "September 2014" "" "" -. .SH "NAME" -\fBnpmrc\fR \-\- The npm config files -. -.SH "DESCRIPTION" +\fBnpmrc\fR \- The npm config files +.SH DESCRIPTION +.P npm gets its config settings from the command line, environment variables, and \fBnpmrc\fR files\. -. .P The \fBnpm config\fR command can be used to update and edit the contents of the user and global npmrc files\. -. .P For a list of available configuration options, see npm help 7 config\. -. -.SH "FILES" +.SH FILES +.P The four relevant files are: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 per\-project config file (/path/to/my/project/\.npmrc) -. -.IP "\(bu" 4 +.IP \(bu 2 per\-user config file (~/\.npmrc) -. -.IP "\(bu" 4 +.IP \(bu 2 global config file ($PREFIX/npmrc) -. -.IP "\(bu" 4 +.IP \(bu 2 npm builtin config file (/path/to/npm/npmrc) -. -.IP "" 0 -. + +.RE .P All npm config files are an ini\-formatted list of \fBkey = value\fR -parameters\. Environment variables can be replaced using \fB${VARIABLE_NAME}\fR\|\. For example: -. -.IP "" 4 -. -.nf +parameters\. Environment variables can be replaced using +\fB${VARIABLE_NAME}\fR\|\. For example: +.P +.RS 2 +.EX prefix = ${HOME}/\.npm\-packages -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Each of these files is loaded, and config options are resolved in priority order\. For example, a setting in the userconfig file would override the setting in the globalconfig file\. -. -.SS "Per\-project config file" +.SS Per\-project config file +.P When working locally in a project, a \fB\|\.npmrc\fR file in the root of the project (ie, a sibling of \fBnode_modules\fR and \fBpackage\.json\fR) will set config values specific to this project\. -. .P -Note that this only applies to the root of the project that you\'re +Note that this only applies to the root of the project that you're running npm in\. It has no effect when your module is published\. For -example, you can\'t publish a module that forces itself to install +example, you can't publish a module that forces itself to install globally, or in a different location\. -. -.SS "Per\-user config file" +.SS Per\-user config file +.P \fB$HOME/\.npmrc\fR (or the \fBuserconfig\fR param, if set in the environment or on the command line) -. -.SS "Global config file" +.SS Global config file +.P \fB$PREFIX/etc/npmrc\fR (or the \fBglobalconfig\fR param, if set above): This file is an ini\-file formatted list of \fBkey = value\fR parameters\. Environment variables can be replaced as above\. -. -.SS "Built\-in config file" +.SS Built\-in config file +.P \fBpath/to/npm/itself/npmrc\fR -. .P This is an unchangeable "builtin" configuration file that npm keeps consistent across updates\. Set fields in here using the \fB\|\./configure\fR script that comes with npm\. This is primarily for distribution maintainers to override default configs in a standard and consistent manner\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 npm help npm -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5 index 8233dc1731..8ab713ccc0 100644 --- a/deps/npm/man/man5/package.json.5 +++ b/deps/npm/man/man5/package.json.5 @@ -1,466 +1,385 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "PACKAGE\.JSON" "5" "September 2014" "" "" -. .SH "NAME" -\fBpackage.json\fR \-\- Specifics of npm\'s package\.json handling -. -.SH "DESCRIPTION" -This document is all you need to know about what\'s required in your package\.json +\fBpackage.json\fR \- Specifics of npm's package\.json handling +.SH DESCRIPTION +.P +This document is all you need to know about what's required in your package\.json file\. It must be actual JSON, not just a JavaScript object literal\. -. .P A lot of the behavior described in this document is affected by the config settings described in npm help 7 \fBnpm\-config\fR\|\. -. -.SH "name" +.SH name +.P The \fImost\fR important things in your package\.json are the name and version fields\. -Those are actually required, and your package won\'t install without +Those are actually required, and your package won't install without them\. The name and version together form an identifier that is assumed to be completely unique\. Changes to the package should come along with changes to the version\. -. .P The name is what your thing is called\. Some tips: -. -.IP "\(bu" 4 -Don\'t put "js" or "node" in the name\. It\'s assumed that it\'s js, since you\'re +.RS 0 +.IP \(bu 2 +Don't put "js" or "node" in the name\. It's assumed that it's js, since you're writing a package\.json file, and you can specify the engine using the "engines" field\. (See below\.) -. -.IP "\(bu" 4 +.IP \(bu 2 The name ends up being part of a URL, an argument on the command line, and a folder name\. Any name with non\-url\-safe characters will be rejected\. -Also, it can\'t start with a dot or an underscore\. -. -.IP "\(bu" 4 +Also, it can't start with a dot or an underscore\. +.IP \(bu 2 The name will probably be passed as an argument to require(), so it should be something short, but also reasonably descriptive\. -. -.IP "\(bu" 4 -You may want to check the npm registry to see if there\'s something by that name +.IP \(bu 2 +You may want to check the npm registry to see if there's something by that name already, before you get too attached to it\. http://registry\.npmjs\.org/ -. -.IP "" 0 -. -.SH "version" + +.RE +.P +A name can be optionally prefixed by a scope, e\.g\. \fB@myorg/mypackage\fR\|\. See +npm help 7 \fBnpm\-scope\fR for more detail\. +.SH version +.P The \fImost\fR important things in your package\.json are the name and version fields\. -Those are actually required, and your package won\'t install without +Those are actually required, and your package won't install without them\. The name and version together form an identifier that is assumed to be completely unique\. Changes to the package should come along with changes to the version\. -. .P -Version must be parseable by node\-semver \fIhttps://github\.com/isaacs/node\-semver\fR, which is bundled +Version must be parseable by +node\-semver \fIhttps://github\.com/isaacs/node\-semver\fR, which is bundled with npm as a dependency\. (\fBnpm install semver\fR to use it yourself\.) -. .P More on version numbers and ranges at npm help 7 semver\. -. -.SH "description" -Put a description in it\. It\'s a string\. This helps people discover your -package, as it\'s listed in \fBnpm search\fR\|\. -. -.SH "keywords" -Put keywords in it\. It\'s an array of strings\. This helps people -discover your package as it\'s listed in \fBnpm search\fR\|\. -. -.SH "homepage" +.SH description +.P +Put a description in it\. It's a string\. This helps people discover your +package, as it's listed in \fBnpm search\fR\|\. +.SH keywords +.P +Put keywords in it\. It's an array of strings\. This helps people +discover your package as it's listed in \fBnpm search\fR\|\. +.SH homepage +.P The url to the project homepage\. -. .P \fBNOTE\fR: This is \fInot\fR the same as "url"\. If you put a "url" field, -then the registry will think it\'s a redirection to your package that has +then the registry will think it's a redirection to your package that has been published somewhere else, and spit at you\. -. .P -Literally\. Spit\. I\'m so not kidding\. -. -.SH "bugs" -The url to your project\'s issue tracker and / or the email address to which +Literally\. Spit\. I'm so not kidding\. +.SH bugs +.P +The url to your project's issue tracker and / or the email address to which issues should be reported\. These are helpful for people who encounter issues with your package\. -. .P It should look like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "url" : "http://github\.com/owner/project/issues" , "email" : "project@hostname\.com" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P You can specify either one or both values\. If you want to provide only a url, you can specify the value for "bugs" as a simple string instead of an object\. -. .P If a url is provided, it will be used by the \fBnpm bugs\fR command\. -. -.SH "license" +.SH license +.P You should specify a license for your package so that people know how they are -permitted to use it, and any restrictions you\'re placing on it\. -. +permitted to use it, and any restrictions you're placing on it\. .P -The simplest way, assuming you\'re using a common license such as BSD\-3\-Clause -or MIT, is to just specify the standard SPDX ID of the license you\'re using, +The simplest way, assuming you're using a common license such as BSD\-3\-Clause +or MIT, is to just specify the standard SPDX ID of the license you're using, like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "license" : "BSD\-3\-Clause" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P You can check the full list of SPDX license IDs \fIhttps://spdx\.org/licenses/\fR\|\. -Ideally you should pick one that is OSI \fIhttp://opensource\.org/licenses/alphabetical\fR approved\. -. +Ideally you should pick one that is +OSI \fIhttp://opensource\.org/licenses/alphabetical\fR approved\. .P -It\'s also a good idea to include a LICENSE file at the top level in +It's also a good idea to include a LICENSE file at the top level in your package\. -. -.SH "people fields: author, contributors" +.SH people fields: author, contributors +.P The "author" is one person\. "contributors" is an array of people\. A "person" is an object with a "name" field and optionally "url" and "email", like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name" : "Barney Rubble" , "email" : "b@rubble\.com" , "url" : "http://barnyrubble\.tumblr\.com/" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Or you can shorten that all into a single string, and npm will parse it for you: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX "Barney Rubble (http://barnyrubble\.tumblr\.com/) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Both email and url are optional either way\. -. .P npm also sets a top\-level "maintainers" field with your npm user info\. -. -.SH "files" +.SH files +.P The "files" field is an array of files to include in your project\. If you name a folder in the array, then it will also include the files inside that folder\. (Unless they would be ignored by another rule\.) -. .P You can also provide a "\.npmignore" file in the root of your package, which will keep files from being included, even if they would be picked up by the files array\. The "\.npmignore" file works just like a "\.gitignore"\. -. -.SH "main" +.SH main +.P The main field is a module ID that is the primary entry point to your program\. -That is, if your package is named \fBfoo\fR, and a user installs it, and then does \fBrequire("foo")\fR, then your main module\'s exports object will be returned\. -. +That is, if your package is named \fBfoo\fR, and a user installs it, and then does +\fBrequire("foo")\fR, then your main module's exports object will be returned\. .P This should be a module ID relative to the root of your package folder\. -. .P For most modules, it makes the most sense to have a main script and often not much else\. -. -.SH "bin" -A lot of packages have one or more executable files that they\'d like to +.SH bin +.P +A lot of packages have one or more executable files that they'd like to install into the PATH\. npm makes this pretty easy (in fact, it uses this feature to install the "npm" executable\.) -. .P To use this, supply a \fBbin\fR field in your package\.json which is a map of -command name to local file name\. On install, npm will symlink that file into \fBprefix/bin\fR for global installs, or \fB\|\./node_modules/\.bin/\fR for local +command name to local file name\. On install, npm will symlink that file into +\fBprefix/bin\fR for global installs, or \fB\|\./node_modules/\.bin/\fR for local installs\. -. .P For example, npm has this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "bin" : { "npm" : "\./cli\.js" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P -So, when you install npm, it\'ll create a symlink from the \fBcli\.js\fR script to \fB/usr/local/bin/npm\fR\|\. -. +So, when you install npm, it'll create a symlink from the \fBcli\.js\fR script to +\fB/usr/local/bin/npm\fR\|\. .P If you have a single executable, and its name should be the name of the package, then you can just supply it as a string\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "my\-program" , "version": "1\.2\.5" , "bin": "\./path/to/program" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P would be the same as this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "my\-program" , "version": "1\.2\.5" , "bin" : { "my\-program" : "\./path/to/program" } } -. -.fi -. -.IP "" 0 -. -.SH "man" -Specify either a single file or an array of filenames to put in place for the \fBman\fR program to find\. -. -.P -If only a single file is provided, then it\'s installed such that it is the +.EE +.RE +.SH man +.P +Specify either a single file or an array of filenames to put in place for the +\fBman\fR program to find\. +.P +If only a single file is provided, then it's installed such that it is the result from \fBman \fR, regardless of its actual filename\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name" : "foo" , "version" : "1\.2\.3" , "description" : "A packaged foo fooer for fooing foos" , "main" : "foo\.js" , "man" : "\./man/doc\.1" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P would link the \fB\|\./man/doc\.1\fR file in such that it is the target for \fBman foo\fR -. .P -If the filename doesn\'t start with the package name, then it\'s prefixed\. +If the filename doesn't start with the package name, then it's prefixed\. So, this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name" : "foo" , "version" : "1\.2\.3" , "description" : "A packaged foo fooer for fooing foos" , "main" : "foo\.js" , "man" : [ "\./man/foo\.1", "\./man/bar\.1" ] } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P will create files to do \fBman foo\fR and \fBman foo\-bar\fR\|\. -. .P Man files must end with a number, and optionally a \fB\|\.gz\fR suffix if they are compressed\. The number dictates which man section the file is installed into\. -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name" : "foo" , "version" : "1\.2\.3" , "description" : "A packaged foo fooer for fooing foos" , "main" : "foo\.js" , "man" : [ "\./man/foo\.1", "\./man/foo\.2" ] } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P will create entries for \fBman foo\fR and \fBman 2 foo\fR -. -.SH "directories" +.SH directories +.P The CommonJS Packages \fIhttp://wiki\.commonjs\.org/wiki/Packages/1\.0\fR spec details a few ways that you can indicate the structure of your package using a \fBdirectories\fR -hash\. If you look at npm\'s package\.json \fIhttp://registry\.npmjs\.org/npm/latest\fR, -you\'ll see that it has directories for doc, lib, and man\. -. +hash\. If you look at npm's package\.json \fIhttp://registry\.npmjs\.org/npm/latest\fR, +you'll see that it has directories for doc, lib, and man\. .P In the future, this information may be used in other creative ways\. -. -.SS "directories\.lib" +.SS directories\.lib +.P Tell people where the bulk of your library is\. Nothing special is done -with the lib folder in any way, but it\'s useful meta info\. -. -.SS "directories\.bin" +with the lib folder in any way, but it's useful meta info\. +.SS directories\.bin +.P If you specify a "bin" directory, then all the files in that folder will be used as the "bin" hash\. -. .P If you have a "bin" hash already, then this has no effect\. -. -.SS "directories\.man" +.SS directories\.man +.P A folder that is full of man pages\. Sugar to generate a "man" array by walking the folder\. -. -.SS "directories\.doc" +.SS directories\.doc +.P Put markdown files in here\. Eventually, these will be displayed nicely, maybe, someday\. -. -.SS "directories\.example" +.SS directories\.example +.P Put example scripts in here\. Someday, it might be exposed in some clever way\. -. -.SH "repository" +.SH repository +.P Specify the place where your code lives\. This is helpful for people who want to contribute\. If the git repo is on github, then the \fBnpm docs\fR command will be able to find you\. -. .P Do it like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX "repository" : { "type" : "git" , "url" : "http://github\.com/npm/npm\.git" } + "repository" : { "type" : "svn" , "url" : "http://v8\.googlecode\.com/svn/trunk/" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .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\. -. -.SH "scripts" +html project page that you put in your browser\. It's for computers\. +.SH scripts +.P The "scripts" member is an object hash of script commands that are run at various times in the lifecycle of your package\. The key is the lifecycle event, and the value is the command to run at that point\. -. .P See npm help 7 \fBnpm\-scripts\fR to find out more about writing package scripts\. -. -.SH "config" +.SH config +.P A "config" hash can be used to set configuration parameters used in package scripts that persist across upgrades\. For instance, if a package had the following: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name" : "foo" , "config" : { "port" : "8080" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P -and then had a "start" command that then referenced the \fBnpm_package_config_port\fR environment variable, then the user could +and then had a "start" command that then referenced the +\fBnpm_package_config_port\fR environment variable, then the user could override that by doing \fBnpm config set foo:port 8001\fR\|\. -. .P See npm help 7 \fBnpm\-config\fR and npm help 7 \fBnpm\-scripts\fR for more on package configs\. -. -.SH "dependencies" +.SH dependencies +.P Dependencies are specified with a simple hash of package name to version range\. The version range is a string which has one or more space\-separated descriptors\. Dependencies can also be identified with a tarball or git URL\. -. .P -\fBPlease do not put test harnesses or transpilers in your \fBdependencies\fR hash\.\fR See \fBdevDependencies\fR, below\. -. +\fBPlease do not put test harnesses or transpilers in your +\fBdependencies\fR hash\.\fR See \fBdevDependencies\fR, below\. .P See npm help 7 semver for more details about specifying version ranges\. -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 \fBversion\fR Must match \fBversion\fR exactly -. -.IP "\(bu" 4 +.IP \(bu 2 \fB>version\fR Must be greater than \fBversion\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB>=version\fR etc -. -.IP "\(bu" 4 +.IP \(bu 2 \fB=version1 <=version2\fR\|\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fBrange1 || range2\fR Passes if either range1 or range2 are satisfied\. -. -.IP "\(bu" 4 -\fBgit\.\.\.\fR See \'Git URLs as Dependencies\' below -. -.IP "\(bu" 4 -\fBuser/repo\fR See \'GitHub URLs\' below -. -.IP "" 0 -. +.IP \(bu 2 +\fBgit\.\.\.\fR See 'Git URLs as Dependencies' below +.IP \(bu 2 +\fBuser/repo\fR See 'GitHub URLs' below +.IP \(bu 2 +\fBtag\fR A specific version tagged and published as \fBtag\fR See npm help \fBnpm\-tag\fR +.IP \(bu 2 +\fBpath/path/path\fR See Local Paths below + +.RE .P For example, these are all valid: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "dependencies" : { "foo" : "1\.0\.0 \- 2\.9999\.9999" , "bar" : ">=1\.0\.2 <2\.1\.2" @@ -472,46 +391,40 @@ For example, these are all valid: , "elf" : "~1\.2\.3" , "two" : "2\.x" , "thr" : "3\.3\.x" + , "lat" : "latest" + , "dyl" : "~/projects/dyl" } } -. -.fi -. -.IP "" 0 -. -.SS "URLs as Dependencies" +.EE +.RE +.SS URLs as Dependencies +.P You may specify a tarball URL in place of a version range\. -. .P This tarball will be downloaded and installed locally to your package at install time\. -. -.SS "Git URLs as Dependencies" +.SS Git URLs as Dependencies +.P Git urls can be of the form: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX git://github\.com/user/project\.git#commit\-ish git+ssh://user@hostname:project\.git#commit\-ish git+ssh://user@hostname/project\.git#commit\-ish git+http://user@hostname/project/blah\.git#commit\-ish git+https://user@hostname/project/blah\.git#commit\-ish -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The \fBcommit\-ish\fR can be any tag, sha, or branch which can be supplied as an argument to \fBgit checkout\fR\|\. The default is \fBmaster\fR\|\. -. -.SH "GitHub URLs" +.SH GitHub URLs +.P As of version 1\.1\.65, you can refer to GitHub urls as just "foo": "user/foo\-project"\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "foo", "version": "0\.0\.0", @@ -519,35 +432,47 @@ As of version 1\.1\.65, you can refer to GitHub urls as just "foo": "user/foo\-p "express": "visionmedia/express" } } -. -.fi -. -.IP "" 0 -. -.SH "devDependencies" +.EE +.RE +.SH Local Paths +.P +As of version 2\.0\.0 you can provide a path to a local directory that +contains a package\. Local paths can be in the form: +.P +.RS 2 +.EX +\|\.\./foo/bar +~/foo/bar +\|\./foo/bar +/foo/bar +.EE +.RE +.P +This feature is helpful for local offline development and creating +tests that require npm installing where you don't want to hit an +external server, but should not be used when publishing packages +to the public registry\. +.SH devDependencies +.P If someone is planning on downloading and using your module in their -program, then they probably don\'t want or need to download and build +program, then they probably don't want or need to download and build the external test or documentation framework that you use\. -. .P -In this case, it\'s best to list these additional items in a \fBdevDependencies\fR hash\. -. +In this case, it's best to list these additional items in a +\fBdevDependencies\fR hash\. .P These things will be installed when doing \fBnpm link\fR or \fBnpm install\fR from the root of a package, and can be managed like any other npm configuration param\. See npm help 7 \fBnpm\-config\fR for more on the topic\. -. .P For build steps that are not platform\-specific, such as compiling CoffeeScript or other languages to JavaScript, use the \fBprepublish\fR script to do this, and make the required package a devDependency\. -. .P For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "ethopia\-waza", "description": "a delightfully fruity coffee varietal", "version": "1\.2\.3", @@ -559,29 +484,24 @@ For example: }, "main": "lib/waza\.js" } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The \fBprepublish\fR script will be run before publishing, so that users can consume the functionality without requiring them to compile it -themselves\. In dev mode (ie, locally running \fBnpm install\fR), it\'ll +themselves\. In dev mode (ie, locally running \fBnpm install\fR), it'll run this script as well, so that you can test it easily\. -. -.SH "peerDependencies" +.SH peerDependencies +.P In some cases, you want to express the compatibility of your package with an host tool or library, while not necessarily doing a \fBrequire\fR of this host\. This is usually refered to as a \fIplugin\fR\|\. Notably, your module may be exposing a specific interface, expected and specified by the host documentation\. -. .P For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name": "tea\-latte", "version": "1\.3\.5" @@ -589,283 +509,223 @@ For example: "tea": "2\.x" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P This ensures your package \fBtea\-latte\fR can be installed \fIalong\fR with the second major version of the host package \fBtea\fR only\. The host package is automatically installed if needed\. \fBnpm install tea\-latte\fR could possibly yield the following dependency graph: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX ├── tea\-latte@1\.3\.5 └── tea@2\.2\.0 -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Trying to install another plugin with a conflicting requirement will cause an error\. For this reason, make sure your plugin requirement is as broad as possible, and not to lock it down to specific patch versions\. -. .P Assuming the host complies with semver \fIhttp://semver\.org/\fR, only changes in -the host package\'s major version will break your plugin\. Thus, if you\'ve worked +the host package's major version will break your plugin\. Thus, if you've worked with every 1\.x version of the host package, use \fB"^1\.0"\fR or \fB"1\.x"\fR to express this\. If you depend on features introduced in 1\.5\.2, use \fB">= 1\.5\.2 < 2"\fR\|\. -. -.SH "bundledDependencies" +.SH bundledDependencies +.P Array of package names that will be bundled when publishing the package\. -. .P If this is spelled \fB"bundleDependencies"\fR, then that is also honorable\. -. -.SH "optionalDependencies" +.SH optionalDependencies +.P If a dependency can be used, but you would like npm to proceed if it -cannot be found or fails to install, then you may put it in the \fBoptionalDependencies\fR hash\. This is a map of package name to version +cannot be found or fails to install, then you may put it in the +\fBoptionalDependencies\fR hash\. This is a map of package name to version or url, just like the \fBdependencies\fR hash\. The difference is that failure is tolerated\. -. .P -It is still your program\'s responsibility to handle the lack of the +It is still your program's responsibility to handle the lack of the dependency\. For example, something like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX try { - var foo = require(\'foo\') - var fooVersion = require(\'foo/package\.json\')\.version + var foo = require('foo') + var fooVersion = require('foo/package\.json')\.version } catch (er) { foo = null } if ( notGoodFooVersion(fooVersion) ) { foo = null } + // \.\. then later in your program \.\. + if (foo) { foo\.doFooThings() } -. -.fi -. -.IP "" 0 -. -.P -Entries in \fBoptionalDependencies\fR will override entries of the same name in \fBdependencies\fR, so it\'s usually best to only put in one place\. -. -.SH "engines" +.EE +.RE +.P +Entries in \fBoptionalDependencies\fR will override entries of the same name in +\fBdependencies\fR, so it's usually best to only put in one place\. +.SH engines +.P You can specify the version of node that your stuff works on: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "engines" : { "node" : ">=0\.10\.3 <0\.12" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P -And, like with dependencies, if you don\'t specify the version (or if you +And, like with dependencies, if you don't specify the version (or if you specify "*" as the version), then any version of node will do\. -. .P If you specify an "engines" field, then npm will require that "node" be somewhere on that list\. If "engines" is omitted, then npm will just assume that it works on node\. -. .P You can also use the "engines" field to specify which versions of npm are capable of properly installing your program\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "engines" : { "npm" : "~1\.0\.20" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Note that, unless the user has set the \fBengine\-strict\fR config flag, this field is advisory only\. -. -.SH "engineStrict" +.SH engineStrict +.P If you are sure that your module will \fIdefinitely not\fR run properly on versions of Node/npm other than those specified in the \fBengines\fR hash, then you can set \fB"engineStrict": true\fR in your package\.json file\. -This will override the user\'s \fBengine\-strict\fR config setting\. -. +This will override the user's \fBengine\-strict\fR config setting\. .P Please do not do this unless you are really very very sure\. If your engines hash is something overly restrictive, you can quite easily and inadvertently lock yourself into obscurity and prevent your users from updating to new versions of Node\. Consider this choice carefully\. If people abuse it, it will be removed in a future version of npm\. -. -.SH "os" +.SH os +.P You can specify which operating systems your module will run on: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX "os" : [ "darwin", "linux" ] -. -.fi -. -.IP "" 0 -. +.EE +.RE .P You can also blacklist instead of whitelist operating systems, -just prepend the blacklisted os with a \'!\': -. -.IP "" 4 -. -.nf +just prepend the blacklisted os with a '!': +.P +.RS 2 +.EX "os" : [ "!win32" ] -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The host operating system is determined by \fBprocess\.platform\fR -. .P -It is allowed to both blacklist, and whitelist, although there isn\'t any +It is allowed to both blacklist, and whitelist, although there isn't any good reason to do this\. -. -.SH "cpu" +.SH cpu +.P If your code only runs on certain cpu architectures, you can specify which ones\. -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX "cpu" : [ "x64", "ia32" ] -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Like the \fBos\fR option, you can also blacklist architectures: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX "cpu" : [ "!arm", "!mips" ] -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The host architecture is determined by \fBprocess\.arch\fR -. -.SH "preferGlobal" +.SH preferGlobal +.P If your package is primarily a command\-line application that should be installed globally, then set this value to \fBtrue\fR to provide a warning if it is installed locally\. -. .P -It doesn\'t actually prevent users from installing it locally, but it -does help prevent some confusion if it doesn\'t work as expected\. -. -.SH "private" +It doesn't actually prevent users from installing it locally, but it +does help prevent some confusion if it doesn't work as expected\. +.SH private +.P If you set \fB"private": true\fR in your package\.json, then npm will refuse to publish it\. -. .P This is a way to prevent accidental publication of private repositories\. If you would like to ensure that a given package is only ever published to a specific registry (for example, an internal registry), then use the \fBpublishConfig\fR hash described below to override the \fBregistry\fR config param at publish\-time\. -. -.SH "publishConfig" -This is a set of config values that will be used at publish\-time\. It\'s +.SH publishConfig +.P +This is a set of config values that will be used at publish\-time\. It's especially handy if you want to set the tag or registry, so that you can ensure that a given package is not tagged with "latest" or published to the global public registry by default\. -. .P Any config values can be overridden, but of course only "tag" and "registry" probably matter for the purposes of publishing\. -. .P See npm help 7 \fBnpm\-config\fR to see the list of config options that can be overridden\. -. -.SH "DEFAULT VALUES" +.SH DEFAULT VALUES +.P npm will default some values based on package contents\. -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 \fB"scripts": {"start": "node server\.js"}\fR -. -.IP If there is a \fBserver\.js\fR file in the root of your package, then npm will default the \fBstart\fR command to \fBnode server\.js\fR\|\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fB"scripts":{"preinstall": "node\-gyp rebuild"}\fR -. -.IP If there is a \fBbinding\.gyp\fR file in the root of your package, npm will default the \fBpreinstall\fR command to compile using node\-gyp\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fB"contributors": [\.\.\.]\fR -. -.IP If there is an \fBAUTHORS\fR file in the root of your package, npm will treat each line as a \fBName (url)\fR format, where email and url are optional\. Lines which start with a \fB#\fR or are blank, will be ignored\. -. -.IP "" 0 -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 + +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 semver -. -.IP "\(bu" 4 +.IP \(bu 2 npm help init -. -.IP "\(bu" 4 +.IP \(bu 2 npm help version -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help help -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 faq -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "\(bu" 4 +.IP \(bu 2 npm help publish -. -.IP "\(bu" 4 +.IP \(bu 2 npm help rm -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man7/index.7 b/deps/npm/man/man7/index.7 deleted file mode 100644 index 911d8efab0..0000000000 --- a/deps/npm/man/man7/index.7 +++ /dev/null @@ -1,298 +0,0 @@ -.\" Generated with Ronnjs 0.4.0 -.\" http://github.com/kapouer/ronnjs -. -.TH "NPM\-INDEX" "7" "July 2013" "" "" -. -.SH "NAME" -\fBnpm-index\fR \-\- Index of all npm documentation -. -npm help .SH "README" -node package manager -. -npm help .SH "npm" -node package manager -. -npm help .SH "npm\-adduser" -Add a registry user account -. -npm help .SH "npm\-bin" -Display npm bin folder -. -npm help .SH "npm\-bugs" -Bugs for a package in a web browser maybe -. -npm help .SH "npm\-build" -Build a package -. -npm help .SH "npm\-bundle" -REMOVED -. -npm help .SH "npm\-cache" -Manipulates packages cache -. -npm help .SH "npm\-completion" -Tab Completion for npm -. -npm help .SH "npm\-config" -Manage the npm configuration files -. -npm help .SH "npm\-dedupe" -Reduce duplication -. -npm help .SH "npm\-deprecate" -Deprecate a version of a package -. -npm help .SH "npm\-docs" -Docs for a package in a web browser maybe -. -npm help .SH "npm\-edit" -Edit an installed package -. -npm help .SH "npm\-explore" -Browse an installed package -. -npm help .SH "npm\-help\-search" -Search npm help documentation -. -npm help .SH "npm\-help" -Get help on npm -. -npm help .SH "npm\-init" -Interactively create a package\.json file -. -npm help .SH "npm\-install" -Install a package -. -npm help .SH "npm\-link" -Symlink a package folder -. -npm help .SH "npm\-ls" -List installed packages -. -npm help .SH "npm\-outdated" -Check for outdated packages -. -npm help .SH "npm\-owner" -Manage package owners -. -npm help .SH "npm\-pack" -Create a tarball from a package -. -npm help .SH "npm\-prefix" -Display prefix -. -npm help .SH "npm\-prune" -Remove extraneous packages -. -npm help .SH "npm\-publish" -Publish a package -. -npm help .SH "npm\-rebuild" -Rebuild a package -. -npm help .SH "npm\-restart" -Start a package -. -npm help .SH "npm\-rm" -Remove a package -. -npm help .SH "npm\-root" -Display npm root -. -npm help .SH "npm\-run\-script" -Run arbitrary package scripts -. -npm help .SH "npm\-search" -Search for packages -. -npm help .SH "npm\-shrinkwrap" -Lock down dependency versions -. -npm help .SH "npm\-star" -Mark your favorite packages -. -npm help .SH "npm\-stars" -View packages marked as favorites -. -npm help .SH "npm\-start" -Start a package -. -npm help .SH "npm\-stop" -Stop a package -. -npm help .SH "npm\-submodule" -Add a package as a git submodule -. -npm help .SH "npm\-tag" -Tag a published version -. -npm help .SH "npm\-test" -Test a package -. -npm help .SH "npm\-uninstall" -Remove a package -. -npm help .SH "npm\-unpublish" -Remove a package from the registry -. -npm help .SH "npm\-update" -Update a package -. -npm help .SH "npm\-version" -Bump a package version -. -npm help .SH "npm\-view" -View registry info -. -npm help .SH "npm\-whoami" -Display npm username -. -npm apihelp .SH "npm" -node package manager -. -npm apihelp .SH "npm\-bin" -Display npm bin folder -. -npm apihelp .SH "npm\-bugs" -Bugs for a package in a web browser maybe -. -npm apihelp .SH "npm\-commands" -npm commands -. -npm apihelp .SH "npm\-config" -Manage the npm configuration files -. -npm apihelp .SH "npm\-deprecate" -Deprecate a version of a package -. -npm apihelp .SH "npm\-docs" -Docs for a package in a web browser maybe -. -npm apihelp .SH "npm\-edit" -Edit an installed package -. -npm apihelp .SH "npm\-explore" -Browse an installed package -. -npm apihelp .SH "npm\-help\-search" -Search the help pages -. -npm apihelp .SH "npm\-init" -Interactively create a package\.json file -. -npm apihelp .SH "npm\-install" -install a package programmatically -. -npm apihelp .SH "npm\-link" -Symlink a package folder -. -npm apihelp .SH "npm\-load" -Load config settings -. -npm apihelp .SH "npm\-ls" -List installed packages -. -npm apihelp .SH "npm\-outdated" -Check for outdated packages -. -npm apihelp .SH "npm\-owner" -Manage package owners -. -npm apihelp .SH "npm\-pack" -Create a tarball from a package -. -npm apihelp .SH "npm\-prefix" -Display prefix -. -npm apihelp .SH "npm\-prune" -Remove extraneous packages -. -npm apihelp .SH "npm\-publish" -Publish a package -. -npm apihelp .SH "npm\-rebuild" -Rebuild a package -. -npm apihelp .SH "npm\-restart" -Start a package -. -npm apihelp .SH "npm\-root" -Display npm root -. -npm apihelp .SH "npm\-run\-script" -Run arbitrary package scripts -. -npm apihelp .SH "npm\-search" -Search for packages -. -npm apihelp .SH "npm\-shrinkwrap" -programmatically generate package shrinkwrap file -. -npm apihelp .SH "npm\-start" -Start a package -. -npm apihelp .SH "npm\-stop" -Stop a package -. -npm apihelp .SH "npm\-submodule" -Add a package as a git submodule -. -npm apihelp .SH "npm\-tag" -Tag a published version -. -npm apihelp .SH "npm\-test" -Test a package -. -npm apihelp .SH "npm\-uninstall" -uninstall a package programmatically -. -npm apihelp .SH "npm\-unpublish" -Remove a package from the registry -. -npm apihelp .SH "npm\-update" -Update a package -. -npm apihelp .SH "npm\-version" -Bump a package version -. -npm apihelp .SH "npm\-view" -View registry info -. -npm apihelp .SH "npm\-whoami" -Display npm username -. -npm help .SH "npm\-folders" -Folder Structures Used by npm -. -npm help .SH "npmrc" -The npm config files -. -npm help .SH "package\.json" -Specifics of npm\'s package\.json handling -. -npm help .SH "npm\-coding\-style" -npm\'s "funny" coding style -. -npm help .SH "npm\-config" -More than you probably want to know about npm configuration -. -npm help .SH "npm\-developers" -Developer Guide -. -npm help .SH "npm\-disputes" -Handling Module Name Disputes -. -npm help .SH "npm\-faq" -Frequently Asked Questions -. -npm help .SH "npm\-registry" -The JavaScript Package Registry -. -npm help .SH "npm\-scripts" -How npm handles the "scripts" field -. -npm help .SH "removing\-npm" -Cleaning the Slate -. -npm help .SH "semver" -The semantic versioner for npm diff --git a/deps/npm/man/man7/npm-coding-style.7 b/deps/npm/man/man7/npm-coding-style.7 index 385a390872..304dd4954e 100644 --- a/deps/npm/man/man7/npm-coding-style.7 +++ b/deps/npm/man/man7/npm-coding-style.7 @@ -1,122 +1,93 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-CODING\-STYLE" "7" "September 2014" "" "" -. .SH "NAME" -\fBnpm-coding-style\fR \-\- npm\'s "funny" coding style -. -.SH "DESCRIPTION" -npm\'s coding style is a bit unconventional\. It is not different for -difference\'s sake, but rather a carefully crafted style that is +\fBnpm-coding-style\fR \- npm's "funny" coding style +.SH DESCRIPTION +.P +npm's coding style is a bit unconventional\. It is not different for +difference's sake, but rather a carefully crafted style that is designed to reduce visual clutter and make bugs more apparent\. -. .P If you want to contribute to npm (which is very encouraged), you should -make your code conform to npm\'s style\. -. +make your code conform to npm's style\. +.P +Note: this concerns npm's code not the specific packages at npmjs\.org +.SH Line Length .P -Note: this concerns npm\'s code not the specific packages at npmjs\.org -. -.SH "Line Length" -Keep lines shorter than 80 characters\. It\'s better for lines to be +Keep lines shorter than 80 characters\. It's better for lines to be too short than to be too long\. Break up long lists, objects, and other statements onto multiple lines\. -. -.SH "Indentation" +.SH Indentation +.P Two\-spaces\. Tabs are better, but they look like hell in web browsers -(and on github), and node uses 2 spaces, so that\'s that\. -. +(and on github), and node uses 2 spaces, so that's that\. .P Configure your editor appropriately\. -. -.SH "Curly braces" +.SH Curly braces +.P Curly braces belong on the same line as the thing that necessitates them\. -. .P Bad: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX function () { -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Good: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX function () { -. -.fi -. -.IP "" 0 -. +.EE +.RE .P -If a block needs to wrap to the next line, use a curly brace\. Don\'t -use it if it doesn\'t\. -. +If a block needs to wrap to the next line, use a curly brace\. Don't +use it if it doesn't\. .P Bad: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX if (foo) { bar() } while (foo) bar() -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Good: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX if (foo) bar() while (foo) { bar() } -. -.fi -. -.IP "" 0 -. -.SH "Semicolons" -Don\'t use them except in four situations: -. -.IP "\(bu" 4 -\fBfor (;;)\fR loops\. They\'re actually required\. -. -.IP "\(bu" 4 -null loops like: \fBwhile (something) ;\fR (But you\'d better have a good +.EE +.RE +.SH Semicolons +.P +Don't use them except in four situations: +.RS 0 +.IP \(bu 2 +\fBfor (;;)\fR loops\. They're actually required\. +.IP \(bu 2 +null loops like: \fBwhile (something) ;\fR (But you'd better have a good reason for doing that\.) -. -.IP "\(bu" 4 +.IP \(bu 2 \fBcase "foo": doSomething(); break\fR -. -.IP "\(bu" 4 +.IP \(bu 2 In front of a leading \fB(\fR or \fB[\fR at the start of the line\. This prevents the expression from being interpreted as a function call or property access, respectively\. -. -.IP "" 0 -. + +.RE .P Some examples of good semicolon usage: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX ;(x || y)\.doSomething() ;[a, b, c]\.forEach(doSomething) for (var i = 0; i < 10; i ++) { @@ -127,24 +98,20 @@ for (var i = 0; i < 10; i ++) { } end() } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Note that starting lines with \fB\-\fR and \fB+\fR also should be prefixed with a semicolon, but this is much less common\. -. -.SH "Comma First" +.SH Comma First +.P If there is a list of things separated by commas, and it wraps across multiple lines, put the comma at the start of the next line, directly below the token that starts the list\. Put the final token in the list on a line by itself\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX var magicWords = [ "abracadabra" , "gesundheit" , "ventrilo" @@ -156,99 +123,82 @@ var magicWords = [ "abracadabra" , b = "abc" , etc , somethingElse -. -.fi -. -.IP "" 0 -. -.SH "Whitespace" +.EE +.RE +.SH Whitespace +.P Put a single space in front of ( for anything other than a function call\. Also use a single space wherever it makes things more readable\. -. .P -Don\'t leave trailing whitespace at the end of lines\. Don\'t indent empty -lines\. Don\'t use more spaces than are helpful\. -. -.SH "Functions" +Don't leave trailing whitespace at the end of lines\. Don't indent empty +lines\. Don't use more spaces than are helpful\. +.SH Functions +.P Use named functions\. They make stack traces a lot easier to read\. -. -.SH "Callbacks, Sync/async Style" +.SH Callbacks, Sync/async Style +.P Use the asynchronous/non\-blocking versions of things as much as possible\. It might make more sense for npm to use the synchronous fs APIs, but this way, the fs and http and child process stuff all uses the same callback\-passing methodology\. -. .P The callback should always be the last argument in the list\. Its first argument is the Error or null\. -. .P -Be very careful never to ever ever throw anything\. It\'s worse than useless\. +Be very careful never to ever ever throw anything\. It's worse than useless\. Just send the error message back as the first argument to the callback\. -. -.SH "Errors" -Always create a new Error object with your message\. Don\'t just return a +.SH Errors +.P +Always create a new Error object with your message\. Don't just return a string message to the callback\. Stack traces are handy\. -. -.SH "Logging" +.SH Logging +.P Logging is done using the npmlog \fIhttps://github\.com/npm/npmlog\fR utility\. -. .P Please clean up logs when they are no longer helpful\. In particular, logging the same object over and over again is not helpful\. Logs should -report what\'s happening so that it\'s easier to track down where a fault +report what's happening so that it's easier to track down where a fault occurs\. -. .P Use appropriate log levels\. See npm help 7 \fBnpm\-config\fR and search for "loglevel"\. -. -.SH "Case, naming, etc\." +.SH Case, naming, etc\. +.P Use \fBlowerCamelCase\fR for multiword identifiers when they refer to objects, functions, methods, members, or anything not specified in this section\. -. .P -Use \fBUpperCamelCase\fR for class names (things that you\'d pass to "new")\. -. +Use \fBUpperCamelCase\fR for class names (things that you'd pass to "new")\. .P Use \fBall\-lower\-hyphen\-css\-case\fR for multiword filenames and config keys\. -. .P Use named functions\. They make stack traces easier to follow\. -. .P Use \fBCAPS_SNAKE_CASE\fR for constants, things that should never change and are rarely used\. -. .P Use a single uppercase letter for function names where the function would normally be anonymous, but needs to call itself recursively\. It -makes it clear that it\'s a "throwaway" function\. -. -.SH "null, undefined, false, 0" -Boolean variables and functions should always be either \fBtrue\fR or \fBfalse\fR\|\. Don\'t set it to 0 unless it\'s supposed to be a number\. -. +makes it clear that it's a "throwaway" function\. +.SH null, undefined, false, 0 +.P +Boolean variables and functions should always be either \fBtrue\fR or +\fBfalse\fR\|\. Don't set it to 0 unless it's supposed to be a number\. .P When something is intentionally missing or removed, set it to \fBnull\fR\|\. -. .P -Don\'t set things to \fBundefined\fR\|\. Reserve that value to mean "not yet +Don't set things to \fBundefined\fR\|\. Reserve that value to mean "not yet set to anything\." -. .P Boolean objects are verboten\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 developers -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 faq -. -.IP "\(bu" 4 +.IP \(bu 2 npm help npm -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7 index 7bdf1c0059..f759d94bfd 100644 --- a/deps/npm/man/man7/npm-config.7 +++ b/deps/npm/man/man7/npm-config.7 @@ -1,1520 +1,1198 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-CONFIG" "7" "September 2014" "" "" -. .SH "NAME" -\fBnpm-config\fR \-\- More than you probably want to know about npm configuration -. -.SH "DESCRIPTION" +\fBnpm-config\fR \- More than you probably want to know about npm configuration +.SH DESCRIPTION +.P npm gets its configuration values from 6 sources, in this priority: -. -.SS "Command Line Flags" +.SS Command Line Flags +.P Putting \fB\-\-foo bar\fR on the command line sets the \fBfoo\fR configuration parameter to \fB"bar"\fR\|\. A \fB\-\-\fR argument tells the cli parser to stop reading flags\. A \fB\-\-flag\fR parameter that is at the \fIend\fR of the command will be given the value of \fBtrue\fR\|\. -. -.SS "Environment Variables" +.SS Environment Variables +.P Any environment variables that start with \fBnpm_config_\fR will be -interpreted as a configuration parameter\. For example, putting \fBnpm_config_foo=bar\fR in your environment will set the \fBfoo\fR +interpreted as a configuration parameter\. For example, putting +\fBnpm_config_foo=bar\fR in your environment will set the \fBfoo\fR configuration parameter to \fBbar\fR\|\. Any environment configurations that are not given a value will be given the value of \fBtrue\fR\|\. Config values are case\-insensitive, so \fBNPM_CONFIG_FOO=bar\fR will work the same\. -. -.SS "npmrc Files" +.SS npmrc Files +.P The four relevant files are: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 per\-project config file (/path/to/my/project/\.npmrc) -. -.IP "\(bu" 4 +.IP \(bu 2 per\-user config file (~/\.npmrc) -. -.IP "\(bu" 4 +.IP \(bu 2 global config file ($PREFIX/npmrc) -. -.IP "\(bu" 4 +.IP \(bu 2 npm builtin config file (/path/to/npm/npmrc) -. -.IP "" 0 -. + +.RE .P See npm help 5 npmrc for more details\. -. -.SS "Default Configs" +.SS Default Configs +.P A set of configuration parameters that are internal to npm, and are defaults if nothing else is specified\. -. -.SH "Shorthands and Other CLI Niceties" +.SH Shorthands and Other CLI Niceties +.P The following shorthands are parsed on the command\-line: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 \fB\-v\fR: \fB\-\-version\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-h\fR, \fB\-?\fR, \fB\-\-help\fR, \fB\-H\fR: \fB\-\-usage\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-s\fR, \fB\-\-silent\fR: \fB\-\-loglevel silent\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-q\fR, \fB\-\-quiet\fR: \fB\-\-loglevel warn\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-d\fR: \fB\-\-loglevel info\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-dd\fR, \fB\-\-verbose\fR: \fB\-\-loglevel verbose\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-ddd\fR: \fB\-\-loglevel silly\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-g\fR: \fB\-\-global\fR -. -.IP "\(bu" 4 +.IP \(bu 2 +\fB\-C\fR: \fB\-\-prefix\fR +.IP \(bu 2 \fB\-l\fR: \fB\-\-long\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-m\fR: \fB\-\-message\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-p\fR, \fB\-\-porcelain\fR: \fB\-\-parseable\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-reg\fR: \fB\-\-registry\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-v\fR: \fB\-\-version\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-f\fR: \fB\-\-force\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-desc\fR: \fB\-\-description\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-S\fR: \fB\-\-save\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-D\fR: \fB\-\-save\-dev\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-O\fR: \fB\-\-save\-optional\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-B\fR: \fB\-\-save\-bundle\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-E\fR: \fB\-\-save\-exact\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-y\fR: \fB\-\-yes\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\-n\fR: \fB\-\-yes false\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fBll\fR and \fBla\fR commands: \fBls \-\-long\fR -. -.IP "" 0 -. + +.RE .P If the specified configuration param resolves unambiguously to a known configuration parameter, then it is expanded to that configuration parameter\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm ls \-\-par # same as: npm ls \-\-parseable -. -.fi -. -.IP "" 0 -. +.EE +.RE .P If multiple single\-character shorthands are strung together, and the resulting combination is unambiguously not some other configuration param, then it is expanded to its various component pieces\. For example: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm ls \-gpld # same as: npm ls \-\-global \-\-parseable \-\-long \-\-loglevel info -. -.fi -. -.IP "" 0 -. -.SH "Per\-Package Config Settings" +.EE +.RE +.SH Per\-Package Config Settings +.P When running scripts (see npm help 7 \fBnpm\-scripts\fR) the package\.json "config" -keys are overwritten in the environment if there is a config param of \fB[@]:\fR\|\. For example, if the package\.json has +keys are overwritten in the environment if there is a config param of +\fB[@]:\fR\|\. For example, if the package\.json has this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name" : "foo" , "config" : { "port" : "8080" } , "scripts" : { "start" : "node server\.js" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P and the server\.js is this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX http\.createServer(\.\.\.)\.listen(process\.env\.npm_package_config_port) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P then the user could change the behavior by doing: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm config set foo:port 80 -. -.fi -. -.IP "" 0 -. +.EE +.RE .P See npm help 5 package\.json for more information\. -. -.SH "Config Settings" -. -.SS "always\-auth" -. -.IP "\(bu" 4 +.SH Config Settings +.SS always\-auth +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Force npm to always require authentication when accessing the registry, even for \fBGET\fR requests\. -. -.SS "bin\-links" -. -.IP "\(bu" 4 +.SS bin\-links +.RS 0 +.IP \(bu 2 Default: \fBtrue\fR -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Tells npm to create symlinks (or \fB\|\.cmd\fR shims on Windows) for package executables\. -. .P Set to false to have it not do this\. This can be used to work around -the fact that some file systems don\'t support symlinks, even on +the fact that some file systems don't support symlinks, even on ostensibly Unix systems\. -. -.SS "browser" -. -.IP "\(bu" 4 +.SS browser +.RS 0 +.IP \(bu 2 Default: OS X: \fB"open"\fR, Windows: \fB"start"\fR, Others: \fB"xdg\-open"\fR -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P The browser that is called by the \fBnpm docs\fR command to open websites\. -. -.SS "ca" -. -.IP "\(bu" 4 +.SS ca +.RS 0 +.IP \(bu 2 Default: The npm CA certificate -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String or null -. -.IP "" 0 -. + +.RE .P The Certificate Authority signing certificate that is trusted for SSL connections to the registry\. -. .P Set to \fBnull\fR to only allow "known" registrars, or to a specific CA cert to trust only that specific signing authority\. -. .P See also the \fBstrict\-ssl\fR config\. -. -.SS "cafile" -. -.IP "\(bu" 4 +.SS cafile +.RS 0 +.IP \(bu 2 Default: \fBnull\fR -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. + +.RE .P A path to a file containing one or multiple Certificate Authority signing -certificates\. Similar to the \fBca\fR setting, but allows for multiple CA\'s, as +certificates\. Similar to the \fBca\fR setting, but allows for multiple CA's, as well as for the CA information to be stored in a file on disk\. -. -.SS "cache" -. -.IP "\(bu" 4 +.SS cache +.RS 0 +.IP \(bu 2 Default: Windows: \fB%AppData%\\npm\-cache\fR, Posix: \fB~/\.npm\fR -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. -.P -The location of npm\'s cache directory\. See npm help \fBnpm\-cache\fR -. -.SS "cache\-lock\-stale" -. -.IP "\(bu" 4 + +.RE +.P +The location of npm's cache directory\. See npm help \fBnpm\-cache\fR +.SS cache\-lock\-stale +.RS 0 +.IP \(bu 2 Default: 60000 (1 minute) -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Number -. -.IP "" 0 -. + +.RE .P The number of ms before cache folder lockfiles are considered stale\. -. -.SS "cache\-lock\-retries" -. -.IP "\(bu" 4 +.SS cache\-lock\-retries +.RS 0 +.IP \(bu 2 Default: 10 -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Number -. -.IP "" 0 -. + +.RE .P Number of times to retry to acquire a lock on cache folder lockfiles\. -. -.SS "cache\-lock\-wait" -. -.IP "\(bu" 4 +.SS cache\-lock\-wait +.RS 0 +.IP \(bu 2 Default: 10000 (10 seconds) -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Number -. -.IP "" 0 -. + +.RE .P Number of ms to wait for cache lock files to expire\. -. -.SS "cache\-max" -. -.IP "\(bu" 4 +.SS cache\-max +.RS 0 +.IP \(bu 2 Default: Infinity -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Number -. -.IP "" 0 -. + +.RE .P The maximum time (in seconds) to keep items in the registry cache before re\-checking against the registry\. -. .P Note that no purging is done unless the \fBnpm cache clean\fR command is explicitly used, and that only GET requests use the cache\. -. -.SS "cache\-min" -. -.IP "\(bu" 4 +.SS cache\-min +.RS 0 +.IP \(bu 2 Default: 10 -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Number -. -.IP "" 0 -. + +.RE .P The minimum time (in seconds) to keep items in the registry cache before re\-checking against the registry\. -. .P Note that no purging is done unless the \fBnpm cache clean\fR command is explicitly used, and that only GET requests use the cache\. -. -.SS "cert" -. -.IP "\(bu" 4 +.SS cert +.RS 0 +.IP \(bu 2 Default: \fBnull\fR -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P A client certificate to pass when accessing the registry\. -. -.SS "color" -. -.IP "\(bu" 4 +.SS color +.RS 0 +.IP \(bu 2 Default: true on Posix, false on Windows -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean or \fB"always"\fR -. -.IP "" 0 -. + +.RE .P If false, never shows colors\. If \fB"always"\fR then always shows colors\. If true, then only prints color codes for tty file descriptors\. -. -.SS "depth" -. -.IP "\(bu" 4 +.SS depth +.RS 0 +.IP \(bu 2 Default: Infinity -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Number -. -.IP "" 0 -. -.P -The depth to go when recursing directories for \fBnpm ls\fR and \fBnpm cache ls\fR\|\. -. -.SS "description" -. -.IP "\(bu" 4 + +.RE +.P +The depth to go when recursing directories for \fBnpm ls\fR and +\fBnpm cache ls\fR\|\. +.SS description +.RS 0 +.IP \(bu 2 Default: true -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Show the description in \fBnpm search\fR -. -.SS "dev" -. -.IP "\(bu" 4 +.SS dev +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Install \fBdev\-dependencies\fR along with packages\. -. .P Note that \fBdev\-dependencies\fR are also installed if the \fBnpat\fR flag is set\. -. -.SS "editor" -. -.IP "\(bu" 4 +.SS editor +.RS 0 +.IP \(bu 2 Default: \fBEDITOR\fR environment variable if set, or \fB"vi"\fR on Posix, or \fB"notepad"\fR on Windows\. -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. + +.RE .P The command to run for \fBnpm edit\fR or \fBnpm config edit\fR\|\. -. -.SS "email" -The email of the logged\-in user\. -. -.P -Set by the \fBnpm adduser\fR command\. Should not be set explicitly\. -. -.SS "engine\-strict" -. -.IP "\(bu" 4 +.SS engine\-strict +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P If set to true, then npm will stubbornly refuse to install (or even consider installing) any package that claims to not be compatible with the current Node\.js version\. -. -.SS "force" -. -.IP "\(bu" 4 +.SS force +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Makes various commands more forceful\. -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 lifecycle script failure does not block progress\. -. -.IP "\(bu" 4 +.IP \(bu 2 publishing clobbers previously published versions\. -. -.IP "\(bu" 4 +.IP \(bu 2 skips cache when requesting from the registry\. -. -.IP "\(bu" 4 +.IP \(bu 2 prevents checks against clobbering non\-npm files\. -. -.IP "" 0 -. -.SS "fetch\-retries" -. -.IP "\(bu" 4 + +.RE +.SS fetch\-retries +.RS 0 +.IP \(bu 2 Default: 2 -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Number -. -.IP "" 0 -. + +.RE .P The "retries" config for the \fBretry\fR module to use when fetching packages from the registry\. -. -.SS "fetch\-retry\-factor" -. -.IP "\(bu" 4 +.SS fetch\-retry\-factor +.RS 0 +.IP \(bu 2 Default: 10 -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Number -. -.IP "" 0 -. + +.RE .P The "factor" config for the \fBretry\fR module to use when fetching packages\. -. -.SS "fetch\-retry\-mintimeout" -. -.IP "\(bu" 4 +.SS fetch\-retry\-mintimeout +.RS 0 +.IP \(bu 2 Default: 10000 (10 seconds) -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Number -. -.IP "" 0 -. + +.RE .P The "minTimeout" config for the \fBretry\fR module to use when fetching packages\. -. -.SS "fetch\-retry\-maxtimeout" -. -.IP "\(bu" 4 +.SS fetch\-retry\-maxtimeout +.RS 0 +.IP \(bu 2 Default: 60000 (1 minute) -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Number -. -.IP "" 0 -. + +.RE .P The "maxTimeout" config for the \fBretry\fR module to use when fetching packages\. -. -.SS "git" -. -.IP "\(bu" 4 +.SS git +.RS 0 +.IP \(bu 2 Default: \fB"git"\fR -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P The command to use for git commands\. If git is installed on the computer, but is not in the \fBPATH\fR, then set this to the full path to the git binary\. -. -.SS "git\-tag\-version" -. -.IP "\(bu" 4 +.SS git\-tag\-version +.RS 0 +.IP \(bu 2 Default: \fBtrue\fR -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Tag the commit when using the \fBnpm version\fR command\. -. -.SS "global" -. -.IP "\(bu" 4 +.SS global +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P -Operates in "global" mode, so that packages are installed into the \fBprefix\fR folder instead of the current working directory\. See npm help 5 \fBnpm\-folders\fR for more on the differences in behavior\. -. -.IP "\(bu" 4 +Operates in "global" mode, so that packages are installed into the +\fBprefix\fR folder instead of the current working directory\. See +npm help 5 \fBnpm\-folders\fR for more on the differences in behavior\. +.RS 0 +.IP \(bu 2 packages are installed into the \fB{prefix}/lib/node_modules\fR folder, instead of the current working directory\. -. -.IP "\(bu" 4 +.IP \(bu 2 bin files are linked to \fB{prefix}/bin\fR -. -.IP "\(bu" 4 +.IP \(bu 2 man pages are linked to \fB{prefix}/share/man\fR -. -.IP "" 0 -. -.SS "globalconfig" -. -.IP "\(bu" 4 + +.RE +.SS globalconfig +.RS 0 +.IP \(bu 2 Default: {prefix}/etc/npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. + +.RE .P The config file to read for global config options\. -. -.SS "group" -. -.IP "\(bu" 4 +.SS group +.RS 0 +.IP \(bu 2 Default: GID of the current process -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String or Number -. -.IP "" 0 -. + +.RE .P The group to use when running package scripts in global mode as the root user\. -. -.SS "heading" -. -.IP "\(bu" 4 +.SS heading +.RS 0 +.IP \(bu 2 Default: \fB"npm"\fR -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P The string that starts all the debugging log output\. -. -.SS "https\-proxy" -. -.IP "\(bu" 4 -Default: the \fBHTTPS_PROXY\fR or \fBhttps_proxy\fR or \fBHTTP_PROXY\fR or \fBhttp_proxy\fR environment variables\. -. -.IP "\(bu" 4 +.SS https\-proxy +.RS 0 +.IP \(bu 2 +Default: the \fBHTTPS_PROXY\fR or \fBhttps_proxy\fR or \fBHTTP_PROXY\fR or +\fBhttp_proxy\fR environment variables\. +.IP \(bu 2 Type: url -. -.IP "" 0 -. + +.RE .P A proxy to use for outgoing https requests\. -. -.SS "ignore\-scripts" -. -.IP "\(bu" 4 +.SS ignore\-scripts +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P If true, npm does not run scripts specified in package\.json files\. -. -.SS "init\-module" -. -.IP "\(bu" 4 +.SS init\-module +.RS 0 +.IP \(bu 2 Default: ~/\.npm\-init\.js -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. + +.RE .P A module that will be loaded by the \fBnpm init\fR command\. See the -documentation for the init\-package\-json \fIhttps://github\.com/isaacs/init\-package\-json\fR module +documentation for the +init\-package\-json \fIhttps://github\.com/isaacs/init\-package\-json\fR module for more information, or npm help init\. -. -.SS "init\.author\.name" -. -.IP "\(bu" 4 +.SS init\.author\.name +.RS 0 +.IP \(bu 2 Default: "" -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. -.P -The value \fBnpm init\fR should use by default for the package author\'s name\. -. -.SS "init\.author\.email" -. -.IP "\(bu" 4 + +.RE +.P +The value \fBnpm init\fR should use by default for the package author's name\. +.SS init\.author\.email +.RS 0 +.IP \(bu 2 Default: "" -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. -.P -The value \fBnpm init\fR should use by default for the package author\'s email\. -. -.SS "init\.author\.url" -. -.IP "\(bu" 4 + +.RE +.P +The value \fBnpm init\fR should use by default for the package author's email\. +.SS init\.author\.url +.RS 0 +.IP \(bu 2 Default: "" -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. -.P -The value \fBnpm init\fR should use by default for the package author\'s homepage\. -. -.SS "init\.license" -. -.IP "\(bu" 4 + +.RE +.P +The value \fBnpm init\fR should use by default for the package author's homepage\. +.SS init\.license +.RS 0 +.IP \(bu 2 Default: "ISC" -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P The value \fBnpm init\fR should use by default for the package license\. -. -.SS "json" -. -.IP "\(bu" 4 +.SS init\.version +.RS 0 +.IP \(bu 2 +Default: "0\.0\.0" +.IP \(bu 2 +Type: semver + +.RE +.P +The value that \fBnpm init\fR should use by default for the package +version number, if not already set in package\.json\. +.SS json +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Whether or not to output JSON data, rather than the normal output\. -. .P This feature is currently experimental, and the output data structures for many commands is either not implemented in JSON yet, or subject to change\. Only the output from \fBnpm ls \-\-json\fR is currently valid\. -. -.SS "key" -. -.IP "\(bu" 4 +.SS key +.RS 0 +.IP \(bu 2 Default: \fBnull\fR -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P A client key to pass when accessing the registry\. -. -.SS "link" -. -.IP "\(bu" 4 +.SS link +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P If true, then local installs will link if there is a suitable globally installed package\. -. .P Note that this means that local installs can cause things to be installed into the global space at the same time\. The link is only done if one of the two conditions are met: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 The package is not already installed globally, or -. -.IP "\(bu" 4 +.IP \(bu 2 the globally installed version is identical to the version that is being installed locally\. -. -.IP "" 0 -. -.SS "local\-address" -. -.IP "\(bu" 4 + +.RE +.SS local\-address +.RS 0 +.IP \(bu 2 Default: undefined -. -.IP "\(bu" 4 +.IP \(bu 2 Type: IP Address -. -.IP "" 0 -. + +.RE .P The IP address of the local interface to use when making connections to the npm registry\. Must be IPv4 in versions of Node prior to 0\.12\. -. -.SS "loglevel" -. -.IP "\(bu" 4 +.SS loglevel +.RS 0 +.IP \(bu 2 Default: "http" -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "\(bu" 4 -Values: "silent", "win", "error", "warn", "http", "info", "verbose", "silly" -. -.IP "" 0 -. +.IP \(bu 2 +Values: "silent", "error", "warn", "http", "info", "verbose", "silly" + +.RE .P -What level of logs to report\. On failure, \fIall\fR logs are written to \fBnpm\-debug\.log\fR in the current working directory\. -. +What level of logs to report\. On failure, \fIall\fR logs are written to +\fBnpm\-debug\.log\fR in the current working directory\. .P Any logs of a higher level than the setting are shown\. The default is "http", which shows http, warn, and error output\. -. -.SS "logstream" -. -.IP "\(bu" 4 +.SS logstream +.RS 0 +.IP \(bu 2 Default: process\.stderr -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Stream -. -.IP "" 0 -. + +.RE .P -This is the stream that is passed to the npmlog \fIhttps://github\.com/npm/npmlog\fR module at run time\. -. +This is the stream that is passed to the +npmlog \fIhttps://github\.com/npm/npmlog\fR module at run time\. .P It cannot be set from the command line, but if you are using npm programmatically, you may wish to send logs to somewhere other than stderr\. -. .P If the \fBcolor\fR config is set to true, then this stream will receive colored output if it is a TTY\. -. -.SS "long" -. -.IP "\(bu" 4 +.SS long +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Show extended information in \fBnpm ls\fR and \fBnpm search\fR\|\. -. -.SS "message" -. -.IP "\(bu" 4 +.SS message +.RS 0 +.IP \(bu 2 Default: "%s" -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P Commit message which is used by \fBnpm version\fR when creating version commit\. -. .P Any "%s" in the message will be replaced with the version number\. -. -.SS "node\-version" -. -.IP "\(bu" 4 +.SS node\-version +.RS 0 +.IP \(bu 2 Default: process\.version -. -.IP "\(bu" 4 +.IP \(bu 2 Type: semver or false -. -.IP "" 0 -. -.P -The node version to use when checking package\'s "engines" hash\. -. -.SS "npat" -. -.IP "\(bu" 4 + +.RE +.P +The node version to use when checking package's "engines" hash\. +.SS npat +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Run tests on installation\. -. -.SS "onload\-script" -. -.IP "\(bu" 4 +.SS onload\-script +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. + +.RE .P A node module to \fBrequire()\fR when npm loads\. Useful for programmatic usage\. -. -.SS "optional" -. -.IP "\(bu" 4 +.SS optional +.RS 0 +.IP \(bu 2 Default: true -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Attempt to install packages in the \fBoptionalDependencies\fR hash\. Note that if these packages fail to install, the overall installation process is not aborted\. -. -.SS "parseable" -. -.IP "\(bu" 4 +.SS parseable +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Output parseable results from commands that write to standard output\. -. -.SS "prefix" -. -.IP "\(bu" 4 +.SS prefix +.RS 0 +.IP \(bu 2 Default: see npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. + +.RE .P The location to install global items\. If set on the command line, then it forces non\-global commands to run in the specified folder\. -. -.SS "production" -. -.IP "\(bu" 4 +.SS production +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Set to true to run in "production" mode\. -. -.IP "1" 4 +.RS 0 +.IP 1. 3 devDependencies are not installed at the topmost level when running local \fBnpm install\fR without any arguments\. -. -.IP "2" 4 +.IP 2. 3 Set the NODE_ENV="production" for lifecycle scripts\. -. -.IP "" 0 -. -.SS "proprietary\-attribs" -. -.IP "\(bu" 4 + +.RE +.SS proprietary\-attribs +.RS 0 +.IP \(bu 2 Default: true -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Whether or not to include proprietary extended attributes in the tarballs created by npm\. -. .P Unless you are expecting to unpack package tarballs with something other than npm \-\- particularly a very outdated tar implementation \-\- leave this as true\. -. -.SS "proxy" -. -.IP "\(bu" 4 +.SS proxy +.RS 0 +.IP \(bu 2 Default: \fBHTTP_PROXY\fR or \fBhttp_proxy\fR environment variable, or null -. -.IP "\(bu" 4 +.IP \(bu 2 Type: url -. -.IP "" 0 -. + +.RE .P A proxy to use for outgoing http requests\. -. -.SS "rebuild\-bundle" -. -.IP "\(bu" 4 +.SS rebuild\-bundle +.RS 0 +.IP \(bu 2 Default: true -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Rebuild bundled dependencies after installation\. -. -.SS "registry" -. -.IP "\(bu" 4 +.SS registry +.RS 0 +.IP \(bu 2 Default: https://registry\.npmjs\.org/ -. -.IP "\(bu" 4 +.IP \(bu 2 Type: url -. -.IP "" 0 -. + +.RE .P The base URL of the npm package registry\. -. -.SS "rollback" -. -.IP "\(bu" 4 +.SS rollback +.RS 0 +.IP \(bu 2 Default: true -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Remove failed installs\. -. -.SS "save" -. -.IP "\(bu" 4 +.SS save +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Save installed packages to a package\.json file as dependencies\. -. .P When used with the \fBnpm rm\fR command, it removes it from the dependencies hash\. -. .P Only works if there is already a package\.json file present\. -. -.SS "save\-bundle" -. -.IP "\(bu" 4 +.SS save\-bundle +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P -If a package would be saved at install time by the use of \fB\-\-save\fR, \fB\-\-save\-dev\fR, or \fB\-\-save\-optional\fR, then also put it in the \fBbundleDependencies\fR list\. -. +If a package would be saved at install time by the use of \fB\-\-save\fR, +\fB\-\-save\-dev\fR, or \fB\-\-save\-optional\fR, then also put it in the +\fBbundleDependencies\fR list\. .P When used with the \fBnpm rm\fR command, it removes it from the bundledDependencies list\. -. -.SS "save\-dev" -. -.IP "\(bu" 4 +.SS save\-dev +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Save installed packages to a package\.json file as devDependencies\. -. .P When used with the \fBnpm rm\fR command, it removes it from the devDependencies hash\. -. .P Only works if there is already a package\.json file present\. -. -.SS "save\-exact" -. -.IP "\(bu" 4 +.SS save\-exact +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. -.P -Dependencies saved to package\.json using \fB\-\-save\fR, \fB\-\-save\-dev\fR or \fB\-\-save\-optional\fR will be configured with an exact version rather than -using npm\'s default semver range operator\. -. -.SS "save\-optional" -. -.IP "\(bu" 4 + +.RE +.P +Dependencies saved to package\.json using \fB\-\-save\fR, \fB\-\-save\-dev\fR or +\fB\-\-save\-optional\fR will be configured with an exact version rather than +using npm's default semver range operator\. +.SS save\-optional +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Save installed packages to a package\.json file as optionalDependencies\. -. .P When used with the \fBnpm rm\fR command, it removes it from the devDependencies hash\. -. .P Only works if there is already a package\.json file present\. -. -.SS "save\-prefix" -. -.IP "\(bu" 4 -Default: \'^\' -. -.IP "\(bu" 4 +.SS save\-prefix +.RS 0 +.IP \(bu 2 +Default: '^' +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P -Configure how versions of packages installed to a package\.json file via \fB\-\-save\fR or \fB\-\-save\-dev\fR get prefixed\. -. +Configure how versions of packages installed to a package\.json file via +\fB\-\-save\fR or \fB\-\-save\-dev\fR get prefixed\. .P -For example if a package has version \fB1\.2\.3\fR, by default it\'s version is +For example if a package has version \fB1\.2\.3\fR, by default it's version is set to \fB^1\.2\.3\fR which allows minor upgrades for that package, but after -. -.br -\fBnpm config set save\-prefix=\'~\'\fR it would be set to \fB~1\.2\.3\fR which only allows +\fBnpm config set save\-prefix='~'\fR it would be set to \fB~1\.2\.3\fR which only allows patch upgrades\. -. -.SS "searchopts" -. -.IP "\(bu" 4 +.SS scope +.RS 0 +.IP \(bu 2 Default: "" -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE +.P +Associate an operation with a scope for a scoped registry\. Useful when logging +in to a private registry for the first time: +\fBnpm login \-\-scope=@organization \-\-registry=registry\.organization\.com\fR, which +will cause \fB@organization\fR to be mapped to the registry for future installation +of packages specified according to the pattern \fB@organization/package\fR\|\. +.SS searchopts +.RS 0 +.IP \(bu 2 +Default: "" +.IP \(bu 2 +Type: String + +.RE .P Space\-separated options that are always passed to search\. -. -.SS "searchexclude" -. -.IP "\(bu" 4 +.SS searchexclude +.RS 0 +.IP \(bu 2 Default: "" -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P Space\-separated options that limit the results from search\. -. -.SS "searchsort" -. -.IP "\(bu" 4 +.SS searchsort +.RS 0 +.IP \(bu 2 Default: "name" -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "\(bu" 4 +.IP \(bu 2 Values: "name", "\-name", "date", "\-date", "description", "\-description", "keywords", "\-keywords" -. -.IP "" 0 -. + +.RE .P Indication of which field to sort search results by\. Prefix with a \fB\-\fR character to indicate reverse sort\. -. -.SS "shell" -. -.IP "\(bu" 4 +.SS shell +.RS 0 +.IP \(bu 2 Default: SHELL environment variable, or "bash" on Posix, or "cmd" on Windows -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. + +.RE .P The shell to run for the \fBnpm explore\fR command\. -. -.SS "shrinkwrap" -. -.IP "\(bu" 4 +.SS shrinkwrap +.RS 0 +.IP \(bu 2 Default: true -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P If set to false, then ignore \fBnpm\-shrinkwrap\.json\fR files when installing\. -. -.SS "sign\-git\-tag" -. -.IP "\(bu" 4 +.SS sign\-git\-tag +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P If set to true, then the \fBnpm version\fR command will tag the version using \fB\-s\fR to add a signature\. -. .P Note that git requires you to have set up GPG keys in your git configs for this to work properly\. -. -.SS "spin" -. -.IP "\(bu" 4 +.SS spin +.RS 0 +.IP \(bu 2 Default: true -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean or \fB"always"\fR -. -.IP "" 0 -. + +.RE .P When set to \fBtrue\fR, npm will display an ascii spinner while it is doing things, if \fBprocess\.stderr\fR is a TTY\. -. .P Set to \fBfalse\fR to suppress the spinner, or set to \fBalways\fR to output the spinner even for non\-TTY outputs\. -. -.SS "strict\-ssl" -. -.IP "\(bu" 4 +.SS strict\-ssl +.RS 0 +.IP \(bu 2 Default: true -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Whether or not to do SSL key validation when making requests to the registry via https\. -. .P See also the \fBca\fR config\. -. -.SS "tag" -. -.IP "\(bu" 4 +.SS tag +.RS 0 +.IP \(bu 2 Default: latest -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P -If you ask npm to install a package and don\'t tell it a specific version, then +If you ask npm to install a package and don't tell it a specific version, then it will install the specified tag\. -. .P Also the tag that is added to the package@version specified by the \fBnpm tag\fR command, if no explicit tag is given\. -. -.SS "tmp" -. -.IP "\(bu" 4 +.SS tmp +.RS 0 +.IP \(bu 2 Default: TMPDIR environment variable, or "/tmp" -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. + +.RE .P Where to store temporary files and folders\. All temp files are deleted on success, but left behind on failure for forensic purposes\. -. -.SS "unicode" -. -.IP "\(bu" 4 +.SS unicode +.RS 0 +.IP \(bu 2 Default: true -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P When set to true, npm uses unicode characters in the tree output\. When false, it uses ascii characters to draw trees\. -. -.SS "unsafe\-perm" -. -.IP "\(bu" 4 +.SS unsafe\-perm +.RS 0 +.IP \(bu 2 Default: false if running as root, true otherwise -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Set to true to suppress the UID/GID switching when running package scripts\. If set explicitly to false, then installing as a non\-root user will fail\. -. -.SS "usage" -. -.IP "\(bu" 4 +.SS usage +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Boolean -. -.IP "" 0 -. + +.RE .P Set to show short usage output (like the \-H output) instead of complete help when doing npm help \fBnpm\-help\fR\|\. -. -.SS "user" -. -.IP "\(bu" 4 +.SS user +.RS 0 +.IP \(bu 2 Default: "nobody" -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String or Number -. -.IP "" 0 -. + +.RE .P The UID to set to when running package scripts as root\. -. -.SS "username" -. -.IP "\(bu" 4 -Default: null -. -.IP "\(bu" 4 -Type: String -. -.IP "" 0 -. -.P -The username on the npm registry\. Set with \fBnpm adduser\fR -. -.SS "userconfig" -. -.IP "\(bu" 4 +.SS userconfig +.RS 0 +.IP \(bu 2 Default: ~/\.npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. + +.RE .P The location of user\-level configuration settings\. -. -.SS "umask" -. -.IP "\(bu" 4 +.SS umask +.RS 0 +.IP \(bu 2 Default: 022 -. -.IP "\(bu" 4 +.IP \(bu 2 Type: Octal numeric string -. -.IP "" 0 -. + +.RE .P The "umask" value to use when setting the file creation mode on files and folders\. -. .P Folders and executables are given a mode which is \fB0777\fR masked against this value\. Other files are given a mode which is \fB0666\fR masked against this value\. Thus, the defaults are \fB0755\fR and \fB0644\fR respectively\. -. -.SS "user\-agent" -. -.IP "\(bu" 4 +.SS user\-agent +.RS 0 +.IP \(bu 2 Default: node/{process\.version} {process\.platform} {process\.arch} -. -.IP "\(bu" 4 +.IP \(bu 2 Type: String -. -.IP "" 0 -. + +.RE .P Sets a User\-Agent to the request header -. -.SS "version" -. -.IP "\(bu" 4 +.SS version +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: boolean -. -.IP "" 0 -. + +.RE .P If true, output the npm version and exit successfully\. -. .P Only relevant when specified explicitly on the command line\. -. -.SS "versions" -. -.IP "\(bu" 4 +.SS versions +.RS 0 +.IP \(bu 2 Default: false -. -.IP "\(bu" 4 +.IP \(bu 2 Type: boolean -. -.IP "" 0 -. + +.RE .P -If true, output the npm version as well as node\'s \fBprocess\.versions\fR +If true, output the npm version as well as node's \fBprocess\.versions\fR hash, and exit successfully\. -. .P Only relevant when specified explicitly on the command line\. -. -.SS "viewer" -. -.IP "\(bu" 4 +.SS viewer +.RS 0 +.IP \(bu 2 Default: "man" on Posix, "browser" on Windows -. -.IP "\(bu" 4 +.IP \(bu 2 Type: path -. -.IP "" 0 -. + +.RE .P The program to use to view help content\. -. .P Set to \fB"browser"\fR to view html help content in the default web browser\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 scripts -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 folders -. -.IP "\(bu" 4 +.IP \(bu 2 npm help npm -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7 index 071b8c2d79..fbf7a3c10b 100644 --- a/deps/npm/man/man7/npm-developers.7 +++ b/deps/npm/man/man7/npm-developers.7 @@ -1,335 +1,258 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-DEVELOPERS" "7" "September 2014" "" "" -. .SH "NAME" -\fBnpm-developers\fR \-\- Developer Guide -. -.SH "DESCRIPTION" -So, you\'ve decided to use npm to develop (and maybe publish/deploy) +\fBnpm-developers\fR \- Developer Guide +.SH DESCRIPTION +.P +So, you've decided to use npm to develop (and maybe publish/deploy) your project\. -. .P Fantastic! -. .P There are a few things that you need to do above the simple steps that your users will do to install your program\. -. -.SH "About These Documents" +.SH About These Documents +.P These are man pages\. If you install npm, you should be able to then do \fBman npm\-thing\fR to get the documentation on a particular topic, or \fBnpm help thing\fR to see the same information\. -. -.SH "What is a " +.SH What is a \fBpackage\fR +.P A package is: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 a) a folder containing a program described by a package\.json file -. -.IP "\(bu" 4 +.IP \(bu 2 b) a gzipped tarball containing (a) -. -.IP "\(bu" 4 +.IP \(bu 2 c) a url that resolves to (b) -. -.IP "\(bu" 4 +.IP \(bu 2 d) a \fB@\fR that is published on the registry with (c) -. -.IP "\(bu" 4 +.IP \(bu 2 e) a \fB@\fR that points to (d) -. -.IP "\(bu" 4 +.IP \(bu 2 f) a \fB\fR that has a "latest" tag satisfying (e) -. -.IP "\(bu" 4 +.IP \(bu 2 g) a \fBgit\fR url that, when cloned, results in (a)\. -. -.IP "" 0 -. + +.RE .P Even if you never publish your package, you can still get a lot of benefits of using npm if you just want to write a node program (a), and perhaps if you also want to be able to easily install it elsewhere after packing it up into a tarball (b)\. -. .P Git urls can be of the form: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX git://github\.com/user/project\.git#commit\-ish git+ssh://user@hostname:project\.git#commit\-ish git+http://user@hostname/project/blah\.git#commit\-ish git+https://user@hostname/project/blah\.git#commit\-ish -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The \fBcommit\-ish\fR can be any tag, sha, or branch which can be supplied as an argument to \fBgit checkout\fR\|\. The default is \fBmaster\fR\|\. -. -.SH "The package\.json File" +.SH The package\.json File +.P You need to have a \fBpackage\.json\fR file in the root of your project to do much of anything with npm\. That is basically the whole interface\. -. .P See npm help 5 \fBpackage\.json\fR for details about what goes in that file\. At the very least, you need: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 name: This should be a string that identifies your project\. Please do not use the name to specify that it runs on node, or is in JavaScript\. You can use the "engines" field to explicitly state the versions of -node (or whatever else) that your program requires, and it\'s pretty -well assumed that it\'s javascript\. -. -.IP +node (or whatever else) that your program requires, and it's pretty +well assumed that it's javascript\. It does not necessarily need to match your github repository name\. -. -.IP So, \fBnode\-foo\fR and \fBbar\-js\fR are bad names\. \fBfoo\fR or \fBbar\fR are better\. -. -.IP "\(bu" 4 +.IP \(bu 2 version: A semver\-compatible version\. -. -.IP "\(bu" 4 +.IP \(bu 2 engines: Specify the versions of node (or whatever else) that your program runs on\. The node API changes a lot, and there may be bugs or new functionality that you depend on\. Be explicit\. -. -.IP "\(bu" 4 +.IP \(bu 2 author: Take some credit\. -. -.IP "\(bu" 4 +.IP \(bu 2 scripts: If you have a special compilation or installation script, then you should put it in the \fBscripts\fR hash\. You should definitely have at least a basic smoke\-test command as the "scripts\.test" field\. See npm help 7 scripts\. -. -.IP "\(bu" 4 +.IP \(bu 2 main: If you have a single module that serves as the entry point to your program (like what the "foo" package gives you at require("foo")), then you need to specify that in the "main" field\. -. -.IP "\(bu" 4 +.IP \(bu 2 directories: This is a hash of folders\. The best ones to include are "lib" and "doc", but if you specify a folder full of man pages in "man", then -they\'ll get installed just like these ones\. -. -.IP "" 0 -. +they'll get installed just like these ones\. + +.RE .P You can use \fBnpm init\fR in the root of your package in order to get you started with a pretty basic package\.json file\. See npm help \fBnpm\-init\fR for more info\. -. -.SH "Keeping files " -Use a \fB\|\.npmignore\fR file to keep stuff out of your package\. If there\'s +.SH Keeping files \fIout\fR of your package +.P +Use a \fB\|\.npmignore\fR file to keep stuff out of your package\. If there's no \fB\|\.npmignore\fR file, but there \fIis\fR a \fB\|\.gitignore\fR file, then npm will ignore the stuff matched by the \fB\|\.gitignore\fR file\. If you \fIwant\fR to include something that is excluded by your \fB\|\.gitignore\fR file, you can create an empty \fB\|\.npmignore\fR file to override it\. -. .P -By default, the following paths and files are ignored, so there\'s no +By default, the following paths and files are ignored, so there's no need to add them to \fB\|\.npmignore\fR explicitly: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 \fB\|\.*\.swp\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\|\._*\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\|\.DS_Store\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\|\.git\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\|\.hg\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\|\.lock\-wscript\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\|\.svn\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fB\|\.wafpickle\-*\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fBCVS\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fBnpm\-debug\.log\fR -. -.IP "" 0 -. + +.RE .P Additionally, everything in \fBnode_modules\fR is ignored, except for -bundled dependencies\. npm automatically handles this for you, so don\'t +bundled dependencies\. npm automatically handles this for you, so don't bother adding \fBnode_modules\fR to \fB\|\.npmignore\fR\|\. -. .P -The following paths and files are never ignored, so adding them to \fB\|\.npmignore\fR is pointless: -. -.IP "\(bu" 4 +The following paths and files are never ignored, so adding them to +\fB\|\.npmignore\fR is pointless: +.RS 0 +.IP \(bu 2 \fBpackage\.json\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fBREADME\.*\fR -. -.IP "" 0 -. -.SH "Link Packages" + +.RE +.SH Link Packages +.P \fBnpm link\fR is designed to install a development package and see the changes in real time without having to keep re\-installing it\. (You do need to either re\-link or \fBnpm rebuild \-g\fR to update compiled packages, of course\.) -. .P More info at npm help \fBnpm\-link\fR\|\. -. -.SH "Before Publishing: Make Sure Your Package Installs and Works" +.SH Before Publishing: Make Sure Your Package Installs and Works +.P \fBThis is important\.\fR -. .P -If you can not install it locally, you\'ll have -problems trying to publish it\. Or, worse yet, you\'ll be able to -publish it, but you\'ll be publishing a broken or pointless package\. -So don\'t do that\. -. +If you can not install it locally, you'll have +problems trying to publish it\. Or, worse yet, you'll be able to +publish it, but you'll be publishing a broken or pointless package\. +So don't do that\. .P In the root of your package, do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm install \. \-g -. -.fi -. -.IP "" 0 -. +.EE +.RE .P -That\'ll show you that it\'s working\. If you\'d rather just create a symlink +That'll show you that it's working\. If you'd rather just create a symlink package that points to your working directory, then do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm link -. -.fi -. -.IP "" 0 -. +.EE +.RE .P -Use \fBnpm ls \-g\fR to see if it\'s there\. -. +Use \fBnpm ls \-g\fR to see if it's there\. .P To test a local install, go into some other folder, and then do: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX cd \.\./some\-other\-folder npm install \.\./my\-package -. -.fi -. -.IP "" 0 -. +.EE +.RE .P to install it locally into the node_modules folder in that other place\. -. .P Then go into the node\-repl, and try using require("my\-thing") to -bring in your module\'s main module\. -. -.SH "Create a User Account" +bring in your module's main module\. +.SH Create a User Account +.P Create a user with the adduser command\. It works like this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm adduser -. -.fi -. -.IP "" 0 -. +.EE +.RE .P and then follow the prompts\. -. .P This is documented better in npm help adduser\. -. -.SH "Publish your package" -This part\'s easy\. IN the root of your folder, do this: -. -.IP "" 4 -. -.nf +.SH Publish your package +.P +This part's easy\. IN the root of your folder, do this: +.P +.RS 2 +.EX npm publish -. -.fi -. -.IP "" 0 -. +.EE +.RE .P You can give publish a url to a tarball, or a filename of a tarball, or a path to a folder\. -. .P Note that pretty much \fBeverything in that folder will be exposed\fR -by default\. So, if you have secret stuff in there, use a \fB\|\.npmignore\fR file to list out the globs to ignore, or publish +by default\. So, if you have secret stuff in there, use a +\fB\|\.npmignore\fR file to list out the globs to ignore, or publish from a fresh checkout\. -. -.SH "Brag about it" +.SH Brag about it +.P Send emails, write blogs, blab in IRC\. -. .P Tell the world how easy it is to install your program! -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 faq -. -.IP "\(bu" 4 +.IP \(bu 2 npm help npm -. -.IP "\(bu" 4 +.IP \(bu 2 npm help init -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 scripts -. -.IP "\(bu" 4 +.IP \(bu 2 npm help publish -. -.IP "\(bu" 4 +.IP \(bu 2 npm help adduser -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 registry -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man7/npm-disputes.7 b/deps/npm/man/man7/npm-disputes.7 index a3163bcaec..fb7fd25f0a 100644 --- a/deps/npm/man/man7/npm-disputes.7 +++ b/deps/npm/man/man7/npm-disputes.7 @@ -1,92 +1,78 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-DISPUTES" "7" "September 2014" "" "" -. .SH "NAME" -\fBnpm-disputes\fR \-\- Handling Module Name Disputes -. -.SH "SYNOPSIS" -. -.IP "1" 4 +\fBnpm-disputes\fR \- Handling Module Name Disputes +.SH SYNOPSIS +.RS 0 +.IP 1. 3 Get the author email with \fBnpm owner ls \fR -. -.IP "2" 4 -Email the author, CC \fIsupport@npmjs\.com\fR -. -.IP "3" 4 -After a few weeks, if there\'s no resolution, we\'ll sort it out\. -. -.IP "" 0 -. +.IP 2. 3 +Email the author, CC support@npmjs\.com +.IP 3. 3 +After a few weeks, if there's no resolution, we'll sort it out\. + +.RE +.P +Don't squat on package names\. Publish code or move out of the way\. +.SH DESCRIPTION .P -Don\'t squat on package names\. Publish code or move out of the way\. -. -.SH "DESCRIPTION" There sometimes arise cases where a user publishes a module, and then later, some other user wants to use that name\. Here are some common ways that happens (each of these is based on actual events\.) -. -.IP "1" 4 +.RS 0 +.IP 1. 3 Joe writes a JavaScript module \fBfoo\fR, which is not node\-specific\. -Joe doesn\'t use node at all\. Bob wants to use \fBfoo\fR in node, so he +Joe doesn't use node at all\. Bob wants to use \fBfoo\fR in node, so he wraps it in an npm module\. Some time later, Joe starts using node, and wants to take over management of his program\. -. -.IP "2" 4 +.IP 2. 3 Bob writes an npm module \fBfoo\fR, and publishes it\. Perhaps much later, Joe finds a bug in \fBfoo\fR, and fixes it\. He sends a pull -request to Bob, but Bob doesn\'t have the time to deal with it, +request to Bob, but Bob doesn't have the time to deal with it, because he has a new job and a new baby and is focused on his new erlang project, and kind of not involved with node any more\. Joe -would like to publish a new \fBfoo\fR, but can\'t, because the name is +would like to publish a new \fBfoo\fR, but can't, because the name is taken\. -. -.IP "3" 4 +.IP 3. 3 Bob writes a 10\-line flow\-control library, and calls it \fBfoo\fR, and publishes it to the npm registry\. Being a simple little thing, it never really has to be updated\. Joe works for Foo Inc, the makers of the critically acclaimed and widely\-marketed \fBfoo\fR JavaScript toolkit framework\. They publish it to npm as \fBfoojs\fR, but people are routinely confused when \fBnpm install foo\fR is some different thing\. -. -.IP "4" 4 +.IP 4. 3 Bob writes a parser for the widely\-known \fBfoo\fR file format, because he needs it for work\. Then, he gets a new job, and never updates the prototype\. Later on, Joe writes a much more complete \fBfoo\fR parser, -but can\'t publish, because Bob\'s \fBfoo\fR is in the way\. -. -.IP "" 0 -. +but can't publish, because Bob's \fBfoo\fR is in the way\. + +.RE .P -The validity of Joe\'s claim in each situation can be debated\. However, -Joe\'s appropriate course of action in each case is the same\. -. -.IP "1" 4 +The validity of Joe's claim in each situation can be debated\. However, +Joe's appropriate course of action in each case is the same\. +.RS 0 +.IP 1. 3 \fBnpm owner ls foo\fR\|\. This will tell Joe the email address of the owner (Bob)\. -. -.IP "2" 4 +.IP 2. 3 Joe emails Bob, explaining the situation \fBas respectfully as possible\fR, and what he would like to do with the module name\. He -adds the npm support staff \fIsupport@npmjs\.com\fR to the CC list of +adds the npm support staff support@npmjs\.com to the CC list of the email\. Mention in the email that Bob can run \fBnpm owner add joe foo\fR to add Joe as an owner of the \fBfoo\fR package\. -. -.IP "3" 4 +.IP 3. 3 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 \fIsupport@npmjs\.com\fR and we\'ll sort it out\. ("Reasonable" is +Bob and Joe can't come to any sort of resolution, email support +support@npmjs\.com and we'll sort it out\. ("Reasonable" is usually at least 4 weeks, but extra time is allowed around common holidays\.) -. -.IP "" 0 -. -.SH "REASONING" + +.RE +.SH REASONING +.P In almost every case so far, the parties involved have been able to reach an amicable resolution without any major intervention\. Most people really do want to be reasonable, and are probably not even aware that -they\'re in your way\. -. +they're in your way\. .P Module ecosystems are most vibrant and powerful when they are as self\-directed as possible\. If an admin one day deletes something you @@ -94,53 +80,45 @@ had worked on, then that is going to make most people quite upset, regardless of the justification\. When humans solve their problems by talking to other humans with respect, everyone has the chance to end up feeling good about the interaction\. -. -.SH "EXCEPTIONS" +.SH EXCEPTIONS +.P Some things are not allowed, and will be removed without discussion if they are brought to the attention of the npm registry admins, including but not limited to: -. -.IP "1" 4 +.RS 0 +.IP 1. 3 Malware (that is, a package designed to exploit or harm the machine on which it is installed)\. -. -.IP "2" 4 +.IP 2. 3 Violations of copyright or licenses (for example, cloning an MIT\-licensed program, and then removing or changing the copyright and license statement)\. -. -.IP "3" 4 +.IP 3. 3 Illegal content\. -. -.IP "4" 4 -"Squatting" on a package name that you \fIplan\fR to use, but aren\'t -actually using\. Sorry, I don\'t care how great the name is, or how +.IP 4. 3 +"Squatting" on a package name that you \fIplan\fR to use, but aren't +actually using\. Sorry, I don't care how great the name is, or how perfect a fit it is for the thing that someday might happen\. If -someone wants to use it today, and you\'re just taking up space with -an empty tarball, you\'re going to be evicted\. -. -.IP "5" 4 +someone wants to use it today, and you're just taking up space with +an empty tarball, you're going to be evicted\. +.IP 5. 3 Putting empty packages in the registry\. Packages must have SOME -functionality\. It can be silly, but it can\'t be \fInothing\fR\|\. (See +functionality\. It can be silly, but it can't be \fInothing\fR\|\. (See also: squatting\.) -. -.IP "6" 4 +.IP 6. 3 Doing weird things with the registry, like using it as your own personal application database or otherwise putting non\-packagey things into it\. -. -.IP "" 0 -. + +.RE .P If you see bad behavior like this, please report it right away\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help 7 registry -. -.IP "\(bu" 4 +.IP \(bu 2 npm help owner -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man7/npm-faq.7 b/deps/npm/man/man7/npm-faq.7 index 5eefee8d06..942d3c0140 100644 --- a/deps/npm/man/man7/npm-faq.7 +++ b/deps/npm/man/man7/npm-faq.7 @@ -1,145 +1,118 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-FAQ" "7" "September 2014" "" "" -. .SH "NAME" -\fBnpm-faq\fR \-\- Frequently Asked Questions -. -.SH "Where can I find these docs in HTML?" -\fIhttps://www\.npmjs\.org/doc/\fR, or run: -. -.IP "" 4 -. -.nf +\fBnpm-faq\fR \- Frequently Asked Questions +.SH Where can I find these docs in HTML? +.P +https://www\.npmjs\.org/doc/, or run: +.P +.RS 2 +.EX npm config set viewer browser -. -.fi -. -.IP "" 0 -. +.EE +.RE .P to open these documents in your default web browser rather than \fBman\fR\|\. -. -.SH "It didn't work\." -That\'s not really a question\. -. -.SH "Why didn't it work?" -I don\'t know yet\. -. -.P -Read the error output, and if you can\'t figure out what it means, +.SH It didn't work\. +.P +That's not really a question\. +.SH Why didn't it work? +.P +I don't know yet\. +.P +Read the error output, and if you can't figure out what it means, do what it says and post a bug with all the information it asks for\. -. -.SH "Where does npm put stuff?" +.SH Where does npm put stuff? +.P See npm help 5 \fBnpm\-folders\fR -. .P tl;dr: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 Use the \fBnpm root\fR command to see where modules go, and the \fBnpm bin\fR command to see where executables go -. -.IP "\(bu" 4 +.IP \(bu 2 Global installs are different from local installs\. If you install something with the \fB\-g\fR flag, then its executables go in \fBnpm bin \-g\fR and its modules go in \fBnpm root \-g\fR\|\. -. -.IP "" 0 -. -.SH "How do I install something on my computer in a central location?" + +.RE +.SH How do I install something on my computer in a central location? +.P Install it globally by tacking \fB\-g\fR or \fB\-\-global\fR to the command\. (This is especially important for command line utilities that need to add their bins to the global system \fBPATH\fR\|\.) -. -.SH "I installed something globally, but I can't " +.SH I installed something globally, but I can't \fBrequire()\fR it +.P Install it locally\. -. .P The global install location is a place for command\-line utilities -to put their bins in the system \fBPATH\fR\|\. It\'s not for use with \fBrequire()\fR\|\. -. +to put their bins in the system \fBPATH\fR\|\. It's not for use with \fBrequire()\fR\|\. .P -If you \fBrequire()\fR a module in your code, then that means it\'s a +If you \fBrequire()\fR a module in your code, then that means it's a dependency, and a part of your program\. You need to install it locally in your program\. -. -.SH "Why can't npm just put everything in one place, like other package managers?" +.SH Why can't npm just put everything in one place, like other package managers? +.P Not every change is an improvement, but every improvement is a change\. -This would be like asking git to do network IO for every commit\. It\'s -not going to happen, because it\'s a terrible idea that causes more +This would be like asking git to do network IO for every commit\. It's +not going to happen, because it's a terrible idea that causes more problems than it solves\. -. .P It is much harder to avoid dependency conflicts without nesting dependencies\. This is fundamental to the way that npm works, and has proven to be an extremely successful approach\. See npm help 5 \fBnpm\-folders\fR for more details\. -. .P If you want a package to be installed in one place, and have all your programs reference the same copy of it, then use the \fBnpm link\fR command\. -That\'s what it\'s for\. Install it globally, then link it into each +That's what it's for\. Install it globally, then link it into each program that uses it\. -. -.SH "Whatever, I really want the old style 'everything global' style\." +.SH Whatever, I really want the old style 'everything global' style\. +.P Write your own package manager\. You could probably even wrap up \fBnpm\fR in a shell script if you really wanted to\. -. .P npm will not help you do something that is known to be a bad idea\. -. -.SH "Should I check my " -Mikeal Rogers answered this question very well: -. -.P -\fIhttp://www\.futurealoof\.com/posts/nodemodules\-in\-git\.html\fR -. -.P -tl;dr -. -.IP "\(bu" 4 -Check \fBnode_modules\fR into git for things you \fBdeploy\fR, such as -websites and apps\. -. -.IP "\(bu" 4 -Do not check \fBnode_modules\fR into git for libraries and modules -intended to be reused\. -. -.IP "\(bu" 4 -Use npm to manage dependencies in your dev environment, but not in -your deployment scripts\. -. -.IP "" 0 -. -.SH "Is it 'npm' or 'NPM' or 'Npm'?" +.SH Should I check my \fBnode_modules\fR folder into git? +.P +Usually, no\. Allow npm to resolve dependencies for your packages\. +.P +For packages you \fBdeploy\fR, such as websites and apps, +you should use npm shrinkwrap to lock down your full dependency tree: +.P +https://www\.npmjs\.org/doc/cli/npm\-shrinkwrap\.html +.P +If you are paranoid about depending on the npm ecosystem, +you should run a private npm mirror or a private cache\. +.P +If you want 100% confidence in being able to reproduce the specific bytes +included in a deployment, you should use an additional mechanism that can +verify contents rather than versions\. For example, +Amazon machine images, DigitalOcean snapshots, Heroku slugs, or simple tarballs\. +.SH Is it 'npm' or 'NPM' or 'Npm'? +.P npm should never be capitalized unless it is being displayed in a location that is customarily all\-caps (such as the title of man pages\.) -. -.SH "If 'npm' is an acronym, why is it never capitalized?" +.SH If 'npm' is an acronym, why is it never capitalized? +.P Contrary to the belief of many, "npm" is not in fact an abbreviation for "Node Package Manager"\. It is a recursive bacronymic abbreviation for "npm is not an acronym"\. (If it was "ninaa", then it would be an acronym, and thus incorrectly named\.) -. .P "NPM", however, \fIis\fR an acronym (more precisely, a capitonym) for the National Association of Pastoral Musicians\. You can learn more -about them at \fIhttp://npm\.org/\fR\|\. -. +about them at http://npm\.org/\|\. .P In software, "NPM" is a Non\-Parametric Mapping utility written by Chris Rorden\. You can analyze pictures of brains with it\. Learn more -about the (capitalized) NPM program at \fIhttp://www\.cabiatl\.com/mricro/npm/\fR\|\. -. +about the (capitalized) NPM program at http://www\.cabiatl\.com/mricro/npm/\|\. .P The first seed that eventually grew into this flower was a bash utility named "pm", which was a shortened descendent of "pkgmakeinst", a bash function that was used to install various different things on different -platforms, most often using Yahoo\'s \fByinst\fR\|\. If \fBnpm\fR was ever an +platforms, most often using Yahoo's \fByinst\fR\|\. If \fBnpm\fR was ever an acronym for anything, it was \fBnode pm\fR or maybe \fBnew pm\fR\|\. -. .P So, in all seriousness, the "npm" project is named after its command\-line utility, which was organically selected to be easily typed by a right\-handed @@ -147,183 +120,151 @@ programmer using a US QWERTY keyboard layout, ending with the right\-ring\-finger in a postition to type the \fB\-\fR key for flags and other command\-line arguments\. That command\-line utility is always lower\-case, though it starts most sentences it is a part of\. -. -.SH "How do I list installed packages?" +.SH How do I list installed packages? +.P \fBnpm ls\fR -. -.SH "How do I search for packages?" +.SH How do I search for packages? +.P \fBnpm search\fR -. .P Arguments are greps\. \fBnpm search jsdom\fR shows jsdom packages\. -. -.SH "How do I update npm?" -. -.nf +.SH How do I update npm? +.P +.RS 2 +.EX npm update npm \-g -. -.fi -. +.EE +.RE .P You can also update all outdated local packages by doing \fBnpm update\fR without any arguments, or global packages by doing \fBnpm update \-g\fR\|\. -. .P Occasionally, the version of npm will progress such that the current version cannot be properly installed with the version that you have installed already\. (Consider, if there is ever a bug in the \fBupdate\fR command\.) -. .P In those cases, you can do this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX curl https://www\.npmjs\.org/install\.sh | sh -. -.fi -. -.IP "" 0 -. -.SH "What is a " +.EE +.RE +.SH What is a \fBpackage\fR? +.P A package is: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 a) a folder containing a program described by a package\.json file -. -.IP "\(bu" 4 +.IP \(bu 2 b) a gzipped tarball containing (a) -. -.IP "\(bu" 4 +.IP \(bu 2 c) a url that resolves to (b) -. -.IP "\(bu" 4 +.IP \(bu 2 d) a \fB@\fR that is published on the registry with (c) -. -.IP "\(bu" 4 +.IP \(bu 2 e) a \fB@\fR that points to (d) -. -.IP "\(bu" 4 +.IP \(bu 2 f) a \fB\fR that has a "latest" tag satisfying (e) -. -.IP "\(bu" 4 +.IP \(bu 2 g) a \fBgit\fR url that, when cloned, results in (a)\. -. -.IP "" 0 -. + +.RE .P Even if you never publish your package, you can still get a lot of benefits of using npm if you just want to write a node program (a), and perhaps if you also want to be able to easily install it elsewhere after packing it up into a tarball (b)\. -. .P Git urls can be of the form: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX git://github\.com/user/project\.git#commit\-ish git+ssh://user@hostname:project\.git#commit\-ish git+http://user@hostname/project/blah\.git#commit\-ish git+https://user@hostname/project/blah\.git#commit\-ish -. -.fi -. -.IP "" 0 -. +.EE +.RE .P The \fBcommit\-ish\fR can be any tag, sha, or branch which can be supplied as an argument to \fBgit checkout\fR\|\. The default is \fBmaster\fR\|\. -. -.SH "What is a " +.SH What is a \fBmodule\fR? +.P A module is anything that can be loaded with \fBrequire()\fR in a Node\.js program\. The following things are all examples of things that can be loaded as modules: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 A folder with a \fBpackage\.json\fR file containing a \fBmain\fR field\. -. -.IP "\(bu" 4 +.IP \(bu 2 A folder with an \fBindex\.js\fR file in it\. -. -.IP "\(bu" 4 +.IP \(bu 2 A JavaScript file\. -. -.IP "" 0 -. + +.RE .P Most npm packages are modules, because they are libraries that you -load with \fBrequire\fR\|\. However, there\'s no requirement that an npm +load with \fBrequire\fR\|\. However, there's no requirement that an npm package be a module! Some only contain an executable command\-line -interface, and don\'t provide a \fBmain\fR field for use in Node programs\. -. +interface, and don't provide a \fBmain\fR field for use in Node programs\. .P -Almost all npm packages (at least, those that are Node programs) \fIcontain\fR many modules within them (because every file they load with \fBrequire()\fR is a module)\. -. +Almost all npm packages (at least, those that are Node programs) +\fIcontain\fR many modules within them (because every file they load with +\fBrequire()\fR is a module)\. .P In the context of a Node program, the \fBmodule\fR is also the thing that was loaded \fIfrom\fR a file\. For example, in the following program: -. -.IP "" 4 -. -.nf -var req = require(\'request\') -. -.fi -. -.IP "" 0 -. +.P +.RS 2 +.EX +var req = require('request') +.EE +.RE .P we might say that "The variable \fBreq\fR refers to the \fBrequest\fR module"\. -. -.SH "So, why is it the "" +.SH So, why is it the "\fBnode_modules\fR" folder, but "\fBpackage\.json\fR" file? Why not \fBnode_packages\fR or \fBmodule\.json\fR? +.P The \fBpackage\.json\fR file defines the package\. (See "What is a package?" above\.) -. .P The \fBnode_modules\fR folder is the place Node\.js looks for modules\. (See "What is a module?" above\.) -. .P For example, if you create a file at \fBnode_modules/foo\.js\fR and then -had a program that did \fBvar f = require(\'foo\.js\')\fR then it would load +had a program that did \fBvar f = require('foo\.js')\fR then it would load the module\. However, \fBfoo\.js\fR is not a "package" in this case, because it does not have a package\.json\. -. .P -Alternatively, if you create a package which does not have an \fBindex\.js\fR or a \fB"main"\fR field in the \fBpackage\.json\fR file, then it is -not a module\. Even if it\'s installed in \fBnode_modules\fR, it can\'t be +Alternatively, if you create a package which does not have an +\fBindex\.js\fR or a \fB"main"\fR field in the \fBpackage\.json\fR file, then it is +not a module\. Even if it's installed in \fBnode_modules\fR, it can't be an argument to \fBrequire()\fR\|\. -. -.SH ""node_modules"" +.SH \fB"node_modules"\fR is the name of my deity's arch\-rival, and a Forbidden Word in my religion\. Can I configure npm to use a different folder? +.P No\. This will never happen\. This question comes up sometimes, -because it seems silly from the outside that npm couldn\'t just be +because it seems silly from the outside that npm couldn't just be configured to put stuff somewhere else, and then npm could load them -from there\. It\'s an arbitrary spelling choice, right? What\'s the big +from there\. It's an arbitrary spelling choice, right? What's the big deal? -. .P -At the time of this writing, the string \fB\'node_modules\'\fR appears 151 +At the time of this writing, the string \fB\|'node_modules'\fR appears 151 times in 53 separate files in npm and node core (excluding tests and documentation)\. -. .P -Some of these references are in node\'s built\-in module loader\. Since +Some of these references are in node's built\-in module loader\. Since npm is not involved \fBat all\fR at run\-time, node itself would have to -be configured to know where you\'ve decided to stick stuff\. Complexity +be configured to know where you've decided to stick stuff\. Complexity hurdle #1\. Since the Node module system is locked, this cannot be -changed, and is enough to kill this request\. But I\'ll continue, in -deference to your deity\'s delicate feelings regarding spelling\. -. +changed, and is enough to kill this request\. But I'll continue, in +deference to your deity's delicate feelings regarding spelling\. .P Many of the others are in dependencies that npm uses, which are not necessarily tightly coupled to npm (in the sense that they do not read -npm\'s configuration files, etc\.) Each of these would have to be +npm's configuration files, etc\.) Each of these would have to be configured to take the name of the \fBnode_modules\fR folder as a parameter\. Complexity hurdle #2\. -. .P Furthermore, npm has the ability to "bundle" dependencies by adding the dep names to the \fB"bundledDependencies"\fR list in package\.json, @@ -332,148 +273,127 @@ if the author of a module bundles its dependencies, and they use a different spelling for \fBnode_modules\fR? npm would have to rename the folder at publish time, and then be smart enough to unpack it using your locally configured name\. Complexity hurdle #3\. -. .P -Furthermore, what happens when you \fIchange\fR this name? Fine, it\'s -easy enough the first time, just rename the \fBnode_modules\fR folders to \fB\|\./blergyblerp/\fR or whatever name you choose\. But what about when you -change it again? npm doesn\'t currently track any state about past +Furthermore, what happens when you \fIchange\fR this name? Fine, it's +easy enough the first time, just rename the \fBnode_modules\fR folders to +\fB\|\./blergyblerp/\fR or whatever name you choose\. But what about when you +change it again? npm doesn't currently track any state about past configuration settings, so this would be rather difficult to do properly\. It would have to track every previous value for this -config, and always accept any of them, or else yesterday\'s install may +config, and always accept any of them, or else yesterday's install may be broken tomorrow\. Complexity hurdle #4\. -. .P Never going to happen\. The folder is named \fBnode_modules\fR\|\. It is written indelibly in the Node Way, handed down from the ancient times of Node 0\.3\. -. -.SH "How do I install node with npm?" -You don\'t\. Try one of these node version managers: -. +.SH How do I install node with npm? +.P +You don't\. Try one of these node version managers: .P Unix: -. -.IP "\(bu" 4 -\fIhttp://github\.com/isaacs/nave\fR -. -.IP "\(bu" 4 -\fIhttp://github\.com/visionmedia/n\fR -. -.IP "\(bu" 4 -\fIhttp://github\.com/creationix/nvm\fR -. -.IP "" 0 -. +.RS 0 +.IP \(bu 2 +http://github\.com/isaacs/nave +.IP \(bu 2 +http://github\.com/visionmedia/n +.IP \(bu 2 +http://github\.com/creationix/nvm + +.RE .P Windows: -. -.IP "\(bu" 4 -\fIhttp://github\.com/marcelklehr/nodist\fR -. -.IP "\(bu" 4 -\fIhttps://github\.com/hakobera/nvmw\fR -. -.IP "\(bu" 4 -\fIhttps://github\.com/nanjingboy/nvmw\fR -. -.IP "" 0 -. -.SH "How can I use npm for development?" +.RS 0 +.IP \(bu 2 +http://github\.com/marcelklehr/nodist +.IP \(bu 2 +https://github\.com/hakobera/nvmw +.IP \(bu 2 +https://github\.com/nanjingboy/nvmw + +.RE +.SH How can I use npm for development? +.P See npm help 7 \fBnpm\-developers\fR and npm help 5 \fBpackage\.json\fR\|\. -. .P -You\'ll most likely want to \fBnpm link\fR your development folder\. That\'s +You'll most likely want to \fBnpm link\fR your development folder\. That's awesomely handy\. -. .P To set up your own private registry, check out npm help 7 \fBnpm\-registry\fR\|\. -. -.SH "Can I list a url as a dependency?" +.SH Can I list a url as a dependency? +.P Yes\. It should be a url to a gzipped tarball containing a single folder that has a package\.json in its root, or a git url\. (See "what is a package?" above\.) -. -.SH "How do I symlink to a dev folder so I don't have to keep re\-installing?" +.SH How do I symlink to a dev folder so I don't have to keep re\-installing? +.P See npm help \fBnpm\-link\fR -. -.SH "The package registry website\. What is that exactly?" +.SH The package registry website\. What is that exactly? +.P See npm help 7 \fBnpm\-registry\fR\|\. -. -.SH "I forgot my password, and can't publish\. How do I reset it?" -Go to \fIhttps://npmjs\.org/forgot\fR\|\. -. -.SH "I get ECONNREFUSED a lot\. What's up?" -Either the registry is down, or node\'s DNS isn\'t able to reach out\. -. -.P -To check if the registry is down, open up \fIhttps://registry\.npmjs\.org/\fR in a web browser\. This will also tell +.SH I forgot my password, and can't publish\. How do I reset it? +.P +Go to https://npmjs\.org/forgot\|\. +.SH I get ECONNREFUSED a lot\. What's up? +.P +Either the registry is down, or node's DNS isn't able to reach out\. +.P +To check if the registry is down, open up +https://registry\.npmjs\.org/ in a web browser\. This will also tell you if you are just unable to access the internet for some reason\. -. .P -If the registry IS down, let us know by emailing \fIsupport@npmjs\.com\fR -or posting an issue at \fIhttps://github\.com/npm/npm/issues\fR\|\. If it\'s -down for the world (and not just on your local network) then we\'re +If the registry IS down, let us know by emailing support@npmjs\.com +or posting an issue at https://github\.com/npm/npm/issues\|\. If it's +down for the world (and not just on your local network) then we're probably already being pinged about it\. -. .P You can also often get a faster response by visiting the #npm channel on Freenode IRC\. -. -.SH "Why no namespaces?" -Please see this discussion: \fIhttps://github\.com/npm/npm/issues/798\fR -. +.SH Why no namespaces? +.P +Please see this discussion: https://github\.com/npm/npm/issues/798 .P -tl;dr \- It doesn\'t actually make things better, and can make them worse\. -. +tl;dr \- It doesn't actually make things better, and can make them worse\. .P -If you want to namespace your own packages, you may: simply use the \fB\-\fR character to separate the names\. npm is a mostly anarchic system\. +If you want to namespace your own packages, you may: simply use the +\fB\-\fR character to separate the names\. npm is a mostly anarchic system\. There is not sufficient need to impose namespace rules on everyone\. -. -.SH "Who does npm?" +.SH Who does npm? +.P npm was originally written by Isaac Z\. Schlueter, and many others have contributed to it, some of them quite substantially\. -. .P The npm open source project, The npm Registry, and the community website \fIhttps://www\.npmjs\.org\fR are maintained and operated by the good folks at npm, Inc\. \fIhttp://www\.npmjs\.com\fR -. -.SH "I have a question or request not addressed here\. Where should I put it?" +.SH I have a question or request not addressed here\. Where should I put it? +.P Post an issue on the github project: -. -.IP "\(bu" 4 -\fIhttps://github\.com/npm/npm/issues\fR -. -.IP "" 0 -. -.SH "Why does npm hate me?" +.RS 0 +.IP \(bu 2 +https://github\.com/npm/npm/issues + +.RE +.SH Why does npm hate me? +.P npm is not capable of hatred\. It loves everyone, especially you\. -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help npm -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 developers -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 folders -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man7/npm-index.7 b/deps/npm/man/man7/npm-index.7 index 763b3dd3e5..5667722b27 100644 --- a/deps/npm/man/man7/npm-index.7 +++ b/deps/npm/man/man7/npm-index.7 @@ -1,322 +1,322 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-INDEX" "7" "September 2014" "" "" -. .SH "NAME" -\fBnpm-index\fR \-\- Index of all npm documentation -. -.SS "npm help README" +\fBnpm-index\fR \- Index of all npm documentation +.SS npm help README +.P node package manager -. -.SH "Command Line Documentation" +.SH Command Line Documentation +.P Using npm on the command line -. -.SS "npm help npm" +.SS npm help npm +.P node package manager -. -.SS "npm help adduser" +.SS npm help adduser +.P Add a registry user account -. -.SS "npm help bin" +.SS npm help bin +.P Display npm bin folder -. -.SS "npm help bugs" +.SS npm help bugs +.P Bugs for a package in a web browser maybe -. -.SS "npm help build" +.SS npm help build +.P Build a package -. -.SS "npm help bundle" +.SS npm help bundle +.P REMOVED -. -.SS "npm help cache" +.SS npm help cache +.P Manipulates packages cache -. -.SS "npm help completion" +.SS npm help completion +.P Tab Completion for npm -. -.SS "npm help config" +.SS npm help config +.P Manage the npm configuration files -. -.SS "npm help dedupe" +.SS npm help dedupe +.P Reduce duplication -. -.SS "npm help deprecate" +.SS npm help deprecate +.P Deprecate a version of a package -. -.SS "npm help docs" +.SS npm help docs +.P Docs for a package in a web browser maybe -. -.SS "npm help edit" +.SS npm help edit +.P Edit an installed package -. -.SS "npm help explore" +.SS npm help explore +.P Browse an installed package -. -.SS "npm help help\-search" +.SS npm help help\-search +.P Search npm help documentation -. -.SS "npm help help" +.SS npm help help +.P Get help on npm -. -.SS "npm help init" +.SS npm help init +.P Interactively create a package\.json file -. -.SS "npm help install" +.SS npm help install +.P Install a package -. -.SS "npm help link" +.SS npm help link +.P Symlink a package folder -. -.SS "npm help ls" +.SS npm help ls +.P List installed packages -. -.SS "npm help outdated" +.SS npm help outdated +.P Check for outdated packages -. -.SS "npm help owner" +.SS npm help owner +.P Manage package owners -. -.SS "npm help pack" +.SS npm help pack +.P Create a tarball from a package -. -.SS "npm help prefix" +.SS npm help prefix +.P Display prefix -. -.SS "npm help prune" +.SS npm help prune +.P Remove extraneous packages -. -.SS "npm help publish" +.SS npm help publish +.P Publish a package -. -.SS "npm help rebuild" +.SS npm help rebuild +.P Rebuild a package -. -.SS "npm help repo" +.SS npm help repo +.P Open package repository page in the browser -. -.SS "npm help restart" +.SS npm help restart +.P Start a package -. -.SS "npm help rm" +.SS npm help rm +.P Remove a package -. -.SS "npm help root" +.SS npm help root +.P Display npm root -. -.SS "npm help run\-script" +.SS npm help run\-script +.P Run arbitrary package scripts -. -.SS "npm help search" +.SS npm help search +.P Search for packages -. -.SS "npm help shrinkwrap" +.SS npm help shrinkwrap +.P Lock down dependency versions -. -.SS "npm help star" +.SS npm help star +.P Mark your favorite packages -. -.SS "npm help stars" +.SS npm help stars +.P View packages marked as favorites -. -.SS "npm help start" +.SS npm help start +.P Start a package -. -.SS "npm help stop" +.SS npm help stop +.P Stop a package -. -.SS "npm help submodule" +.SS npm help submodule +.P Add a package as a git submodule -. -.SS "npm help tag" +.SS npm help tag +.P Tag a published version -. -.SS "npm help test" +.SS npm help test +.P Test a package -. -.SS "npm help uninstall" +.SS npm help uninstall +.P Remove a package -. -.SS "npm help unpublish" +.SS npm help unpublish +.P Remove a package from the registry -. -.SS "npm help update" +.SS npm help update +.P Update a package -. -.SS "npm help version" +.SS npm help version +.P Bump a package version -. -.SS "npm help view" +.SS npm help view +.P View registry info -. -.SS "npm help whoami" +.SS npm help whoami +.P Display npm username -. -.SH "API Documentation" +.SH API Documentation +.P Using npm in your Node programs -. -.SS "npm apihelp npm" +.SS npm apihelp npm +.P node package manager -. -.SS "npm apihelp bin" +.SS npm apihelp bin +.P Display npm bin folder -. -.SS "npm apihelp bugs" +.SS npm apihelp bugs +.P Bugs for a package in a web browser maybe -. -.SS "npm apihelp cache" +.SS npm apihelp cache +.P manage the npm cache programmatically -. -.SS "npm apihelp commands" +.SS npm apihelp commands +.P npm commands -. -.SS "npm apihelp config" +.SS npm apihelp config +.P Manage the npm configuration files -. -.SS "npm apihelp deprecate" +.SS npm apihelp deprecate +.P Deprecate a version of a package -. -.SS "npm apihelp docs" +.SS npm apihelp docs +.P Docs for a package in a web browser maybe -. -.SS "npm apihelp edit" +.SS npm apihelp edit +.P Edit an installed package -. -.SS "npm apihelp explore" +.SS npm apihelp explore +.P Browse an installed package -. -.SS "npm apihelp help\-search" +.SS npm apihelp help\-search +.P Search the help pages -. -.SS "npm apihelp init" +.SS npm apihelp init +.P Interactively create a package\.json file -. -.SS "npm apihelp install" +.SS npm apihelp install +.P install a package programmatically -. -.SS "npm apihelp link" +.SS npm apihelp link +.P Symlink a package folder -. -.SS "npm apihelp load" +.SS npm apihelp load +.P Load config settings -. -.SS "npm apihelp ls" +.SS npm apihelp ls +.P List installed packages -. -.SS "npm apihelp outdated" +.SS npm apihelp outdated +.P Check for outdated packages -. -.SS "npm apihelp owner" +.SS npm apihelp owner +.P Manage package owners -. -.SS "npm apihelp pack" +.SS npm apihelp pack +.P Create a tarball from a package -. -.SS "npm apihelp prefix" +.SS npm apihelp prefix +.P Display prefix -. -.SS "npm apihelp prune" +.SS npm apihelp prune +.P Remove extraneous packages -. -.SS "npm apihelp publish" +.SS npm apihelp publish +.P Publish a package -. -.SS "npm apihelp rebuild" +.SS npm apihelp rebuild +.P Rebuild a package -. -.SS "npm apihelp repo" +.SS npm apihelp repo +.P Open package repository page in the browser -. -.SS "npm apihelp restart" +.SS npm apihelp restart +.P Start a package -. -.SS "npm apihelp root" +.SS npm apihelp root +.P Display npm root -. -.SS "npm apihelp run\-script" +.SS npm apihelp run\-script +.P Run arbitrary package scripts -. -.SS "npm apihelp search" +.SS npm apihelp search +.P Search for packages -. -.SS "npm apihelp shrinkwrap" +.SS npm apihelp shrinkwrap +.P programmatically generate package shrinkwrap file -. -.SS "npm apihelp start" +.SS npm apihelp start +.P Start a package -. -.SS "npm apihelp stop" +.SS npm apihelp stop +.P Stop a package -. -.SS "npm apihelp submodule" +.SS npm apihelp submodule +.P Add a package as a git submodule -. -.SS "npm apihelp tag" +.SS npm apihelp tag +.P Tag a published version -. -.SS "npm apihelp test" +.SS npm apihelp test +.P Test a package -. -.SS "npm apihelp uninstall" +.SS npm apihelp uninstall +.P uninstall a package programmatically -. -.SS "npm apihelp unpublish" +.SS npm apihelp unpublish +.P Remove a package from the registry -. -.SS "npm apihelp update" +.SS npm apihelp update +.P Update a package -. -.SS "npm apihelp version" +.SS npm apihelp version +.P Bump a package version -. -.SS "npm apihelp view" +.SS npm apihelp view +.P View registry info -. -.SS "npm apihelp whoami" +.SS npm apihelp whoami +.P Display npm username -. -.SH "Files" +.SH Files +.P File system structures npm uses -. -.SS "npm help 5 folders" +.SS npm help 5 folders +.P Folder Structures Used by npm -. -.SS "npm help 5 npmrc" +.SS npm help 5 npmrc +.P The npm config files -. -.SS "npm help 5 package\.json" -Specifics of npm\'s package\.json handling -. -.SH "Misc" +.SS npm help 5 package\.json +.P +Specifics of npm's package\.json handling +.SH Misc +.P Various other bits and bobs -. -.SS "npm help 7 coding\-style" -npm\'s "funny" coding style -. -.SS "npm help 7 config" +.SS npm help 7 coding\-style +.P +npm's "funny" coding style +.SS npm help 7 config +.P More than you probably want to know about npm configuration -. -.SS "npm help 7 developers" +.SS npm help 7 developers +.P Developer Guide -. -.SS "npm help 7 disputes" +.SS npm help 7 disputes +.P Handling Module Name Disputes -. -.SS "npm help 7 faq" +.SS npm help 7 faq +.P Frequently Asked Questions -. -.SS "npm help 7 index" +.SS npm help 7 index +.P Index of all npm documentation -. -.SS "npm help 7 registry" +.SS npm help 7 registry +.P The JavaScript Package Registry -. -.SS "npm help 7 scripts" +.SS npm help 7 scope +.P +Scoped packages +.SS npm help 7 scripts +.P How npm handles the "scripts" field -. -.SS "npm help 7 removing\-npm" +.SS npm help 7 removing\-npm +.P Cleaning the Slate -. -.SS "npm help 7 semver" +.SS npm help 7 semver +.P The semantic versioner for npm + diff --git a/deps/npm/man/man7/npm-registry.7 b/deps/npm/man/man7/npm-registry.7 index c190779ad1..ac3059cae2 100644 --- a/deps/npm/man/man7/npm-registry.7 +++ b/deps/npm/man/man7/npm-registry.7 @@ -1,82 +1,70 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-REGISTRY" "7" "September 2014" "" "" -. .SH "NAME" -\fBnpm-registry\fR \-\- The JavaScript Package Registry -. -.SH "DESCRIPTION" +\fBnpm-registry\fR \- The JavaScript Package Registry +.SH DESCRIPTION +.P To resolve packages by name and version, npm talks to a registry website that implements the CommonJS Package Registry specification for reading package info\. -. .P -Additionally, npm\'s package registry implementation supports several +Additionally, npm's package registry implementation supports several write APIs as well, to allow for publishing packages and managing user account information\. -. .P -The official public npm registry is at \fIhttp://registry\.npmjs\.org/\fR\|\. It -is powered by a CouchDB database at \fIhttp://isaacs\.iriscouch\.com/registry\fR\|\. The code for the couchapp is -available at \fIhttp://github\.com/npm/npmjs\.org\fR\|\. npm user accounts -are CouchDB users, stored in the \fIhttp://isaacs\.iriscouch\.com/_users\fR -database\. -. +The official public npm registry is at http://registry\.npmjs\.org/\|\. It +is powered by a CouchDB database, of which there is a public mirror at +http://skimdb\.npmjs\.com/registry\|\. The code for the couchapp is +available at http://github\.com/npm/npm\-registry\-couchapp\|\. +.P +The registry URL used is determined by the scope of the package (see +npm help 7 \fBnpm\-scope\fR)\. If no scope is specified, the default registry is used, which is +supplied by the \fBregistry\fR config parameter\. See npm help \fBnpm\-config\fR, +npm help 5 \fBnpmrc\fR, and npm help 7 \fBnpm\-config\fR for more on managing npm's configuration\. +.SH Can I run my own private registry? .P -The registry URL is supplied by the \fBregistry\fR config parameter\. See npm help \fBnpm\-config\fR, npm help 5 \fBnpmrc\fR, and npm help 7 \fBnpm\-config\fR for more on managing -npm\'s configuration\. -. -.SH "Can I run my own private registry?" Yes! -. .P The easiest way is to replicate the couch database, and use the same (or similar) design doc to implement the APIs\. -. .P If you set up continuous replication from the official CouchDB, and then -set your internal CouchDB as the registry config, then you\'ll be able +set your internal CouchDB as the registry config, then you'll be able to read any published packages, in addition to your private ones, and by default will only publish internally\. If you then want to publish a -package for the whole world to see, you can simply override the \fB\-\-registry\fR config for that command\. -. -.SH "I don't want my package published in the official registry\. It's private\." +package for the whole world to see, you can simply override the +\fB\-\-registry\fR config for that command\. +.SH I don't want my package published in the official registry\. It's private\. +.P Set \fB"private": true\fR in your package\.json to prevent it from being -published at all, or \fB"publishConfig":{"registry":"http://my\-internal\-registry\.local"}\fR +published at all, or +\fB"publishConfig":{"registry":"http://my\-internal\-registry\.local"}\fR to force it to be published only to your internal registry\. -. .P See npm help 5 \fBpackage\.json\fR for more info on what goes in the package\.json file\. -. -.SH "Will you replicate from my registry into the public one?" +.SH Will you replicate from my registry into the public one? +.P No\. If you want things to be public, then publish them into the public registry using npm\. What little security there is would be for nought otherwise\. -. -.SH "Do I have to use couchdb to build a registry that npm can talk to?" -No, but it\'s way easier\. Basically, yes, you do, or you have to +.SH Do I have to use couchdb to build a registry that npm can talk to? +.P +No, but it's way easier\. Basically, yes, you do, or you have to effectively implement the entire CouchDB API anyway\. -. -.SH "Is there a website or something to see package docs and such?" -Yes, head over to \fIhttps://npmjs\.org/\fR -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH Is there a website or something to see package docs and such? +.P +Yes, head over to https://npmjs\.org/ +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 config -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 npmrc -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 developers -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 disputes -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man7/npm-scripts.7 b/deps/npm/man/man7/npm-scripts.7 index d4d045f870..4cc93a6469 100644 --- a/deps/npm/man/man7/npm-scripts.7 +++ b/deps/npm/man/man7/npm-scripts.7 @@ -1,77 +1,64 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-SCRIPTS" "7" "September 2014" "" "" -. .SH "NAME" -\fBnpm-scripts\fR \-\- How npm handles the "scripts" field -. -.SH "DESCRIPTION" +\fBnpm-scripts\fR \- How npm handles the "scripts" field +.SH DESCRIPTION +.P npm supports the "scripts" member of the package\.json script, for the following scripts: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 prepublish: Run BEFORE the package is published\. (Also run on local \fBnpm install\fR without any arguments\.) -. -.IP "\(bu" 4 +.IP \(bu 2 publish, postpublish: Run AFTER the package is published\. -. -.IP "\(bu" 4 +.IP \(bu 2 preinstall: Run BEFORE the package is installed -. -.IP "\(bu" 4 +.IP \(bu 2 install, postinstall: Run AFTER the package is installed\. -. -.IP "\(bu" 4 +.IP \(bu 2 preuninstall, uninstall: Run BEFORE the package is uninstalled\. -. -.IP "\(bu" 4 +.IP \(bu 2 postuninstall: Run AFTER the package is uninstalled\. -. -.IP "\(bu" 4 +.IP \(bu 2 preupdate: Run BEFORE the package is updated with the update command\. -. -.IP "\(bu" 4 +.IP \(bu 2 update, postupdate: Run AFTER the package is updated with the update command\. -. -.IP "\(bu" 4 +.IP \(bu 2 pretest, test, posttest: Run by the \fBnpm test\fR command\. -. -.IP "\(bu" 4 +.IP \(bu 2 prestop, stop, poststop: Run by the \fBnpm stop\fR command\. -. -.IP "\(bu" 4 +.IP \(bu 2 prestart, start, poststart: Run by the \fBnpm start\fR command\. -. -.IP "\(bu" 4 +.IP \(bu 2 prerestart, restart, postrestart: Run by the \fBnpm restart\fR command\. Note: \fBnpm restart\fR will run the stop and start scripts if no \fBrestart\fR script is provided\. -. -.IP "" 0 -. + +.RE +.P +Additionally, arbitrary scripts can be executed by running `npm run\-script +.P + \fB\|\. *Pre* and *post* commands with matching names will be run for +those as well (e\.g\.\fRpremyscript\fB,\fRmyscript\fB,\fRpostmyscript`)\. +.SH NOTE: INSTALL SCRIPTS ARE AN ANTIPATTERN .P -Additionally, arbitrary scripts can be run by doing \fBnpm run\-script \fR\|\. -. -.SH "NOTE: INSTALL SCRIPTS ARE AN ANTIPATTERN" -\fBtl;dr\fR Don\'t use \fBinstall\fR\|\. Use a \fB\|\.gyp\fR file for compilation, and \fBprepublish\fR for anything else\. -. +\fBtl;dr\fR Don't use \fBinstall\fR\|\. Use a \fB\|\.gyp\fR file for compilation, and +\fBprepublish\fR for anything else\. .P -You should almost never have to explicitly set a \fBpreinstall\fR or \fBinstall\fR script\. If you are doing this, please consider if there is +You should almost never have to explicitly set a \fBpreinstall\fR or +\fBinstall\fR script\. If you are doing this, please consider if there is another option\. -. .P The only valid use of \fBinstall\fR or \fBpreinstall\fR scripts is for compilation which must be done on the target architecture\. In early @@ -79,276 +66,233 @@ versions of node, this was often done using the \fBnode\-waf\fR scripts, or a standalone \fBMakefile\fR, and early versions of npm required that it be explicitly set in package\.json\. This was not portable, and harder to do properly\. -. .P -In the current version of node, the standard way to do this is using a \fB\|\.gyp\fR file\. If you have a file with a \fB\|\.gyp\fR extension in the root +In the current version of node, the standard way to do this is using a +\fB\|\.gyp\fR file\. If you have a file with a \fB\|\.gyp\fR extension in the root of your package, then npm will run the appropriate \fBnode\-gyp\fR commands automatically at install time\. This is the only officially supported method for compiling binary addons, and does not require that you add anything to your package\.json file\. -. .P If you have to do other things before your package is used, in a way that is not dependent on the operating system or architecture of the target system, then use a \fBprepublish\fR script instead\. This includes tasks such as: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 Compile CoffeeScript source code into JavaScript\. -. -.IP "\(bu" 4 +.IP \(bu 2 Create minified versions of JavaScript source code\. -. -.IP "\(bu" 4 +.IP \(bu 2 Fetching remote resources that your package will use\. -. -.IP "" 0 -. + +.RE .P -The advantage of doing these things at \fBprepublish\fR time instead of \fBpreinstall\fR or \fBinstall\fR time is that they can be done once, in a +The advantage of doing these things at \fBprepublish\fR time instead of +\fBpreinstall\fR or \fBinstall\fR time is that they can be done once, in a single place, and thus greatly reduce complexity and variability\. Additionally, this means that: -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 You can depend on \fBcoffee\-script\fR as a \fBdevDependency\fR, and thus -your users don\'t need to have it installed\. -. -.IP "\(bu" 4 -You don\'t need to include the minifiers in your package, reducing +your users don't need to have it installed\. +.IP \(bu 2 +You don't need to include the minifiers in your package, reducing the size for your users\. -. -.IP "\(bu" 4 -You don\'t need to rely on your users having \fBcurl\fR or \fBwget\fR or +.IP \(bu 2 +You don't need to rely on your users having \fBcurl\fR or \fBwget\fR or other system tools on the target machines\. -. -.IP "" 0 -. -.SH "DEFAULT VALUES" + +.RE +.SH DEFAULT VALUES +.P npm will default some script values based on package contents\. -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 \fB"start": "node server\.js"\fR: -. -.IP If there is a \fBserver\.js\fR file in the root of your package, then npm will default the \fBstart\fR command to \fBnode server\.js\fR\|\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fB"preinstall": "node\-waf clean || true; node\-waf configure build"\fR: -. -.IP If there is a \fBwscript\fR file in the root of your package, npm will default the \fBpreinstall\fR command to compile using node\-waf\. -. -.IP "" 0 -. -.SH "USER" + +.RE +.SH USER +.P If npm was invoked with root privileges, then it will change the uid to the user account or uid specified by the \fBuser\fR config, which defaults to \fBnobody\fR\|\. Set the \fBunsafe\-perm\fR flag to run scripts with root privileges\. -. -.SH "ENVIRONMENT" +.SH ENVIRONMENT +.P Package scripts run in an environment where many pieces of information are made available regarding the setup of npm and the current state of the process\. -. -.SS "path" +.SS path +.P If you depend on modules that define executable scripts, like test suites, then those executables will be added to the \fBPATH\fR for executing the scripts\. So, if your package\.json has this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name" : "foo" , "dependencies" : { "bar" : "0\.1\.x" } , "scripts": { "start" : "bar \./test" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P then you could run \fBnpm start\fR to execute the \fBbar\fR script, which is exported into the \fBnode_modules/\.bin\fR directory on \fBnpm install\fR\|\. -. -.SS "package\.json vars" +.SS package\.json vars +.P The package\.json fields are tacked onto the \fBnpm_package_\fR prefix\. So, for instance, if you had \fB{"name":"foo", "version":"1\.2\.5"}\fR in your -package\.json file, then your package scripts would have the \fBnpm_package_name\fR environment variable set to "foo", and the \fBnpm_package_version\fR set to "1\.2\.5" -. -.SS "configuration" -Configuration parameters are put in the environment with the \fBnpm_config_\fR prefix\. For instance, you can view the effective \fBroot\fR +package\.json file, then your package scripts would have the +\fBnpm_package_name\fR environment variable set to "foo", and the +\fBnpm_package_version\fR set to "1\.2\.5" +.SS configuration +.P +Configuration parameters are put in the environment with the +\fBnpm_config_\fR prefix\. For instance, you can view the effective \fBroot\fR config by checking the \fBnpm_config_root\fR environment variable\. -. -.SS "Special: package\.json "config" hash" +.SS Special: package\.json "config" hash +.P The package\.json "config" keys are overwritten in the environment if there is a config param of \fB[@]:\fR\|\. For example, if the package\.json has this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "name" : "foo" , "config" : { "port" : "8080" } , "scripts" : { "start" : "node server\.js" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P and the server\.js is this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX http\.createServer(\.\.\.)\.listen(process\.env\.npm_package_config_port) -. -.fi -. -.IP "" 0 -. +.EE +.RE .P then the user could change the behavior by doing: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX npm config set foo:port 80 -. -.fi -. -.IP "" 0 -. -.SS "current lifecycle event" +.EE +.RE +.SS current lifecycle event +.P Lastly, the \fBnpm_lifecycle_event\fR environment variable is set to whichever stage of the cycle is being executed\. So, you could have a single script used for different parts of the process which switches -based on what\'s currently happening\. -. +based on what's currently happening\. .P -Objects are flattened following this format, so if you had \fB{"scripts":{"install":"foo\.js"}}\fR in your package\.json, then you\'d +Objects are flattened following this format, so if you had +\fB{"scripts":{"install":"foo\.js"}}\fR in your package\.json, then you'd see this in the script: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX process\.env\.npm_package_scripts_install === "foo\.js" -. -.fi -. -.IP "" 0 -. -.SH "EXAMPLES" +.EE +.RE +.SH EXAMPLES +.P For example, if your package\.json contains this: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "scripts" : { "install" : "scripts/install\.js" , "postinstall" : "scripts/install\.js" , "uninstall" : "scripts/uninstall\.js" } } -. -.fi -. -.IP "" 0 -. +.EE +.RE .P then the \fBscripts/install\.js\fR will be called for the install, post\-install, stages of the lifecycle, and the \fBscripts/uninstall\.js\fR -would be called when the package is uninstalled\. Since \fBscripts/install\.js\fR is running for three different phases, it would +would be called when the package is uninstalled\. Since +\fBscripts/install\.js\fR is running for three different phases, it would be wise in this case to look at the \fBnpm_lifecycle_event\fR environment variable\. -. .P If you want to run a make command, you can do so\. This works just fine: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX { "scripts" : { "preinstall" : "\./configure" , "install" : "make && make install" , "test" : "make test" } } -. -.fi -. -.IP "" 0 -. -.SH "EXITING" +.EE +.RE +.SH EXITING +.P Scripts are run by passing the line as a script argument to \fBsh\fR\|\. -. .P If the script exits with a code other than 0, then this will abort the process\. -. .P -Note that these script files don\'t have to be nodejs or even +Note that these script files don't have to be nodejs or even javascript programs\. They just have to be some kind of executable file\. -. -.SH "HOOK SCRIPTS" +.SH HOOK SCRIPTS +.P If you want to run a specific script at a specific lifecycle event for ALL packages, then you can use a hook script\. -. .P Place an executable file at \fBnode_modules/\.hooks/{eventname}\fR, and -it\'ll get run for all packages when they are going through that point +it'll get run for all packages when they are going through that point in the package lifecycle for any packages installed in that root\. -. .P Hook scripts are run exactly the same way as package\.json scripts\. That is, they are in a separate child process, with the env described above\. -. -.SH "BEST PRACTICES" -. -.IP "\(bu" 4 -Don\'t exit with a non\-zero error code unless you \fIreally\fR mean it\. +.SH BEST PRACTICES +.RS 0 +.IP \(bu 2 +Don't exit with a non\-zero error code unless you \fIreally\fR mean it\. Except for uninstall scripts, this will cause the npm action to fail, and potentially be rolled back\. If the failure is minor or -only will prevent some optional features, then it\'s better to just +only will prevent some optional features, then it's better to just print a warning and exit successfully\. -. -.IP "\(bu" 4 -Try not to use scripts to do what npm can do for you\. Read through npm help 5 \fBpackage\.json\fR to see all the things that you can specify and enable +.IP \(bu 2 +Try not to use scripts to do what npm can do for you\. Read through +npm help 5 \fBpackage\.json\fR to see all the things that you can specify and enable by simply describing your package appropriately\. In general, this will lead to a more robust and consistent state\. -. -.IP "\(bu" 4 +.IP \(bu 2 Inspect the env to determine where to put things\. For instance, if the \fBnpm_config_binroot\fR environ is set to \fB/home/user/bin\fR, then -don\'t try to install executables into \fB/usr/local/bin\fR\|\. The user +don't try to install executables into \fB/usr/local/bin\fR\|\. The user probably set it up that way for a reason\. -. -.IP "\(bu" 4 -Don\'t prefix your script commands with "sudo"\. If root permissions -are required for some reason, then it\'ll fail with that error, and +.IP \(bu 2 +Don't prefix your script commands with "sudo"\. If root permissions +are required for some reason, then it'll fail with that error, and the user will sudo the npm command in question\. -. -.IP "" 0 -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 + +.RE +.SH SEE ALSO +.RS 0 +.IP \(bu 2 npm help run\-script -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 5 package\.json -. -.IP "\(bu" 4 +.IP \(bu 2 npm help 7 developers -. -.IP "\(bu" 4 +.IP \(bu 2 npm help install -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man7/removing-npm.7 b/deps/npm/man/man7/removing-npm.7 index e8a60cdf95..ae3513c4df 100644 --- a/deps/npm/man/man7/removing-npm.7 +++ b/deps/npm/man/man7/removing-npm.7 @@ -1,107 +1,78 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "NPM\-REMOVAL" "1" "September 2014" "" "" -. .SH "NAME" -\fBnpm-removal\fR \-\- Cleaning the Slate -. -.SH "SYNOPSIS" +\fBnpm-removal\fR \- Cleaning the Slate +.SH SYNOPSIS +.P So sad to see you go\. -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX sudo npm uninstall npm \-g -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Or, if that fails, get the npm source code, and do: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX sudo make uninstall -. -.fi -. -.IP "" 0 -. -.SH "More Severe Uninstalling" +.EE +.RE +.SH More Severe Uninstalling +.P Usually, the above instructions are sufficient\. That will remove -npm, but leave behind anything you\'ve installed\. -. +npm, but leave behind anything you've installed\. .P -If that doesn\'t work, or if you require more drastic measures, +If that doesn't work, or if you require more drastic measures, continue reading\. -. .P Note that this is only necessary for globally\-installed packages\. Local -installs are completely contained within a project\'s \fBnode_modules\fR -folder\. Delete that folder, and everything is gone (unless a package\'s +installs are completely contained within a project's \fBnode_modules\fR +folder\. Delete that folder, and everything is gone (unless a package's install script is particularly ill\-behaved)\. -. .P This assumes that you installed node and npm in the default place\. If you configured node with a different \fB\-\-prefix\fR, or installed npm with a -different prefix setting, then adjust the paths accordingly, replacing \fB/usr/local\fR with your install prefix\. -. +different prefix setting, then adjust the paths accordingly, replacing +\fB/usr/local\fR with your install prefix\. .P To remove everything npm\-related manually: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX rm \-rf /usr/local/{lib/node{,/\.npm,_modules},bin,share/man}/npm* -. -.fi -. -.IP "" 0 -. +.EE +.RE .P If you installed things \fIwith\fR npm, then your best bet is to uninstall them with npm first, and then install them again once you have a proper install\. This can help find any symlinks that are lying around: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX ls \-laF /usr/local/{lib/node{,/\.npm},bin,share/man} | grep npm -. -.fi -. -.IP "" 0 -. +.EE +.RE .P Prior to version 0\.3, npm used shim files for executables and node modules\. To track those down, you can do the following: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX find /usr/local/{lib/node,bin} \-exec grep \-l npm \\{\\} \\; ; -. -.fi -. -.IP "" 0 -. +.EE +.RE .P (This is also in the README file\.) -. -.SH "SEE ALSO" -. -.IP "\(bu" 4 +.SH SEE ALSO +.RS 0 +.IP \(bu 2 README -. -.IP "\(bu" 4 +.IP \(bu 2 npm help rm -. -.IP "\(bu" 4 +.IP \(bu 2 npm help prune -. -.IP "" 0 + +.RE diff --git a/deps/npm/man/man7/semver.7 b/deps/npm/man/man7/semver.7 index 1e64a8df20..c2efd3d2cf 100644 --- a/deps/npm/man/man7/semver.7 +++ b/deps/npm/man/man7/semver.7 @@ -1,243 +1,343 @@ -.\" Generated with Ronnjs 0.3.8 -.\" http://github.com/kapouer/ronnjs/ -. .TH "SEMVER" "7" "September 2014" "" "" -. .SH "NAME" -\fBsemver\fR \-\- The semantic versioner for npm -. -.SH "Usage" -. -.nf +\fBsemver\fR \- The semantic versioner for npm +.SH Usage +.P +.RS 2 +.EX $ npm install semver -semver\.valid(\'1\.2\.3\') // \'1\.2\.3\' -semver\.valid(\'a\.b\.c\') // null -semver\.clean(\' =v1\.2\.3 \') // \'1\.2\.3\' -semver\.satisfies(\'1\.2\.3\', \'1\.x || >=2\.5\.0 || 5\.0\.0 \- 7\.2\.3\') // true -semver\.gt(\'1\.2\.3\', \'9\.8\.7\') // false -semver\.lt(\'1\.2\.3\', \'9\.8\.7\') // true -. -.fi -. + +semver\.valid('1\.2\.3') // '1\.2\.3' +semver\.valid('a\.b\.c') // null +semver\.clean(' =v1\.2\.3 ') // '1\.2\.3' +semver\.satisfies('1\.2\.3', '1\.x || >=2\.5\.0 || 5\.0\.0 \- 7\.2\.3') // true +semver\.gt('1\.2\.3', '9\.8\.7') // false +semver\.lt('1\.2\.3', '9\.8\.7') // true +.EE +.RE .P As a command\-line utility: -. -.IP "" 4 -. -.nf +.P +.RS 2 +.EX $ semver \-h + Usage: semver [ [\.\.\.]] [\-r | \-i | \-d ] Test if version(s) satisfy the supplied range(s), and sort them\. + Multiple versions or ranges may be supplied, unless increment or decrement options are specified\. In that case, only a single version may be used, and it is incremented by the specified level + Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions\. + If no versions are valid, or ranges are not satisfied, then exits failure\. + Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them\. -. -.fi -. -.IP "" 0 -. -.SH "Versions" -A "version" is described by the \fBv2\.0\.0\fR specification found at \fIhttp://semver\.org/\fR\|\. -. +.EE +.RE +.SH Versions +.P +A "version" is described by the \fBv2\.0\.0\fR specification found at +http://semver\.org/\|\. .P A leading \fB"="\fR or \fB"v"\fR character is stripped off and ignored\. -. -.SH "Ranges" -The following range styles are supported: -. -.IP "\(bu" 4 -\fB1\.2\.3\fR A specific version\. When nothing else will do\. Must be a full -version number, with major, minor, and patch versions specified\. -Note that build metadata is still ignored, so \fB1\.2\.3+build2012\fR will -satisfy this range\. -. -.IP "\(bu" 4 -\fB>1\.2\.3\fR Greater than a specific version\. -. -.IP "\(bu" 4 -\fB<1\.2\.3\fR Less than a specific version\. If there is no prerelease -tag on the version range, then no prerelease version will be allowed -either, even though these are technically "less than"\. -. -.IP "\(bu" 4 -\fB>=1\.2\.3\fR Greater than or equal to\. Note that prerelease versions -are NOT equal to their "normal" equivalents, so \fB1\.2\.3\-beta\fR will -not satisfy this range, but \fB2\.3\.0\-beta\fR will\. -. -.IP "\(bu" 4 -\fB<=1\.2\.3\fR Less than or equal to\. In this case, prerelease versions -ARE allowed, so \fB1\.2\.3\-beta\fR would satisfy\. -. -.IP "\(bu" 4 +.SH Ranges +.P +A \fBversion range\fR is a set of \fBcomparators\fR which specify versions +that satisfy the range\. +.P +A \fBcomparator\fR is composed of an \fBoperator\fR and a \fBversion\fR\|\. The set +of primitive \fBoperators\fR is: +.RS 0 +.IP \(bu 2 +\fB<\fR Less than +.IP \(bu 2 +\fB<=\fR Less than or equal to +.IP \(bu 2 +\fB>\fR Greater than +.IP \(bu 2 +\fB>=\fR Greater than or equal to +.IP \(bu 2 +\fB=\fR Equal\. If no operator is specified, then equality is assumed, +so this operator is optional, but MAY be included\. + +.RE +.P +For example, the comparator \fB>=1\.2\.7\fR would match the versions +\fB1\.2\.7\fR, \fB1\.2\.8\fR, \fB2\.5\.3\fR, and \fB1\.3\.9\fR, but not the versions \fB1\.2\.6\fR +or \fB1\.1\.0\fR\|\. +.P +Comparators can be joined by whitespace to form a \fBcomparator set\fR, +which is satisfied by the \fBintersection\fR of all of the comparators +it includes\. +.P +A range is composed of one or more comparator sets, joined by \fB||\fR\|\. A +version matches a range if and only if every comparator in at least +one of the \fB||\fR\-separated comparator sets is satisfied by the version\. +.P +For example, the range \fB>=1\.2\.7 <1\.3\.0\fR would match the versions +\fB1\.2\.7\fR, \fB1\.2\.8\fR, and \fB1\.2\.99\fR, but not the versions \fB1\.2\.6\fR, \fB1\.3\.0\fR, +or \fB1\.1\.0\fR\|\. +.P +The range \fB1\.2\.7 || >=1\.2\.9 <2\.0\.0\fR would match the versions \fB1\.2\.7\fR, +\fB1\.2\.9\fR, and \fB1\.4\.6\fR, but not the versions \fB1\.2\.8\fR or \fB2\.0\.0\fR\|\. +.SS Prerelease Tags +.P +If a version has a prerelease tag (for example, \fB1\.2\.3\-alpha\.3\fR) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same \fB[major, minor, patch]\fR tuple also has a +prerelease tag\. +.P +For example, the range \fB>1\.2\.3\-alpha\.3\fR would be allowed to match the +version \fB1\.2\.3\-alpha\.7\fR, but it would \fInot\fR be satisfied by +\fB3\.4\.5\-alpha\.9\fR, even though \fB3\.4\.5\-alpha\.9\fR is technically "greater +than" \fB1\.2\.3\-alpha\.3\fR according to the SemVer sort rules\. The version +range only accepts prerelease tags on the \fB1\.2\.3\fR version\. The +version \fB3\.4\.5\fR \fIwould\fR satisfy the range, because it does not have a +prerelease flag, and \fB3\.4\.5\fR is greater than \fB1\.2\.3\-alpha\.7\fR\|\. +.P +The purpose for this behavior is twofold\. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption\. +Therefore, by default, they are excluded from range matching +semantics\. +.P +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use \fIthat specific\fR set of +alpha/beta/rc versions\. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk\. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the \fInext\fR set of prerelease versions\. +.SS Advanced Range Syntax +.P +Advanced range syntax desugars to primitive comparators in +deterministic ways\. +.P +Advanced ranges may be combined in the same way as primitive +comparators using white space or \fB||\fR\|\. +.SS Hyphen Ranges \fBX\.Y\.Z \- A\.B\.C\fR +.P +Specifies an inclusive set\. +.RS 0 +.IP \(bu 2 \fB1\.2\.3 \- 2\.3\.4\fR := \fB>=1\.2\.3 <=2\.3\.4\fR -. -.IP "\(bu" 4 -\fB~1\.2\.3\fR := \fB>=1\.2\.3\-0 <1\.3\.0\-0\fR "Reasonably close to \fB1\.2\.3\fR"\. When -using tilde operators, prerelease versions are supported as well, -but a prerelease of the next significant digit will NOT be -satisfactory, so \fB1\.3\.0\-beta\fR will not satisfy \fB~1\.2\.3\fR\|\. -. -.IP "\(bu" 4 -\fB^1\.2\.3\fR := \fB>=1\.2\.3\-0 <2\.0\.0\-0\fR "Compatible with \fB1\.2\.3\fR"\. When -using caret operators, anything from the specified version (including -prerelease) will be supported up to, but not including, the next -major version (or its prereleases)\. \fB1\.5\.1\fR will satisfy \fB^1\.2\.3\fR, -while \fB1\.2\.2\fR and \fB2\.0\.0\-beta\fR will not\. -. -.IP "\(bu" 4 -\fB^0\.1\.3\fR := \fB>=0\.1\.3\-0 <0\.2\.0\-0\fR "Compatible with \fB0\.1\.3\fR"\. \fB0\.x\.x\fR versions are -special: the first non\-zero component indicates potentially breaking changes, -meaning the caret operator matches any version with the same first non\-zero -component starting at the specified version\. -. -.IP "\(bu" 4 -\fB^0\.0\.2\fR := \fB=0\.0\.2\fR "Only the version \fB0\.0\.2\fR is considered compatible" -. -.IP "\(bu" 4 -\fB~1\.2\fR := \fB>=1\.2\.0\-0 <1\.3\.0\-0\fR "Any version starting with \fB1\.2\fR" -. -.IP "\(bu" 4 -\fB^1\.2\fR := \fB>=1\.2\.0\-0 <2\.0\.0\-0\fR "Any version compatible with \fB1\.2\fR" -. -.IP "\(bu" 4 -\fB1\.2\.x\fR := \fB>=1\.2\.0\-0 <1\.3\.0\-0\fR "Any version starting with \fB1\.2\fR" -. -.IP "\(bu" 4 -\fB1\.2\.*\fR Same as \fB1\.2\.x\fR\|\. -. -.IP "\(bu" 4 -\fB1\.2\fR Same as \fB1\.2\.x\fR\|\. -. -.IP "\(bu" 4 -\fB~1\fR := \fB>=1\.0\.0\-0 <2\.0\.0\-0\fR "Any version starting with \fB1\fR" -. -.IP "\(bu" 4 -\fB^1\fR := \fB>=1\.0\.0\-0 <2\.0\.0\-0\fR "Any version compatible with \fB1\fR" -. -.IP "\(bu" 4 -\fB1\.x\fR := \fB>=1\.0\.0\-0 <2\.0\.0\-0\fR "Any version starting with \fB1\fR" -. -.IP "\(bu" 4 -\fB1\.*\fR Same as \fB1\.x\fR\|\. -. -.IP "\(bu" 4 -\fB1\fR Same as \fB1\.x\fR\|\. -. -.IP "\(bu" 4 -\fB*\fR Any version whatsoever\. -. -.IP "\(bu" 4 -\fBx\fR Same as \fB*\fR\|\. -. -.IP "\(bu" 4 -\fB""\fR (just an empty string) Same as \fB*\fR\|\. -. -.IP "" 0 -. -.P -Ranges can be joined with either a space (which implies "and") or a \fB||\fR (which implies "or")\. -. -.SH "Functions" + +.RE +.P +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes\. +.RS 0 +.IP \(bu 2 +\fB1\.2 \- 2\.3\.4\fR := \fB>=1\.2\.0 <=2\.3\.4\fR + +.RE +.P +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts\. +.RS 0 +.IP \(bu 2 +\fB1\.2\.3 \- 2\.3\fR := \fB>=1\.2\.3 <2\.4\.0\fR +.IP \(bu 2 +\fB1\.2\.3 \- 2\fR := \fB>=1\.2\.3 <3\.0\.0\fR + +.RE +.SS X\-Ranges \fB1\.2\.x\fR \fB1\.X\fR \fB1\.2\.*\fR \fB*\fR +.P +Any of \fBX\fR, \fBx\fR, or \fB*\fR may be used to "stand in" for one of the +numeric values in the \fB[major, minor, patch]\fR tuple\. +.RS 0 +.IP \(bu 2 +\fB*\fR := \fB>=0\.0\.0\fR (Any version satisfies) +.IP \(bu 2 +\fB1\.x\fR := \fB>=1\.0\.0 <2\.0\.0\fR (Matching major version) +.IP \(bu 2 +\fB1\.2\.x\fR := \fB>=1\.2\.0 <1\.3\.0\fR (Matching major and minor versions) + +.RE +.P +A partial version range is treated as an X\-Range, so the special +character is in fact optional\. +.RS 0 +.IP \(bu 2 +\fB` (empty string) :=\fR*\fB:=\fR>=0\.0\.0` +.IP \(bu 2 +\fB1\fR := \fB1\.x\.x\fR := \fB>=1\.0\.0 <2\.0\.0\fR +.IP \(bu 2 +\fB1\.2\fR := \fB1\.2\.x\fR := \fB>=1\.2\.0 <1\.3\.0\fR + +.RE +.SS Tilde Ranges \fB~1\.2\.3\fR \fB~1\.2\fR \fB~1\fR +.P +Allows patch\-level changes if a minor version is specified on the +comparator\. Allows minor\-level changes if not\. +.RS 0 +.IP \(bu 2 +\fB~1\.2\.3\fR := \fB>=1\.2\.3 <1\.(2+1)\.0\fR := \fB>=1\.2\.3 <1\.3\.0\fR +.IP \(bu 2 +\fB~1\.2\fR := \fB>=1\.2\.0 <1\.(2+1)\.0\fR := \fB>=1\.2\.0 <1\.3\.0\fR (Same as \fB1\.2\.x\fR) +.IP \(bu 2 +\fB~1\fR := \fB>=1\.0\.0 <(1+1)\.0\.0\fR := \fB>=1\.0\.0 <2\.0\.0\fR (Same as \fB1\.x\fR) +.IP \(bu 2 +\fB~0\.2\.3\fR := \fB>=0\.2\.3 <0\.(2+1)\.0\fR := \fB>=0\.2\.3 <0\.3\.0\fR +.IP \(bu 2 +\fB~0\.2\fR := \fB>=0\.2\.0 <0\.(2+1)\.0\fR := \fB>=0\.2\.0 <0\.3\.0\fR (Same as \fB0\.2\.x\fR) +.IP \(bu 2 +\fB~0\fR := \fB>=0\.0\.0 <(0+1)\.0\.0\fR := \fB>=0\.0\.0 <1\.0\.0\fR (Same as \fB0\.x\fR) +.IP \(bu 2 +\fB~1\.2\.3\-beta\.2\fR := \fB>=1\.2\.3\-beta\.2 <1\.3\.0\fR Note that prereleases in +the \fB1\.2\.3\fR version will be allowed, if they are greater than or +equal to \fBbeta\.2\fR\|\. So, \fB1\.2\.3\-beta\.4\fR would be allowed, but +\fB1\.2\.4\-beta\.2\fR would not, because it is a prerelease of a +different \fB[major, minor, patch]\fR tuple\. + +.RE +.P +Note: this is the same as the \fB~>\fR operator in rubygems\. +.SS Caret Ranges \fB^1\.2\.3\fR \fB^0\.2\.5\fR \fB^0\.0\.4\fR +.P +Allows changes that do not modify the left\-most non\-zero digit in the +\fB[major, minor, patch]\fR tuple\. In other words, this allows patch and +minor updates for versions \fB1\.0\.0\fR and above, patch updates for +versions \fB0\.X >=0\.1\.0\fR, and \fIno\fR updates for versions \fB0\.0\.X\fR\|\. +.P +Many authors treat a \fB0\.x\fR version as if the \fBx\fR were the major +"breaking\-change" indicator\. +.P +Caret ranges are ideal when an author may make breaking changes +between \fB0\.2\.4\fR and \fB0\.3\.0\fR releases, which is a common practice\. +However, it presumes that there will \fInot\fR be breaking changes between +\fB0\.2\.4\fR and \fB0\.2\.5\fR\|\. It allows for changes that are presumed to be +additive (but non\-breaking), according to commonly observed practices\. +.RS 0 +.IP \(bu 2 +\fB^1\.2\.3\fR := \fB>=1\.2\.3 <2\.0\.0\fR +.IP \(bu 2 +\fB^0\.2\.3\fR := \fB>=0\.2\.3 <0\.3\.0\fR +.IP \(bu 2 +\fB^0\.0\.3\fR := \fB>=0\.0\.3 <0\.0\.4\fR +.IP \(bu 2 +\fB^1\.2\.3\-beta\.2\fR := \fB>=1\.2\.3\-beta\.2 <2\.0\.0\fR Note that prereleases in +the \fB1\.2\.3\fR version will be allowed, if they are greater than or +equal to \fBbeta\.2\fR\|\. So, \fB1\.2\.3\-beta\.4\fR would be allowed, but +\fB1\.2\.4\-beta\.2\fR would not, because it is a prerelease of a +different \fB[major, minor, patch]\fR tuple\. +.IP \(bu 2 +\fB^0\.0\.3\-beta\fR := \fB>=0\.0\.3\-beta <0\.0\.4\fR Note that prereleases in the +\fB0\.0\.3\fR version \fIonly\fR will be allowed, if they are greater than or +equal to \fBbeta\fR\|\. So, \fB0\.0\.3\-pr\.2\fR would be allowed\. + +.RE +.P +When parsing caret ranges, a missing \fBpatch\fR value desugars to the +number \fB0\fR, but will allow flexibility within that value, even if the +major and minor versions are both \fB0\fR\|\. +.RS 0 +.IP \(bu 2 +\fB^1\.2\.x\fR := \fB>=1\.2\.0 <2\.0\.0\fR +.IP \(bu 2 +\fB^0\.0\.x\fR := \fB>=0\.0\.0 <0\.1\.0\fR +.IP \(bu 2 +\fB^0\.0\fR := \fB>=0\.0\.0 <0\.1\.0\fR + +.RE +.P +A missing \fBminor\fR and \fBpatch\fR values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero\. +.RS 0 +.IP \(bu 2 +\fB^1\.x\fR := \fB>=1\.0\.0 <2\.0\.0\fR +.IP \(bu 2 +\fB^0\.x\fR := \fB>=0\.0\.0 <1\.0\.0\fR + +.RE +.SH Functions +.P All methods and classes take a final \fBloose\fR boolean argument that, if true, will be more forgiving about not\-quite\-valid semver strings\. The resulting output will always be 100% strict, of course\. -. .P Strict\-mode Comparators and Ranges will be strict about the SemVer strings that they parse\. -. -.IP "\(bu" 4 -\fBvalid(v)\fR: Return the parsed version, or null if it\'s not valid\. -. -.IP "\(bu" 4 -\fBinc(v, release)\fR\fBmajor\fR\fBpremajor\fR\fBminor\fR\fBpreminor\fR\fBpatch\fR\fBprepatch\fR\fBprerelease\fR -. -.IP "\(bu" 4 +.RS 0 +.IP \(bu 2 +\fBvalid(v)\fR: Return the parsed version, or null if it's not valid\. +.IP \(bu 2 +\fBinc(v, release)\fR: Return the version incremented by the release +type (\fBmajor\fR, \fBpremajor\fR, \fBminor\fR, \fBpreminor\fR, \fBpatch\fR, +\fBprepatch\fR, or \fBprerelease\fR), or null if it's not valid +.RS 0 +.IP \(bu 2 \fBpremajor\fR in one call will bump the version up to the next major -version and down to a prerelease of that major version\. \fBpreminor\fR, and \fBprepatch\fR work the same way\. -. -.IP "\(bu" 4 +version and down to a prerelease of that major version\. +\fBpreminor\fR, and \fBprepatch\fR work the same way\. +.IP \(bu 2 If called from a non\-prerelease version, the \fBprerelease\fR will work the same as \fBprepatch\fR\|\. It increments the patch version, then makes a prerelease\. If the input version is already a prerelease it simply increments it\. -. -.IP "" 0 - -. -.IP "" 0 -. -.SS "Comparison" -. -.IP "\(bu" 4 + +.RE + +.RE +.SS Comparison +.RS 0 +.IP \(bu 2 \fBgt(v1, v2)\fR: \fBv1 > v2\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fBgte(v1, v2)\fR: \fBv1 >= v2\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fBlt(v1, v2)\fR: \fBv1 < v2\fR -. -.IP "\(bu" 4 +.IP \(bu 2 \fBlte(v1, v2)\fR: \fBv1 <= v2\fR -. -.IP "\(bu" 4 -\fBeq(v1, v2)\fR: \fBv1 == v2\fR This is true if they\'re logically equivalent, -even if they\'re not the exact same string\. You already know how to +.IP \(bu 2 +\fBeq(v1, v2)\fR: \fBv1 == v2\fR This is true if they're logically equivalent, +even if they're not the exact same string\. You already know how to compare strings\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fBneq(v1, v2)\fR: \fBv1 != v2\fR The opposite of \fBeq\fR\|\. -. -.IP "\(bu" 4 -\fBcmp(v1, comparator, v2)\fR: Pass in a comparison string, and it\'ll call +.IP \(bu 2 +\fBcmp(v1, comparator, v2)\fR: Pass in a comparison string, and it'll call the corresponding function above\. \fB"==="\fR and \fB"!=="\fR do simple string comparison, but are included for completeness\. Throws if an invalid comparison string is provided\. -. -.IP "\(bu" 4 -\fBcompare(v1, v2)\fR: Return \fB0\fR if \fBv1 == v2\fR, or \fB1\fR if \fBv1\fR is greater, or \fB\-1\fR if \fBv2\fR is greater\. Sorts in ascending order if passed to \fBArray\.sort()\fR\|\. -. -.IP "\(bu" 4 +.IP \(bu 2 +\fBcompare(v1, v2)\fR: Return \fB0\fR if \fBv1 == v2\fR, or \fB1\fR if \fBv1\fR is greater, or \fB\-1\fR if +\fBv2\fR is greater\. Sorts in ascending order if passed to \fBArray\.sort()\fR\|\. +.IP \(bu 2 \fBrcompare(v1, v2)\fR: The reverse of compare\. Sorts an array of versions in descending order when passed to \fBArray\.sort()\fR\|\. -. -.IP "" 0 -. -.SS "Ranges" -. -.IP "\(bu" 4 -\fBvalidRange(range)\fR: Return the valid range or null if it\'s not valid -. -.IP "\(bu" 4 + +.RE +.SS Ranges +.RS 0 +.IP \(bu 2 +\fBvalidRange(range)\fR: Return the valid range or null if it's not valid +.IP \(bu 2 \fBsatisfies(version, range)\fR: Return true if the version satisfies the range\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fBmaxSatisfying(versions, range)\fR: Return the highest version in the list that satisfies the range, or \fBnull\fR if none of them do\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fBgtr(version, range)\fR: Return \fBtrue\fR if version is greater than all the versions possible in the range\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fBltr(version, range)\fR: Return \fBtrue\fR if version is less than all the versions possible in the range\. -. -.IP "\(bu" 4 +.IP \(bu 2 \fBoutside(version, range, hilo)\fR: Return true if the version is outside -the bounds of the range in either the high or low direction\. The \fBhilo\fR argument must be either the string \fB\'>\'\fR or \fB\'<\'\fR\|\. (This is +the bounds of the range in either the high or low direction\. The +\fBhilo\fR argument must be either the string \fB\|'>'\fR or \fB\|'<'\fR\|\. (This is the function called by \fBgtr\fR and \fBltr\fR\|\.) -. -.IP "" 0 -. + +.RE .P Note that, since ranges may be non\-contiguous, a version might not be greater than a range, less than a range, \fIor\fR satisfy a range! For @@ -246,7 +346,7 @@ until \fB2\.0\.0\fR, so the version \fB1\.2\.10\fR would not be greater than the range (because \fB2\.0\.1\fR satisfies, which is higher), nor less than the range (since \fB1\.2\.8\fR satisfies, which is lower), and it also does not satisfy the range\. -. .P If you want to know if a version satisfies or does not satisfy a range, use the \fBsatisfies(version, range)\fR function\. + diff --git a/deps/npm/node_modules/async-some/.eslintrc b/deps/npm/node_modules/async-some/.eslintrc new file mode 100644 index 0000000000..5c39c67eca --- /dev/null +++ b/deps/npm/node_modules/async-some/.eslintrc @@ -0,0 +1,18 @@ +{ + "env" : { + "node" : true + }, + "rules" : { + "curly" : 0, + "no-lonely-if" : 1, + "no-mixed-requires" : 0, + "no-underscore-dangle" : 0, + "no-unused-vars" : [2, {"vars" : "all", "args" : "after-used"}], + "no-use-before-define" : [2, "nofunc"], + "quotes" : [1, "double", "avoid-escape"], + "semi" : [2, "never"], + "space-after-keywords" : 1, + "space-infix-ops" : 0, + "strict" : 0 + } +} diff --git a/deps/npm/node_modules/async-some/.npmignore b/deps/npm/node_modules/async-some/.npmignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/deps/npm/node_modules/async-some/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/deps/npm/node_modules/async-some/README.md b/deps/npm/node_modules/async-some/README.md new file mode 100644 index 0000000000..bb502ee060 --- /dev/null +++ b/deps/npm/node_modules/async-some/README.md @@ -0,0 +1,62 @@ +# some + +Short-circuited async Array.prototype.some implementation. + +Serially evaluates a list of values from a JS array or arraylike +against an asynchronous predicate, terminating on the first truthy +value. If the predicate encounters an error, pass it to the completion +callback. Otherwise, pass the truthy value passed by the predicate, or +`false` if no truthy value was passed. + +Is +[Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony)-proof, +browser-safe, and pretty efficient. + +## Usage + +```javascript +var some = require("async-some"); +var resolve = require("path").resolve; +var stat = require("fs").stat; +var readFileSync = require("fs").readFileSync; + +some(["apple", "seaweed", "ham", "quince"], porkDetector, function (error, match) { + if (error) return console.error(error); + + if (match) return console.dir(JSON.parse(readFileSync(match))); + + console.error("time to buy more Sporkle™!"); +}); + +var PREFIX = resolve(__dirname, "../pork_store"); +function porkDetector(value, cb) { + var path = resolve(PREFIX, value + ".json"); + stat(path, function (er, stat) { + if (er) { + if (er.code === "ENOENT") return cb(null, false); + + return cb(er); + } + + cb(er, path); + }); +} +``` + +### some(list, test, callback) + +* `list` {Object} An arraylike (either an Array or the arguments arraylike) to + be checked. +* `test` {Function} The predicate against which the elements of `list` will be + tested. Takes two parameters: + * `element` {any} The element of the list to be tested. + * `callback` {Function} The continuation to be called once the test is + complete. Takes (again) two values: + * `error` {Error} Any errors that the predicate encountered. + * `value` {any} A truthy value. A non-falsy result terminates checking the + entire list. +* `callback` {Function} The callback to invoke when either a value has been + found or the entire input list has been processed with no result. Is invoked + with the traditional two parameters: + * `error` {Error} Errors that were encountered during the evaluation of some(). + * `match` {any} Value successfully matched by `test`, if any. diff --git a/deps/npm/node_modules/async-some/package.json b/deps/npm/node_modules/async-some/package.json new file mode 100644 index 0000000000..d32ae73fb2 --- /dev/null +++ b/deps/npm/node_modules/async-some/package.json @@ -0,0 +1,57 @@ +{ + "name": "async-some", + "version": "1.0.1", + "description": "short-circuited, asynchronous version of Array.protototype.some", + "main": "some.js", + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/othiym23/async-some.git" + }, + "keywords": [ + "async", + "some", + "array", + "collections", + "fp" + ], + "author": { + "name": "Forrest L Norvell", + "email": "ogd@aoaioxxysz.net" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/othiym23/async-some/issues" + }, + "homepage": "https://github.com/othiym23/async-some", + "dependencies": { + "dezalgo": "^1.0.0" + }, + "devDependencies": { + "tap": "^0.4.11" + }, + "gitHead": "e73d6d1fbc03cca5a0d54f456f39bab294a4c7b7", + "_id": "async-some@1.0.1", + "_shasum": "8b54f08d46f0f9babc72ea9d646c245d23a4d9e5", + "_from": "async-some@>=1.0.1-0 <2.0.0-0", + "_npmVersion": "1.5.0-pre", + "_npmUser": { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + "maintainers": [ + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "dist": { + "shasum": "8b54f08d46f0f9babc72ea9d646c245d23a4d9e5", + "tarball": "http://registry.npmjs.org/async-some/-/async-some-1.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/async-some/-/async-some-1.0.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/async-some/some.js b/deps/npm/node_modules/async-some/some.js new file mode 100644 index 0000000000..0419709f76 --- /dev/null +++ b/deps/npm/node_modules/async-some/some.js @@ -0,0 +1,47 @@ +var assert = require("assert") +var dezalgoify = require("dezalgo") + +module.exports = some + +/** + * short-circuited async Array.prototype.some implementation + * + * Serially evaluates a list of values from a JS array or arraylike + * against an asynchronous predicate, terminating on the first truthy + * value. If the predicate encounters an error, pass it to the completion + * callback. Otherwise, pass the truthy value passed by the predicate, or + * `false` if no truthy value was passed. + */ +function some (list, test, cb) { + assert("length" in list, "array must be arraylike") + assert.equal(typeof test, "function", "predicate must be callable") + assert.equal(typeof cb, "function", "callback must be callable") + + var array = slice(list) + , index = 0 + , length = array.length + , hecomes = dezalgoify(cb) + + map() + + function map () { + if (index >= length) return hecomes(null, false) + + test(array[index], reduce) + } + + function reduce (er, result) { + if (er) return hecomes(er, false) + if (result) return hecomes(null, result) + + index++ + map() + } +} + +// Array.prototype.slice on arguments arraylike is expensive +function slice(args) { + var l = args.length, a = [], i + for (i = 0; i < l; i++) a[i] = args[i] + return a +} diff --git a/deps/npm/node_modules/async-some/test/base-case.js b/deps/npm/node_modules/async-some/test/base-case.js new file mode 100644 index 0000000000..356890521d --- /dev/null +++ b/deps/npm/node_modules/async-some/test/base-case.js @@ -0,0 +1,35 @@ +var test = require("tap").test + +var some = require("../some.js") + +test("some() array base case", function (t) { + some([], failer, function (error, match) { + t.ifError(error, "ran successfully") + + t.notOk(match, "nothing to find, so nothing found") + + t.end() + }) + + function failer(value, cb) { + cb(new Error("test should never have been called")) + } +}) + +test("some() arguments arraylike base case", function (t) { + go() + + function go() { + some(arguments, failer, function (error, match) { + t.ifError(error, "ran successfully") + + t.notOk(match, "nothing to find, so nothing found") + + t.end() + }) + + function failer(value, cb) { + cb(new Error("test should never have been called")) + } + } +}) diff --git a/deps/npm/node_modules/async-some/test/parameters.js b/deps/npm/node_modules/async-some/test/parameters.js new file mode 100644 index 0000000000..0706d1da6f --- /dev/null +++ b/deps/npm/node_modules/async-some/test/parameters.js @@ -0,0 +1,37 @@ +var test = require("tap").test + +var some = require("../some.js") + +var NOP = function () {} + +test("some() called with bogus parameters", function (t) { + t.throws(function () { + some() + }, "throws when called with no parameters") + + t.throws(function () { + some(null, NOP, NOP) + }, "throws when called with no list") + + t.throws(function () { + some([], null, NOP) + }, "throws when called with no predicate") + + t.throws(function () { + some([], NOP, null) + }, "throws when called with no callback") + + t.throws(function () { + some({}, NOP, NOP) + }, "throws when called with wrong list type") + + t.throws(function () { + some([], "ham", NOP) + }, "throws when called with wrong test type") + + t.throws(function () { + some([], NOP, "ham") + }, "throws when called with wrong test type") + + t.end() +}) diff --git a/deps/npm/node_modules/async-some/test/simple.js b/deps/npm/node_modules/async-some/test/simple.js new file mode 100644 index 0000000000..3d68e1e507 --- /dev/null +++ b/deps/npm/node_modules/async-some/test/simple.js @@ -0,0 +1,60 @@ +var test = require("tap").test + +var some = require("../some.js") + +test("some() doesn't find anything asynchronously", function (t) { + some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { + t.ifError(error, "ran successfully") + + t.notOk(match, "nothing to find, so nothing found") + + t.end() + }) + + function predicate(value, cb) { + // dezalgo ensures it's safe to not do this, but just in case + setTimeout(function () { cb(null, value > "j" && value) }) + } +}) + +test("some() doesn't find anything synchronously", function (t) { + some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { + t.ifError(error, "ran successfully") + + t.notOk(match, "nothing to find, so nothing found") + + t.end() + }) + + function predicate(value, cb) { + cb(null, value > "j" && value) + } +}) + +test("some() doesn't find anything asynchronously", function (t) { + some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { + t.ifError(error, "ran successfully") + + t.equals(match, "d", "found expected element") + + t.end() + }) + + function predicate(value, cb) { + setTimeout(function () { cb(null, value > "c" && value) }) + } +}) + +test("some() doesn't find anything synchronously", function (t) { + some(["a", "b", "c", "d", "e", "f", "g"], predicate, function (error, match) { + t.ifError(error, "ran successfully") + + t.equals(match, "d", "found expected") + + t.end() + }) + + function predicate(value, cb) { + cb(null, value > "c" && value) + } +}) diff --git a/deps/npm/node_modules/cmd-shim/index.js b/deps/npm/node_modules/cmd-shim/index.js index 7853e8605d..59a1f6cbd6 100644 --- a/deps/npm/node_modules/cmd-shim/index.js +++ b/deps/npm/node_modules/cmd-shim/index.js @@ -11,11 +11,7 @@ module.exports = cmdShim cmdShim.ifExists = cmdShimIfExists -try { - var fs = require("graceful-fs") -} catch (e) { - var fs = require("fs") -} +var fs = require("graceful-fs") var mkdir = require("mkdirp") , path = require("path") diff --git a/deps/npm/node_modules/cmd-shim/package.json b/deps/npm/node_modules/cmd-shim/package.json index 09f0c48a4d..e1f4f543ea 100644 --- a/deps/npm/node_modules/cmd-shim/package.json +++ b/deps/npm/node_modules/cmd-shim/package.json @@ -1,6 +1,6 @@ { "name": "cmd-shim", - "version": "2.0.0", + "version": "2.0.1", "description": "Used in npm for command line application support", "scripts": { "test": "tap test/*.js" @@ -10,26 +10,37 @@ "url": "https://github.com/ForbesLindesay/cmd-shim.git" }, "license": "BSD", - "optionalDependencies": { - "graceful-fs": "^3.0.2" - }, "dependencies": { - "mkdirp": "~0.5.0", - "graceful-fs": "^3.0.2" + "graceful-fs": ">3.0.1 <4.0.0-0", + "mkdirp": "~0.5.0" }, "devDependencies": { "tap": "~0.4.11", "rimraf": "~2.2.8" }, - "readme": "# cmd-shim\n\nThe cmd-shim used in npm to create executable scripts on Windows,\nsince symlinks are not suitable for this purpose there.\n\nOn Unix systems, you should use a symbolic link instead.\n\n[![Build Status](https://img.shields.io/travis/ForbesLindesay/cmd-shim/master.svg)](https://travis-ci.org/ForbesLindesay/cmd-shim)\n[![Dependency Status](https://img.shields.io/gemnasium/ForbesLindesay/cmd-shim.svg)](https://gemnasium.com/ForbesLindesay/cmd-shim)\n[![NPM version](https://img.shields.io/npm/v/cmd-shim.svg)](http://badge.fury.io/js/cmd-shim)\n\n## Installation\n\n```\nnpm install cmd-shim\n```\n\n## API\n\n### cmdShim(from, to, cb)\n\nCreate a cmd shim at `to` for the command line program at `from`.\ne.g.\n\n```javascript\nvar cmdShim = require('cmd-shim');\ncmdShim(__dirname + '/cli.js', '/usr/bin/command-name', function (err) {\n if (err) throw err;\n});\n```\n\n### cmdShim.ifExists(from, to, cb)\n\nThe same as above, but will just continue if the file does not exist.\nSource:\n\n```javascript\nfunction cmdShimIfExists (from, to, cb) {\n fs.stat(from, function (er) {\n if (er) return cb()\n cmdShim(from, to, cb)\n })\n}\n```\n", - "readmeFilename": "README.md", + "gitHead": "6f53d506be590fe9ac20c9801512cd1a3aad5974", "bugs": { "url": "https://github.com/ForbesLindesay/cmd-shim/issues" }, "homepage": "https://github.com/ForbesLindesay/cmd-shim", - "_id": "cmd-shim@2.0.0", - "_shasum": "64fd5859110051571406f61821bf37d366bc3cb3", - "_resolved": "git://github.com/othiym23/cmd-shim#12de64ca97f45ac600910092f19afacc3d5376dd", - "_from": "git://github.com/othiym23/cmd-shim", - "_fromGithub": true + "_id": "cmd-shim@2.0.1", + "_shasum": "4512a373d2391679aec51ad1d4733559e9b85d4a", + "_from": "cmd-shim@>=2.0.1-0 <3.0.0-0", + "_npmVersion": "1.5.0-alpha-4", + "_npmUser": { + "name": "forbeslindesay", + "email": "forbes@lindesay.co.uk" + }, + "maintainers": [ + { + "name": "forbeslindesay", + "email": "forbes@lindesay.co.uk" + } + ], + "dist": { + "shasum": "4512a373d2391679aec51ad1d4733559e9b85d4a", + "tarball": "http://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-2.0.1.tgz" } diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json index 716ae00899..ca610250c9 100644 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json @@ -57,7 +57,7 @@ "homepage": "https://github.com/sindresorhus/ansi-regex", "_id": "ansi-regex@0.2.1", "_shasum": "0d8e946967a3d8143f93e24e298525fc1b2235f9", - "_from": "ansi-regex@^0.2.1", + "_from": "ansi-regex@0.2.1", "_npmVersion": "1.4.9", "_npmUser": { "name": "sindresorhus", @@ -74,6 +74,5 @@ "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.2.1.tgz" } diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json b/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json index 0fd180b6f2..64c4dee52c 100644 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json @@ -63,7 +63,7 @@ "homepage": "https://github.com/sindresorhus/strip-ansi", "_id": "strip-ansi@1.0.0", "_shasum": "6c021321d6ece161a3c608fbab268c7328901c73", - "_from": "strip-ansi@^1.0.0", + "_from": "strip-ansi@>=1.0.0-0 <2.0.0-0", "_npmVersion": "1.4.14", "_npmUser": { "name": "sindresorhus", @@ -84,6 +84,5 @@ "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-1.0.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-1.0.0.tgz" } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json index ee00ac7e54..3c6b776470 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json @@ -100,7 +100,7 @@ "homepage": "https://github.com/pvorb/node-clone", "_id": "clone@0.1.18", "_shasum": "64a0d5d57eaa85a1a8af380cd1db8c7b3a895f66", - "_from": "clone@~0.1.5", + "_from": "clone@>=0.1.5-0 <0.2.0-0", "_npmVersion": "1.4.14", "_npmUser": { "name": "pvorb", @@ -117,6 +117,5 @@ "tarball": "http://registry.npmjs.org/clone/-/clone-0.1.18.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.18.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.18.tgz" } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json index ba00482142..f9243a1200 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json @@ -45,10 +45,6 @@ ], "directories": {}, "_shasum": "3ae25f44416c6c01f9809a25fcdd285912d2a6b1", - "_from": "defaults@^1.0.0", - "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.0.tgz", - "bugs": { - "url": "https://github.com/tmpvar/defaults/issues" - }, - "homepage": "https://github.com/tmpvar/defaults" + "_from": "defaults@>=1.0.0-0 <2.0.0-0", + "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.0.tgz" } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json index 0045c3cdba..f12d49b789 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json @@ -40,7 +40,7 @@ "gitHead": "5bc3aafd45c89f233c27b9479c18a23ca91ba660", "_id": "wcwidth@1.0.0", "_shasum": "02d059ff7a8fc741e0f6b5da1e69b2b40daeca6f", - "_from": "wcwidth@^1.0.0", + "_from": "wcwidth@>=1.0.0-0 <2.0.0-0", "_npmVersion": "1.4.23", "_npmUser": { "name": "timoxley", @@ -56,6 +56,5 @@ "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" } diff --git a/deps/npm/node_modules/columnify/package.json b/deps/npm/node_modules/columnify/package.json index 01ac64bb21..ef307b5092 100644 --- a/deps/npm/node_modules/columnify/package.json +++ b/deps/npm/node_modules/columnify/package.json @@ -43,7 +43,7 @@ "gitHead": "14e77bef3f57acaa3f390145915a9f2d2a4f882c", "_id": "columnify@1.2.1", "_shasum": "921ec51c178f4126d3c07e9acecd67a55c7953e4", - "_from": "columnify@^1.2.1", + "_from": "columnify@>=1.2.1-0 <2.0.0-0", "_npmVersion": "1.4.23", "_npmUser": { "name": "timoxley", @@ -59,6 +59,5 @@ "shasum": "921ec51c178f4126d3c07e9acecd67a55c7953e4", "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.2.1.tgz" }, - "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.2.1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.2.1.tgz" } diff --git a/deps/npm/node_modules/dezalgo/README.md b/deps/npm/node_modules/dezalgo/README.md new file mode 100644 index 0000000000..bdfc8ba80d --- /dev/null +++ b/deps/npm/node_modules/dezalgo/README.md @@ -0,0 +1,29 @@ +# dezalgo + +Contain async insanity so that the dark pony lord doesn't eat souls + +See [this blog +post](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony). + +## USAGE + +Pass a callback to `dezalgo` and it will ensure that it is *always* +called in a future tick, and never in this tick. + +```javascript +var dz = require('dezalgo') + +var cache = {} +function maybeSync(arg, cb) { + cb = dz(cb) + + // this will actually defer to nextTick + if (cache[arg]) cb(null, cache[arg]) + + fs.readFile(arg, function (er, data) { + // since this is *already* defered, it will call immediately + if (er) cb(er) + cb(null, cache[arg] = data) + }) +} +``` diff --git a/deps/npm/node_modules/dezalgo/dezalgo.js b/deps/npm/node_modules/dezalgo/dezalgo.js new file mode 100644 index 0000000000..cdc48aec8c --- /dev/null +++ b/deps/npm/node_modules/dezalgo/dezalgo.js @@ -0,0 +1,21 @@ +module.exports = dezalgo + +var asap = require('asap') + +function dezalgo (cb) { + var sync = true + asap(function () { + sync = false + }) + + return function zalgoSafe() { + var args = arguments + var me = this + if (sync) + asap(function() { + cb.apply(me, args) + }) + else + cb.apply(me, args) + } +} diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md b/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md new file mode 100644 index 0000000000..5d98ad8fe9 --- /dev/null +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md @@ -0,0 +1,20 @@ + +Copyright 2009–2013 Contributors. All rights reserved. +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. + diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/README.md b/deps/npm/node_modules/dezalgo/node_modules/asap/README.md new file mode 100644 index 0000000000..9a42759761 --- /dev/null +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/README.md @@ -0,0 +1,81 @@ + +# ASAP + +This `asap` CommonJS package contains a single `asap` module that +exports a single `asap` function that executes a function **as soon as +possible**. + +```javascript +asap(function () { + // ... +}); +``` + +More formally, ASAP provides a fast event queue that will execute tasks +until it is empty before yielding to the JavaScript engine's underlying +event-loop. When the event queue becomes non-empty, ASAP schedules a +flush event, preferring for that event to occur before the JavaScript +engine has an opportunity to perform IO tasks or rendering, thus making +the first task and subsequent tasks semantically indistinguishable. +ASAP uses a variety of techniques to preserve this invariant on +different versions of browsers and NodeJS. + +By design, ASAP can starve the event loop on the theory that, if there +is enough work to be done synchronously, albeit in separate events, long +enough to starve input or output, it is a strong indicator that the +program needs to push back on scheduling more work. + +Take care. ASAP can sustain infinite recursive calls indefinitely +without warning. This is behaviorally equivalent to an infinite loop. +It will not halt from a stack overflow, but it *will* chew through +memory (which is an oddity I cannot explain at this time). Just as with +infinite loops, you can monitor a Node process for this behavior with a +heart-beat signal. As with infinite loops, a very small amount of +caution goes a long way to avoiding problems. + +```javascript +function loop() { + asap(loop); +} +loop(); +``` + +ASAP is distinct from `setImmediate` in that it does not suffer the +overhead of returning a handle and being possible to cancel. For a +`setImmediate` shim, consider [setImmediate][]. + +[setImmediate]: https://github.com/noblejs/setimmediate + +If a task throws an exception, it will not interrupt the flushing of +high-priority tasks. The exception will be postponed to a later, +low-priority event to avoid slow-downs, when the underlying JavaScript +engine will treat it as it does any unhandled exception. + +## Heritage + +ASAP has been factored out of the [Q][] asynchronous promise library. +It originally had a naïve implementation in terms of `setTimeout`, but +[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be +useful for creating a high-priority, no-delay event dispatch hack. +Since then, Internet Explorer proposed and implemented `setImmediate`. +Robert Kratić began contributing to Q by measuring the performance of +the internal implementation of `asap`, paying particular attention to +error recovery. Domenic, Robert, and I collectively settled on the +current strategy of unrolling the high-priority event queue internally +regardless of what strategy we used to dispatch the potentially +lower-priority flush event. Domenic went on to make ASAP cooperate with +NodeJS domains. + +[Q]: https://github.com/kriskowal/q +[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html + +For further reading, Nicholas Zakas provided a thorough article on [The +Case for setImmediate][NCZ]. + +[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/ + +## License + +Copyright 2009-2013 by Contributors +MIT License (enclosed) + diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js b/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js new file mode 100644 index 0000000000..2f85516cde --- /dev/null +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js @@ -0,0 +1,113 @@ + +// Use the fastest possible means to execute a task in a future turn +// of the event loop. + +// linked list of tasks (single, with head node) +var head = {task: void 0, next: null}; +var tail = head; +var flushing = false; +var requestFlush = void 0; +var isNodeJS = false; + +function flush() { + /* jshint loopfunc: true */ + + while (head.next) { + head = head.next; + var task = head.task; + head.task = void 0; + var domain = head.domain; + + if (domain) { + head.domain = void 0; + domain.enter(); + } + + try { + task(); + + } catch (e) { + if (isNodeJS) { + // In node, uncaught exceptions are considered fatal errors. + // Re-throw them synchronously to interrupt flushing! + + // Ensure continuation if the uncaught exception is suppressed + // listening "uncaughtException" events (as domains does). + // Continue in next event to avoid tick recursion. + if (domain) { + domain.exit(); + } + setTimeout(flush, 0); + if (domain) { + domain.enter(); + } + + throw e; + + } else { + // In browsers, uncaught exceptions are not fatal. + // Re-throw them asynchronously to avoid slow-downs. + setTimeout(function() { + throw e; + }, 0); + } + } + + if (domain) { + domain.exit(); + } + } + + flushing = false; +} + +if (typeof process !== "undefined" && process.nextTick) { + // Node.js before 0.9. Note that some fake-Node environments, like the + // Mocha test runner, introduce a `process` global without a `nextTick`. + isNodeJS = true; + + requestFlush = function () { + process.nextTick(flush); + }; + +} else if (typeof setImmediate === "function") { + // In IE10, Node.js 0.9+, or https://github.com/NobleJS/setImmediate + if (typeof window !== "undefined") { + requestFlush = setImmediate.bind(window, flush); + } else { + requestFlush = function () { + setImmediate(flush); + }; + } + +} else if (typeof MessageChannel !== "undefined") { + // modern browsers + // http://www.nonblocking.io/2011/06/windownexttick.html + var channel = new MessageChannel(); + channel.port1.onmessage = flush; + requestFlush = function () { + channel.port2.postMessage(0); + }; + +} else { + // old browsers + requestFlush = function () { + setTimeout(flush, 0); + }; +} + +function asap(task) { + tail = tail.next = { + task: task, + domain: isNodeJS && process.domain, + next: null + }; + + if (!flushing) { + flushing = true; + requestFlush(); + } +}; + +module.exports = asap; + diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/package.json b/deps/npm/node_modules/dezalgo/node_modules/asap/package.json new file mode 100644 index 0000000000..1237784d41 --- /dev/null +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/package.json @@ -0,0 +1,39 @@ +{ + "name": "asap", + "version": "1.0.0", + "description": "High-priority task queue for Node.js and browsers", + "keywords": [ + "event", + "task", + "queue" + ], + "licenses": [ + { + "type": "MIT", + "url": "https://github.com/kriskowal/asap/raw/master/LICENSE.md" + } + ], + "main": "asap", + "readme": "\n# ASAP\n\nThis `asap` CommonJS package contains a single `asap` module that\nexports a single `asap` function that executes a function **as soon as\npossible**.\n\n```javascript\nasap(function () {\n // ...\n});\n```\n\nMore formally, ASAP provides a fast event queue that will execute tasks\nuntil it is empty before yielding to the JavaScript engine's underlying\nevent-loop. When the event queue becomes non-empty, ASAP schedules a\nflush event, preferring for that event to occur before the JavaScript\nengine has an opportunity to perform IO tasks or rendering, thus making\nthe first task and subsequent tasks semantically indistinguishable.\nASAP uses a variety of techniques to preserve this invariant on\ndifferent versions of browsers and NodeJS.\n\nBy design, ASAP can starve the event loop on the theory that, if there\nis enough work to be done synchronously, albeit in separate events, long\nenough to starve input or output, it is a strong indicator that the\nprogram needs to push back on scheduling more work.\n\nTake care. ASAP can sustain infinite recursive calls indefinitely\nwithout warning. This is behaviorally equivalent to an infinite loop.\nIt will not halt from a stack overflow, but it *will* chew through\nmemory (which is an oddity I cannot explain at this time). Just as with\ninfinite loops, you can monitor a Node process for this behavior with a\nheart-beat signal. As with infinite loops, a very small amount of\ncaution goes a long way to avoiding problems.\n\n```javascript\nfunction loop() {\n asap(loop);\n}\nloop();\n```\n\nASAP is distinct from `setImmediate` in that it does not suffer the\noverhead of returning a handle and being possible to cancel. For a\n`setImmediate` shim, consider [setImmediate][].\n\n[setImmediate]: https://github.com/noblejs/setimmediate\n\nIf a task throws an exception, it will not interrupt the flushing of\nhigh-priority tasks. The exception will be postponed to a later,\nlow-priority event to avoid slow-downs, when the underlying JavaScript\nengine will treat it as it does any unhandled exception.\n\n## Heritage\n\nASAP has been factored out of the [Q][] asynchronous promise library.\nIt originally had a naïve implementation in terms of `setTimeout`, but\n[Malte Ubl][NonBlocking] provided an insight that `postMessage` might be\nuseful for creating a high-priority, no-delay event dispatch hack.\nSince then, Internet Explorer proposed and implemented `setImmediate`.\nRobert Kratić began contributing to Q by measuring the performance of\nthe internal implementation of `asap`, paying particular attention to\nerror recovery. Domenic, Robert, and I collectively settled on the\ncurrent strategy of unrolling the high-priority event queue internally\nregardless of what strategy we used to dispatch the potentially\nlower-priority flush event. Domenic went on to make ASAP cooperate with\nNodeJS domains.\n\n[Q]: https://github.com/kriskowal/q\n[NonBlocking]: http://www.nonblocking.io/2011/06/windownexttick.html\n\nFor further reading, Nicholas Zakas provided a thorough article on [The\nCase for setImmediate][NCZ].\n\n[NCZ]: http://www.nczonline.net/blog/2013/07/09/the-case-for-setimmediate/\n\n## License\n\nCopyright 2009-2013 by Contributors\nMIT License (enclosed)\n\n", + "readmeFilename": "README.md", + "_id": "asap@1.0.0", + "dist": { + "shasum": "b2a45da5fdfa20b0496fc3768cc27c12fa916a7d", + "tarball": "http://registry.npmjs.org/asap/-/asap-1.0.0.tgz" + }, + "_from": "asap@>=1.0.0-0 <2.0.0-0", + "_npmVersion": "1.2.15", + "_npmUser": { + "name": "kriskowal", + "email": "kris.kowal@cixar.com" + }, + "maintainers": [ + { + "name": "kriskowal", + "email": "kris.kowal@cixar.com" + } + ], + "directories": {}, + "_shasum": "b2a45da5fdfa20b0496fc3768cc27c12fa916a7d", + "_resolved": "https://registry.npmjs.org/asap/-/asap-1.0.0.tgz" +} diff --git a/deps/npm/node_modules/dezalgo/package.json b/deps/npm/node_modules/dezalgo/package.json new file mode 100644 index 0000000000..072e2ad6f4 --- /dev/null +++ b/deps/npm/node_modules/dezalgo/package.json @@ -0,0 +1,66 @@ +{ + "name": "dezalgo", + "version": "1.0.0", + "description": "Contain async insanity so that the dark pony lord doesn't eat souls", + "main": "dezalgo.js", + "directories": { + "test": "test" + }, + "dependencies": { + "asap": "^1.0.0" + }, + "devDependencies": { + "tap": "^0.4.11" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/dezalgo" + }, + "keywords": [ + "async", + "zalgo", + "the dark pony", + "he comes", + "asynchrony of all holy and good", + "T̯̪ͅo̯͖̹ ̻̮̖̲͢i̥̖n̢͈͇̝͍v͏͉ok̭̬̝ͅe̞͍̩̫͍̩͝ ̩̮̖̟͇͉́t͔͔͎̗h͏̗̟e̘͉̰̦̠̞͓ ͕h͉̟͎̪̠̱͠ḭ̮̩v̺͉͇̩e̵͖-̺̪m͍i̜n̪̲̲̲̮d̷ ̢r̠̼̯̹̦̦͘ͅe͓̳͓̙p̺̗̫͙͘ͅr͔̰͜e̴͓̞s͉̩̩͟ͅe͏̣n͚͇̗̭̺͍tì͙̣n͏̖̥̗͎̰̪g̞͓̭̱̯̫̕ ̣̱͜ͅc̦̰̰̠̮͎͙̀hao̺̜̻͍͙ͅs͉͓̘.͎̼̺̼͕̹͘", + "̠̞̱̰I͖͇̝̻n̦̰͍̰̟v̤̺̫̳̭̼̗͘ò̹̟̩̩͚k̢̥̠͍͉̦̬i̖͓͔̮̱̻͘n̶̳͙̫͎g̖̯̣̲̪͉ ̞͎̗͕͚ͅt̲͕̘̺̯̗̦h̘̦̲̜̻e̳͎͉̬͙ ̴̞̪̲̥f̜̯͓͓̭̭͢e̱̘͔̮e̜̤l̺̱͖̯͓͙͈͢i̵̦̬͉͔̫͚͕n͉g̨͖̙̙̹̹̟̤ ͉̪o̞̠͍̪̰͙ͅf̬̲̺ ͔͕̲͕͕̲̕c̙͉h̝͔̩̙̕ͅa̲͖̻̗̹o̥̼̫s̝̖̜̝͚̫̟.̺͚ ̸̱̲W̶̥̣͖̦i͏̤̬̱̳̣ͅt͉h̗̪̪ ̷̱͚̹̪ǫ͕̗̣̳̦͎u̼̦͔̥̮̕ţ͖͎̻͔͉ ̴͎̩òr̹̰̖͉͈͝d̷̲̦̖͓e̲͓̠r", + "̧͚̜͓̰̭̭Ṯ̫̹̜̮̟̮͝h͚̘̩̘̖̰́e ̥̘͓͉͔͙̼N̟̜̣̘͔̪e̞̞̤͢z̰̖̘͇p̠͟e̺̱̣͍͙̝ṛ̘̬͔̙͇̠d͝ḭ̯̱̥̗̩a̛ͅn͏̦ ̷̥hi̥v̖̳̹͉̮̱͝e̹̪̘̖̰̟-̴͙͓͚̜̻mi̗̺̻͙̺ͅn̪̯͈d ͏̘͓̫̳ͅơ̹͔̳̖̣͓f͈̹̘ ͕ͅc̗̤̠̜̮̥̥h̡͍̩̭̫͚̱a̤͉̤͔͜os͕̤̼͍̲̀ͅ.̡̱ ̦Za̯̱̗̭͍̣͚l̗͉̰̤g͏̣̭̬̗̲͖ͅo̶̭̩̳̟͈.̪̦̰̳", + "H̴̱̦̗̬̣͓̺e̮ ͉̠̰̞͎̖͟ẁh̛̺̯ͅo̖̫͡ ̢Ẁa̡̗i̸t͖̣͉̀ş͔̯̩ ̤̦̮͇̞̦̲B͎̭͇̦̼e̢hin͏͙̟̪d̴̰͓̻̣̮͕ͅ T͖̮̕h͖e̘̺̰̙͘ ̥Ẁ̦͔̻͚a̞͖̪͉l̪̠̻̰̣̠l̲͎͞", + "Z̘͍̼͎̣͔͝Ą̲̜̱̱̹̤͇L̶̝̰̭͔G͍̖͍O̫͜ͅ!̼̤ͅ", + "H̝̪̜͓̀̌̂̒E̢̙̠̣ ̴̳͇̥̟̠͍̐C̹̓̑̐̆͝Ó̶̭͓̚M̬̼Ĕ̖̤͔͔̟̹̽̿̊ͥ̍ͫS̻̰̦̻̖̘̱̒ͪ͌̅͟" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/dezalgo/issues" + }, + "homepage": "https://github.com/npm/dezalgo", + "gitHead": "b10ea8ae0096d0e60c1acaa88d5334a9b372e4b0", + "_id": "dezalgo@1.0.0", + "_shasum": "050bb723f18b5617b309f26c2dc8fe6f2573b6fc", + "_from": "dezalgo@1.0.0", + "_npmVersion": "1.4.18", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "050bb723f18b5617b309f26c2dc8fe6f2573b6fc", + "tarball": "http://registry.npmjs.org/dezalgo/-/dezalgo-1.0.0.tgz" + }, + "_resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/dezalgo/test/basic.js b/deps/npm/node_modules/dezalgo/test/basic.js new file mode 100644 index 0000000000..cc10336e03 --- /dev/null +++ b/deps/npm/node_modules/dezalgo/test/basic.js @@ -0,0 +1,25 @@ +var test = require('tap').test +var dz = require('../dezalgo.js') + +test('the dark pony', function(t) { + + var n = 0 + function foo(cb) { + cb = dz(cb) + if (++n % 2) cb() + else process.nextTick(cb) + } + + var called = 0 + for (var i = 0; i < 10; i++) { + foo(function() { + called++ + }) + t.equal(called, 0) + } + + setTimeout(function() { + t.equal(called, 10) + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/.eslintrc b/deps/npm/node_modules/fs-vacuum/.eslintrc new file mode 100644 index 0000000000..5c39c67eca --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/.eslintrc @@ -0,0 +1,18 @@ +{ + "env" : { + "node" : true + }, + "rules" : { + "curly" : 0, + "no-lonely-if" : 1, + "no-mixed-requires" : 0, + "no-underscore-dangle" : 0, + "no-unused-vars" : [2, {"vars" : "all", "args" : "after-used"}], + "no-use-before-define" : [2, "nofunc"], + "quotes" : [1, "double", "avoid-escape"], + "semi" : [2, "never"], + "space-after-keywords" : 1, + "space-infix-ops" : 0, + "strict" : 0 + } +} diff --git a/deps/npm/node_modules/fs-vacuum/.npmignore b/deps/npm/node_modules/fs-vacuum/.npmignore new file mode 100644 index 0000000000..3c3629e647 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/.npmignore @@ -0,0 +1 @@ +node_modules diff --git a/deps/npm/node_modules/fs-vacuum/README.md b/deps/npm/node_modules/fs-vacuum/README.md new file mode 100644 index 0000000000..df31243df5 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/README.md @@ -0,0 +1,33 @@ +# fs-vacuum + +Remove the empty branches of a directory tree, optionally up to (but not +including) a specified base directory. Optionally nukes the leaf directory. + +## Usage + +```javascript +var logger = require("npmlog"); +var vacuum = require("fs-vacuum"); + +var options = { + base : "/path/to/my/tree/root", + purge : true, + log : logger.silly.bind(logger, "myCleanup") +}; + +/* Assuming there are no other files or directories in "out", "to", or "my", + * the final path will just be "/path/to/my/tree/root". + */ +vacuum("/path/to/my/tree/root/out/to/my/files", function (error) { + if (error) console.error("Unable to cleanly vacuum:", error.message); +}); +``` +# vacuum(directory, options, callback) + +* `directory` {String} Leaf node to remove. **Must be a directory, symlink, or file.** +* `options` {Object} + * `base` {String} No directories at or above this level of the filesystem will be removed. + * `purge` {Boolean} If set, nuke the whole leaf directory, including its contents. + * `log` {Function} A logging function that takes `npmlog`-compatible argument lists. +* `callback` {Function} Function to call once vacuuming is complete. + * `error` {Error} What went wrong along the way, if anything. diff --git a/deps/npm/node_modules/fs-vacuum/package.json b/deps/npm/node_modules/fs-vacuum/package.json new file mode 100644 index 0000000000..140536797f --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/package.json @@ -0,0 +1,42 @@ +{ + "name": "fs-vacuum", + "version": "1.2.1", + "description": "recursively remove empty directories -- to a point", + "main": "vacuum.js", + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/fs-vacuum.git" + }, + "keywords": [ + "rm", + "rimraf", + "clean" + ], + "author": { + "name": "Forrest L Norvell", + "email": "ogd@aoaioxxysz.net" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/fs-vacuum/issues" + }, + "homepage": "https://github.com/npm/fs-vacuum", + "devDependencies": { + "mkdirp": "^0.5.0", + "tap": "^0.4.11", + "tmp": "0.0.23" + }, + "dependencies": { + "graceful-fs": "^3.0.2", + "rimraf": "^2.2.8" + }, + "readme": "# fs-vacuum\n\nRemove the empty branches of a directory tree, optionally up to (but not\nincluding) a specified base directory. Optionally nukes the leaf directory.\n\n## Usage\n\n```javascript\nvar logger = require(\"npmlog\");\nvar vacuum = require(\"fs-vacuum\");\n\nvar options = {\n base : \"/path/to/my/tree/root\",\n purge : true,\n log : logger.silly.bind(logger, \"myCleanup\")\n};\n\n/* Assuming there are no other files or directories in \"out\", \"to\", or \"my\",\n * the final path will just be \"/path/to/my/tree/root\".\n */\nvacuum(\"/path/to/my/tree/root/out/to/my/files\", function (error) {\n if (error) console.error(\"Unable to cleanly vacuum:\", error.message);\n});\n```\n# vacuum(directory, options, callback)\n\n* `directory` {String} Leaf node to remove. **Must be a directory, symlink, or file.**\n* `options` {Object}\n * `base` {String} No directories at or above this level of the filesystem will be removed.\n * `purge` {Boolean} If set, nuke the whole leaf directory, including its contents.\n * `log` {Function} A logging function that takes `npmlog`-compatible argument lists.\n* `callback` {Function} Function to call once vacuuming is complete.\n * `error` {Error} What went wrong along the way, if anything.\n", + "readmeFilename": "README.md", + "gitHead": "bad24b21c45d86b3da991f2c3d058ef03546d83e", + "_id": "fs-vacuum@1.2.1", + "_shasum": "1bc3c62da30d6272569b8b9089c9811abb0a600b", + "_from": "fs-vacuum@>=1.2.1-0 <1.3.0-0" +} diff --git a/deps/npm/node_modules/fs-vacuum/test/arguments.js b/deps/npm/node_modules/fs-vacuum/test/arguments.js new file mode 100644 index 0000000000..d77ce0627d --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/arguments.js @@ -0,0 +1,24 @@ +var test = require("tap").test + +var vacuum = require("../vacuum.js") + +test("vacuum throws on missing parameters", function (t) { + t.throws(vacuum, "called with no parameters") + t.throws(function () { vacuum("directory", {}) }, "called with no callback") + + t.end() +}) + +test('vacuum throws on incorrect types ("Forrest is pedantic" section)', function (t) { + t.throws(function () { + vacuum({}, {}, function () {}) + }, "called with path parameter of incorrect type") + t.throws(function () { + vacuum("directory", "directory", function () {}) + }, "called with options of wrong type") + t.throws(function () { + vacuum("directory", {}, "whoops") + }, "called with callback that isn't callable") + + t.end() +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/base-leaf-mismatch.js b/deps/npm/node_modules/fs-vacuum/test/base-leaf-mismatch.js new file mode 100644 index 0000000000..cfdf074fe4 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/base-leaf-mismatch.js @@ -0,0 +1,16 @@ +var test = require("tap").test + +var vacuum = require("../vacuum.js") + +test("vacuum errors when base is set and path is not under it", function (t) { + vacuum("/a/made/up/path", {base : "/root/elsewhere"}, function (er) { + t.ok(er, "got an error") + t.equal( + er.message, + "/a/made/up/path is not a child of /root/elsewhere", + "got the expected error message" + ) + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-file-no-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-file-no-purge.js new file mode 100644 index 0000000000..6a6e51bcab --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/no-entries-file-no-purge.js @@ -0,0 +1,78 @@ +var path = require("path") + +var test = require("tap").test +var statSync = require("graceful-fs").statSync +var writeFile = require("graceful-fs").writeFile +var readdirSync = require("graceful-fs").readdirSync +var mkdtemp = require("tmp").dir +var mkdirp = require("mkdirp") + +var vacuum = require("../vacuum.js") + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup : true, + mode : "0700" +} +var SHORT_PATH = path.join("i", "am", "a", "path") +var PARTIAL_PATH = path.join(SHORT_PATH, "that", "ends", "at", "a") +var FULL_PATH = path.join(PARTIAL_PATH, "file") + +var messages = [] +function log() { messages.push(Array.prototype.slice.call(arguments).join(" ")) } + +var testBase, partialPath, fullPath +test("xXx setup xXx", function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, "temp directory exists") + + testBase = path.resolve(tmpdir, SHORT_PATH) + partialPath = path.resolve(tmpdir, PARTIAL_PATH) + fullPath = path.resolve(tmpdir, FULL_PATH) + + mkdirp(partialPath, function (er) { + t.ifError(er, "made test path") + + writeFile(fullPath, new Buffer("hi"), function (er) { + t.ifError(er, "made file") + + t.end() + }) + }) + }) +}) + +test("remove up to a point", function (t) { + vacuum(fullPath, {purge : false, base : testBase, log : log}, function (er) { + t.ifError(er, "cleaned up to base") + + t.equal(messages.length, 6, "got 5 removal & 1 finish message") + t.equal(messages[5], "finished vacuuming up to " + testBase) + + var stat + var verifyPath = fullPath + + function verify() { stat = statSync(verifyPath) } + + // handle the file separately + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isFile(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + + for (var i = 0; i < 4; i++) { + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isDirectory(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + " can be statted") + t.ok(stat && stat.isDirectory(), testBase + " is still a directory") + + var files = readdirSync(testBase) + t.equal(files.length, 0, "nothing left in base directory") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-link-no-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-link-no-purge.js new file mode 100644 index 0000000000..087c039d61 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/no-entries-link-no-purge.js @@ -0,0 +1,78 @@ +var path = require("path") + +var test = require("tap").test +var statSync = require("graceful-fs").statSync +var symlinkSync = require("graceful-fs").symlinkSync +var readdirSync = require("graceful-fs").readdirSync +var mkdtemp = require("tmp").dir +var mkdirp = require("mkdirp") + +var vacuum = require("../vacuum.js") + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup : true, + mode : "0700" +} +var SHORT_PATH = path.join("i", "am", "a", "path") +var TARGET_PATH = path.join("target-link", "in", "the", "middle") +var PARTIAL_PATH = path.join(SHORT_PATH, "with", "a") +var FULL_PATH = path.join(PARTIAL_PATH, "link") +var EXPANDO_PATH = path.join(SHORT_PATH, "with", "a", "link", "in", "the", "middle") + +var messages = [] +function log() { messages.push(Array.prototype.slice.call(arguments).join(" ")) } + +var testBase, targetPath, partialPath, fullPath, expandoPath +test("xXx setup xXx", function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, "temp directory exists") + + testBase = path.resolve(tmpdir, SHORT_PATH) + targetPath = path.resolve(tmpdir, TARGET_PATH) + partialPath = path.resolve(tmpdir, PARTIAL_PATH) + fullPath = path.resolve(tmpdir, FULL_PATH) + expandoPath = path.resolve(tmpdir, EXPANDO_PATH) + + mkdirp(partialPath, function (er) { + t.ifError(er, "made test path") + + mkdirp(targetPath, function (er) { + t.ifError(er, "made target path") + + symlinkSync(path.join(tmpdir, "target-link"), fullPath) + + t.end() + }) + }) + }) +}) + +test("remove up to a point", function (t) { + vacuum(expandoPath, {purge : false, base : testBase, log : log}, function (er) { + t.ifError(er, "cleaned up to base") + + t.equal(messages.length, 7, "got 6 removal & 1 finish message") + t.equal(messages[6], "finished vacuuming up to " + testBase) + + var stat + var verifyPath = expandoPath + function verify() { stat = statSync(verifyPath) } + + for (var i = 0; i < 6; i++) { + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isDirectory(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + " can be statted") + t.ok(stat && stat.isDirectory(), testBase + " is still a directory") + + var files = readdirSync(testBase) + t.equal(files.length, 0, "nothing left in base directory") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-no-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-no-purge.js new file mode 100644 index 0000000000..346ab56697 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/no-entries-no-purge.js @@ -0,0 +1,61 @@ +var path = require("path") + +var test = require("tap").test +var statSync = require("graceful-fs").statSync +var mkdtemp = require("tmp").dir +var mkdirp = require("mkdirp") + +var vacuum = require("../vacuum.js") + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup : true, + mode : "0700" +} +var SHORT_PATH = path.join("i", "am", "a", "path") +var LONG_PATH = path.join(SHORT_PATH, "of", "a", "certain", "length") + +var messages = [] +function log() { messages.push(Array.prototype.slice.call(arguments).join(" ")) } + +var testPath, testBase +test("xXx setup xXx", function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, "temp directory exists") + + testBase = path.resolve(tmpdir, SHORT_PATH) + testPath = path.resolve(tmpdir, LONG_PATH) + + mkdirp(testPath, function (er) { + t.ifError(er, "made test path") + + t.end() + }) + }) +}) + +test("remove up to a point", function (t) { + vacuum(testPath, {purge : false, base : testBase, log : log}, function (er) { + t.ifError(er, "cleaned up to base") + + t.equal(messages.length, 5, "got 4 removal & 1 finish message") + t.equal(messages[4], "finished vacuuming up to " + testBase) + + var stat + var verifyPath = testPath + function verify() { stat = statSync(verifyPath) } + + for (var i = 0; i < 4; i++) { + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isDirectory(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + " can be statted") + t.ok(stat && stat.isDirectory(), testBase + " is still a directory") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-with-link-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-with-link-purge.js new file mode 100644 index 0000000000..4ed1a39397 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/no-entries-with-link-purge.js @@ -0,0 +1,78 @@ +var path = require("path") + +var test = require("tap").test +var statSync = require("graceful-fs").statSync +var writeFileSync = require("graceful-fs").writeFileSync +var symlinkSync = require("graceful-fs").symlinkSync +var mkdtemp = require("tmp").dir +var mkdirp = require("mkdirp") + +var vacuum = require("../vacuum.js") + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup : true, + mode : "0700" +} +var SHORT_PATH = path.join("i", "am", "a", "path") +var TARGET_PATH = "link-target" +var FIRST_FILE = path.join(TARGET_PATH, "monsieurs") +var SECOND_FILE = path.join(TARGET_PATH, "mesdames") +var PARTIAL_PATH = path.join(SHORT_PATH, "with", "a", "definite") +var FULL_PATH = path.join(PARTIAL_PATH, "target") + +var messages = [] +function log() { messages.push(Array.prototype.slice.call(arguments).join(" ")) } + +var testBase, partialPath, fullPath, targetPath +test("xXx setup xXx", function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, "temp directory exists") + + testBase = path.resolve(tmpdir, SHORT_PATH) + targetPath = path.resolve(tmpdir, TARGET_PATH) + partialPath = path.resolve(tmpdir, PARTIAL_PATH) + fullPath = path.resolve(tmpdir, FULL_PATH) + + mkdirp(partialPath, function (er) { + t.ifError(er, "made test path") + + mkdirp(targetPath, function (er) { + t.ifError(er, "made target path") + + writeFileSync(path.resolve(tmpdir, FIRST_FILE), new Buffer("c'est vraiment joli")) + writeFileSync(path.resolve(tmpdir, SECOND_FILE), new Buffer("oui oui")) + symlinkSync(targetPath, fullPath) + + t.end() + }) + }) + }) +}) + +test("remove up to a point", function (t) { + vacuum(fullPath, {purge : true, base : testBase, log : log}, function (er) { + t.ifError(er, "cleaned up to base") + + t.equal(messages.length, 5, "got 4 removal & 1 finish message") + t.equal(messages[0], "purging " + fullPath) + t.equal(messages[4], "finished vacuuming up to " + testBase) + + var stat + var verifyPath = fullPath + function verify() { stat = statSync(verifyPath) } + + for (var i = 0; i < 4; i++) { + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isDirectory(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + " can be statted") + t.ok(stat && stat.isDirectory(), testBase + " is still a directory") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/no-entries-with-purge.js b/deps/npm/node_modules/fs-vacuum/test/no-entries-with-purge.js new file mode 100644 index 0000000000..10fa558552 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/no-entries-with-purge.js @@ -0,0 +1,67 @@ +var path = require("path") + +var test = require("tap").test +var statSync = require("graceful-fs").statSync +var writeFileSync = require("graceful-fs").writeFileSync +var mkdtemp = require("tmp").dir +var mkdirp = require("mkdirp") + +var vacuum = require("../vacuum.js") + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup : true, + mode : "0700" +} +var SHORT_PATH = path.join("i", "am", "a", "path") +var LONG_PATH = path.join(SHORT_PATH, "of", "a", "certain", "kind") +var FIRST_FILE = path.join(LONG_PATH, "monsieurs") +var SECOND_FILE = path.join(LONG_PATH, "mesdames") + +var messages = [] +function log() { messages.push(Array.prototype.slice.call(arguments).join(" ")) } + +var testPath, testBase +test("xXx setup xXx", function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, "temp directory exists") + + testBase = path.resolve(tmpdir, SHORT_PATH) + testPath = path.resolve(tmpdir, LONG_PATH) + + mkdirp(testPath, function (er) { + t.ifError(er, "made test path") + + writeFileSync(path.resolve(tmpdir, FIRST_FILE), new Buffer("c'est vraiment joli")) + writeFileSync(path.resolve(tmpdir, SECOND_FILE), new Buffer("oui oui")) + t.end() + }) + }) +}) + +test("remove up to a point", function (t) { + vacuum(testPath, {purge : true, base : testBase, log : log}, function (er) { + t.ifError(er, "cleaned up to base") + + t.equal(messages.length, 5, "got 4 removal & 1 finish message") + t.equal(messages[0], "purging " + testPath) + t.equal(messages[4], "finished vacuuming up to " + testBase) + + var stat + var verifyPath = testPath + function verify() { stat = statSync(verifyPath) } + + for (var i = 0; i < 4; i++) { + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isDirectory(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(testBase) + }, testBase + " can be statted") + t.ok(stat && stat.isDirectory(), testBase + " is still a directory") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js b/deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js new file mode 100644 index 0000000000..dce785623e --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/test/other-directories-no-purge.js @@ -0,0 +1,76 @@ +var path = require("path") + +var test = require("tap").test +var statSync = require("graceful-fs").statSync +var mkdtemp = require("tmp").dir +var mkdirp = require("mkdirp") + +var vacuum = require("../vacuum.js") + +// CONSTANTS +var TEMP_OPTIONS = { + unsafeCleanup : true, + mode : "0700" +} +var SHORT_PATH = path.join("i", "am", "a", "path") +var REMOVE_PATH = path.join(SHORT_PATH, "of", "a", "certain", "length") +var OTHER_PATH = path.join(SHORT_PATH, "of", "no", "qualities") + +var messages = [] +function log() { messages.push(Array.prototype.slice.call(arguments).join(" ")) } + +var testBase, testPath, otherPath +test("xXx setup xXx", function (t) { + mkdtemp(TEMP_OPTIONS, function (er, tmpdir) { + t.ifError(er, "temp directory exists") + + testBase = path.resolve(tmpdir, SHORT_PATH) + testPath = path.resolve(tmpdir, REMOVE_PATH) + otherPath = path.resolve(tmpdir, OTHER_PATH) + + mkdirp(testPath, function (er) { + t.ifError(er, "made test path") + + mkdirp(otherPath, function (er) { + t.ifError(er, "made other path") + + t.end() + }) + }) + }) +}) + +test("remove up to a point", function (t) { + vacuum(testPath, {purge : false, base : testBase, log : log}, function (er) { + t.ifError(er, "cleaned up to base") + + t.equal(messages.length, 4, "got 3 removal & 1 finish message") + t.equal( + messages[3], "quitting because other entries in " + testBase + "/of", + "got expected final message" + ) + + var stat + var verifyPath = testPath + function verify() { stat = statSync(verifyPath) } + + for (var i = 0; i < 3; i++) { + t.throws(verify, verifyPath + " cannot be statted") + t.notOk(stat && stat.isDirectory(), verifyPath + " is totally gone") + verifyPath = path.dirname(verifyPath) + } + + t.doesNotThrow(function () { + stat = statSync(otherPath) + }, otherPath + " can be statted") + t.ok(stat && stat.isDirectory(), otherPath + " is still a directory") + + var intersection = path.join(testBase, "of") + t.doesNotThrow(function () { + stat = statSync(intersection) + }, intersection + " can be statted") + t.ok(stat && stat.isDirectory(), intersection + " is still a directory") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/fs-vacuum/vacuum.js b/deps/npm/node_modules/fs-vacuum/vacuum.js new file mode 100644 index 0000000000..f706a4be68 --- /dev/null +++ b/deps/npm/node_modules/fs-vacuum/vacuum.js @@ -0,0 +1,104 @@ +var assert = require("assert") +var dirname = require("path").dirname +var resolve = require("path").resolve + +var rimraf = require("rimraf") +var lstat = require("graceful-fs").lstat +var readdir = require("graceful-fs").readdir +var rmdir = require("graceful-fs").rmdir +var unlink = require("graceful-fs").unlink + +module.exports = vacuum + +function vacuum(leaf, options, cb) { + assert(typeof leaf === "string", "must pass in path to remove") + assert(typeof cb === "function", "must pass in callback") + + if (!options) options = {} + assert(typeof options === "object", "options must be an object") + + var log = options.log ? options.log : function () {} + + var base = options.base + if (base && resolve(leaf).indexOf(resolve(base)) !== 0) { + return cb(new Error(resolve(leaf) + " is not a child of " + resolve(base))) + } + + lstat(leaf, function (error, stat) { + if (error) { + if (error.code === "ENOENT") return cb(null) + + log(error.stack) + return cb(error) + } + + if (!(stat && (stat.isDirectory() || stat.isSymbolicLink() || stat.isFile()))) { + log(leaf, "is not a directory, file, or link") + return cb(new Error(leaf + " is not a directory, file, or link")) + } + + if (options.purge) { + log("purging", leaf) + rimraf(leaf, function (error) { + if (error) return cb(error) + + next(dirname(leaf)) + }) + } + else if (!stat.isDirectory()) { + log("removing", leaf) + unlink(leaf, function (error) { + if (error) return cb(error) + + next(dirname(leaf)) + }) + } + else { + next(leaf) + } + }) + + function next(branch) { + // either we've reached the base or we've reached the root + if ((base && resolve(branch) === resolve(base)) || branch === dirname(branch)) { + log("finished vacuuming up to", branch) + return cb(null) + } + + readdir(branch, function (error, files) { + if (error) { + if (error.code === "ENOENT") return cb(null) + + log("unable to check directory", branch, "due to", error.message) + return cb(error) + } + + if (files.length > 0) { + log("quitting because other entries in", branch) + return cb(null) + } + + log("removing", branch) + lstat(branch, function (error, stat) { + if (error) { + if (error.code === "ENOENT") return cb(null) + + log("unable to lstat", branch, "due to", error.message) + return cb(error) + } + + var remove = stat.isDirectory() ? rmdir : unlink + remove(branch, function (error) { + if (error) { + if (error.code === "ENOENT") return cb(null) + + log("unable to remove", branch, "due to", error.message) + return cb(error) + } + + next(dirname(branch)) + }) + }) + }) + } +} diff --git a/deps/npm/node_modules/fstream/package.json b/deps/npm/node_modules/fstream/package.json index de7f7bc14f..d0ac58243a 100644 --- a/deps/npm/node_modules/fstream/package.json +++ b/deps/npm/node_modules/fstream/package.json @@ -28,8 +28,6 @@ "test": "tap examples/*.js" }, "license": "BSD", - "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n", - "readmeFilename": "README.md", "gitHead": "b3b74e92ef4a91ae206fab90b7998c7cd2e4290d", "bugs": { "url": "https://github.com/isaacs/fstream/issues" @@ -37,5 +35,23 @@ "homepage": "https://github.com/isaacs/fstream", "_id": "fstream@1.0.2", "_shasum": "56930ff1b4d4d7b1a689c8656b3a11e744ab92c6", - "_from": "fstream@latest" + "_from": "fstream@1.0.2", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "56930ff1b4d4d7b1a689c8656b3a11e744ab92c6", + "tarball": "http://registry.npmjs.org/fstream/-/fstream-1.0.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.2.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/github-url-from-git/package.json b/deps/npm/node_modules/github-url-from-git/package.json index 978435c7da..229af333ca 100644 --- a/deps/npm/node_modules/github-url-from-git/package.json +++ b/deps/npm/node_modules/github-url-from-git/package.json @@ -32,7 +32,7 @@ "homepage": "https://github.com/visionmedia/node-github-url-from-git", "_id": "github-url-from-git@1.4.0", "_shasum": "285e6b520819001bde128674704379e4ff03e0de", - "_from": "github-url-from-git@^1.4.0", + "_from": "github-url-from-git@>=1.4.0-0 <2.0.0-0", "_npmVersion": "2.0.0-alpha.7", "_npmUser": { "name": "bcoe", @@ -53,6 +53,5 @@ "tarball": "http://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.4.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.4.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.4.0.tgz" } diff --git a/deps/npm/node_modules/github-url-from-username-repo/index.js b/deps/npm/node_modules/github-url-from-username-repo/index.js index 794daabf3b..f9d77f952f 100644 --- a/deps/npm/node_modules/github-url-from-username-repo/index.js +++ b/deps/npm/node_modules/github-url-from-username-repo/index.js @@ -2,7 +2,16 @@ module.exports = getUrl function getUrl (r, forBrowser) { if (!r) return null - if (/^[\w-]+\/[\w\.-]+(#[a-z0-9]*)?$/.test(r)) { + // Regex taken from https://github.com/npm/npm-package-arg/commit/01dce583c64afae07b66a2a8a6033aeba871c3cd + // 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 + // + // The only way to do this properly would be to shell out to + // git-check-ref-format, and as this is a fast sync function, + // we don't want to do that. Just let git fail if it turns + // out that the commit-ish is invalid. + // GH usernames cannot start with . or - + if (/^[^@%\/\s\.-][^:@%\/\s]*\/[^@\s\/%]+(?:#.*)?$/.test(r)) { if (forBrowser) r = r.replace("#", "/tree/") return "https://github.com/" + r diff --git a/deps/npm/node_modules/github-url-from-username-repo/package.json b/deps/npm/node_modules/github-url-from-username-repo/package.json index 8b6be10115..f8aa80d5b6 100644 --- a/deps/npm/node_modules/github-url-from-username-repo/package.json +++ b/deps/npm/node_modules/github-url-from-username-repo/package.json @@ -1,6 +1,6 @@ { "name": "github-url-from-username-repo", - "version": "1.0.0", + "version": "1.0.2", "description": "Create urls from username/repo", "main": "index.js", "scripts": { @@ -26,34 +26,11 @@ "github", "repo" ], - "gitHead": "d5b3c01193504d67b3ecc030e93d5c58c9b0df63", + "readme": "[![Build Status](https://travis-ci.org/robertkowalski/github-url-from-username-repo.png?branch=master)](https://travis-ci.org/robertkowalski/github-url-from-username-repo)\n[![Dependency Status](https://gemnasium.com/robertkowalski/github-url-from-username-repo.png)](https://gemnasium.com/robertkowalski/github-url-from-username-repo)\n\n\n# github-url-from-username-repo\n\n## API\n\n### getUrl(url, [forBrowser])\n\nGet's the url normalized for npm.\nIf `forBrowser` is true, return a GitHub url that is usable in a webbrowser.\n\n## Usage\n\n```javascript\n\nvar getUrl = require(\"github-url-from-username-repo\")\ngetUrl(\"visionmedia/express\") // https://github.com/visionmedia/express\n\n```\n", + "readmeFilename": "README.md", + "gitHead": "d404a13f7f04edaed0e2f068a43b81230b8c7aee", "homepage": "https://github.com/robertkowalski/github-url-from-username-repo", - "_id": "github-url-from-username-repo@1.0.0", - "_shasum": "848d4f19bc838dc428484ce0dc33da593e8400ed", - "_from": "github-url-from-username-repo@^1.0.0", - "_npmVersion": "1.4.21", - "_npmUser": { - "name": "robertkowalski", - "email": "rok@kowalski.gd" - }, - "maintainers": [ - { - "name": "robertkowalski", - "email": "rok@kowalski.gd" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - { - "name": "forbeslindesay", - "email": "forbes@lindesay.co.uk" - } - ], - "dist": { - "shasum": "848d4f19bc838dc428484ce0dc33da593e8400ed", - "tarball": "http://registry.npmjs.org/github-url-from-username-repo/-/github-url-from-username-repo-1.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/github-url-from-username-repo/-/github-url-from-username-repo-1.0.0.tgz" + "_id": "github-url-from-username-repo@1.0.2", + "_shasum": "7dd79330d2abe69c10c2cef79714c97215791dfa", + "_from": "github-url-from-username-repo@>=1.0.2-0 <2.0.0-0" } diff --git a/deps/npm/node_modules/github-url-from-username-repo/test/index.js b/deps/npm/node_modules/github-url-from-username-repo/test/index.js index 935bb439d3..10fe3a34cc 100644 --- a/deps/npm/node_modules/github-url-from-username-repo/test/index.js +++ b/deps/npm/node_modules/github-url-from-username-repo/test/index.js @@ -17,6 +17,11 @@ describe("github url from username/repo", function () { assert.deepEqual(null, url) }) + it("returns null for something that's already a URI", function () { + var url = getUrl("file:../relative") + assert.deepEqual(null, url) + }) + it("works with .", function () { var url = getUrl("component/.download.er.js.") assert.equal("https://github.com/component/.download.er.js.", url) @@ -40,6 +45,13 @@ describe("github url from username/repo", function () { "4b477f04d947bd53c473799b277", url) }) + it("can handle branches with slashes", function () { + var url = getUrl( + "component/entejs#some/branch/name") + + assert.equal("https://github.com/component/entejs#some/branch/name", url) + }) + describe("browser mode", function () { it("is able to return urls for branches", function () { var url = getUrl( diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json index bba3057d99..703b34ac42 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/package.json @@ -27,7 +27,7 @@ "homepage": "https://github.com/isaacs/promzard", "_id": "promzard@0.2.2", "_shasum": "918b9f2b29458cb001781a8856502e4a79b016e0", - "_from": "promzard@~0.2.0", + "_from": "promzard@>=0.2.0-0 <0.3.0-0", "_npmVersion": "1.4.10", "_npmUser": { "name": "isaacs", @@ -44,6 +44,5 @@ "tarball": "http://registry.npmjs.org/promzard/-/promzard-0.2.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.2.2.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.2.2.tgz" } diff --git a/deps/npm/node_modules/init-package-json/package.json b/deps/npm/node_modules/init-package-json/package.json index ff9f926fc9..c716cd6e87 100644 --- a/deps/npm/node_modules/init-package-json/package.json +++ b/deps/npm/node_modules/init-package-json/package.json @@ -1,6 +1,6 @@ { "name": "init-package-json", - "version": "1.0.0", + "version": "1.0.1", "main": "init-package-json.js", "scripts": { "test": "tap test/*.js" @@ -21,7 +21,7 @@ "promzard": "~0.2.0", "read": "~1.0.1", "read-package-json": "1", - "semver": "2.x || 3.x" + "semver": "2.x || 3.x || 4" }, "devDependencies": { "tap": "~0.2.5", @@ -37,15 +37,15 @@ "prompt", "start" ], - "gitHead": "e8c42e4be8877195e0ef2cd0b50d806afd2eec08", + "gitHead": "e1a5917ba1723ab5dcedacbffb5b10208d203e2f", "bugs": { "url": "https://github.com/isaacs/init-package-json/issues" }, "homepage": "https://github.com/isaacs/init-package-json", - "_id": "init-package-json@1.0.0", - "_shasum": "8985a99ef11589695d6d3a5d03300b1eab0dd47a", - "_from": "init-package-json@1.0.0", - "_npmVersion": "1.4.21", + "_id": "init-package-json@1.0.1", + "_shasum": "c01b08cc90504ebc448d57b468e66fc08293e8a8", + "_from": "init-package-json@>=1.0.0-0 <1.1.0-0", + "_npmVersion": "2.0.0-beta.3", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -57,9 +57,9 @@ } ], "dist": { - "shasum": "8985a99ef11589695d6d3a5d03300b1eab0dd47a", - "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-1.0.0.tgz" + "shasum": "c01b08cc90504ebc448d57b468e66fc08293e8a8", + "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-1.0.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.0.0.tgz" + "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.0.1.tgz" } diff --git a/deps/npm/node_modules/lockfile/package.json b/deps/npm/node_modules/lockfile/package.json index bf4a90dcfb..27bd23777d 100644 --- a/deps/npm/node_modules/lockfile/package.json +++ b/deps/npm/node_modules/lockfile/package.json @@ -31,8 +31,6 @@ }, "license": "BSD", "description": "A very polite lock file utility, which endeavors to not litter, and to wait patiently for others.", - "readme": "# lockfile\n\nA very polite lock file utility, which endeavors to not litter, and to\nwait patiently for others.\n\n## Usage\n\n```javascript\nvar lockFile = require('lockfile')\n\n// opts is optional, and defaults to {}\nlockFile.lock('some-file.lock', opts, function (er) {\n // if the er happens, then it failed to acquire a lock.\n // if there was not an error, then the file was created,\n // and won't be deleted until we unlock it.\n\n // do my stuff, free of interruptions\n // then, some time later, do:\n lockFile.unlock('some-file.lock', function (er) {\n // er means that an error happened, and is probably bad.\n })\n})\n```\n\n## Methods\n\nSync methods return the value/throw the error, others don't. Standard\nnode fs stuff.\n\nAll known locks are removed when the process exits. Of course, it's\npossible for certain types of failures to cause this to fail, but a best\neffort is made to not be a litterbug.\n\n### lockFile.lock(path, [opts], cb)\n\nAcquire a file lock on the specified path\n\n### lockFile.lockSync(path, [opts])\n\nAcquire a file lock on the specified path\n\n### lockFile.unlock(path, cb)\n\nClose and unlink the lockfile.\n\n### lockFile.unlockSync(path)\n\nClose and unlink the lockfile.\n\n### lockFile.check(path, [opts], cb)\n\nCheck if the lockfile is locked and not stale.\n\nReturns boolean.\n\n### lockFile.checkSync(path, [opts], cb)\n\nCheck if the lockfile is locked and not stale.\n\nCallback is called with `cb(error, isLocked)`.\n\n## Options\n\n### opts.wait\n\nA number of milliseconds to wait for locks to expire before giving up.\nOnly used by lockFile.lock. Poll for `opts.wait` ms. If the lock is\nnot cleared by the time the wait expires, then it returns with the\noriginal error.\n\n### opts.pollPeriod\n\nWhen using `opts.wait`, this is the period in ms in which it polls to\ncheck if the lock has expired. Defaults to `100`.\n\n### opts.stale\n\nA number of milliseconds before locks are considered to have expired.\n\n### opts.retries\n\nUsed by lock and lockSync. Retry `n` number of times before giving up.\n\n### opts.retryWait\n\nUsed by lock. Wait `n` milliseconds before retrying.\n", - "readmeFilename": "README.md", "gitHead": "9590c6f02521eb1bb154ddc3ca9a7e84ce770c45", "bugs": { "url": "https://github.com/isaacs/lockfile/issues" @@ -40,5 +38,26 @@ "homepage": "https://github.com/isaacs/lockfile", "_id": "lockfile@1.0.0", "_shasum": "b3a7609dda6012060083bacb0ab0ecbca58e9203", - "_from": "lockfile@latest" + "_from": "lockfile@1.0.0", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "trevorburnham", + "email": "trevorburnham@gmail.com" + }, + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "b3a7609dda6012060083bacb0ab0ecbca58e9203", + "tarball": "http://registry.npmjs.org/lockfile/-/lockfile-1.0.0.tgz" + }, + "_resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/node-gyp/package.json b/deps/npm/node_modules/node-gyp/package.json index 8ee9869518..2e2e47c7a3 100644 --- a/deps/npm/node_modules/node-gyp/package.json +++ b/deps/npm/node_modules/node-gyp/package.json @@ -10,7 +10,7 @@ "bindings", "gyp" ], - "version": "1.0.1", + "version": "1.0.2", "installVersion": 9, "author": { "name": "Nathan Rajlich", @@ -37,22 +37,45 @@ "osenv": "0", "request": "2", "rimraf": "2", - "semver": "2.x || 3.x", + "semver": "2.x || 3.x || 4", "tar": "^1.0.0", "which": "1" }, "engines": { "node": ">= 0.8.0" }, - "readme": "node-gyp\n=========\n### Node.js native addon build tool\n\n`node-gyp` is a cross-platform command-line tool written in Node.js for compiling\nnative addon modules for Node.js. It bundles the [gyp](https://code.google.com/p/gyp/)\nproject used by the Chromium team and takes away the pain of dealing with the\nvarious differences in build platforms. It is the replacement to the `node-waf`\nprogram which is removed for node `v0.8`. If you have a native addon for node that\nstill has a `wscript` file, then you should definitely add a `binding.gyp` file\nto support the latest versions of node.\n\nMultiple target versions of node are supported (i.e. `0.8`, `0.9`, `0.10`, ..., `1.0`,\netc.), regardless of what version of node is actually installed on your system\n(`node-gyp` downloads the necessary development files for the target version).\n\n#### Features:\n\n * Easy to use, consistent interface\n * Same commands to build your module on every platform\n * Supports multiple target versions of Node\n\n\nInstallation\n------------\n\nYou can install with `npm`:\n\n``` bash\n$ npm install -g node-gyp\n```\n\nYou will also need to install:\n\n * On Unix:\n * `python` (`v2.7` recommended, `v3.x.x` is __*not*__ supported)\n * `make`\n * A proper C/C++ compiler toolchain, like GCC\n * On Windows:\n * [Python][windows-python] ([`v2.7.3`][windows-python-v2.7.3] recommended, `v3.x.x` is __*not*__ supported)\n * Windows XP/Vista/7:\n * Microsoft Visual Studio C++ 2010 ([Express][msvc2010] version works well)\n * For 64-bit builds of node and native modules you will _**also**_ need the [Windows 7 64-bit SDK][win7sdk]\n * If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed first.\n * If you get errors that the 64-bit compilers are not installed you may also need the [compiler update for the Windows SDK 7.1]\n * Windows 7/8:\n * Microsoft Visual Studio C++ 2012 for Windows Desktop ([Express][msvc2012] version works well)\n\nIf you have multiple Python versions installed, you can identify which Python\nversion `node-gyp` uses by setting the '--python' variable:\n\n``` bash\n$ node-gyp --python /path/to/python2.7\n```\n\nIf `node-gyp` is called by way of `npm` *and* you have multiple versions of\nPython installed, then you can set `npm`'s 'python' config key to the appropriate\nvalue:\n\n``` bash\n$ npm config set python /path/to/executable/python2.7\n```\n\nNote that OS X is just a flavour of Unix and so needs `python`, `make`, and C/C++.\nAn easy way to obtain these is to install XCode from Apple,\nand then use it to install the command line tools (under Preferences -> Downloads).\n\nHow to Use\n----------\n\nTo compile your native addon, first go to its root directory:\n\n``` bash\n$ cd my_node_addon\n```\n\nThe next step is to generate the appropriate project build files for the current\nplatform. Use `configure` for that:\n\n``` bash\n$ node-gyp configure\n```\n\n__Note__: The `configure` step looks for the `binding.gyp` file in the current\ndirectory to processs. See below for instructions on creating the `binding.gyp` file.\n\nNow you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file\n(on Windows) in the `build/` directory. Next invoke the `build` command:\n\n``` bash\n$ node-gyp build\n```\n\nNow you have your compiled `.node` bindings file! The compiled bindings end up\nin `build/Debug/` or `build/Release/`, depending on the build mode. At this point\nyou can require the `.node` file with Node and run your tests!\n\n__Note:__ To create a _Debug_ build of the bindings file, pass the `--debug` (or\n`-d`) switch when running the either `configure` or `build` command.\n\n\nThe \"binding.gyp\" file\n----------------------\n\nPreviously when node had `node-waf` you had to write a `wscript` file. The\nreplacement for that is the `binding.gyp` file, which describes the configuration\nto build your module in a JSON-like format. This file gets placed in the root of\nyour package, alongside the `package.json` file.\n\nA barebones `gyp` file appropriate for building a node addon looks like:\n\n``` python\n{\n \"targets\": [\n {\n \"target_name\": \"binding\",\n \"sources\": [ \"src/binding.cc\" ]\n }\n ]\n}\n```\n\nSome additional resources for writing `gyp` files:\n\n * [\"Hello World\" node addon example](https://github.com/joyent/node/tree/master/test/addons/hello-world)\n * [gyp user documentation](http://code.google.com/p/gyp/wiki/GypUserDocumentation)\n * [gyp input format reference](http://code.google.com/p/gyp/wiki/InputFormatReference)\n * [*\"binding.gyp\" files out in the wild* wiki page](https://github.com/TooTallNate/node-gyp/wiki/%22binding.gyp%22-files-out-in-the-wild)\n\n\nCommands\n--------\n\n`node-gyp` responds to the following commands:\n\n| **Command** | **Description**\n|:--------------|:---------------------------------------------------------------\n| `build` | Invokes `make`/`msbuild.exe` and builds the native addon\n| `clean` | Removes any the `build` dir if it exists\n| `configure` | Generates project build files for the current platform\n| `rebuild` | Runs \"clean\", \"configure\" and \"build\" all in a row\n| `install` | Installs node development header files for the given version\n| `list` | Lists the currently installed node development file versions\n| `remove` | Removes the node development header files for the given version\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n\n[windows-python]: http://www.python.org/getit/windows\n[windows-python-v2.7.3]: http://www.python.org/download/releases/2.7.3#download\n[msvc2010]: http://go.microsoft.com/?linkid=9709949\n[msvc2012]: http://go.microsoft.com/?linkid=9816758\n[win7sdk]: http://www.microsoft.com/en-us/download/details.aspx?id=8279\n[compiler update for the Windows SDK 7.1]: http://www.microsoft.com/en-us/download/details.aspx?id=4422\n", - "readmeFilename": "README.md", - "gitHead": "b2abd70377c356483c98509b14a01d71f1eaa17f", + "gitHead": "1e399b471945b35f3bfbca4a10fba31a6739b5db", "bugs": { "url": "https://github.com/TooTallNate/node-gyp/issues" }, "homepage": "https://github.com/TooTallNate/node-gyp", - "_id": "node-gyp@1.0.1", + "_id": "node-gyp@1.0.2", "scripts": {}, - "_shasum": "d5e364145ff10b259be9986855c83b5a76a2d975", - "_from": "node-gyp@latest" + "_shasum": "b0bb6d2d762271408dd904853e7aa3000ed2eb57", + "_from": "node-gyp@>=1.0.1-0 <1.1.0-0", + "_npmVersion": "2.0.0-beta.3", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "TooTallNate", + "email": "nathan@tootallnate.net" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "b0bb6d2d762271408dd904853e7aa3000ed2eb57", + "tarball": "http://registry.npmjs.org/node-gyp/-/node-gyp-1.0.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-1.0.2.tgz" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/.npmignore b/deps/npm/node_modules/normalize-package-data/.npmignore similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/.npmignore rename to deps/npm/node_modules/normalize-package-data/.npmignore diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/.travis.yml b/deps/npm/node_modules/normalize-package-data/.travis.yml similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/.travis.yml rename to deps/npm/node_modules/normalize-package-data/.travis.yml diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/AUTHORS b/deps/npm/node_modules/normalize-package-data/AUTHORS similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/AUTHORS rename to deps/npm/node_modules/normalize-package-data/AUTHORS diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/LICENSE b/deps/npm/node_modules/normalize-package-data/LICENSE similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/LICENSE rename to deps/npm/node_modules/normalize-package-data/LICENSE diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/README.md b/deps/npm/node_modules/normalize-package-data/README.md similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/README.md rename to deps/npm/node_modules/normalize-package-data/README.md diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/core_module_names.json b/deps/npm/node_modules/normalize-package-data/lib/core_module_names.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/core_module_names.json rename to deps/npm/node_modules/normalize-package-data/lib/core_module_names.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/extract_description.js b/deps/npm/node_modules/normalize-package-data/lib/extract_description.js similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/extract_description.js rename to deps/npm/node_modules/normalize-package-data/lib/extract_description.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js b/deps/npm/node_modules/normalize-package-data/lib/fixer.js similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js rename to deps/npm/node_modules/normalize-package-data/lib/fixer.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/make_warning.js b/deps/npm/node_modules/normalize-package-data/lib/make_warning.js similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/make_warning.js rename to deps/npm/node_modules/normalize-package-data/lib/make_warning.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js b/deps/npm/node_modules/normalize-package-data/lib/normalize.js similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/normalize.js rename to deps/npm/node_modules/normalize-package-data/lib/normalize.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/safe_format.js b/deps/npm/node_modules/normalize-package-data/lib/safe_format.js similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/safe_format.js rename to deps/npm/node_modules/normalize-package-data/lib/safe_format.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/typos.json b/deps/npm/node_modules/normalize-package-data/lib/typos.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/typos.json rename to deps/npm/node_modules/normalize-package-data/lib/typos.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/warning_messages.json b/deps/npm/node_modules/normalize-package-data/lib/warning_messages.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/warning_messages.json rename to deps/npm/node_modules/normalize-package-data/lib/warning_messages.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json b/deps/npm/node_modules/normalize-package-data/package.json similarity index 74% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json rename to deps/npm/node_modules/normalize-package-data/package.json index 084068ead7..0471bcd6e0 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json +++ b/deps/npm/node_modules/normalize-package-data/package.json @@ -1,6 +1,6 @@ { "name": "normalize-package-data", - "version": "1.0.1", + "version": "1.0.2", "author": { "name": "Meryn Stol", "email": "merynstol@gmail.com" @@ -17,7 +17,7 @@ "dependencies": { "github-url-from-git": "^1.3.0", "github-url-from-username-repo": "^1.0.0", - "semver": "2 || 3" + "semver": "2 || 3 || 4" }, "devDependencies": { "tap": "~0.2.5", @@ -38,18 +38,18 @@ "email": "rok@kowalski.gd" } ], - "gitHead": "d260644f514672cc84f1cc471024679cccc4fd65", + "gitHead": "05fafb91466ac634fa7d591d0796d64b0b432dc0", "bugs": { "url": "https://github.com/meryn/normalize-package-data/issues" }, "homepage": "https://github.com/meryn/normalize-package-data", - "_id": "normalize-package-data@1.0.1", - "_shasum": "2a4b5200c82cc47bb91c8c9cf47d645499d200bf", - "_from": "normalize-package-data@^1.0.0", - "_npmVersion": "2.0.0-beta.0", + "_id": "normalize-package-data@1.0.2", + "_shasum": "32a902ad3cad3286f1106b9b9550062f44ee2118", + "_from": "normalize-package-data@>=1.0.1-0 <1.1.0-0", + "_npmVersion": "2.0.0-beta.3", "_npmUser": { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" + "name": "isaacs", + "email": "i@izs.me" }, "maintainers": [ { @@ -66,9 +66,9 @@ } ], "dist": { - "shasum": "2a4b5200c82cc47bb91c8c9cf47d645499d200bf", - "tarball": "http://registry.npmjs.org/normalize-package-data/-/normalize-package-data-1.0.1.tgz" + "shasum": "32a902ad3cad3286f1106b9b9550062f44ee2118", + "tarball": "http://registry.npmjs.org/normalize-package-data/-/normalize-package-data-1.0.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-1.0.1.tgz" + "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-1.0.2.tgz" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/basic.js b/deps/npm/node_modules/normalize-package-data/test/basic.js similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/basic.js rename to deps/npm/node_modules/normalize-package-data/test/basic.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/consistency.js b/deps/npm/node_modules/normalize-package-data/test/consistency.js similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/consistency.js rename to deps/npm/node_modules/normalize-package-data/test/consistency.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/dependencies.js b/deps/npm/node_modules/normalize-package-data/test/dependencies.js similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/dependencies.js rename to deps/npm/node_modules/normalize-package-data/test/dependencies.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/async.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/async.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/async.json rename to deps/npm/node_modules/normalize-package-data/test/fixtures/async.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/bcrypt.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/bcrypt.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/bcrypt.json rename to deps/npm/node_modules/normalize-package-data/test/fixtures/bcrypt.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/coffee-script.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/coffee-script.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/coffee-script.json rename to deps/npm/node_modules/normalize-package-data/test/fixtures/coffee-script.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/http-server.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/http-server.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/http-server.json rename to deps/npm/node_modules/normalize-package-data/test/fixtures/http-server.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/movefile.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/movefile.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/movefile.json rename to deps/npm/node_modules/normalize-package-data/test/fixtures/movefile.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/no-description.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/no-description.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/no-description.json rename to deps/npm/node_modules/normalize-package-data/test/fixtures/no-description.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/node-module_exist.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/node-module_exist.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/node-module_exist.json rename to deps/npm/node_modules/normalize-package-data/test/fixtures/node-module_exist.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/npm.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/npm.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/npm.json rename to deps/npm/node_modules/normalize-package-data/test/fixtures/npm.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/read-package-json.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/read-package-json.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/read-package-json.json rename to deps/npm/node_modules/normalize-package-data/test/fixtures/read-package-json.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/request.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/request.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/request.json rename to deps/npm/node_modules/normalize-package-data/test/fixtures/request.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/underscore.json b/deps/npm/node_modules/normalize-package-data/test/fixtures/underscore.json similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/fixtures/underscore.json rename to deps/npm/node_modules/normalize-package-data/test/fixtures/underscore.json diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/github-urls.js b/deps/npm/node_modules/normalize-package-data/test/github-urls.js similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/github-urls.js rename to deps/npm/node_modules/normalize-package-data/test/github-urls.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/normalize.js b/deps/npm/node_modules/normalize-package-data/test/normalize.js similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/normalize.js rename to deps/npm/node_modules/normalize-package-data/test/normalize.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/scoped.js b/deps/npm/node_modules/normalize-package-data/test/scoped.js similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/scoped.js rename to deps/npm/node_modules/normalize-package-data/test/scoped.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/strict.js b/deps/npm/node_modules/normalize-package-data/test/strict.js similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/strict.js rename to deps/npm/node_modules/normalize-package-data/test/strict.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/typo.js b/deps/npm/node_modules/normalize-package-data/test/typo.js similarity index 100% rename from deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/typo.js rename to deps/npm/node_modules/normalize-package-data/test/typo.js diff --git a/deps/npm/node_modules/npm-install-checks/package.json b/deps/npm/node_modules/npm-install-checks/package.json index 9457df0b5c..06ca052e41 100644 --- a/deps/npm/node_modules/npm-install-checks/package.json +++ b/deps/npm/node_modules/npm-install-checks/package.json @@ -1,11 +1,11 @@ { "name": "npm-install-checks", - "version": "1.0.2", + "version": "1.0.4", "description": "checks that npm runs during the installation of a module", "main": "index.js", "dependencies": { "npmlog": "0.1", - "semver": "^2.3.0" + "semver": "^2.3.0 || 3.x || 4" }, "devDependencies": { "tap": "~0.4.8", @@ -32,10 +32,29 @@ "bugs": { "url": "https://github.com/npm/npm-install-checks/issues" }, - "readme": "# npm-install-checks\n\nA package that contains checks that npm runs during the installation.\n\n## API\n\n### .checkEngine(target, npmVer, nodeVer, force, strict, cb)\nCheck if node/npm version is supported by the package.\n\nError type: `ENOTSUP`\n\n### .checkPlatform(target, force, cb)\nCheck if OS/Arch is supported by the package.\n\nError type: `EBADPLATFORM`\n\n### .checkCycle(target, ancestors, cb)\nCheck for cyclic dependencies.\n\nError type: `ECYCLE`\n\n### .checkGit(folder, cb)\nCheck if a folder is a .git folder.\n\nError type: `EISGIT`\n", - "readmeFilename": "README.md", - "gitHead": "056ade7c5e3a6b3c720ca6a743c1b99a0705d29e", - "_id": "npm-install-checks@1.0.2", - "_shasum": "ebba769753fc8551308333ef411920743a6809f6", - "_from": "npm-install-checks@latest" + "gitHead": "05944f95860b0ac3769667551c4b7aa3d3fcdc32", + "_id": "npm-install-checks@1.0.4", + "_shasum": "9757c6f9d4d493c2489465da6d07a8ed416d44c8", + "_from": "npm-install-checks@>=1.0.2-0 <1.1.0-0", + "_npmVersion": "2.0.0-beta.3", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "robertkowalski", + "email": "rok@kowalski.gd" + }, + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "9757c6f9d4d493c2489465da6d07a8ed416d44c8", + "tarball": "http://registry.npmjs.org/npm-install-checks/-/npm-install-checks-1.0.4.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-1.0.4.tgz" } diff --git a/deps/npm/node_modules/npm-package-arg/LICENSE b/deps/npm/node_modules/npm-package-arg/LICENSE new file mode 100644 index 0000000000..05eeeb88c2 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-package-arg/README.md b/deps/npm/node_modules/npm-package-arg/README.md new file mode 100644 index 0000000000..602277a378 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/README.md @@ -0,0 +1,55 @@ +# npm-package-arg + +Parse the things that can be arguments to `npm install` + +Takes an argument like `foo@1.2`, or `foo@user/foo`, or +`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`, and +figures out what type of thing it is. + +## USAGE + +```javascript +var assert = require("assert") +var npa = require("npm-package-arg") + +// Pass in the descriptor, and it'll return an object +var parsed = npa("foo@1.2") + +// Returns an object like: +// { +// name: "foo", // The bit in front of the @ +// type: "range", // the type of descriptor this is +// spec: "1.2" // the specifier for this descriptor +// } + +// Completely unreasonable invalid garbage throws an error +// Make sure you wrap this in a try/catch if you have not +// already sanitized the inputs! +assert.throws(function() { + npa("this is not \0 a valid package name or url") +}) +``` + +For more examples, see the test file. + +## Result Objects + +The objects that are returned by npm-package-arg contain the following +fields: + +* `name` - If known, the `name` field expected in the resulting pkg. +* `type` - One of the following strings: + * `git` - A git repo + * `github` - A github shorthand, like `user/project` + * `tag` - A tagged version, like `"foo@latest"` + * `version` - A specific version number, like `"foo@1.2.3"` + * `range` - A version range, like `"foo@2.x"` + * `local` - A local file or folder path + * `remote` - An http url (presumably to a tgz) +* `spec` - The "thing". URL, the range, git repo, etc. +* `raw` - The original un-modified string that was provided. +* `rawSpec` - The part after the `name@...`, as it was originally + provided. +* `scope` - If a name is something like `@org/module` then the `scope` + field will be set to `org`. If it doesn't have a scoped name, then + scope is `null`. diff --git a/deps/npm/node_modules/npm-package-arg/npa.js b/deps/npm/node_modules/npm-package-arg/npa.js new file mode 100644 index 0000000000..8333c75f44 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/npa.js @@ -0,0 +1,187 @@ +var url = require("url") +var assert = require("assert") +var util = require("util") +var semver = require("semver") +var path = require("path") + +module.exports = npa + +var isWindows = process.platform === "win32" || global.FAKE_WINDOWS +var slashRe = isWindows ? /\\|\// : /\// + +var parseName = /^(?:@([^\/]+?)\/)?([^\/]+?)$/ +var nameAt = /^(@([^\/]+?)\/)?([^\/]+?)@/ +var debug = util.debuglog ? util.debuglog("npa") + : /\bnpa\b/i.test(process.env.NODE_DEBUG || "") + ? function () { + console.error("NPA: " + util.format.apply(util, arguments).split("\n").join("\nNPA: ")) + } : function () {} + +function validName (name) { + if (!name) { + debug("not a name %j", name) + return false + } + var n = name.trim() + if (!n || n.charAt(0) === "." + || !n.match(/^[a-zA-Z0-9]/) + || n.match(/[\/\(\)&\?#\|<>@:%\s\\\*'"!~`]/) + || n.toLowerCase() === "node_modules" + || n !== encodeURIComponent(n) + || n.toLowerCase() === "favicon.ico") { + debug("not a valid name %j", name) + return false + } + return n +} + +function npa (arg) { + assert.equal(typeof arg, "string") + arg = arg.trim() + + var res = new Result + res.raw = arg + res.scope = null + + // See if it's something like foo@... + var nameparse = arg.match(nameAt) + debug("nameparse", nameparse) + if (nameparse && validName(nameparse[3]) && + (!nameparse[2] || validName(nameparse[2]))) { + res.name = (nameparse[1] || "") + nameparse[3] + if (nameparse[2]) + res.scope = "@" + nameparse[2] + arg = arg.substr(nameparse[0].length) + } else { + res.name = null + } + + res.rawSpec = arg + res.spec = arg + + var urlparse = url.parse(arg) + debug("urlparse", urlparse) + + // windows paths look like urls + // don't be fooled! + if (isWindows && urlparse && urlparse.protocol && + urlparse.protocol.match(/^[a-zA-Z]:$/)) { + debug("windows url-ish local path", urlparse) + urlparse = {} + } + + if (urlparse.protocol) { + return parseUrl(res, arg, urlparse) + } + + // parse git stuff + // parse tag/range/local/remote + + if (maybeGitHubShorthand(arg)) { + res.type = "github" + res.spec = arg + return res + } + + // at this point, it's not a url, and not github + // If it's a valid name, and doesn't already have a name, then assume + // $name@"" range + // + // if it's got / chars in it, then assume that it's local. + + if (res.name) { + var version = semver.valid(arg, true) + var range = semver.validRange(arg, true) + // foo@... + if (version) { + res.spec = version + res.type = "version" + } else if (range) { + res.spec = range + res.type = "range" + } else if (slashRe.test(arg)) { + parseLocal(res, arg) + } else { + res.type = "tag" + res.spec = arg + } + } else { + var p = arg.match(parseName) + if (p && validName(p[2]) && + (!p[1] || validName(p[1]))) { + res.type = "range" + res.spec = "*" + res.rawSpec = "" + res.name = arg + if (p[1]) + res.scope = "@" + p[1] + } else { + parseLocal(res, arg) + } + } + + return res +} + +function parseLocal (res, arg) { + // turns out nearly every character is allowed in fs paths + if (/\0/.test(arg)) { + throw new Error("Invalid Path: " + JSON.stringify(arg)) + } + res.type = "local" + res.spec = path.resolve(arg) +} + +function maybeGitHubShorthand (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 + // + // The only way to do this properly would be to shell out to + // git-check-ref-format, and as this is a fast sync function, + // we don't want to do that. Just let git fail if it turns + // out that the commit-ish is invalid. + // GH usernames cannot start with . or - + return /^[^@%\/\s\.-][^@%\/\s]*\/[^@\s\/%]+(?:#.*)?$/.test(arg) +} + +function parseUrl (res, arg, urlparse) { + // check the protocol, and then see if it's git or not + switch (urlparse.protocol) { + case "git:": + case "git+http:": + case "git+https:": + case "git+rsync:": + case "git+ftp:": + case "git+ssh:": + case "git+file:": + res.type = 'git' + res.spec = arg.replace(/^git\+/, '') + break + + case 'http:': + case 'https:': + res.type = 'remote' + res.spec = arg + break + + case 'file:': + res.type = 'local' + res.spec = urlparse.pathname + break; + + default: + throw new Error('Unsupported URL Type: ' + arg) + break + } + + return res +} + + +function Result () { + if (!(this instanceof Result)) return new Result +} +Result.prototype.name = null +Result.prototype.type = null +Result.prototype.spec = null +Result.prototype.raw = null diff --git a/deps/npm/node_modules/npm-package-arg/package.json b/deps/npm/node_modules/npm-package-arg/package.json new file mode 100644 index 0000000000..45604cb086 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/package.json @@ -0,0 +1,38 @@ +{ + "name": "npm-package-arg", + "version": "2.1.2", + "description": "Parse the things that can be arguments to `npm install`", + "main": "npa.js", + "directories": { + "test": "test" + }, + "dependencies": { + "semver": "^2.3.0 || 3.x || 4" + }, + "devDependencies": { + "tap": "^0.4.9" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/npm-package-arg" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/npm-package-arg/issues" + }, + "homepage": "https://github.com/npm/npm-package-arg", + "readme": "# npm-package-arg\n\nParse the things that can be arguments to `npm install`\n\nTakes an argument like `foo@1.2`, or `foo@user/foo`, or\n`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`, and\nfigures out what type of thing it is.\n\n## USAGE\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(\"foo@1.2\")\n\n// Returns an object like:\n// {\n// name: \"foo\", // The bit in front of the @\n// type: \"range\", // the type of descriptor this is\n// spec: \"1.2\" // the specifier for this descriptor\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\nFor more examples, see the test file.\n\n## Result Objects\n\nThe objects that are returned by npm-package-arg contain the following\nfields:\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 * `github` - A github shorthand, like `user/project`\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* `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", + "gitHead": "ebb3c5ee4c362aca5722cf805adf871f86b5c4f2", + "_id": "npm-package-arg@2.1.2", + "_shasum": "14f9be32e203a77977dd8120cf749d0db8c93761", + "_from": "npm-package-arg@>=2.1.2 <2.2.0" +} diff --git a/deps/npm/node_modules/npm-package-arg/test/basic.js b/deps/npm/node_modules/npm-package-arg/test/basic.js new file mode 100644 index 0000000000..3bc984e9d7 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/test/basic.js @@ -0,0 +1,203 @@ +var npa = require("../npa.js") +var path = require("path") + +require("tap").test("basic", function (t) { + t.setMaxListeners(999) + + var tests = { + "foo@1.2": { + name: "foo", + type: "range", + spec: ">=1.2.0-0 <1.3.0-0", + raw: "foo@1.2", + rawSpec: "1.2" + }, + + "@foo/bar": { + raw: "@foo/bar", + name: "@foo/bar", + scope: "@foo", + rawSpec: "", + spec: "*", + type: "range" + }, + + "@foo/bar@": { + raw: "@foo/bar@", + name: "@foo/bar", + scope: "@foo", + rawSpec: "", + spec: "*", + type: "range" + }, + + "@foo/bar@baz": { + raw: "@foo/bar@baz", + name: "@foo/bar", + scope: "@foo", + rawSpec: "baz", + spec: "baz", + type: "tag" + }, + + "@f fo o al/ a d s ;f ": { + raw: "@f fo o al/ a d s ;f", + name: null, + rawSpec: "@f fo o al/ a d s ;f", + spec: path.resolve("@f fo o al/ a d s ;f"), + type: "local" + }, + + "foo@1.2.3": { + name: "foo", + type: "version", + spec: "1.2.3", + raw: "foo@1.2.3" + }, + + "foo@=v1.2.3": { + name: "foo", + type: "version", + spec: "1.2.3", + raw: "foo@=v1.2.3", + rawSpec: "=v1.2.3" + }, + + "git+ssh://git@github.com/user/foo#1.2.3": { + name: null, + type: "git", + spec: "ssh://git@github.com/user/foo#1.2.3", + raw: "git+ssh://git@github.com/user/foo#1.2.3" + }, + + "git+file://path/to/repo#1.2.3": { + name: null, + type: "git", + spec: "file://path/to/repo#1.2.3", + raw: "git+file://path/to/repo#1.2.3" + }, + + "git://github.com/user/foo": { + name: null, + type: "git", + spec: "git://github.com/user/foo", + raw: "git://github.com/user/foo" + }, + + "@foo/bar@git+ssh://github.com/user/foo": { + name: "@foo/bar", + scope: "@foo", + spec: "ssh://github.com/user/foo", + rawSpec: "git+ssh://github.com/user/foo", + raw: "@foo/bar@git+ssh://github.com/user/foo" + }, + + "/path/to/foo": { + name: null, + type: "local", + spec: "/path/to/foo", + raw: "/path/to/foo" + }, + + "file:path/to/foo": { + name: null, + type: "local", + spec: "path/to/foo", + raw: "file:path/to/foo" + }, + + "file:~/path/to/foo": { + name: null, + type: "local", + spec: "~/path/to/foo", + raw: "file:~/path/to/foo" + }, + + "file:../path/to/foo": { + name: null, + type: "local", + spec: "../path/to/foo", + raw: "file:../path/to/foo" + }, + + "file:///path/to/foo": { + name: null, + type: "local", + spec: "/path/to/foo", + raw: "file:///path/to/foo" + }, + + "https://server.com/foo.tgz": { + name: null, + type: "remote", + spec: "https://server.com/foo.tgz", + raw: "https://server.com/foo.tgz" + }, + + "user/foo-js": { + name: null, + type: "github", + spec: "user/foo-js", + raw: "user/foo-js" + }, + + "user/foo-js#bar/baz": { + name: null, + type: "github", + spec: "user/foo-js#bar/baz", + raw: "user/foo-js#bar/baz" + }, + + "user..blerg--/..foo-js# . . . . . some . tags / / /": { + name: null, + type: "github", + spec: "user..blerg--/..foo-js# . . . . . some . tags / / /", + raw: "user..blerg--/..foo-js# . . . . . some . tags / / /" + }, + + "user/foo-js#bar/baz/bin": { + name: null, + type: "github", + spec: "user/foo-js#bar/baz/bin", + raw: "user/foo-js#bar/baz/bin" + }, + + "foo@user/foo-js": { + name: "foo", + type: "github", + spec: "user/foo-js", + raw: "foo@user/foo-js" + }, + + "foo@latest": { + name: "foo", + type: "tag", + spec: "latest", + raw: "foo@latest" + }, + + "foo": { + name: "foo", + type: "range", + spec: "*", + raw: "foo" + } + } + + Object.keys(tests).forEach(function (arg) { + var res = npa(arg) + t.type(res, "Result") + t.has(res, tests[arg]) + }) + + // Completely unreasonable invalid garbage throws an error + t.throws(function() { + npa("this is not a \0 valid package name or url") + }) + + t.throws(function() { + npa("gopher://yea right") + }, "Unsupported URL Type: gopher://yea right") + + t.end() +}) diff --git a/deps/npm/node_modules/npm-package-arg/test/windows.js b/deps/npm/node_modules/npm-package-arg/test/windows.js new file mode 100644 index 0000000000..51629fe075 --- /dev/null +++ b/deps/npm/node_modules/npm-package-arg/test/windows.js @@ -0,0 +1,41 @@ +global.FAKE_WINDOWS = true + +var npa = require("../npa.js") +var test = require("tap").test +var path = require("path") + +var cases = { + "C:\\x\\y\\z": { + raw: 'C:\\x\\y\\z', + scope: null, + name: null, + rawSpec: 'C:\\x\\y\\z', + spec: path.resolve('C:\\x\\y\\z'), + type: 'local' + }, + "foo@C:\\x\\y\\z": { + raw: 'foo@C:\\x\\y\\z', + scope: null, + name: 'foo', + rawSpec: 'C:\\x\\y\\z', + spec: path.resolve('C:\\x\\y\\z'), + type: 'local' + }, + "foo@/foo/bar/baz": { + raw: 'foo@/foo/bar/baz', + scope: null, + name: 'foo', + rawSpec: '/foo/bar/baz', + spec: path.resolve('/foo/bar/baz'), + type: 'local' + } +} + +test("parse a windows path", function (t) { + Object.keys(cases).forEach(function (c) { + var expect = cases[c] + var actual = npa(c) + t.same(actual, expect, c) + }) + t.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/.npmignore b/deps/npm/node_modules/npm-registry-client/.npmignore index 187ab67953..bea2db6203 100644 --- a/deps/npm/node_modules/npm-registry-client/.npmignore +++ b/deps/npm/node_modules/npm-registry-client/.npmignore @@ -1,3 +1,5 @@ test/fixtures/cache node_modules npm-debug.log +.eslintrc +.jshintrc diff --git a/deps/npm/node_modules/npm-registry-client/lib/adduser.js b/deps/npm/node_modules/npm-registry-client/lib/adduser.js index d1fcac8e91..e449c25808 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/adduser.js +++ b/deps/npm/node_modules/npm-registry-client/lib/adduser.js @@ -29,15 +29,13 @@ function adduser (base, username, password, email, cb) { // pluck off any other username/password/token. it needs to be the // same as the user we're becoming now. replace them on error. - var pre = { username: this.conf.get('username') - , password: this.conf.get('_password') - , auth: this.conf.get('_auth') + var c = this.conf.getCredentialsByURI(base) + var pre = { username: c.username + , password: c.password + , email: c.email , token: this.conf.get('_token') } this.conf.del('_token') - this.conf.del('username') - this.conf.del('_auth') - this.conf.del('_password') if (this.couchLogin) { this.couchLogin.token = null } @@ -61,13 +59,15 @@ function adduser (base, username, password, email, cb) { , function (error, data, json, response) { // if it worked, then we just created a new user, and all is well. // but if we're updating a current record, then it'll 409 first - if (error && !this.conf.get('_auth')) { + var c = this.conf.getCredentialsByURI(base) + if (error && !c.auth) { // must be trying to re-auth on a new machine. // use this info as auth - var b = new Buffer(username + ":" + password) - this.conf.set('_auth', b.toString("base64")) - this.conf.set('username', username) - this.conf.set('_password', password) + this.conf.setCredentialsByURI(base, { + username : username, + password : password, + email : email + }) } if (!error || !response || response.statusCode !== 409) { @@ -94,39 +94,43 @@ function adduser (base, username, password, email, cb) { , cb) }.bind(this)) }.bind(this)) -} -function done (cb, pre) { - return function (error, data, json, response) { - if (!error && (!response || response.statusCode === 201)) { - return cb(error, data, json, response) - } - - // there was some kind of error, re-instate previous auth/token/etc. - this.conf.set('_token', pre.token) - if (this.couchLogin) { - this.couchLogin.token = pre.token - if (this.couchLogin.tokenSet) { - this.couchLogin.tokenSet(pre.token) + function done (cb, pre) { + return function (error, data, json, response) { + if (!error && (!response || response.statusCode === 201)) { + return cb(error, data, json, response) + } + + // there was some kind of error, re-instate previous auth/token/etc. + this.conf.set('_token', pre.token) + if (this.couchLogin) { + this.couchLogin.token = pre.token + if (this.couchLogin.tokenSet) { + this.couchLogin.tokenSet(pre.token) + } + } + this.conf.setCredentialsByURI(base, { + username : pre.username, + password : pre.password, + email : pre.email + }) + + this.log.verbose("adduser", "back", [error, data, json]) + if (!error) { + error = new Error( + (response && response.statusCode || "") + " " + + "Could not create user\n" + JSON.stringify(data) + ) } - } - this.conf.set('username', pre.username) - this.conf.set('_password', pre.password) - this.conf.set('_auth', pre.auth) - - this.log.verbose("adduser", "back", [error, data, json]) - if (!error) { - error = new Error( (response && response.statusCode || "") + " "+ - "Could not create user\n"+JSON.stringify(data)) - } - if (response - && (response.statusCode === 401 || response.statusCode === 403)) { - this.log.warn("adduser", "Incorrect username or password\n" - +"You can reset your account by visiting:\n" - +"\n" - +" https://npmjs.org/forgot\n") - } - - return cb(error) - }.bind(this) + + if (response && (response.statusCode === 401 || response.statusCode === 403)) { + this.log.warn("adduser", "Incorrect username or password\n" + + "You can reset your account by visiting:\n" + + "\n" + + " https://npmjs.org/forgot\n") + } + + return cb(error) + }.bind(this) + } } diff --git a/deps/npm/node_modules/npm-registry-client/lib/attempt.js b/deps/npm/node_modules/npm-registry-client/lib/attempt.js new file mode 100644 index 0000000000..0794fdc3bf --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/lib/attempt.js @@ -0,0 +1,22 @@ +var retry = require("retry") + +module.exports = attempt + +function attempt(cb) { + // Tuned to spread 3 attempts over about a minute. + // See formula at . + var operation = retry.operation({ + retries : this.conf.get("fetch-retries") || 2, + factor : this.conf.get("fetch-retry-factor"), + minTimeout : this.conf.get("fetch-retry-mintimeout") || 10000, + maxTimeout : this.conf.get("fetch-retry-maxtimeout") || 60000 + }) + + var client = this + operation.attempt(function (currentAttempt) { + client.log.info("attempt", "registry request try #"+currentAttempt+ + " at "+(new Date()).toLocaleTimeString()) + + cb(operation) + }) +} diff --git a/deps/npm/node_modules/npm-registry-client/lib/authify.js b/deps/npm/node_modules/npm-registry-client/lib/authify.js new file mode 100644 index 0000000000..2b0c7a2a33 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/lib/authify.js @@ -0,0 +1,27 @@ +var url = require("url") + +module.exports = authify + +function authify (authed, parsed, headers) { + var c = this.conf.getCredentialsByURI(url.format(parsed)) + + if (c && c.token) { + this.log.verbose("request", "using bearer token for auth") + headers.authorization = "Bearer " + c.token + + return null + } + + if (authed) { + if (c && c.username && c.password) { + var username = encodeURIComponent(c.username) + var password = encodeURIComponent(c.password) + parsed.auth = username + ":" + password + } + else { + return new Error( + "This request requires auth credentials. Run `npm login` and repeat the request." + ) + } + } +} diff --git a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js b/deps/npm/node_modules/npm-registry-client/lib/deprecate.js index 078968dd32..f5fd597047 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js +++ b/deps/npm/node_modules/npm-registry-client/lib/deprecate.js @@ -4,7 +4,8 @@ var url = require("url") var semver = require("semver") function deprecate (uri, ver, message, cb) { - if (!this.conf.get('username')) { + var c = this.conf.getCredentialsByURI(uri) + if (!(c.token || c.auth)) { return cb(new Error("Must be logged in to deprecate a package")) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/fetch.js b/deps/npm/node_modules/npm-registry-client/lib/fetch.js new file mode 100644 index 0000000000..8dd6b28b07 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/lib/fetch.js @@ -0,0 +1,85 @@ +var assert = require("assert") + , url = require("url") + +var request = require("request") + , once = require("once") + +module.exports = fetch + +function fetch (uri, headers, cb) { + assert(uri, "must pass resource to fetch") + assert(cb, "must pass callback") + + if (!headers) headers = {} + + cb = once(cb) + + var client = this + this.attempt(function (operation) { + makeRequest.call(client, uri, headers, function (er, req) { + if (er) return cb(er) + + req.on("error", function (er) { + if (operation.retry(er)) { + client.log.info("retry", "will retry, error on last attempt: " + er) + } + }) + + req.on("response", function (res) { + client.log.http("fetch", "" + res.statusCode, uri) + + var er + var statusCode = res && res.statusCode + if (statusCode === 200) { + // Work around bug in node v0.10.0 where the CryptoStream + // gets stuck and never starts reading again. + res.resume() + if (process.version === "v0.10.0") unstick(res) + + return cb(null, res) + } + // Only retry on 408, 5xx or no `response`. + else if (statusCode === 408) { + er = new Error("request timed out") + } + else if (statusCode >= 500) { + er = new Error("server error " + statusCode) + } + + if (er && operation.retry(er)) { + client.log.info("retry", "will retry, error on last attempt: " + er) + } + else { + cb(new Error("fetch failed with status code " + statusCode)) + } + }) + }) + }) +} + +function unstick(response) { + response.resume = function (orig) { return function() { + var ret = orig.apply(response, arguments) + if (response.socket.encrypted) response.socket.encrypted.read(0) + return ret + }}(response.resume) +} + +function makeRequest (remote, headers, cb) { + var parsed = url.parse(remote) + this.log.http("fetch", "GET", parsed.href) + + var er = this.authify(this.conf.get("always-auth"), parsed, headers) + if (er) return cb(er) + + var opts = this.initialize( + parsed, + "GET", + "application/x-tar", + headers + ) + // always want to follow redirects for fetch + opts.followRedirect = true + + cb(null, request(opts)) +} diff --git a/deps/npm/node_modules/npm-registry-client/lib/initialize.js b/deps/npm/node_modules/npm-registry-client/lib/initialize.js new file mode 100644 index 0000000000..b6e89ffe95 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/lib/initialize.js @@ -0,0 +1,41 @@ +var crypto = require("crypto") + +var pkg = require("../package.json") + +module.exports = initialize + +function initialize (uri, method, accept, headers) { + if (!this.sessionToken) { + this.sessionToken = crypto.randomBytes(8).toString("hex") + this.log.verbose("request id", this.sessionToken) + } + + var strict = this.conf.get("strict-ssl") + if (strict === undefined) strict = true + + var p = this.conf.get("proxy") + var sp = this.conf.get("https-proxy") || p + + var opts = { + url : uri, + method : method, + headers : headers, + proxy : uri.protocol === "https:" ? sp : p, + localAddress : this.conf.get("local-address"), + strictSSL : strict, + cert : this.conf.get("cert"), + key : this.conf.get("key"), + ca : this.conf.get("ca") + } + + headers.version = this.version || pkg.version + headers.accept = accept + + if (this.refer) headers.referer = this.refer + + headers["npm-session"] = this.sessionToken + headers["user-agent"] = this.conf.get("user-agent") || + "node/" + process.version + + return opts +} diff --git a/deps/npm/node_modules/npm-registry-client/lib/publish.js b/deps/npm/node_modules/npm-registry-client/lib/publish.js index 5504658d33..c3b2f3e1f2 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/publish.js +++ b/deps/npm/node_modules/npm-registry-client/lib/publish.js @@ -5,20 +5,26 @@ var url = require("url") , semver = require("semver") , crypto = require("crypto") , fs = require("fs") + , fixNameField = require("normalize-package-data/lib/fixer.js").fixNameField -function publish (uri, data, tarball, cb) { - var email = this.conf.get('email') - var auth = this.conf.get('_auth') - var username = this.conf.get('username') +function escaped(name) { + return name.replace("/", "%2f") +} - if (!email || !auth || !username) { +function publish (uri, data, tarball, cb) { + var c = this.conf.getCredentialsByURI(uri) + if (!(c.token || (c.auth && c.username && c.email))) { var er = new Error("auth and email required for publishing") er.code = 'ENEEDAUTH' return cb(er) } - if (data.name !== encodeURIComponent(data.name)) - return cb(new Error('invalid name: must be url-safe')) + try { + fixNameField(data, true) + } + catch (er) { + return cb(er) + } var ver = semver.clean(data.version) if (!ver) @@ -30,12 +36,12 @@ function publish (uri, data, tarball, cb) { if (er) return cb(er) fs.readFile(tarball, function(er, tarbuffer) { if (er) return cb(er) - putFirst.call(self, uri, data, tarbuffer, s, username, email, cb) + putFirst.call(self, uri, data, tarbuffer, s, c, cb) }) }) } -function putFirst (registry, data, tarbuffer, stat, username, email, cb) { +function putFirst (registry, data, tarbuffer, stat, creds, cb) { // optimistically try to PUT all in one single atomic thing. // If 409, then GET and merge, try again. // If other error, then fail. @@ -47,15 +53,14 @@ function putFirst (registry, data, tarbuffer, stat, username, email, cb) { , "dist-tags" : {} , versions : {} , readme: data.readme || "" - , maintainers : - [ { name : username - , email : email - } - ] } + if (!creds.token) { + root.maintainers = [{name : creds.username, email : creds.email}] + data.maintainers = JSON.parse(JSON.stringify(root.maintainers)) + } + root.versions[ data.version ] = data - data.maintainers = JSON.parse(JSON.stringify(root.maintainers)) var tag = data.tag || this.conf.get('tag') || "latest" root["dist-tags"][tag] = data.version @@ -70,12 +75,12 @@ function putFirst (registry, data, tarbuffer, stat, username, email, cb) { root._attachments = {} root._attachments[ tbName ] = { - content_type: 'application/octet-stream', - data: tarbuffer.toString('base64'), - length: stat.size - }; + "content_type": "application/octet-stream", + "data": tarbuffer.toString("base64"), + "length": stat.size + } - var fixed = url.resolve(registry, data.name) + var fixed = url.resolve(registry, escaped(data.name)) this.request("PUT", fixed, { body : root }, function (er, parsed, json, res) { var r409 = "must supply latest _rev to update existing package" var r409b = "Document update conflict." @@ -94,8 +99,7 @@ function putFirst (registry, data, tarbuffer, stat, username, email, cb) { return cb(er, parsed, json, res) // let's see what versions are already published. - var getUrl = url.resolve(registry, data.name + "?write=true") - this.request("GET", getUrl, null, function (er, current) { + this.request("GET", fixed + "?write=true", null, function (er, current) { if (er) return cb(er) putNext.call(this, registry, data.version, root, current, cb) @@ -133,7 +137,7 @@ function putNext(registry, newVersion, root, current, cb) { // ignore these case 'maintainers': - break; + break // copy default: @@ -143,7 +147,8 @@ function putNext(registry, newVersion, root, current, cb) { var maint = JSON.parse(JSON.stringify(root.maintainers)) root.versions[newVersion].maintainers = maint - this.request("PUT", url.resolve(registry, root.name), { body : current }, cb) + var uri = url.resolve(registry, escaped(root.name)) + this.request("PUT", uri, { body : current }, cb) } function conflictError (pkgid, version) { diff --git a/deps/npm/node_modules/npm-registry-client/lib/request.js b/deps/npm/node_modules/npm-registry-client/lib/request.js index 7a770a6d22..498b326f28 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/request.js +++ b/deps/npm/node_modules/npm-registry-client/lib/request.js @@ -1,15 +1,13 @@ -module.exports = regRequest - -var url = require("url") +var assert = require("assert") + , url = require("url") , zlib = require("zlib") - , assert = require("assert") - , rm = require("rimraf") , Stream = require("stream").Stream + +var rm = require("rimraf") , request = require("request") - , retry = require("retry") - , crypto = require("crypto") - , pkg = require("../package.json") + , once = require("once") +module.exports = regRequest // npm: means // 1. https @@ -20,59 +18,43 @@ function regRequest (method, uri, options, cb_) { assert(cb_, "must pass callback") options = options || {} - var nofollow = (typeof options.follow === 'boolean' ? !options.follow : false) - var etag = options.etag - var what = options.body var parsed = url.parse(uri) - - var authThis = false - if (parsed.protocol === "npm") { - parsed.protocol = "https" - authThis = true - } - var where = parsed.pathname + var what = options.body + var follow = (typeof options.follow === "boolean" ? options.follow : true) + this.log.verbose("request", "on initialization, where is", where) + if (parsed.search) { where = where + parsed.search parsed.search = "" } parsed.pathname = "/" - this.log.verbose("request", "where is", where) - - var registry = url.format(parsed) - this.log.verbose("request", "registry", registry) - - if (!this.sessionToken) { - this.sessionToken = crypto.randomBytes(8).toString("hex") - this.log.verbose("request id", this.sessionToken) - } + this.log.verbose("request", "after pass 1, where is", where) // Since there are multiple places where an error could occur, // don't let the cb be called more than once. - var errState = null - function cb (er) { - if (errState) return - if (er) errState = er - cb_.apply(null, arguments) - } + var cb = once(cb_) if (where.match(/^\/?favicon.ico/)) { return cb(new Error("favicon.ico isn't a package, it's a picture.")) } var adduserChange = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)\/-rev/ - , adduserNew = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)/ - , nu = where.match(adduserNew) - , uc = where.match(adduserChange) - , alwaysAuth = this.conf.get('always-auth') - , isDel = method === "DELETE" - , isWrite = what || isDel - , authRequired = (authThis || alwaysAuth || isWrite) && !nu || uc || isDel + , isUserChange = where.match(adduserChange) + , adduserNew = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)$/ + , isNewUser = where.match(adduserNew) + , alwaysAuth = this.conf.get("always-auth") + , isDelete = method === "DELETE" + , isWrite = what || isDelete + + if (isUserChange && !isWrite) { + return cb(new Error("trying to change user document without writing(?!)")) + } // resolve to a full url on the registry if (!where.match(/^https?:\/\//)) { - this.log.verbose("url raw", where) + this.log.verbose("request", "url raw", where) var q = where.split("?") where = q.shift() @@ -84,56 +66,44 @@ function regRequest (method, uri, options, cb_) { if (p.match(/^org.couchdb.user/)) { return p.replace(/\//g, encodeURIComponent("/")) } - return encodeURIComponent(p) + return p }).join("/") if (q) where += "?" + q - this.log.verbose("url resolving", [registry, where]) - where = url.resolve(registry, where) - this.log.verbose("url resolved", where) - } - this.log.verbose("request", "where is", where) - var remote = url.parse(where) - , auth = this.conf.get('_auth') + var registry = url.format(parsed) + this.log.verbose("request", "resolving registry", [registry, where]) - if (authRequired && !auth) { - var un = this.conf.get('username') - var pw = this.conf.get('_password') - if (un && pw) - auth = new Buffer(un + ':' + pw).toString('base64') + where = url.resolve(registry, where) + this.log.verbose("request", "after pass 2, where is", where) } - if (authRequired && !auth) { - return cb(new Error( - "This request requires auth credentials. Run `npm login` and repeat the request.")) + var authed + // new users can *not* use auth, because they don't *have* auth yet + if (isNewUser) { + this.log.verbose("request", "new user, so can't send auth") + authed = false } - - if (auth && authRequired) { - // Escape any weird characters that might be in the auth string - // TODO(isaacs) Clean up this awful back and forth mess. - var remoteAuth = new Buffer(auth, "base64").toString("utf8") - remoteAuth = encodeURIComponent(remoteAuth).replace(/%3A/, ":") - remote.auth = remoteAuth + else if (alwaysAuth) { + this.log.verbose("request", "always-auth set; sending authorization") + authed = true + } + else if (isWrite) { + this.log.verbose("request", "sending authorization for write operation") + authed = true + } + else { + // most of the time we don't want to auth + this.log.verbose("request", "no auth needed") + authed = false } - - // Tuned to spread 3 attempts over about a minute. - // See formula at . - var operation = retry.operation({ - retries: this.conf.get('fetch-retries') || 2, - factor: this.conf.get('fetch-retry-factor'), - minTimeout: this.conf.get('fetch-retry-mintimeout') || 10000, - maxTimeout: this.conf.get('fetch-retry-maxtimeout') || 60000 - }) var self = this - operation.attempt(function (currentAttempt) { - self.log.info("trying", "registry request attempt " + currentAttempt - + " at " + (new Date()).toLocaleTimeString()) - makeRequest.call(self, method, remote, where, what, etag, nofollow + this.attempt(function (operation) { + makeRequest.call(self, method, where, what, options.etag, follow, authed , function (er, parsed, raw, response) { if (!er || (er.message && er.message.match(/^SSL Error/))) { if (er) - er.code = 'ESSL' + er.code = "ESSL" return cb(er, parsed, raw, response) } @@ -145,61 +115,47 @@ function regRequest (method, uri, options, cb_) { var statusRetry = !statusCode || timeout || serverError if (er && statusRetry && operation.retry(er)) { self.log.info("retry", "will retry, error on last attempt: " + er) - return + return undefined } if (response) { - this.log.verbose("headers", response.headers) + self.log.verbose("headers", response.headers) if (response.headers["npm-notice"]) { - this.log.warn("notice", response.headers["npm-notice"]) + self.log.warn("notice", response.headers["npm-notice"]) } } cb.apply(null, arguments) - }.bind(this)) - }.bind(this)) + }) + }) } -function makeRequest (method, remote, where, what, etag, nofollow, cb_) { - var cbCalled = false - function cb () { - if (cbCalled) return - cbCalled = true - cb_.apply(null, arguments) - } +function makeRequest (method, where, what, etag, follow, authed, cb_) { + var cb = once(cb_) - var strict = this.conf.get('strict-ssl') - if (strict === undefined) strict = true - var opts = { url: remote - , method: method - , encoding: null // tell request let body be Buffer instance - , ca: this.conf.get('ca') - , localAddress: this.conf.get('local-address') - , cert: this.conf.get('cert') - , key: this.conf.get('key') - , strictSSL: strict } - , headers = opts.headers = {} - if (etag) { - this.log.verbose("etag", etag) - headers[method === "GET" ? "if-none-match" : "if-match"] = etag - } + var parsed = url.parse(where) + var headers = {} - headers['npm-session'] = this.sessionToken - headers.version = this.version || pkg.version + // metadata should be compressed + headers["accept-encoding"] = "gzip" - if (this.refer) { - headers.referer = this.refer - } + var er = this.authify(authed, parsed, headers) + if (er) return cb_(er) - headers.accept = "application/json" - headers['accept-encoding'] = 'gzip' + var opts = this.initialize( + parsed, + method, + "application/json", + headers + ) - headers["user-agent"] = this.conf.get('user-agent') || - 'node/' + process.version + opts.followRedirect = follow + opts.encoding = null // tell request let body be Buffer instance - var p = this.conf.get('proxy') - var sp = this.conf.get('https-proxy') || p - opts.proxy = remote.protocol === "https:" ? sp : p + if (etag) { + this.log.verbose("etag", etag) + headers[method === "GET" ? "if-none-match" : "if-match"] = etag + } - // figure out wth 'what' is + // figure out wth "what" is if (what) { if (Buffer.isBuffer(what) || typeof what === "string") { opts.body = what @@ -214,11 +170,7 @@ function makeRequest (method, remote, where, what, etag, nofollow, cb_) { } } - if (nofollow) { - opts.followRedirect = false - } - - this.log.http(method, remote.href || "/") + this.log.http("request", method, parsed.href || "/") var done = requestDone.call(this, method, where, cb) var req = request(opts, decodeResponseBody(done)) @@ -243,7 +195,7 @@ function decodeResponseBody(cb) { response.socket.destroy() } - if (response.headers['content-encoding'] !== 'gzip') return cb(er, response, data) + if (response.headers["content-encoding"] !== "gzip") return cb(er, response, data) zlib.gunzip(data, function (er, buf) { if (er) return cb(er, response, data) @@ -260,7 +212,7 @@ function requestDone (method, where, cb) { var urlObj = url.parse(where) if (urlObj.auth) - urlObj.auth = '***' + urlObj.auth = "***" this.log.http(response.statusCode, url.format(urlObj)) var parsed @@ -298,16 +250,21 @@ function requestDone (method, where, cb) { if (parsed && parsed.error && response.statusCode >= 400) { var w = url.parse(where).pathname.substr(1) var name - if (!w.match(/^-/) && parsed.error === "not_found") { + if (!w.match(/^-/)) { w = w.split("/") name = w[w.indexOf("_rewrite") + 1] - er = new Error("404 Not Found: "+name) - er.code = "E404" - er.pkgid = name + } + + if (name && parsed.error === "not_found") { + er = new Error("404 Not Found: " + name) } else { er = new Error( parsed.error + " " + (parsed.reason || "") + ": " + w) } + if (name) er.pkgid = name + er.statusCode = response.statusCode + er.code = "E" + er.statusCode + } else if (method !== "HEAD" && method !== "GET") { // invalidate cache // This is irrelevant for commands that do etag caching, but diff --git a/deps/npm/node_modules/npm-registry-client/lib/star.js b/deps/npm/node_modules/npm-registry-client/lib/star.js index c0590f1e2e..97745851ea 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/star.js +++ b/deps/npm/node_modules/npm-registry-client/lib/star.js @@ -2,10 +2,15 @@ module.exports = star function star (uri, starred, cb) { - if (!this.conf.get('username')) return cb(new Error( - "Must be logged in to star/unstar packages")) + var c = this.conf.getCredentialsByURI(uri) + if (c.token) { + return cb(new Error("This operation is unsupported for token-based auth")) + } + else if (!c.auth) { + return cb(new Error("Must be logged in to star/unstar packages")) + } - this.request("GET", uri+"?write=true", null, function (er, fullData) { + this.request("GET", uri + "?write=true", null, function (er, fullData) { if (er) return cb(er) fullData = { _id: fullData._id @@ -14,10 +19,10 @@ function star (uri, starred, cb) { if (starred) { this.log.info("starring", fullData._id) - fullData.users[this.conf.get('username')] = true + fullData.users[c.username] = true this.log.verbose("starring", fullData) } else { - delete fullData.users[this.conf.get('username')] + delete fullData.users[c.username] this.log.info("unstarring", fullData._id) this.log.verbose("unstarring", fullData) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/unpublish.js b/deps/npm/node_modules/npm-registry-client/lib/unpublish.js index 6a4ac8a191..346d537fe6 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/unpublish.js +++ b/deps/npm/node_modules/npm-registry-client/lib/unpublish.js @@ -22,7 +22,7 @@ function unpublish (uri, ver, cb) { // remove all if no version specified if (!ver) { this.log.info("unpublish", "No version specified, removing all") - return this.request("DELETE", uri+'/-rev/'+data._rev, null, cb) + return this.request("DELETE", uri+"/-rev/"+data._rev, null, cb) } var versions = data.versions || {} @@ -72,7 +72,7 @@ function unpublish (uri, ver, cb) { function detacher (uri, data, dist, cb) { return function (er) { if (er) return cb(er) - this.get(url.resolve(uri, data.name), null, function (er, data) { + this.get(escape(uri, data.name), null, function (er, data) { if (er) return cb(er) var tb = url.parse(dist.tarball) @@ -96,10 +96,15 @@ function detach (uri, data, path, rev, cb) { this.log.info("detach", path) return this.request("DELETE", url.resolve(uri, path), null, cb) } - this.get(url.resolve(uri, data.name), null, function (er, data) { + this.get(escape(uri, data.name), null, function (er, data) { rev = data._rev if (!rev) return cb(new Error( "No _rev found in "+data._id)) detach.call(this, data, path, rev, cb) }.bind(this)) } + +function escape (base, name) { + var escaped = name.replace(/\//, "%2f") + return url.resolve(base, escaped) +} diff --git a/deps/npm/node_modules/npm-registry-client/lib/util/nerf-dart.js b/deps/npm/node_modules/npm-registry-client/lib/util/nerf-dart.js new file mode 100644 index 0000000000..3b26a56c65 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/lib/util/nerf-dart.js @@ -0,0 +1,21 @@ +var url = require("url") + +module.exports = toNerfDart + +/** + * Maps a URL to an identifier. + * + * Name courtesy schiffertronix media LLC, a New Jersey corporation + * + * @param {String} uri The URL to be nerfed. + * + * @returns {String} A nerfed URL. + */ +function toNerfDart(uri) { + var parsed = url.parse(uri) + parsed.pathname = "/" + delete parsed.protocol + delete parsed.auth + + return url.format(parsed) +} diff --git a/deps/npm/node_modules/npm-registry-client/lib/whoami.js b/deps/npm/node_modules/npm-registry-client/lib/whoami.js new file mode 100644 index 0000000000..ffa7bd704e --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/lib/whoami.js @@ -0,0 +1,15 @@ +module.exports = whoami + +var url = require("url") + +function whoami (uri, cb) { + if (!this.conf.getCredentialsByURI(uri)) { + return cb(new Error("Must be logged in to see who you are")) + } + + this.request("GET", url.resolve(uri, "whoami"), null, function (er, userdata) { + if (er) return cb(er) + + cb(null, userdata.username) + }) +} diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json index 6d29da9ddf..5de4bd2aa3 100644 --- a/deps/npm/node_modules/npm-registry-client/package.json +++ b/deps/npm/node_modules/npm-registry-client/package.json @@ -6,7 +6,7 @@ }, "name": "npm-registry-client", "description": "Client for the npm registry", - "version": "2.0.7", + "version": "3.2.1", "repository": { "url": "git://github.com/isaacs/npm-registry-client" }, @@ -18,15 +18,18 @@ "chownr": "0", "graceful-fs": "^3.0.0", "mkdirp": "^0.5.0", + "normalize-package-data": "~1.0.1", "npm-cache-filename": "^1.0.0", + "once": "^1.3.0", "request": "2 >=2.25.0", "retry": "0.6.0", - "rimraf": "~2", - "semver": "2 >=2.2.1", - "slide": "~1.1.3", + "rimraf": "2", + "semver": "2 >=2.2.1 || 3.x || 4", + "slide": "^1.1.3", "npmlog": "" }, "devDependencies": { + "concat-stream": "^1.4.6", "tap": "" }, "optionalDependencies": { @@ -35,12 +38,12 @@ "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 options = {timeout: 1000}\n\nclient.get(uri, options, 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 (for the base URL, any path\nwill be ignored). In addition to `http` and `https`, `npm` URLs are allowed.\n`npm` URLs are `https` URLs with the additional restrictions that they will\nalways include authorization credentials, and the response is always registry\nmetadata (and not tarballs or other attachments).\n\n# Configuration\n\nThis program is designed to work with\n[npmconf](https://npmjs.org/package/npmconf), but you can also pass in\na plain-jane object with the appropriate configs, and it'll shim it\nfor you. Any configuration thingie that has get/set/del methods will\nalso be accepted.\n\n* `cache` **Required** {String} Path to the cache folder\n* `always-auth` {Boolean} Auth even for GET requests.\n* `auth` {String} A base64-encoded `username:password`\n* `email` {String} User's email address\n* `tag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `ca` {String} Cerficate signing authority certificates to trust.\n* `cert` {String} Client certificate (PEM encoded). Enable access\n to servers that require client certificates\n* `key` {String} Private key (PEM encoded) for client certificate 'cert'\n* `strict-ssl` {Boolean} Whether or not to be strict with SSL\n certificates. Default = `true`\n* `user-agent` {String} User agent header to send. Default =\n `\"node/{process.version} {process.platform} {process.arch}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `fetch-retries` {Number} Number of times to retry on GET failures.\n Default=2\n* `fetch-retry-factor` {Number} `factor` setting for `node-retry`. Default=10\n* `fetch-retry-mintimeout` {Number} `minTimeout` setting for `node-retry`.\n Default=10000 (10 seconds)\n* `fetch-retry-maxtimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default=60000 (60 seconds)\n* `proxy` {URL} The url to proxy requests through.\n* `https-proxy` {URL} The url to proxy https requests through.\n Defaults to be the same as `proxy` if unset.\n* `_auth` {String} The base64-encoded authorization header.\n* `username` `_password` {String} Username/password to use to generate\n `_auth` if not supplied.\n* `_token` {Object} A token for use with\n [couch-login](https://npmjs.org/package/couch-login)\n\n# client.request(method, uri, options, cb)\n\n* `method` {String} HTTP method\n* `uri` {String} URI pointing to the resource to request\n* `options` {Object} Object containing optional per-request properties.\n * `what` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON.\n * `etag` {String} The cached ETag\n * `follow` {Boolean} Follow 302/301 responses (defaults to true)\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 request to the registry. All the other methods are wrappers around\n`request`.\n\n# client.adduser(base, username, password, email, cb)\n\n* `base` {String} Base registry URL\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `cb` {Function}\n\nAdd a user account to the registry, or verify the credentials.\n\n# client.deprecate(uri, version, message, cb)\n\n* `uri` {String} Full registry URI for the deprecated package\n* `version` {String} Semver version range\n* `message` {String} The message to use as a deprecation warning\n* `cb` {Function}\n\nDeprecate a version of a package in the registry.\n\n# client.bugs(uri, cb)\n\n* `uri` {String} Full registry URI for the package\n* `cb` {Function}\n\nGet the url for bugs of a package\n\n# client.get(uri, options, cb)\n\n* `uri` {String} The complete registry URI to fetch\n* `options` {Object} Object containing optional per-request properties.\n * `timeout` {Number} Duration before the request times out.\n * `follow` {Boolean} Follow 302/301 responses (defaults to true)\n * `staleOk` {Boolean} If there's cached data available, then return that\n to the callback quickly, and update the cache the background.\n\nFetches data from the registry via a GET request, saving it in the cache folder\nwith the ETag.\n\n# client.publish(uri, data, tarball, cb)\n\n* `uri` {String} The registry URI to publish to\n* `data` {Object} Package data\n* `tarball` {String | Stream} Filename or stream of the package tarball\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder. However, it can\naccept a gzipped tar stream or a filename to a tarball.\n\n# client.star(uri, starred, cb)\n\n* `uri` {String} The complete registry URI to star\n* `starred` {Boolean} True to star the package, false to unstar it.\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(base, username, cb)\n\n* `base` {String} The base URL for the registry\n* `username` {String} Name of user to fetch starred packages for.\n* `cb` {Function}\n\nView your own or another user's starred packages.\n\n# client.tag(uri, version, tag, cb)\n\n* `uri` {String} The complete registry URI to tag\n* `version` {String} Version to tag\n* `tag` {String} Tag name to apply\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, [ver], cb)\n\n* `uri` {String} The complete registry URI to unpublish\n* `ver` {String} version to unpublish. Leave blank to unpublish all\n versions.\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.upload(uri, file, [etag], [nofollow], cb)\n\n* `uri` {String} The complete registry URI to upload to\n* `file` {String | Stream} Either the filename or a readable stream\n* `etag` {String} Cache ETag\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `cb` {Function}\n\nUpload an attachment. Mostly used by `client.publish()`.\n", "readmeFilename": "README.md", - "gitHead": "bb534a209f9a36d77aff57cd4318ba3985501360", + "gitHead": "c60d91b1e8dceba21e33ec40eeaf1b0d02cac8c6", "bugs": { "url": "https://github.com/isaacs/npm-registry-client/issues" }, "homepage": "https://github.com/isaacs/npm-registry-client", - "_id": "npm-registry-client@2.0.7", - "_shasum": "97a2cdca5aba753b4b5b334b4ae65669c6641085", - "_from": "npm-registry-client@^2.0.7" + "_id": "npm-registry-client@3.2.1", + "_shasum": "a502a818de273085e8e1a931ff7beac6e3fe2a7a", + "_from": "npm-registry-client@>=3.2.1-0 <3.3.0-0" } diff --git a/deps/npm/node_modules/npm-registry-client/test/bugs.js b/deps/npm/node_modules/npm-registry-client/test/bugs.js index a7336b4a58..799445295d 100644 --- a/deps/npm/node_modules/npm-registry-client/test/bugs.js +++ b/deps/npm/node_modules/npm-registry-client/test/bugs.js @@ -2,13 +2,7 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username : "username", - password : "%1234@asdf%", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) +var client = common.freshClient() tap.test("get the URL for the bugs page on a package", function (t) { server.expect("GET", "/sample/latest", function (req, res) { @@ -23,7 +17,8 @@ tap.test("get the URL for the bugs page on a package", function (t) { }) client.bugs("http://localhost:1337/sample", function (error, info) { - t.notOk(error, "no errors") + t.ifError(error) + t.ok(info.url, "got the URL") t.ok(info.email, "got the email address") diff --git a/deps/npm/node_modules/npm-registry-client/test/deprecate.js b/deps/npm/node_modules/npm-registry-client/test/deprecate.js index 29d33742c7..76a5ba128d 100644 --- a/deps/npm/node_modules/npm-registry-client/test/deprecate.js +++ b/deps/npm/node_modules/npm-registry-client/test/deprecate.js @@ -2,13 +2,13 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username : "username", - password : "password", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "_authToken"] = "not-bad-meaning-bad-but-bad-meaning-wombat" + +var client = common.freshClient(configuration) var cache = require("./fixtures/underscore/cache.json") @@ -57,8 +57,8 @@ tap.test("deprecate a package", function (t) { }) }) - client.deprecate("http://localhost:1337/underscore", VERSION, MESSAGE, function (error, data) { - t.notOk(error, "no errors") + client.deprecate(common.registry + "/underscore", VERSION, MESSAGE, function (er, data) { + t.ifError(er) t.ok(data.deprecated, "was deprecated") t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-404.js b/deps/npm/node_modules/npm-registry-client/test/fetch-404.js new file mode 100644 index 0000000000..2ce3b212b0 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-404.js @@ -0,0 +1,44 @@ +var resolve = require("path").resolve +var createReadStream = require("graceful-fs").createReadStream +var readFileSync = require("graceful-fs").readFileSync + +var tap = require("tap") +var cat = require("concat-stream") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var tgz = resolve(__dirname, "./fixtures/underscore/1.3.3/package.tgz") + +tap.test("basic fetch", function (t) { + server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(200, { + "content-type" : "application/x-tar", + "content-encoding" : "gzip" + }) + + createReadStream(tgz).pipe(res) + }) + + var client = common.freshClient() + client.fetch( + "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", + null, + function (er, res) { + t.ifError(er, "loaded successfully") + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + t.end() + }) + + res.on("error", function (error) { + t.ifError(error, "no errors on stream") + }) + + res.pipe(sink) + } + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-408.js b/deps/npm/node_modules/npm-registry-client/test/fetch-408.js new file mode 100644 index 0000000000..bdd8bf0703 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-408.js @@ -0,0 +1,52 @@ +var resolve = require("path").resolve +var createReadStream = require("graceful-fs").createReadStream +var readFileSync = require("graceful-fs").readFileSync + +var tap = require("tap") +var cat = require("concat-stream") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var tgz = resolve(__dirname, "./fixtures/underscore/1.3.3/package.tgz") + +tap.test("fetch with retry on timeout", function (t) { + server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(408) + res.end() + }) + + server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(200, { + "content-type" : "application/x-tar", + "content-encoding" : "gzip" + }) + + createReadStream(tgz).pipe(res) + }) + + var client = common.freshClient() + client.conf.set("fetch-retry-mintimeout", 100) + client.fetch( + "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", + {}, + function (er, res) { + t.ifError(er, "loaded successfully") + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + t.end() + }) + + res.on("error", function (error) { + t.ifError(error, "no errors on stream") + }) + + res.pipe(sink) + } + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-503.js b/deps/npm/node_modules/npm-registry-client/test/fetch-503.js new file mode 100644 index 0000000000..91cd6754da --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-503.js @@ -0,0 +1,52 @@ +var resolve = require("path").resolve +var createReadStream = require("graceful-fs").createReadStream +var readFileSync = require("graceful-fs").readFileSync + +var tap = require("tap") +var cat = require("concat-stream") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var tgz = resolve(__dirname, "./fixtures/underscore/1.3.3/package.tgz") + +tap.test("fetch with retry on server error", function (t) { + server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(503) + res.end() + }) + + server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(200, { + "content-type" : "application/x-tar", + "content-encoding" : "gzip" + }) + + createReadStream(tgz).pipe(res) + }) + + var client = common.freshClient() + client.conf.set("fetch-retry-mintimeout", 100) + client.fetch( + "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", + {}, + function (er, res) { + t.ifError(er, "loaded successfully") + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + t.end() + }) + + res.on("error", function (error) { + t.ifError(error, "no errors on stream") + }) + + res.pipe(sink) + } + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js b/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js new file mode 100644 index 0000000000..2ce3b212b0 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-basic.js @@ -0,0 +1,44 @@ +var resolve = require("path").resolve +var createReadStream = require("graceful-fs").createReadStream +var readFileSync = require("graceful-fs").readFileSync + +var tap = require("tap") +var cat = require("concat-stream") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var tgz = resolve(__dirname, "./fixtures/underscore/1.3.3/package.tgz") + +tap.test("basic fetch", function (t) { + server.expect("/underscore/-/underscore-1.3.3.tgz", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(200, { + "content-type" : "application/x-tar", + "content-encoding" : "gzip" + }) + + createReadStream(tgz).pipe(res) + }) + + var client = common.freshClient() + client.fetch( + "http://localhost:1337/underscore/-/underscore-1.3.3.tgz", + null, + function (er, res) { + t.ifError(er, "loaded successfully") + + var sink = cat(function (data) { + t.deepEqual(data, readFileSync(tgz)) + t.end() + }) + + res.on("error", function (error) { + t.ifError(error, "no errors on stream") + }) + + res.pipe(sink) + } + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-all.js b/deps/npm/node_modules/npm-registry-client/test/get-all.js index 86978b2670..75570fcbb6 100644 --- a/deps/npm/node_modules/npm-registry-client/test/get-all.js +++ b/deps/npm/node_modules/npm-registry-client/test/get-all.js @@ -10,7 +10,7 @@ tap.test("basic request", function (t) { }) client.get("http://localhost:1337/-/all", null, function (er) { - t.notOk(er, "no error") + t.ifError(er, "no error") t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-basic.js b/deps/npm/node_modules/npm-registry-client/test/get-basic.js index 10c48b0b87..240dc87622 100644 --- a/deps/npm/node_modules/npm-registry-client/test/get-basic.js +++ b/deps/npm/node_modules/npm-registry-client/test/get-basic.js @@ -16,7 +16,11 @@ tap.test("basic request", function (t) { res.json(usroot) }) - t.plan(2) + server.expect("/@bigco%2funderscore", function (req, res) { + res.json(usroot) + }) + + t.plan(3) client.get("http://localhost:1337/underscore/1.3.3", null, function (er, data) { t.deepEqual(data, us) }) @@ -24,4 +28,8 @@ tap.test("basic request", function (t) { client.get("http://localhost:1337/underscore", null, function (er, data) { t.deepEqual(data, usroot) }) + + client.get("http://localhost:1337/@bigco%2funderscore", null, function (er, data) { + t.deepEqual(data, usroot) + }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-error-403.js b/deps/npm/node_modules/npm-registry-client/test/get-error-403.js new file mode 100644 index 0000000000..27406b1680 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/get-error-403.js @@ -0,0 +1,33 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +tap.test("get fails with 403", function (t) { + server.expect("/habanero", function (req, res) { + t.equal(req.method, "GET", "got expected method") + + res.writeHead(403) + res.end("{\"error\":\"get that cat out of the toilet that's gross omg\"}") + }) + + var client = common.freshClient() + client.conf.set("fetch-retry-mintimeout", 100) + client.get( + "http://localhost:1337/habanero", + {}, + function (er) { + t.ok(er, "failed as expected") + + t.equal(er.statusCode, 403, "status code was attached as expected") + t.equal(er.code, "E403", "error code was formatted as expected") + t.equal( + er.message, + "get that cat out of the toilet that's gross omg : habanero", + "got error message" + ) + + t.end() + } + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/lib/common.js b/deps/npm/node_modules/npm-registry-client/test/lib/common.js index f9048c0945..bbf55ca302 100644 --- a/deps/npm/node_modules/npm-registry-client/test/lib/common.js +++ b/deps/npm/node_modules/npm-registry-client/test/lib/common.js @@ -1,16 +1,76 @@ var resolve = require("path").resolve -var server = require('./server.js') -var RC = require('../../') + +var server = require("./server.js") +var RC = require("../../") +var toNerfDart = require("../../lib/util/nerf-dart.js") + +var REGISTRY = "http://localhost:" + server.port module.exports = { + port : server.port, + registry : REGISTRY, freshClient : function freshClient(config) { config = config || {} - config.cache = resolve(__dirname, '../fixtures/cache') - config.registry = 'http://localhost:' + server.port + config.cache = resolve(__dirname, "../fixtures/cache") + config.registry = REGISTRY + var container = { + get: function (k) { return config[k] }, + set: function (k, v) { config[k] = v }, + del: function (k) { delete config[k] }, + getCredentialsByURI: function(uri) { + var nerfed = toNerfDart(uri) + var c = {scope : nerfed} + + if (this.get(nerfed + ":_authToken")) { + c.token = this.get(nerfed + ":_authToken") + // the bearer token is enough, don't confuse things + return c + } + + if (this.get(nerfed + ":_password")) { + c.password = new Buffer(this.get(nerfed + ":_password"), "base64").toString("utf8") + } + + if (this.get(nerfed + ":username")) { + c.username = this.get(nerfed + ":username") + } + + if (this.get(nerfed + ":email")) { + c.email = this.get(nerfed + ":email") + } + + if (c.username && c.password) { + c.auth = new Buffer(c.username + ":" + c.password).toString("base64") + } + + return c + }, + setCredentialsByURI: function (uri, c) { + var nerfed = toNerfDart(uri) + + if (c.token) { + this.set(nerfed + ":_authToken", c.token, "user") + this.del(nerfed + ":_password", "user") + this.del(nerfed + ":username", "user") + this.del(nerfed + ":email", "user") + } + else if (c.username || c.password || c.email) { + this.del(nerfed + ":_authToken", "user") + + var encoded = new Buffer(c.password, "utf8").toString("base64") + this.set(nerfed + ":_password", encoded, "user") + this.set(nerfed + ":username", c.username, "user") + this.set(nerfed + ":email", c.email, "user") + } + else { + throw new Error("No credentials to set.") + } + } + } - var client = new RC(config) + var client = new RC(container) server.log = client.log - client.log.level = 'silent' + client.log.level = "silent" return client } diff --git a/deps/npm/node_modules/npm-registry-client/test/lib/server.js b/deps/npm/node_modules/npm-registry-client/test/lib/server.js index b195d9a9b3..37cfae0417 100644 --- a/deps/npm/node_modules/npm-registry-client/test/lib/server.js +++ b/deps/npm/node_modules/npm-registry-client/test/lib/server.js @@ -14,7 +14,7 @@ function handler (req, res) { req.connection.setTimeout(1000) // If we got authorization, make sure it's the right password. - if (req.headers.authorization) { + if (req.headers.authorization && req.headers.authorization.match(/^Basic/)) { var auth = req.headers.authorization.replace(/^Basic /, "") auth = new Buffer(auth, "base64").toString("utf8") assert.equal(auth, "username:%1234@asdf%") diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js b/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js new file mode 100644 index 0000000000..97838ca44d --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/publish-again-scoped.js @@ -0,0 +1,82 @@ +var tap = require("tap") +var fs = require("fs") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "username"] = "username" +configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") +configuration[nerfed + "email"] = "i@izs.me" + +var client = common.freshClient(configuration) + +tap.test("publish again", function (t) { + // not really a tarball, but doesn't matter + var tarball = require.resolve("../package.json") + var pd = fs.readFileSync(tarball, "base64") + var pkg = require("../package.json") + var lastTime = null + + server.expect("/@npm%2fnpm-registry-client", function (req, res) { + t.equal(req.method, "PUT") + var b = "" + req.setEncoding("utf8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function () { + var o = lastTime = JSON.parse(b) + t.equal(o._id, "@npm/npm-registry-client") + t.equal(o["dist-tags"].latest, pkg.version) + t.has(o.versions[pkg.version], pkg) + t.same(o.maintainers, [ { name: "username", email: "i@izs.me" } ]) + var att = o._attachments[ pkg.name + "-" + pkg.version + ".tgz" ] + t.same(att.data, pd) + res.statusCode = 409 + res.json({reason: "must supply latest _rev to update existing package"}) + }) + }) + + server.expect("/@npm%2fnpm-registry-client?write=true", function (req, res) { + t.equal(req.method, "GET") + t.ok(lastTime) + for (var i in lastTime.versions) { + var v = lastTime.versions[i] + delete lastTime.versions[i] + lastTime.versions["0.0.2"] = v + lastTime["dist-tags"] = { latest: "0.0.2" } + } + lastTime._rev = "asdf" + res.json(lastTime) + }) + + server.expect("/@npm%2fnpm-registry-client", function (req, res) { + t.equal(req.method, "PUT") + t.ok(lastTime) + + var b = "" + req.setEncoding("utf8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function() { + var o = JSON.parse(b) + t.equal(o._rev, "asdf") + t.deepEqual(o.versions["0.0.2"], o.versions[pkg.version]) + res.statusCode = 201 + res.json({created: true}) + }) + }) + + pkg.name = "@npm/npm-registry-client" + client.publish("http://localhost:1337/", pkg, tarball, function (er, data) { + if (er) throw er + t.deepEqual(data, { created: true }) + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-again.js b/deps/npm/node_modules/npm-registry-client/test/publish-again.js index 6d286fb7eb..39c368fd35 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-again.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-again.js @@ -3,16 +3,23 @@ var fs = require("fs") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username: "username", - password: "%1234@asdf%", - email: "i@izs.me", - _auth: new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth": true -}) + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "username"] = "username" +configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") +configuration[nerfed + "email"] = "i@izs.me" + +var client = common.freshClient(configuration) tap.test("publish again", function (t) { + // not really a tarball, but doesn't matter + var tarball = require.resolve("../package.json") + var pd = fs.readFileSync(tarball, "base64") + var pkg = require("../package.json") var lastTime = null + server.expect("/npm-registry-client", function (req, res) { t.equal(req.method, "PUT") var b = "" @@ -66,11 +73,6 @@ tap.test("publish again", function (t) { }) }) - - // not really a tarball, but doesn't matter - var tarball = require.resolve("../package.json") - var pd = fs.readFileSync(tarball, "base64") - var pkg = require("../package.json") client.publish("http://localhost:1337/", pkg, tarball, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js b/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js new file mode 100644 index 0000000000..e1bb7dd1ee --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/publish-scoped-auth-token.js @@ -0,0 +1,52 @@ +var tap = require("tap") +var crypto = require("crypto") +var fs = require("fs") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "_authToken"] = "of-glad-tidings" + +var client = common.freshClient(configuration) + +tap.test("publish", function (t) { + // not really a tarball, but doesn't matter + var tarball = require.resolve("../package.json") + var pd = fs.readFileSync(tarball, "base64") + var pkg = require("../package.json") + pkg.name = "@npm/npm-registry-client" + + server.expect("/@npm%2fnpm-registry-client", function (req, res) { + t.equal(req.method, "PUT") + t.equal(req.headers.authorization, "Bearer of-glad-tidings") + + var b = "" + req.setEncoding("utf8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function () { + var o = JSON.parse(b) + t.equal(o._id, "@npm/npm-registry-client") + t.equal(o["dist-tags"].latest, pkg.version) + t.has(o.versions[pkg.version], pkg) + t.same(o.maintainers, o.versions[pkg.version].maintainers) + var att = o._attachments[ pkg.name + "-" + pkg.version + ".tgz" ] + t.same(att.data, pd) + var hash = crypto.createHash("sha1").update(pd, "base64").digest("hex") + t.equal(o.versions[pkg.version].dist.shasum, hash) + res.statusCode = 201 + res.json({created:true}) + }) + }) + + client.publish(common.registry, pkg, tarball, function (er, data) { + if (er) throw er + t.deepEqual(data, { created: true }) + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js b/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js new file mode 100644 index 0000000000..b5dea3649c --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/publish-scoped.js @@ -0,0 +1,57 @@ +var tap = require("tap") +var crypto = require("crypto") +var fs = require("fs") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "username"] = "username" +configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") +configuration[nerfed + "email"] = "ogd@aoaioxxysz.net" + +var client = common.freshClient(configuration) + +var _auth = new Buffer("username:%1234@asdf%").toString("base64") + +tap.test("publish", function (t) { + // not really a tarball, but doesn't matter + var tarball = require.resolve("../package.json") + var pd = fs.readFileSync(tarball, "base64") + var pkg = require("../package.json") + pkg.name = "@npm/npm-registry-client" + + server.expect("/@npm%2fnpm-registry-client", function (req, res) { + t.equal(req.method, "PUT") + t.equal(req.headers.authorization, "Basic " + _auth) + + var b = "" + req.setEncoding("utf8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function () { + var o = JSON.parse(b) + t.equal(o._id, "@npm/npm-registry-client") + t.equal(o["dist-tags"].latest, pkg.version) + t.has(o.versions[pkg.version], pkg) + t.same(o.maintainers, [ { name: "username", email: "ogd@aoaioxxysz.net" } ]) + t.same(o.maintainers, o.versions[pkg.version].maintainers) + var att = o._attachments[ pkg.name + "-" + pkg.version + ".tgz" ] + t.same(att.data, pd) + var hash = crypto.createHash("sha1").update(pd, "base64").digest("hex") + t.equal(o.versions[pkg.version].dist.shasum, hash) + res.statusCode = 201 + res.json({created:true}) + }) + }) + + client.publish(common.registry, pkg, tarball, function (er, data) { + if (er) throw er + t.deepEqual(data, { created: true }) + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/publish.js b/deps/npm/node_modules/npm-registry-client/test/publish.js index c34bf6c534..2d76dfae20 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish.js @@ -4,16 +4,22 @@ var fs = require("fs") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username: "username", - password: "%1234@asdf%", - email: "i@izs.me", - _auth: new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth": true -}) +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "username"] = "username" +configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") +configuration[nerfed + "email"] = "i@izs.me" + +var client = common.freshClient(configuration) tap.test("publish", function (t) { + // not really a tarball, but doesn't matter + var tarball = require.resolve("../package.json") + var pd = fs.readFileSync(tarball, "base64") + var pkg = require("../package.json") + server.expect("/npm-registry-client", function (req, res) { t.equal(req.method, "PUT") var b = "" @@ -38,10 +44,6 @@ tap.test("publish", function (t) { }) }) - // not really a tarball, but doesn't matter - var tarball = require.resolve("../package.json") - var pd = fs.readFileSync(tarball, "base64") - var pkg = require("../package.json") client.publish("http://localhost:1337/", pkg, tarball, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) diff --git a/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js b/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js index 79c2e8dc02..1085bfaca2 100644 --- a/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js +++ b/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js @@ -19,10 +19,12 @@ var pkg = { zlib.gzip(JSON.stringify(pkg), function (err, pkgGzip) { tap.test("request gzip package content", function (t) { + t.ifError(err, "example package compressed") + server.expect("GET", "/some-package-gzip/1.2.3", function (req, res) { res.statusCode = 200 - res.setHeader("Content-Encoding", "gzip"); - res.setHeader("Content-Type", "application/json"); + res.setHeader("Content-Encoding", "gzip") + res.setHeader("Content-Type", "application/json") res.end(pkgGzip) }) @@ -46,4 +48,4 @@ zlib.gzip(JSON.stringify(pkg), function (err, pkgGzip) { t.end() }) }) -}); +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/star.js b/deps/npm/node_modules/npm-registry-client/test/star.js index 0e43e10d76..43c8888ef2 100644 --- a/deps/npm/node_modules/npm-registry-client/test/star.js +++ b/deps/npm/node_modules/npm-registry-client/test/star.js @@ -2,18 +2,20 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username : "username", - password : "%1234@asdf%", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) - -var cache = require("./fixtures/underscore/cache.json") var DEP_USER = "username" +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "username"] = DEP_USER +configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") +configuration[nerfed + "email"] = "i@izs.me" + +var client = common.freshClient(configuration) + +var cache = require("./fixtures/underscore/cache.json") + tap.test("star a package", function (t) { server.expect("GET", "/underscore?write=true", function (req, res) { t.equal(req.method, "GET") @@ -52,7 +54,7 @@ tap.test("star a package", function (t) { }) client.star("http://localhost:1337/underscore", true, function (error, data) { - t.notOk(error, "no errors") + t.ifError(error, "no errors") t.ok(data.starred, "was starred") t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/stars.js b/deps/npm/node_modules/npm-registry-client/test/stars.js index ae1ddbb49d..28f8a98d76 100644 --- a/deps/npm/node_modules/npm-registry-client/test/stars.js +++ b/deps/npm/node_modules/npm-registry-client/test/stars.js @@ -2,13 +2,7 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username : "username", - password : "%1234@asdf%", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) +var client = common.freshClient() var users = [ "benjamincoe", @@ -24,7 +18,7 @@ tap.test("get the URL for the bugs page on a package", function (t) { }) client.stars("http://localhost:1337/", "sample", function (error, info) { - t.notOk(error, "no errors") + t.ifError(error, "no errors") t.deepEqual(info, users, "got the list of users") t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/tag.js b/deps/npm/node_modules/npm-registry-client/test/tag.js index 216ac6c520..7551569307 100644 --- a/deps/npm/node_modules/npm-registry-client/test/tag.js +++ b/deps/npm/node_modules/npm-registry-client/test/tag.js @@ -2,13 +2,15 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username : "username", - password : "%1234@asdf%", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "username"] = "username" +configuration[nerfed + "_password"] = new Buffer("%1234@asdf%").toString("base64") +configuration[nerfed + "email"] = "i@izs.me" + +var client = common.freshClient(configuration) tap.test("tag a package", function (t) { server.expect("PUT", "/underscore/not-lodash", function (req, res) { @@ -31,7 +33,7 @@ tap.test("tag a package", function (t) { }) client.tag("http://localhost:1337/underscore", {"1.3.2":{}}, "not-lodash", function (error, data) { - t.notOk(error, "no errors") + t.ifError(error, "no errors") t.ok(data.tagged, "was tagged") t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js b/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js new file mode 100644 index 0000000000..0e5cb8606d --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/unpublish-scoped.js @@ -0,0 +1,59 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "_authToken"] = "of-glad-tidings" + +var client = common.freshClient(configuration) + +var cache = require("./fixtures/@npm/npm-registry-client/cache.json") + +var REV = "/-rev/213-0a1049cf56172b7d9a1184742c6477b9" +var VERSION = "3.0.6" + +tap.test("unpublish a package", function (t) { + server.expect("GET", "/@npm%2fnpm-registry-client?write=true", function (req, res) { + t.equal(req.method, "GET") + + res.json(cache) + }) + + server.expect("PUT", "/@npm%2fnpm-registry-client" + REV, function (req, res) { + t.equal(req.method, "PUT") + + var b = "" + req.setEncoding("utf-8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function () { + var updated = JSON.parse(b) + t.notOk(updated.versions[VERSION]) + }) + + res.json(cache) + }) + + server.expect("GET", "/@npm%2fnpm-registry-client", function (req, res) { + t.equal(req.method, "GET") + + res.json(cache) + }) + + server.expect("DELETE", "/@npm%2fnpm-registry-client/-/@npm%2fnpm-registry-client-" + VERSION + ".tgz" + REV, function (req, res) { + t.equal(req.method, "DELETE") + + res.json({unpublished:true}) + }) + + client.unpublish("http://localhost:1337/@npm%2fnpm-registry-client", VERSION, function (error) { + t.ifError(error, "no errors") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/unpublish.js b/deps/npm/node_modules/npm-registry-client/test/unpublish.js index 47c5617c8a..7a60431fac 100644 --- a/deps/npm/node_modules/npm-registry-client/test/unpublish.js +++ b/deps/npm/node_modules/npm-registry-client/test/unpublish.js @@ -2,13 +2,13 @@ var tap = require("tap") var server = require("./lib/server.js") var common = require("./lib/common.js") -var client = common.freshClient({ - username : "username", - password : "%1234@asdf%", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "_authToken"] = "of-glad-tidings" + +var client = common.freshClient(configuration) var cache = require("./fixtures/underscore/cache.json") @@ -52,7 +52,7 @@ tap.test("unpublish a package", function (t) { }) client.unpublish("http://localhost:1337/underscore", VERSION, function (error) { - t.notOk(error, "no errors") + t.ifError(error, "no errors") t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/upload.js b/deps/npm/node_modules/npm-registry-client/test/upload.js index 434ad36f01..fa197e3681 100644 --- a/deps/npm/node_modules/npm-registry-client/test/upload.js +++ b/deps/npm/node_modules/npm-registry-client/test/upload.js @@ -7,13 +7,12 @@ var server = require("./lib/server.js") var cache = require("./fixtures/underscore/cache.json") -var client = common.freshClient({ - username : "username", - password : "%1234@asdf%", - email : "ogd@aoaioxxysz.net", - _auth : new Buffer("username:%1234@asdf%").toString("base64"), - "always-auth" : true -}) +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "_authToken"] = "of-glad-tidings" + +var client = common.freshClient(configuration) function OneA() { Readable.call(this) @@ -22,7 +21,7 @@ function OneA() { } inherits(OneA, Readable) -tap.test("unpublish a package", function (t) { +tap.test("uploading a tarball", function (t) { server.expect("PUT", "/underscore", function (req, res) { t.equal(req.method, "PUT") @@ -30,7 +29,7 @@ tap.test("unpublish a package", function (t) { }) client.upload("http://localhost:1337/underscore", new OneA(), "daedabeefa", true, function (error) { - t.notOk(error, "no errors") + t.ifError(error, "no errors") t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/whoami.js b/deps/npm/node_modules/npm-registry-client/test/whoami.js new file mode 100644 index 0000000000..f9c817684f --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/whoami.js @@ -0,0 +1,30 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") + +var nerfed = "//localhost:" + server.port + "/:" + +var configuration = {} +configuration[nerfed + "_authToken"] = "not-bad-meaning-bad-but-bad-meaning-wombat" + +var client = common.freshClient(configuration) + +var WHOIAM = "wombat" + +tap.test("whoami", function (t) { + server.expect("GET", "/whoami", function (req, res) { + t.equal(req.method, "GET") + // only available for token-based auth for now + t.equal(req.headers.authorization, "Bearer not-bad-meaning-bad-but-bad-meaning-wombat") + + res.json({username : WHOIAM}) + }) + + client.whoami(common.registry, function (error, wombat) { + t.ifError(error, "no errors") + t.equal(wombat, WHOIAM, "im a wombat") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/npmconf/.npmignore b/deps/npm/node_modules/npmconf/.npmignore index baa471ca80..485007791f 100644 --- a/deps/npm/node_modules/npmconf/.npmignore +++ b/deps/npm/node_modules/npmconf/.npmignore @@ -1 +1,3 @@ /test/fixtures/userconfig-with-gc +.eslintrc +.jshintrc diff --git a/deps/npm/node_modules/npmconf/LICENSE b/deps/npm/node_modules/npmconf/LICENSE index 19129e315f..0c44ae716d 100644 --- a/deps/npm/node_modules/npmconf/LICENSE +++ b/deps/npm/node_modules/npmconf/LICENSE @@ -1,15 +1,27 @@ -The ISC License +Copyright (c) Isaac Z. Schlueter ("Author") +All rights reserved. -Copyright (c) Isaac Z. Schlueter and Contributors +The BSD License -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/deps/npm/node_modules/npmconf/config-defs.js b/deps/npm/node_modules/npmconf/config-defs.js index 31522fb643..b0b4acf22d 100644 --- a/deps/npm/node_modules/npmconf/config-defs.js +++ b/deps/npm/node_modules/npmconf/config-defs.js @@ -16,7 +16,7 @@ try { } catch (er) { var util = require("util") log = { warn: function (m) { - console.warn(m + util.format.apply(util, [].slice.call(arguments, 1))) + console.warn(m + ' ' + util.format.apply(util, [].slice.call(arguments, 1))) } } } @@ -40,6 +40,12 @@ function validateSemver (data, k, val) { data[k] = semver.valid(val) } +function validateTag (data, k, val) { + val = ('' + val).trim() + if (!val || semver.validRange(val)) return false + data[k] = val +} + function validateStream (data, k, val) { if (!(val instanceof Stream)) return false data[k] = val @@ -49,6 +55,10 @@ nopt.typeDefs.semver = { type: semver, validate: validateSemver } nopt.typeDefs.Octal = { type: Octal, validate: validateOctal } nopt.typeDefs.Stream = { type: Stream, validate: validateStream } +// Don't let --tag=1.2.3 ever be a thing +var tag = {} +nopt.typeDefs.tag = { type: tag, validate: validateTag } + nopt.invalidHandler = function (k, val, type) { log.warn("invalid config", k + "=" + JSON.stringify(val)) @@ -58,6 +68,9 @@ nopt.invalidHandler = function (k, val, type) { } switch (type) { + case tag: + log.warn("invalid config", "Tag must not be a SemVer range") + break case Octal: log.warn("invalid config", "Must be octal number, starting with 0") break @@ -137,7 +150,6 @@ Object.defineProperty(exports, "defaults", {get: function () { , description : true , dev : false , editor : osenv.editor() - , email: "" , "engine-strict": false , force : false @@ -159,6 +171,7 @@ Object.defineProperty(exports, "defaults", {get: function () { , "init.author.name" : "" , "init.author.email" : "" , "init.author.url" : "" + , "init.version": "1.0.0" , "init.license": "ISC" , json: false , key: null @@ -192,6 +205,7 @@ Object.defineProperty(exports, "defaults", {get: function () { , "save-exact" : false , "save-optional" : false , "save-prefix": "^" + , scope : "" , searchopts: "" , searchexclude: null , searchsort: "name" @@ -210,7 +224,6 @@ Object.defineProperty(exports, "defaults", {get: function () { || process.getuid() !== 0 , usage : false , user : process.platform === "win32" ? 0 : "nobody" - , username : "" , userconfig : path.resolve(home, ".npmrc") , umask: process.umask ? process.umask() : parseInt("022", 8) , version : false @@ -239,7 +252,6 @@ exports.types = , description : Boolean , dev : Boolean , editor : String - , email: [null, String] , "engine-strict": Boolean , force : Boolean , "fetch-retries": Number @@ -260,13 +272,14 @@ exports.types = , "init.author.email" : String , "init.author.url" : ["", url] , "init.license": String + , "init.version": semver , json: Boolean , key: [null, String] , link: Boolean // local-address must be listed as an IP for a local network interface // must be IPv4 due to node bug , "local-address" : getLocalAddresses() - , loglevel : ["silent","win","error","warn","http","info","verbose","silly"] + , loglevel : ["silent","error","warn","http","info","verbose","silly"] , logstream : Stream , long : Boolean , message: String @@ -288,6 +301,7 @@ exports.types = , "save-exact" : Boolean , "save-optional" : Boolean , "save-prefix": String + , scope : String , searchopts : String , searchexclude: [null, String] , searchsort: [ "name", "-name" @@ -300,20 +314,18 @@ exports.types = , "sign-git-tag": Boolean , spin: ["always", Boolean] , "strict-ssl": Boolean - , tag : String + , tag : tag , tmp : path , unicode : Boolean , "unsafe-perm" : Boolean , usage : Boolean , user : [Number, String] - , username : String , userconfig : path , umask: Octal , version : Boolean , versions : Boolean , viewer: String , _exit : Boolean - , _password: String } function getLocalAddresses() { @@ -365,4 +377,5 @@ exports.shorthands = , y : ["--yes"] , n : ["--no-yes"] , B : ["--save-bundle"] + , C : ["--prefix"] } diff --git a/deps/npm/node_modules/npmconf/lib/get-credentials-by-uri.js b/deps/npm/node_modules/npmconf/lib/get-credentials-by-uri.js new file mode 100644 index 0000000000..6fb8f31707 --- /dev/null +++ b/deps/npm/node_modules/npmconf/lib/get-credentials-by-uri.js @@ -0,0 +1,57 @@ +var assert = require("assert") + +var toNerfDart = require("./nerf-dart.js") + +module.exports = getCredentialsByURI + +function getCredentialsByURI (uri) { + assert(uri && typeof uri === "string", "registry URL is required") + var nerfed = toNerfDart(uri) + var defnerf = toNerfDart(this.get("registry")) + + var c = {scope : nerfed} + + if (this.get(nerfed + ":_authToken")) { + c.token = this.get(nerfed + ":_authToken") + // the bearer token is enough, don't confuse things + return c + } + + // Handle the old-style _auth= style for the default + // registry, if set. + // + // XXX(isaacs): Remove when npm 1.4 is no longer relevant + var authDef = this.get("_auth") + var userDef = this.get("username") + var passDef = this.get("_password") + if (authDef && !(userDef && passDef)) { + authDef = new Buffer(authDef, "base64").toString() + authDef = authDef.split(":") + userDef = authDef.shift() + passDef = authDef.join(":") + } + + if (this.get(nerfed + ":_password")) { + c.password = new Buffer(this.get(nerfed + ":_password"), "base64").toString("utf8") + } else if (nerfed === defnerf && passDef) { + c.password = passDef + } + + if (this.get(nerfed + ":username")) { + c.username = this.get(nerfed + ":username") + } else if (nerfed === defnerf && userDef) { + c.username = userDef + } + + if (this.get(nerfed + ":email")) { + c.email = this.get(nerfed + ":email") + } else if (this.get("email")) { + c.email = this.get("email") + } + + if (c.username && c.password) { + c.auth = new Buffer(c.username + ":" + c.password).toString("base64") + } + + return c +} diff --git a/deps/npm/node_modules/npmconf/lib/nerf-dart.js b/deps/npm/node_modules/npmconf/lib/nerf-dart.js new file mode 100644 index 0000000000..3b26a56c65 --- /dev/null +++ b/deps/npm/node_modules/npmconf/lib/nerf-dart.js @@ -0,0 +1,21 @@ +var url = require("url") + +module.exports = toNerfDart + +/** + * Maps a URL to an identifier. + * + * Name courtesy schiffertronix media LLC, a New Jersey corporation + * + * @param {String} uri The URL to be nerfed. + * + * @returns {String} A nerfed URL. + */ +function toNerfDart(uri) { + var parsed = url.parse(uri) + parsed.pathname = "/" + delete parsed.protocol + delete parsed.auth + + return url.format(parsed) +} diff --git a/deps/npm/node_modules/npmconf/lib/set-credentials-by-uri.js b/deps/npm/node_modules/npmconf/lib/set-credentials-by-uri.js new file mode 100644 index 0000000000..2fa0d19e36 --- /dev/null +++ b/deps/npm/node_modules/npmconf/lib/set-credentials-by-uri.js @@ -0,0 +1,34 @@ +var assert = require("assert") + +var toNerfDart = require("./nerf-dart.js") + +module.exports = setCredentialsByURI + +function setCredentialsByURI (uri, c) { + assert(uri && typeof uri === "string", "registry URL is required") + assert(c && typeof c === "object", "credentials are required") + + var nerfed = toNerfDart(uri) + + if (c.token) { + this.set(nerfed + ":_authToken", c.token, "user") + this.del(nerfed + ":_password", "user") + this.del(nerfed + ":username", "user") + this.del(nerfed + ":email", "user") + } + else if (c.username || c.password || c.email) { + assert(c.username, "must include username") + assert(c.password, "must include password") + assert(c.email, "must include email address") + + this.del(nerfed + ":_authToken", "user") + + var encoded = new Buffer(c.password, "utf8").toString("base64") + this.set(nerfed + ":_password", encoded, "user") + this.set(nerfed + ":username", c.username, "user") + this.set(nerfed + ":email", c.email, "user") + } + else { + throw new Error("No credentials to set.") + } +} diff --git a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json index 2dff2917c0..391d876d2f 100644 --- a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json +++ b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json @@ -29,7 +29,7 @@ "homepage": "https://github.com/isaacs/proto-list", "_id": "proto-list@1.2.3", "_shasum": "6235554a1bca1f0d15e3ca12ca7329d5def42bd9", - "_from": "proto-list@~1.2.1", + "_from": "proto-list@>=1.2.1-0 <1.3.0-0", "_npmVersion": "1.4.14", "_npmUser": { "name": "isaacs", @@ -46,6 +46,5 @@ "tarball": "http://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz" } diff --git a/deps/npm/node_modules/npmconf/node_modules/config-chain/package.json b/deps/npm/node_modules/npmconf/node_modules/config-chain/package.json index c59f5ceeb6..bec4626e6d 100644 --- a/deps/npm/node_modules/npmconf/node_modules/config-chain/package.json +++ b/deps/npm/node_modules/npmconf/node_modules/config-chain/package.json @@ -32,7 +32,7 @@ "shasum": "0943d0b7227213a20d4eaff4434f4a1c0a052cad", "tarball": "http://registry.npmjs.org/config-chain/-/config-chain-1.1.8.tgz" }, - "_from": "config-chain@~1.1.8", + "_from": "config-chain@>=1.1.8-0 <1.2.0-0", "_npmVersion": "1.3.6", "_npmUser": { "name": "dominictarr", diff --git a/deps/npm/node_modules/npmconf/npmconf.js b/deps/npm/node_modules/npmconf/npmconf.js index a17705447a..7607b50f82 100644 --- a/deps/npm/node_modules/npmconf/npmconf.js +++ b/deps/npm/node_modules/npmconf/npmconf.js @@ -10,7 +10,6 @@ var nopt = require('nopt') var ini = require('ini') var Octal = configDefs.Octal var mkdirp = require('mkdirp') -var path = require('path') exports.load = load exports.Conf = Conf @@ -181,7 +180,7 @@ function load_(builtin, rc, cli, cb) { finalize() } - function finalize(er, cadata) { + function finalize(er) { if (er) { return cb(er) } @@ -217,6 +216,8 @@ Conf.prototype.loadCAFile = require('./lib/load-cafile.js') Conf.prototype.loadUid = require('./lib/load-uid.js') Conf.prototype.setUser = require('./lib/set-user.js') Conf.prototype.findPrefix = require('./lib/find-prefix.js') +Conf.prototype.getCredentialsByURI = require('./lib/get-credentials-by-uri.js') +Conf.prototype.setCredentialsByURI = require('./lib/set-credentials-by-uri.js') Conf.prototype.loadExtras = function(cb) { this.setUser(function(er) { @@ -235,7 +236,7 @@ Conf.prototype.save = function (where, cb) { var target = this.sources[where] if (!target || !(target.path || target.source) || !target.data) { if (where !== 'builtin') - var er = new Error('bad save target: '+where) + var er = new Error('bad save target: ' + where) if (cb) { process.nextTick(cb.bind(null, er)) return this @@ -252,28 +253,13 @@ Conf.prototype.save = function (where, cb) { return this } - var data = target.data - - if (typeof data._password === 'string' && - typeof data.username === 'string') { - var auth = data.username + ':' + data._password - data = Object.keys(data).reduce(function (c, k) { - if (k === 'username' || k === '_password') - return c - c[k] = data[k] - return c - }, { _auth: new Buffer(auth, 'utf8').toString('base64') }) - delete data.username - delete data._password - } - - data = ini.stringify(data) + var data = ini.stringify(target.data) then = then.bind(this) done = done.bind(this) this._saving ++ - var mode = where === 'user' ? 0600 : 0666 + var mode = where === 'user' ? "0600" : "0666" if (!data.trim()) { fs.unlink(target.path, function (er) { // ignore the possible error (e.g. the file doesn't exist) @@ -338,13 +324,6 @@ Conf.prototype.add = function (data, marker) { Object.keys(data).forEach(function (k) { data[k] = parseField(data[k], k) }) - if (Object.prototype.hasOwnProperty.call(data, '_auth')) { - var auth = new Buffer(data._auth, 'base64').toString('utf8').split(':') - var username = auth.shift() - var password = auth.join(':') - data.username = username - data._password = password - } return CC.prototype.add.call(this, data, marker) } @@ -367,7 +346,7 @@ Conf.prototype.addEnv = function (env) { return CC.prototype.addEnv.call(this, '', conf, 'env') } -function parseField (f, k, emptyIsFalse) { +function parseField (f, k) { if (typeof f !== 'string' && !(f instanceof String)) return f @@ -415,7 +394,7 @@ function envReplace (f) { // replace any ${ENV} values with the appropriate environ. var envExpr = /(\\*)\$\{([^}]+)\}/g - return f.replace(envExpr, function (orig, esc, name, i, s) { + return f.replace(envExpr, function (orig, esc, name) { esc = esc.length && esc.length % 2 if (esc) return orig @@ -427,7 +406,7 @@ function envReplace (f) { function validate (cl) { // warn about invalid configs at every level. - cl.list.forEach(function (conf, level) { + cl.list.forEach(function (conf) { nopt.clean(conf, configDefs.types) }) diff --git a/deps/npm/node_modules/npmconf/package.json b/deps/npm/node_modules/npmconf/package.json index 55daab66e1..2699e90b83 100644 --- a/deps/npm/node_modules/npmconf/package.json +++ b/deps/npm/node_modules/npmconf/package.json @@ -1,6 +1,6 @@ { "name": "npmconf", - "version": "1.1.8", + "version": "2.0.9", "description": "The config thing npm uses", "main": "npmconf.js", "directories": { @@ -14,7 +14,7 @@ "nopt": "~3.0.1", "once": "~1.3.0", "osenv": "^0.1.0", - "semver": "2", + "semver": "2 || 3 || 4", "uid-number": "0.0.5" }, "devDependencies": { @@ -39,15 +39,33 @@ "email": "i@izs.me", "url": "http://blog.izs.me" }, - "license": "ISC", - "readme": "# npmconf\n\nThe config thing npm uses\n\nIf you are interested in interacting with the config settings that npm\nuses, then use this module.\n\nHowever, if you are writing a new Node.js program, and want\nconfiguration functionality similar to what npm has, but for your\nown thing, then I'd recommend using [rc](https://github.com/dominictarr/rc),\nwhich is probably what you want.\n\nIf I were to do it all over again, that's what I'd do for npm. But,\nalas, there are many systems depending on many of the particulars of\nnpm's configuration setup, so it's not worth the cost of changing.\n\n## USAGE\n\n```javascript\nvar npmconf = require('npmconf')\n\n// pass in the cli options that you read from the cli\n// or whatever top-level configs you want npm to use for now.\nnpmconf.load({some:'configs'}, function (er, conf) {\n // do stuff with conf\n conf.get('some', 'cli') // 'configs'\n conf.get('username') // 'joebobwhatevers'\n conf.set('foo', 'bar', 'user')\n conf.save('user', function (er) {\n // foo = bar is now saved to ~/.npmrc or wherever\n })\n})\n```\n", - "readmeFilename": "README.md", - "gitHead": "98e8ed0e2a307470f8db14d2727a165d8524b567", + "license": "BSD", + "gitHead": "1f07a91b86f3bbba00967d7079dc6a456e746734", "bugs": { "url": "https://github.com/isaacs/npmconf/issues" }, "homepage": "https://github.com/isaacs/npmconf", - "_id": "npmconf@1.1.8", - "_shasum": "350e3d7a4da8e4958dfd0391c81e9a750b01cde2", - "_from": "npmconf@^1.1.8" + "_id": "npmconf@2.0.9", + "_shasum": "5c87e5fb308104eceeca781e3d9115d216351ef2", + "_from": "npmconf@>=2.0.8-0 <2.1.0-0", + "_npmVersion": "2.0.0-beta.3", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "dist": { + "shasum": "5c87e5fb308104eceeca781e3d9115d216351ef2", + "tarball": "http://registry.npmjs.org/npmconf/-/npmconf-2.0.9.tgz" + }, + "_resolved": "https://registry.npmjs.org/npmconf/-/npmconf-2.0.9.tgz" } diff --git a/deps/npm/node_modules/npmconf/test/00-setup.js b/deps/npm/node_modules/npmconf/test/00-setup.js index d009e81eb6..3f5109f043 100644 --- a/deps/npm/node_modules/npmconf/test/00-setup.js +++ b/deps/npm/node_modules/npmconf/test/00-setup.js @@ -3,6 +3,30 @@ var userconfigSrc = path.resolve(__dirname, 'fixtures', 'userconfig') exports.userconfig = userconfigSrc + '-with-gc' exports.globalconfig = path.resolve(__dirname, 'fixtures', 'globalconfig') exports.builtin = path.resolve(__dirname, 'fixtures', 'builtin') +exports.ucData = + { globalconfig: exports.globalconfig, + email: 'i@izs.me', + 'env-thing': 'asdf', + 'init.author.name': 'Isaac Z. Schlueter', + 'init.author.email': 'i@izs.me', + 'init.author.url': 'http://blog.izs.me/', + 'init.version': '1.2.3', + 'proprietary-attribs': false, + 'npm:publishtest': true, + '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', + 'npm-www:nocache': '1', + nodedir: '/Users/isaacs/dev/js/node-v0.8', + 'sign-git-tag': true, + message: 'v%s', + 'strict-ssl': false, + 'tmp': process.env.HOME + '/.tmp', + _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', + _token: + { AuthSession: 'yabba-dabba-doodle', + version: '1', + expires: '1345001053415', + path: '/', + httponly: true } } // set the userconfig in the env // unset anything else that npm might be trying to foist on us diff --git a/deps/npm/node_modules/npmconf/test/basic.js b/deps/npm/node_modules/npmconf/test/basic.js index 29d708b3a6..e3a684f947 100644 --- a/deps/npm/node_modules/npmconf/test/basic.js +++ b/deps/npm/node_modules/npmconf/test/basic.js @@ -5,32 +5,7 @@ var path = require('path') var projectData = {} -var ucData = - { globalconfig: common.globalconfig, - email: 'i@izs.me', - 'env-thing': 'asdf', - 'init.author.name': 'Isaac Z. Schlueter', - 'init.author.email': 'i@izs.me', - 'init.author.url': 'http://blog.izs.me/', - 'proprietary-attribs': false, - 'npm:publishtest': true, - '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', - _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - 'npm-www:nocache': '1', - nodedir: '/Users/isaacs/dev/js/node-v0.8', - 'sign-git-tag': true, - message: 'v%s', - 'strict-ssl': false, - 'tmp': process.env.HOME + '/.tmp', - username : "username", - _password : "password", - _token: - { AuthSession: 'yabba-dabba-doodle', - version: '1', - expires: '1345001053415', - path: '/', - httponly: true } } - +var ucData = common.ucData var envData = common.envData var envDataFix = common.envDataFix diff --git a/deps/npm/node_modules/npmconf/test/builtin.js b/deps/npm/node_modules/npmconf/test/builtin.js index 15cb9083aa..c94de8abdc 100644 --- a/deps/npm/node_modules/npmconf/test/builtin.js +++ b/deps/npm/node_modules/npmconf/test/builtin.js @@ -3,31 +3,7 @@ var npmconf = require('../npmconf.js') var common = require('./00-setup.js') var path = require('path') -var ucData = - { globalconfig: common.globalconfig, - email: 'i@izs.me', - 'env-thing': 'asdf', - 'init.author.name': 'Isaac Z. Schlueter', - 'init.author.email': 'i@izs.me', - 'init.author.url': 'http://blog.izs.me/', - 'proprietary-attribs': false, - 'npm:publishtest': true, - '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', - _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - 'npm-www:nocache': '1', - nodedir: '/Users/isaacs/dev/js/node-v0.8', - 'sign-git-tag': true, - message: 'v%s', - 'strict-ssl': false, - 'tmp': process.env.HOME + '/.tmp', - username : "username", - _password : "password", - _token: - { AuthSession: 'yabba-dabba-doodle', - version: '1', - expires: '1345001053415', - path: '/', - httponly: true } } +var ucData = common.ucData var envData = common.envData var envDataFix = common.envDataFix diff --git a/deps/npm/node_modules/npmconf/test/credentials.js b/deps/npm/node_modules/npmconf/test/credentials.js new file mode 100644 index 0000000000..85632f9f11 --- /dev/null +++ b/deps/npm/node_modules/npmconf/test/credentials.js @@ -0,0 +1,166 @@ +var test = require("tap").test + +var npmconf = require("../npmconf.js") +var common = require("./00-setup.js") + +var URI = "https://registry.lvh.me:8661/" + +test("getting scope with no credentials set", function (t) { + npmconf.load({}, function (er, conf) { + t.ifError(er, "configuration loaded") + + var basic = conf.getCredentialsByURI(URI) + t.equal(basic.scope, "//registry.lvh.me:8661/", "nerfed URL extracted") + + t.end() + }) +}) + +test("trying to set credentials with no URI", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.throws(function () { + conf.setCredentialsByURI() + }, "enforced missing URI") + + t.end() + }) +}) + +test("set with missing credentials object", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.throws(function () { + conf.setCredentialsByURI(URI) + }, "enforced missing credentials") + + t.end() + }) +}) + +test("set with empty credentials object", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.throws(function () { + conf.setCredentialsByURI(URI, {}) + }, "enforced missing credentials") + + t.end() + }) +}) + +test("set with token", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + t.doesNotThrow(function () { + conf.setCredentialsByURI(URI, {token : "simple-token"}) + }, "needs only token") + + var expected = { + scope : "//registry.lvh.me:8661/", + token : "simple-token" + } + + t.same(conf.getCredentialsByURI(URI), expected, "got bearer token and scope") + + t.end() + }) +}) + +test("set with missing username", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + password : "password", + email : "ogd@aoaioxxysz.net" + } + + t.throws(function () { + conf.setCredentialsByURI(URI, credentials) + }, "enforced missing email") + + t.end() + }) +}) + +test("set with missing password", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + username : "username", + email : "ogd@aoaioxxysz.net" + } + + t.throws(function () { + conf.setCredentialsByURI(URI, credentials) + }, "enforced missing email") + + t.end() + }) +}) + +test("set with missing email", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + username : "username", + password : "password" + } + + t.throws(function () { + conf.setCredentialsByURI(URI, credentials) + }, "enforced missing email") + + t.end() + }) +}) + +test("set with old-style credentials", function (t) { + npmconf.load(common.builtin, function (er, conf) { + t.ifError(er, "configuration loaded") + + var credentials = { + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net" + } + + t.doesNotThrow(function () { + conf.setCredentialsByURI(URI, credentials) + }, "requires all of username, password, and email") + + var expected = { + scope : "//registry.lvh.me:8661/", + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net", + auth : "dXNlcm5hbWU6cGFzc3dvcmQ=" + } + + t.same(conf.getCredentialsByURI(URI), expected, "got credentials") + + t.end() + }) +}) + +test("get old-style credentials for default registry", function (t) { + npmconf.load(common.builtin, function (er, conf) { + var actual = conf.getCredentialsByURI(conf.get("registry")) + var expected = { + scope: '//registry.npmjs.org/', + password: 'password', + username: 'username', + email: 'i@izs.me', + auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=' + } + t.same(actual, expected) + t.end() + }) +}) diff --git a/deps/npm/node_modules/npmconf/test/fixtures/userconfig b/deps/npm/node_modules/npmconf/test/fixtures/userconfig index bda1eb82ae..d600c0664e 100644 --- a/deps/npm/node_modules/npmconf/test/fixtures/userconfig +++ b/deps/npm/node_modules/npmconf/test/fixtures/userconfig @@ -3,16 +3,17 @@ env-thing = ${random_env_var} init.author.name = Isaac Z. Schlueter init.author.email = i@izs.me init.author.url = http://blog.izs.me/ +init.version = 1.2.3 proprietary-attribs = false npm:publishtest = true _npmjs.org:couch = https://admin:password@localhost:5984/registry -_auth = dXNlcm5hbWU6cGFzc3dvcmQ= npm-www:nocache = 1 nodedir = /Users/isaacs/dev/js/node-v0.8 sign-git-tag = true message = v%s strict-ssl = false tmp = ~/.tmp +_auth = dXNlcm5hbWU6cGFzc3dvcmQ= [_token] AuthSession = yabba-dabba-doodle diff --git a/deps/npm/node_modules/npmconf/test/project.js b/deps/npm/node_modules/npmconf/test/project.js index fa21e43d22..d9a0bdbcc5 100644 --- a/deps/npm/node_modules/npmconf/test/project.js +++ b/deps/npm/node_modules/npmconf/test/project.js @@ -7,32 +7,7 @@ var projectRc = path.resolve(fix, '.npmrc') var projectData = { just: 'testing' } -var ucData = - { globalconfig: common.globalconfig, - email: 'i@izs.me', - 'env-thing': 'asdf', - 'init.author.name': 'Isaac Z. Schlueter', - 'init.author.email': 'i@izs.me', - 'init.author.url': 'http://blog.izs.me/', - 'proprietary-attribs': false, - 'npm:publishtest': true, - '_npmjs.org:couch': 'https://admin:password@localhost:5984/registry', - _auth: 'dXNlcm5hbWU6cGFzc3dvcmQ=', - 'npm-www:nocache': '1', - nodedir: '/Users/isaacs/dev/js/node-v0.8', - 'sign-git-tag': true, - message: 'v%s', - 'strict-ssl': false, - 'tmp': process.env.HOME + '/.tmp', - username : "username", - _password : "password", - _token: - { AuthSession: 'yabba-dabba-doodle', - version: '1', - expires: '1345001053415', - path: '/', - httponly: true } } - +var ucData = common.ucData var envData = common.envData var envDataFix = common.envDataFix diff --git a/deps/npm/node_modules/npmconf/test/save.js b/deps/npm/node_modules/npmconf/test/save.js index 64b114449e..0d2f1978f9 100644 --- a/deps/npm/node_modules/npmconf/test/save.js +++ b/deps/npm/node_modules/npmconf/test/save.js @@ -10,16 +10,15 @@ var expectConf = 'init.author.name = Isaac Z. Schlueter', 'init.author.email = i@izs.me', 'init.author.url = http://blog.izs.me/', + 'init.version = 1.2.3', 'proprietary-attribs = false', 'npm:publishtest = true', '_npmjs.org:couch = https://admin:password@localhost:5984/registry', - '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', 'npm-www:nocache = 1', 'sign-git-tag = false', 'message = v%s', 'strict-ssl = false', - 'username = username', - '_password = password', + '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', '', '[_token]', 'AuthSession = yabba-dabba-doodle', @@ -35,14 +34,15 @@ var expectFile = 'init.author.name = Isaac Z. Schlueter', 'init.author.email = i@izs.me', 'init.author.url = http://blog.izs.me/', + 'init.version = 1.2.3', 'proprietary-attribs = false', 'npm:publishtest = true', '_npmjs.org:couch = https://admin:password@localhost:5984/registry', - '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', 'npm-www:nocache = 1', 'sign-git-tag = false', 'message = v%s', 'strict-ssl = false', + '_auth = dXNlcm5hbWU6cGFzc3dvcmQ=', '', '[_token]', 'AuthSession = yabba-dabba-doodle', diff --git a/deps/npm/node_modules/npmconf/test/semver-tag.js b/deps/npm/node_modules/npmconf/test/semver-tag.js new file mode 100644 index 0000000000..b0ce27f1b3 --- /dev/null +++ b/deps/npm/node_modules/npmconf/test/semver-tag.js @@ -0,0 +1,65 @@ +var test = require('tap').test +var npmconf = require('../npmconf.js') +var common = require('./00-setup.js') +var path = require('path') + +var ucData = common.ucData + +var envData = common.envData +var envDataFix = common.envDataFix + +var gcData = { 'package-config:foo': 'boo' } + +var biData = { 'builtin-config': true } + +var cli = { tag: 'v2.x' } + +var projectData = {} + +var expectList = +[ cli, + envDataFix, + projectData, + ucData, + gcData, + biData ] + + +var expectSources = +{ cli: { data: cli }, + env: + { data: envDataFix, + source: envData, + prefix: '' }, + project: + { path: path.resolve(__dirname, '..', '.npmrc'), + type: 'ini', + data: projectData }, + user: + { path: common.userconfig, + type: 'ini', + data: ucData }, + global: + { path: common.globalconfig, + type: 'ini', + data: gcData }, + builtin: { data: biData } } + +test('tag cannot be a SemVer', function (t) { + var messages = [] + console.warn = function (m) { + messages.push(m) + } + + var expect = [ + 'invalid config tag="v2.x"', + 'invalid config Tag must not be a SemVer range' + ] + + npmconf.load(cli, common.builtin, function (er, conf) { + if (er) throw er + t.equal(conf.get('tag'), 'latest') + t.same(messages, expect) + t.end() + }) +}) diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/LICENSE b/deps/npm/node_modules/read-installed/node_modules/debuglog/LICENSE new file mode 100644 index 0000000000..a3187cc100 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/debuglog/LICENSE @@ -0,0 +1,19 @@ +Copyright Joyent, Inc. and other Node contributors. All rights reserved. + +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. diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/README.md b/deps/npm/node_modules/read-installed/node_modules/debuglog/README.md new file mode 100644 index 0000000000..dc6fccecc3 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/debuglog/README.md @@ -0,0 +1,40 @@ +# debuglog - backport of util.debuglog() from node v0.11 + +To facilitate using the `util.debuglog()` function that will be available when +node v0.12 is released now, this is a copy extracted from the source. + +## require('debuglog') + +Return `util.debuglog`, if it exists, otherwise it will return an internal copy +of the implementation from node v0.11. + +## debuglog(section) + +* `section` {String} The section of the program to be debugged +* Returns: {Function} The logging function + +This is used to create a function which conditionally writes to stderr +based on the existence of a `NODE_DEBUG` environment variable. If the +`section` name appears in that environment variable, then the returned +function will be similar to `console.error()`. If not, then the +returned function is a no-op. + +For example: + +```javascript +var debuglog = util.debuglog('foo'); + +var bar = 123; +debuglog('hello from foo [%d]', bar); +``` + +If this program is run with `NODE_DEBUG=foo` in the environment, then +it will output something like: + + FOO 3245: hello from foo [123] + +where `3245` is the process id. If it is not run with that +environment variable set, then it will not print anything. + +You may separate multiple `NODE_DEBUG` environment variables with a +comma. For example, `NODE_DEBUG=fs,net,tls`. diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/debuglog.js b/deps/npm/node_modules/read-installed/node_modules/debuglog/debuglog.js new file mode 100644 index 0000000000..748fd72a1a --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/debuglog/debuglog.js @@ -0,0 +1,22 @@ +var util = require('util'); + +module.exports = (util && util.debuglog) || debuglog; + +var debugs = {}; +var debugEnviron = process.env.NODE_DEBUG || ''; + +function debuglog(set) { + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = util.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json b/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json new file mode 100644 index 0000000000..3966625621 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json @@ -0,0 +1,45 @@ +{ + "name": "debuglog", + "version": "1.0.1", + "description": "backport of util.debuglog from node v0.11", + "license": "MIT", + "main": "debuglog.js", + "repository": { + "type": "git", + "url": "https://github.com/sam-github/node-debuglog.git" + }, + "author": { + "name": "Sam Roberts", + "email": "sam@strongloop.com" + }, + "engines": { + "node": "*" + }, + "browser": { + "util": false + }, + "bugs": { + "url": "https://github.com/sam-github/node-debuglog/issues" + }, + "homepage": "https://github.com/sam-github/node-debuglog", + "_id": "debuglog@1.0.1", + "dist": { + "shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", + "tarball": "http://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" + }, + "_from": "debuglog@>=1.0.1-0 <2.0.0-0", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "octet", + "email": "sam@strongloop.com" + }, + "maintainers": [ + { + "name": "octet", + "email": "sam@strongloop.com" + } + ], + "directories": {}, + "_shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", + "_resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" +} diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/LICENSE b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/LICENSE new file mode 100644 index 0000000000..19129e315f --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/README.md b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/README.md new file mode 100644 index 0000000000..ade57a186d --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/README.md @@ -0,0 +1,17 @@ +# readdir-scoped-modules + +Like `fs.readdir` but handling `@org/module` dirs as if they were +a single entry. + +Used by npm. + +## USAGE + +```javascript +var readdir = require('readdir-scoped-modules') + +readdir('node_modules', function (er, entries) { + // entries will be something like + // ['a', '@org/foo', '@org/bar'] +}) +``` diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json new file mode 100644 index 0000000000..84b91e75a5 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json @@ -0,0 +1,54 @@ +{ + "name": "readdir-scoped-modules", + "version": "1.0.0", + "description": "Like `fs.readdir` but handling `@org/module` dirs as if they were a single entry.", + "main": "readdir.js", + "directories": { + "test": "test" + }, + "dependencies": { + "debuglog": "^1.0.1", + "dezalgo": "^1.0.0", + "once": "^1.3.0" + }, + "devDependencies": { + "tap": "0.4" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/npm/readdir-scoped-modules" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/readdir-scoped-modules/issues" + }, + "homepage": "https://github.com/npm/readdir-scoped-modules", + "gitHead": "35a4a7a2325d12ed25ed322cd61f976b740f7fb7", + "_id": "readdir-scoped-modules@1.0.0", + "_shasum": "e939de969b38b3e7dfaa14fbcfe7a2fd15a4ea37", + "_from": "readdir-scoped-modules@>=1.0.0-0 <2.0.0-0", + "_npmVersion": "2.0.0-alpha.6.0", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "e939de969b38b3e7dfaa14fbcfe7a2fd15a4ea37", + "tarball": "http://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.0.tgz" + }, + "_resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.0.tgz" +} diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js new file mode 100644 index 0000000000..91978a739d --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js @@ -0,0 +1,71 @@ +var fs = require ('fs') +var dz = require ('dezalgo') +var once = require ('once') +var path = require ('path') +var debug = require ('debuglog') ('rds') + +module . exports = readdir + +function readdir (dir, cb) { + fs . readdir (dir, function (er, kids) { + if (er) + return cb (er) + + debug ('dir=%j, kids=%j', dir, kids) + readScopes (dir, kids, function (er, data) { + if (er) + return cb (er) + + // Sort for bonus consistency points + data = data . sort (function (a, b) { + return a > b ? 1 : -1 + }) + + return cb (null, data) + }) + }) +} + +// Turn [ 'a', '@scope' ] into +// ['a', '@scope/foo', '@scope/bar'] +function readScopes (root, kids, cb) { + var scopes = kids . filter (function (kid) { + return kid . charAt (0) === '@' + }) + + kids = kids . filter (function (kid) { + return kid . charAt (0) !== '@' + }) + + debug ('scopes=%j', scopes) + + if (scopes . length === 0) + dz (cb) (null, kids) // prevent maybe-sync zalgo release + + cb = once (cb) + var l = scopes . length + scopes . forEach (function (scope) { + var scopedir = path . resolve (root, scope) + debug ('root=%j scope=%j scopedir=%j', root, scope, scopedir) + fs . readdir (scopedir, then . bind (null, scope)) + }) + + function then (scope, er, scopekids) { + if (er) + return cb (er) + + // XXX: Not sure how old this node bug is. Maybe superstition? + scopekids = scopekids . filter (function (scopekid) { + return !(scopekid === '.' || scopekid === '..' || !scopekid) + }) + + kids . push . apply (kids, scopekids . map (function (scopekid) { + return scope + '/' + scopekid + })) + + debug ('scope=%j scopekids=%j kids=%j', scope, scopekids, kids) + + if (--l === 0) + cb (null, kids) + } +} diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/basic.js b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/basic.js new file mode 100644 index 0000000000..715c40d584 --- /dev/null +++ b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/basic.js @@ -0,0 +1,14 @@ +var test = require ('tap') . test +var readdir = require ('../readdir.js') + +test ('basic', function (t) { + // should not get {a,b}/{x,y}, but SHOULD get @org/ and @scope children + var expect = [ '@org/x', '@org/y', '@scope/x', '@scope/y', 'a', 'b' ] + + readdir (__dirname + '/fixtures', function (er, kids) { + if (er) + throw er + t.same(kids, expect) + t.end() + }) +}) diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep b/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json b/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json index 96f5a3f51b..0bab48d329 100644 --- a/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json +++ b/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json @@ -22,7 +22,7 @@ "shasum": "bb703b79480293ddcdcfb3c6a9fea20f483415bc", "tarball": "http://registry.npmjs.org/util-extend/-/util-extend-1.0.1.tgz" }, - "_from": "util-extend@^1.0.1", + "_from": "util-extend@>=1.0.1-0 <2.0.0-0", "_npmVersion": "1.3.4", "_npmUser": { "name": "isaacs", diff --git a/deps/npm/node_modules/read-installed/package.json b/deps/npm/node_modules/read-installed/package.json index de958a544e..2c50225534 100644 --- a/deps/npm/node_modules/read-installed/package.json +++ b/deps/npm/node_modules/read-installed/package.json @@ -1,7 +1,7 @@ { "name": "read-installed", "description": "Read all the installed packages in a folder, and return a tree structure with all the data.", - "version": "2.0.5", + "version": "3.1.3", "repository": { "type": "git", "url": "git://github.com/isaacs/read-installed" @@ -11,8 +11,10 @@ "test": "tap ./test/*.js" }, "dependencies": { + "debuglog": "^1.0.1", "read-package-json": "1", - "semver": "2", + "readdir-scoped-modules": "^1.0.0", + "semver": "2 || 3 || 4", "slide": "~1.1.3", "util-extend": "^1.0.1", "graceful-fs": "2 || 3" @@ -27,16 +29,37 @@ }, "license": "ISC", "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", "tap": "~0.4.8" }, - "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": "2595631e4d3cbd64b26cee63dc3b5ce9f53e3533", + "gitHead": "50e45af7581b1a879c62146fafbfa1b92842f7df", "bugs": { "url": "https://github.com/isaacs/read-installed/issues" }, "homepage": "https://github.com/isaacs/read-installed", - "_id": "read-installed@2.0.5", - "_shasum": "761eda1fd2dc322f8e77844a8bf1ddedbcfc754b", - "_from": "read-installed@latest" + "_id": "read-installed@3.1.3", + "_shasum": "c09092a13c2117f22842cad16804f3b059129d11", + "_from": "read-installed@>=3.1.2-0 <3.2.0-0", + "_npmVersion": "2.0.0-beta.3", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "dist": { + "shasum": "c09092a13c2117f22842cad16804f3b059129d11", + "tarball": "http://registry.npmjs.org/read-installed/-/read-installed-3.1.3.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/read-installed/-/read-installed-3.1.3.tgz" } diff --git a/deps/npm/node_modules/read-installed/read-installed.js b/deps/npm/node_modules/read-installed/read-installed.js index 9b5a479622..a92ed3fbee 100644 --- a/deps/npm/node_modules/read-installed/read-installed.js +++ b/deps/npm/node_modules/read-installed/read-installed.js @@ -101,6 +101,10 @@ var url = require("url") var util = require("util") var extend = require("util-extend") +var debug = require("debuglog")("read-installed") + +var readdir = require("readdir-scoped-modules") + module.exports = readInstalled function readInstalled (folder, opts, cb) { @@ -120,25 +124,29 @@ function readInstalled (folder, opts, cb) { opts.log = function () {} opts.dev = !!opts.dev + opts.realpathSeen = {} + opts.findUnmetSeen = [] + readInstalled_(folder, null, null, null, 0, opts, function (er, obj) { if (er) return cb(er) // now obj has all the installed things, where they're installed // figure out the inheritance links, now that the object is built. resolveInheritance(obj, opts) - markExtraneous(obj) + obj.root = true + unmarkExtraneous(obj, opts) cb(null, obj) }) } -var rpSeen = {} function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) { var installed , obj , real , link + , realpathSeen = opts.realpathSeen - fs.readdir(path.resolve(folder, "node_modules"), function (er, i) { + readdir(path.resolve(folder, "node_modules"), function (er, i) { // error indicates that nothing is installed here if (er) i = [] installed = i.filter(function (f) { return f.charAt(0) !== "." }) @@ -161,7 +169,7 @@ function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) { return next(er) } fs.realpath(folder, function (er, rp) { - //console.error("realpath(%j) = %j", folder, rp) + debug("realpath(%j) = %j", folder, rp) real = rp if (st.isSymbolicLink()) link = rp next(er) @@ -176,10 +184,10 @@ function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) { errState = er return cb(null, []) } - //console.error('next', installed, obj && typeof obj, name, real) + debug('next', installed, obj && typeof obj, name, real) if (!installed || !obj || !real || called) return called = true - if (rpSeen[real]) return cb(null, rpSeen[real]) + if (realpathSeen[real]) return cb(null, realpathSeen[real]) if (obj === true) { obj = {dependencies:{}, path:folder} installed.forEach(function (i) { obj.dependencies[i] = "*" }) @@ -188,6 +196,9 @@ function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) { obj.realName = name || obj.name obj.dependencies = obj.dependencies || {} + // At this point, figure out what dependencies we NEED to get met + obj._dependencies = copy(obj.dependencies) + // "foo":"http://blah" and "foo":"latest" are always presumed valid if (reqver && semver.validRange(reqver, true) @@ -195,21 +206,17 @@ function readInstalled_ (folder, parent, name, reqver, depth, opts, cb) { obj.invalid = true } - if (parent) { - var deps = parent.dependencies || {} - var inDeps = name in deps - var devDeps = parent.devDependencies || {} - var inDev = opts.dev && (name in devDeps) - if (!inDeps && !inDev) { - obj.extraneous = true - } - } + // Mark as extraneous at this point. + // This will be un-marked in unmarkExtraneous, where we mark as + // not-extraneous everything that is required in some way from + // the root object. + obj.extraneous = true obj.path = obj.path || folder obj.realPath = real obj.link = link if (parent && !obj.link) obj.parent = parent - rpSeen[real] = obj + realpathSeen[real] = obj obj.depth = depth //if (depth >= opts.depth) return cb(null, obj) asyncMap(installed, function (pkg, cb) { @@ -259,50 +266,45 @@ function resolveInheritance (obj, opts) { findUnmet(obj.dependencies[dep], opts) }) Object.keys(obj.dependencies).forEach(function (dep) { - resolveInheritance(obj.dependencies[dep], opts) + if (typeof obj.dependencies[dep] === "object") { + resolveInheritance(obj.dependencies[dep], opts) + } else { + debug("unmet dep! %s %s@%s", obj.name, dep, obj.dependencies[dep]) + } }) findUnmet(obj, opts) } // find unmet deps by walking up the tree object. // No I/O -var fuSeen = [] function findUnmet (obj, opts) { - if (fuSeen.indexOf(obj) !== -1) return - fuSeen.push(obj) - //console.error("find unmet", obj.name, obj.parent && obj.parent.name) + var findUnmetSeen = opts.findUnmetSeen + if (findUnmetSeen.indexOf(obj) !== -1) return + findUnmetSeen.push(obj) + debug("find unmet parent=%s obj=", obj.parent && obj.parent.name, obj.name || obj) var deps = obj.dependencies = obj.dependencies || {} - //console.error(deps) + debug(deps) Object.keys(deps) .filter(function (d) { return typeof deps[d] === "string" }) .forEach(function (d) { - //console.error("find unmet", obj.name, d, deps[d]) - var r = obj.parent - , found = null - while (r && !found && typeof deps[d] === "string") { - // if r is a valid choice, then use that. - found = r.dependencies[d] - if (!found && r.realName === d) found = r - - if (!found) { - r = r.link ? null : r.parent - continue - } - // "foo":"http://blah" and "foo":"latest" are always presumed valid - if ( typeof deps[d] === "string" - && semver.validRange(deps[d], true) - && !semver.satisfies(found.version, deps[d], true)) { - // the bad thing will happen - opts.log("unmet dependency", obj.path + " requires "+d+"@'"+deps[d] - +"' but will load\n" - +found.path+",\nwhich is version "+found.version - ) - found.invalid = true - } + var found = findDep(obj, d) + debug("finding dep %j", d, found && found.name || found) + // "foo":"http://blah" and "foo":"latest" are always presumed valid + if (typeof deps[d] === "string" && + semver.validRange(deps[d], true) && + found && + !semver.satisfies(found.version, deps[d], true)) { + // the bad thing will happen + opts.log( "unmet dependency" + , obj.path + " requires "+d+"@'"+deps[d] + + "' but will load\n" + + found.path+",\nwhich is version "+found.version ) + found.invalid = true + } + if (found) { deps[d] = found } - }) var peerDeps = obj.peerDependencies = obj.peerDependencies || {} @@ -329,34 +331,58 @@ function findUnmet (obj, opts) { obj.dependencies[d] = peerDeps[d] } else if (!semver.satisfies(dependency.version, peerDeps[d], true)) { dependency.peerInvalid = true - } else { - dependency.extraneous = false } }) return obj } -function recursivelyMarkExtraneous (obj, extraneous) { - // stop recursion if we're not changing anything - if (obj.extraneous === extraneous) return +function unmarkExtraneous (obj, opts) { + // Mark all non-required deps as extraneous. + // start from the root object and mark as non-extraneous all modules + // that haven't been previously flagged as extraneous then propagate + // to all their dependencies - obj.extraneous = extraneous - var deps = obj.dependencies = obj.dependencies || {} - Object.keys(deps).forEach(function(d){ - recursivelyMarkExtraneous(deps[d], extraneous) - }); + obj.extraneous = false + + var deps = obj._dependencies + if (opts.dev && obj.devDependencies && (obj.root || obj.link)) { + Object.keys(obj.devDependencies).forEach(function (k) { + deps[k] = obj.devDependencies[k] + }) + } + + if (obj.peerDependencies) { + Object.keys(obj.peerDependencies).forEach(function (k) { + deps[k] = obj.peerDependencies[k] + }) + } + + debug("not extraneous", obj._id, deps) + Object.keys(deps).forEach(function (d) { + var dep = findDep(obj, d) + if (dep && dep.extraneous) { + unmarkExtraneous(dep, opts) + } + }) } -function markExtraneous (obj) { - // start from the root object and mark as non-extraneous all modules that haven't been previously flagged as - // extraneous then propagate to all their dependencies - var deps = obj.dependencies = obj.dependencies || {} - Object.keys(deps).forEach(function(d){ - if (!deps[d].extraneous){ - recursivelyMarkExtraneous(deps[d], false); +// Find the one that will actually be loaded by require() +// so we can make sure it's valid etc. +function findDep (obj, d) { + var r = obj + , found = null + while (r && !found) { + // if r is a valid choice, then use that. + // kinda weird if a pkg depends on itself, but after the first + // iteration of this loop, it indicates a dep cycle. + if (typeof r.dependencies[d] === "object") { + found = r.dependencies[d] } - }); + if (!found && r.realName === d) found = r + r = r.link ? null : r.parent + } + return found } function copy (obj) { diff --git a/deps/npm/node_modules/read-installed/test/basic.js b/deps/npm/node_modules/read-installed/test/basic.js index 4d83cd0ca5..f497848879 100644 --- a/deps/npm/node_modules/read-installed/test/basic.js +++ b/deps/npm/node_modules/read-installed/test/basic.js @@ -1,8 +1,9 @@ var readInstalled = require("../read-installed.js") -var json = require("./fixtures/package.json") -var known = [].concat(Object.keys(json.dependencies) - , Object.keys(json.optionalDependencies) - , Object.keys(json.devDependencies)).sort() +var json = require("../package.json") +var d = Object.keys(json.dependencies) +var dd = Object.keys(json.devDependencies) +var od = Object.keys(json.optionalDependencies) +var known = d.concat(dd).concat(od).sort() var test = require("tap").test var path = require("path") @@ -36,9 +37,7 @@ function cleanup (map) { default: delete map[i] } var dep = map.dependencies -// delete map.dependencies if (dep) { -// map.dependencies = dep for (var i in dep) if (typeof dep[i] === "object") { cleanup(dep[i]) } diff --git a/deps/npm/node_modules/read-installed/test/cyclic-extraneous-peer-deps.js b/deps/npm/node_modules/read-installed/test/cyclic-extraneous-peer-deps.js new file mode 100644 index 0000000000..58bf6a649a --- /dev/null +++ b/deps/npm/node_modules/read-installed/test/cyclic-extraneous-peer-deps.js @@ -0,0 +1,81 @@ +var test = require("tap").test +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var fs = require("fs") +var path = require("path") +var readInstalled = require("../read-installed.js") + +var parent = { + name: "parent", + version: "1.2.3", + dependencies: {}, + devDependencies: { + "child1":"*" + }, + readme:"." +} + +var child1 = { + name: "child1", + version: "1.2.3", + peerDependencies: { + child2: "*" + }, + readme:"." +} + +var child2 = { + name: "child2", + version: "1.2.3", + peerDependencies: { + child1: "*" + }, + readme:"." +} + + +var root = path.resolve(__dirname, "cyclic-extraneous-peer-deps") +var parentjson = path.resolve(root, "package.json") +var child1root = path.resolve(root, "node_modules/child1") +var child1json = path.resolve(child1root, "package.json") +var child2root = path.resolve(root, "node_modules/child2") +var child2json = path.resolve(child2root, "package.json") + +test("setup", function (t) { + rimraf.sync(root) + mkdirp.sync(child1root) + mkdirp.sync(child2root) + fs.writeFileSync(parentjson, JSON.stringify(parent, null, 2) + "\n", "utf8") + fs.writeFileSync(child1json, JSON.stringify(child1, null, 2) + "\n", "utf8") + fs.writeFileSync(child2json, JSON.stringify(child2, null, 2) + "\n", "utf8") + t.pass("setup done") + t.end() +}) + +test("dev mode", function (t) { + // peer dev deps should both be not extraneous. + readInstalled(root, { dev: true }, function (er, data) { + if (er) + throw er + t.notOk(data.dependencies.child1.extraneous, "c1 not extra") + t.notOk(data.dependencies.child2.extraneous, "c2 not extra") + t.end() + }) +}) + +test("prod mode", function (t) { + readInstalled(root, { dev: false }, function (er, data) { + if (er) + throw er + t.ok(data.dependencies.child1.extraneous, "c1 extra") + t.ok(data.dependencies.child2.extraneous, "c2 extra") + t.end() + }) +}) + + +test("cleanup", function (t) { + rimraf.sync(root) + t.pass("cleanup done") + t.end() +}) diff --git a/deps/npm/node_modules/read-installed/test/dev.js b/deps/npm/node_modules/read-installed/test/dev.js index f6f4857bb0..5e5a994a88 100644 --- a/deps/npm/node_modules/read-installed/test/dev.js +++ b/deps/npm/node_modules/read-installed/test/dev.js @@ -1,6 +1,6 @@ var readInstalled = require("../read-installed.js") var test = require("tap").test -var json = require("./fixtures/package.json") +var json = require("../package.json") var path = require("path") var known = [].concat(Object.keys(json.dependencies) , Object.keys(json.optionalDependencies) @@ -17,7 +17,7 @@ test("make sure that it works without dev deps", function (t) { var deps = Object.keys(map.dependencies).sort() t.equal(deps.length, known.length, "array lengths are equal") t.deepEqual(deps, known, "arrays should be equal") - t.ok(map.dependencies.tap.extraneous, 'extraneous is set on devDep') + t.ok(map.dependencies.tap.extraneous, "extraneous is set on devDep") t.end() }) }) diff --git a/deps/npm/node_modules/read-installed/test/extraneous-dev.js b/deps/npm/node_modules/read-installed/test/extraneous-dev.js new file mode 100644 index 0000000000..2f9012d548 --- /dev/null +++ b/deps/npm/node_modules/read-installed/test/extraneous-dev.js @@ -0,0 +1,20 @@ +var readInstalled = require("../read-installed.js") +var test = require("tap").test +var path = require("path") + +test("extraneous detected", function(t) { + // This test verifies read-installed#16 + readInstalled( + path.join(__dirname, "fixtures/extraneous-dev-dep"), + { + log: console.error, + dev: true + }, + function (err, map) { + t.ifError(err, "read-installed made it") + + t.notOk(map.dependencies.d.extraneous, "d is not extraneous, it's required by root") + t.ok(map.dependencies.x.extraneous, "x is extraneous, it's only a dev dep of d") + t.end() + }) +}) diff --git a/deps/npm/node_modules/read-installed/test/extraneous.js b/deps/npm/node_modules/read-installed/test/extraneous.js index 2cc0d04e7a..e999c9b4fc 100644 --- a/deps/npm/node_modules/read-installed/test/extraneous.js +++ b/deps/npm/node_modules/read-installed/test/extraneous.js @@ -1,6 +1,6 @@ var readInstalled = require('../read-installed.js') var test = require('tap').test -var path = require('path'); +var path = require('path') test('extraneous detected', function(t) { // This test verifies read-installed#16 @@ -12,6 +12,6 @@ test('extraneous detected', function(t) { t.ok(map.dependencies.bar.extraneous, 'bar is extraneous, it\'s not required by any module') t.notOk(map.dependencies.asdf.extraneous, 'asdf is not extraneous, it\'s required by ghjk') t.notOk(map.dependencies.ghjk.extraneous, 'ghjk is not extraneous, it\'s required by our root module') - t.end(); + t.end() }) }) diff --git a/deps/npm/node_modules/read-installed/test/fixtures/extraneous-dev-dep/package.json b/deps/npm/node_modules/read-installed/test/fixtures/extraneous-dev-dep/package.json new file mode 100644 index 0000000000..9bfa7ce8f5 --- /dev/null +++ b/deps/npm/node_modules/read-installed/test/fixtures/extraneous-dev-dep/package.json @@ -0,0 +1,7 @@ +{ + "name": "extraneous-dev-dep", + "version": "0.0.0", + "dependencies": { + "d": "1.0.0" + } +} diff --git a/deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer-dev/package.json b/deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer-dev/package.json new file mode 100644 index 0000000000..1a229c1cff --- /dev/null +++ b/deps/npm/node_modules/read-installed/test/fixtures/grandparent-peer-dev/package.json @@ -0,0 +1,8 @@ +{ + "name": "example", + "version": "0.0.0", + "devDependencies": { + "plugin-wrapper": "0.0.0", + "framework": "0.0.0" + } +} diff --git a/deps/npm/node_modules/read-installed/test/grandparent-peer-dev.js b/deps/npm/node_modules/read-installed/test/grandparent-peer-dev.js new file mode 100644 index 0000000000..fd7c2d2bc9 --- /dev/null +++ b/deps/npm/node_modules/read-installed/test/grandparent-peer-dev.js @@ -0,0 +1,20 @@ +var readInstalled = require('../read-installed.js') +var test = require('tap').test +var path = require('path'); + +function allValid(t, map) { + var deps = Object.keys(map.dependencies || {}) + deps.forEach(function (dep) { + t.ok(map.dependencies[dep].extraneous, 'dependency ' + dep + ' of ' + map.name + ' is extraneous') + }) +} + +test('grandparent dev peer dependencies should be extraneous', function(t) { + readInstalled( + path.join(__dirname, 'fixtures/grandparent-peer-dev'), + { log: console.error }, + function(err, map) { + allValid(t, map) + t.end() + }) +}) diff --git a/deps/npm/node_modules/read-installed/test/linked-dep-dev-deps-extraneous.js b/deps/npm/node_modules/read-installed/test/linked-dep-dev-deps-extraneous.js new file mode 100644 index 0000000000..6560513304 --- /dev/null +++ b/deps/npm/node_modules/read-installed/test/linked-dep-dev-deps-extraneous.js @@ -0,0 +1,59 @@ +var test = require('tap').test +var path = require('path') +var fs = require('fs') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var readInstalled = require('../') + +var root = path.resolve(__dirname, 'root') +var pkg = path.resolve(root, 'pkg') +var pkgnm = path.resolve(pkg, 'node_modules') +var linkdepSrc = path.resolve(root, 'linkdep') +var linkdepLink = path.resolve(pkgnm, 'linkdep') +var devdep = path.resolve(linkdepSrc, 'node_modules', 'devdep') + +function pjson (dir, data) { + mkdirp.sync(dir) + var d = path.resolve(dir, 'package.json') + fs.writeFileSync(d, JSON.stringify(data)) +} + +test('setup', function (t) { + rimraf.sync(root) + pjson(pkg, { + name: 'root', + version: '1.2.3', + dependencies: { + linkdep: '' + } + }) + pjson(linkdepSrc, { + name: 'linkdep', + version: '1.2.3', + devDependencies: { + devdep: '' + } + }) + pjson(devdep, { + name: 'devdep', + version: '1.2.3' + }) + + mkdirp.sync(pkgnm) + fs.symlinkSync(linkdepSrc, linkdepLink, 'dir') + + t.end() +}) + +test('basic', function (t) { + readInstalled(pkg, { dev: true }, function (er, data) { + var dd = data.dependencies.linkdep.dependencies.devdep + t.notOk(dd.extraneous, 'linked dev dep should not be extraneous') + t.end() + }) +}) + +test('cleanup', function (t) { + rimraf.sync(root) + t.end() +}) diff --git a/deps/npm/node_modules/read-installed/test/noargs.js b/deps/npm/node_modules/read-installed/test/noargs.js index a84a8f4cfa..66fabeb74e 100644 --- a/deps/npm/node_modules/read-installed/test/noargs.js +++ b/deps/npm/node_modules/read-installed/test/noargs.js @@ -1,6 +1,6 @@ var readInstalled = require("../read-installed.js") var test = require("tap").test -var json = require("./fixtures/package.json") +var json = require("../package.json") var path = require("path") var known = [].concat(Object.keys(json.dependencies) , Object.keys(json.optionalDependencies) diff --git a/deps/npm/node_modules/read-package-json/package.json b/deps/npm/node_modules/read-package-json/package.json index 8b67330c1d..1fd2f674f7 100644 --- a/deps/npm/node_modules/read-package-json/package.json +++ b/deps/npm/node_modules/read-package-json/package.json @@ -37,7 +37,7 @@ "homepage": "https://github.com/isaacs/read-package-json", "_id": "read-package-json@1.2.7", "_shasum": "f0b440c461a218f4dbf48b094e80fc65c5248502", - "_from": "read-package-json@^1.2.7", + "_from": "read-package-json@>=1.2.7-0 <1.3.0-0", "_npmVersion": "2.0.0-beta.0", "_npmUser": { "name": "othiym23", diff --git a/deps/npm/node_modules/request/node_modules/aws-sign2/package.json b/deps/npm/node_modules/request/node_modules/aws-sign2/package.json index 719d488706..d04010d603 100644 --- a/deps/npm/node_modules/request/node_modules/aws-sign2/package.json +++ b/deps/npm/node_modules/request/node_modules/aws-sign2/package.json @@ -27,7 +27,7 @@ "shasum": "c57103f7a17fc037f02d7c2e64b602ea223f7d63", "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz" }, - "_from": "aws-sign2@~0.5.0", + "_from": "aws-sign2@>=0.5.0-0 <0.6.0-0", "_npmVersion": "1.3.2", "_npmUser": { "name": "mikeal", diff --git a/deps/npm/node_modules/request/node_modules/bl/.jshintrc b/deps/npm/node_modules/request/node_modules/bl/.jshintrc deleted file mode 100644 index c8ef3ca409..0000000000 --- a/deps/npm/node_modules/request/node_modules/bl/.jshintrc +++ /dev/null @@ -1,59 +0,0 @@ -{ - "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 diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json index add87edf58..8e79c3a748 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -35,7 +35,7 @@ "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" }, - "_from": "core-util-is@~1.0.0", + "_from": "core-util-is@>=1.0.0-0 <1.1.0-0", "_npmVersion": "1.3.23", "_npmUser": { "name": "isaacs", diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json index a8c586bfb9..752eab63cc 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -28,7 +28,7 @@ }, "_id": "string_decoder@0.10.31", "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_from": "string_decoder@~0.10.x", + "_from": "string_decoder@>=0.10.0-0 <0.11.0-0", "_npmVersion": "1.4.23", "_npmUser": { "name": "rvagg", diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json index 1448587013..6c73ab3765 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json @@ -39,7 +39,7 @@ "homepage": "https://github.com/isaacs/readable-stream", "_id": "readable-stream@1.0.31", "_shasum": "8f2502e0bc9e3b0da1b94520aabb4e2603ecafae", - "_from": "readable-stream@~1.0.26", + "_from": "readable-stream@>=1.0.26-0 <1.1.0-0", "_npmVersion": "1.4.9", "_npmUser": { "name": "rvagg", diff --git a/deps/npm/node_modules/request/node_modules/bl/package.json b/deps/npm/node_modules/request/node_modules/bl/package.json index 19c4ac079f..e94473d36c 100644 --- a/deps/npm/node_modules/request/node_modules/bl/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/package.json @@ -38,7 +38,7 @@ }, "_id": "bl@0.9.1", "_shasum": "d262c5b83aa5cf4386cea1d998c82b36d7ae2942", - "_from": "bl@~0.9.0", + "_from": "bl@>=0.9.0-0 <0.10.0-0", "_npmVersion": "1.4.21", "_npmUser": { "name": "rvagg", diff --git a/deps/npm/node_modules/request/node_modules/caseless/package.json b/deps/npm/node_modules/request/node_modules/caseless/package.json index 62d467544d..e3cd409c78 100644 --- a/deps/npm/node_modules/request/node_modules/caseless/package.json +++ b/deps/npm/node_modules/request/node_modules/caseless/package.json @@ -30,7 +30,7 @@ "homepage": "https://github.com/mikeal/caseless", "_id": "caseless@0.6.0", "_shasum": "8167c1ab8397fb5bb95f96d28e5a81c50f247ac4", - "_from": "caseless@~0.6.0", + "_from": "caseless@>=0.6.0-0 <0.7.0-0", "_npmVersion": "1.4.9", "_npmUser": { "name": "mikeal", diff --git a/deps/npm/node_modules/request/node_modules/forever-agent/package.json b/deps/npm/node_modules/request/node_modules/forever-agent/package.json index 764ca1e2c4..65a6c55f26 100644 --- a/deps/npm/node_modules/request/node_modules/forever-agent/package.json +++ b/deps/npm/node_modules/request/node_modules/forever-agent/package.json @@ -26,7 +26,7 @@ "shasum": "6d0e09c4921f94a27f63d3b49c5feff1ea4c5130", "tarball": "http://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz" }, - "_from": "forever-agent@~0.5.0", + "_from": "forever-agent@>=0.5.0-0 <0.6.0-0", "_npmVersion": "1.3.21", "_npmUser": { "name": "mikeal", diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json index bdbe740109..3b921537e7 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json @@ -41,7 +41,7 @@ "shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7", "tarball": "http://registry.npmjs.org/async/-/async-0.9.0.tgz" }, - "_from": "async@~0.9.0", + "_from": "async@>=0.9.0-0 <0.10.0-0", "_npmVersion": "1.4.3", "_npmUser": { "name": "caolan", diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json index 37c37314cc..fd82201d20 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json @@ -31,7 +31,7 @@ }, "_id": "combined-stream@0.0.5", "_shasum": "29ed76e5c9aad07c4acf9ca3d32601cce28697a2", - "_from": "combined-stream@~0.0.4", + "_from": "combined-stream@>=0.0.4-0 <0.1.0-0", "_npmVersion": "1.4.14", "_npmUser": { "name": "alexindigo", diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json index 259822b788..8f4c392662 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/mime/package.json @@ -35,7 +35,7 @@ "shasum": "58203eed86e3a5ef17aed2b7d9ebd47f0a60dd10", "tarball": "http://registry.npmjs.org/mime/-/mime-1.2.11.tgz" }, - "_from": "mime@~1.2.11", + "_from": "mime@>=1.2.11-0 <1.3.0-0", "_npmVersion": "1.3.6", "_npmUser": { "name": "broofa", diff --git a/deps/npm/node_modules/request/node_modules/form-data/package.json b/deps/npm/node_modules/request/node_modules/form-data/package.json index afda8b6c30..04d7ec69dd 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/package.json @@ -42,7 +42,7 @@ "homepage": "https://github.com/felixge/node-form-data", "_id": "form-data@0.1.4", "_shasum": "91abd788aba9702b1aabfa8bc01031a2ac9e3b12", - "_from": "form-data@~0.1.0", + "_from": "form-data@>=0.1.0-0 <0.2.0-0", "_npmVersion": "1.4.14", "_npmUser": { "name": "alexindigo", diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json index 2406a49a5d..c95faa9e27 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json @@ -41,7 +41,7 @@ "shasum": "7a636e9ded4efcefb19cef4947a3c67dfaee911b", "tarball": "http://registry.npmjs.org/boom/-/boom-0.4.2.tgz" }, - "_from": "boom@0.4.x", + "_from": "boom@>=0.4.0-0 <0.5.0-0", "_npmVersion": "1.2.18", "_npmUser": { "name": "hueniverse", diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json index c4cd1b2342..3ed098bea5 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json @@ -45,7 +45,7 @@ "shasum": "ed91ff1f17ad13d3748288594f8a48a0d26f325c", "tarball": "http://registry.npmjs.org/cryptiles/-/cryptiles-0.2.2.tgz" }, - "_from": "cryptiles@0.2.x", + "_from": "cryptiles@>=0.2.0-0 <0.3.0-0", "_npmVersion": "1.2.24", "_npmUser": { "name": "hueniverse", diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json index 4e4eb74b7a..bbc7031133 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json @@ -43,7 +43,7 @@ "shasum": "3d322462badf07716ea7eb85baf88079cddce505", "tarball": "http://registry.npmjs.org/hoek/-/hoek-0.9.1.tgz" }, - "_from": "hoek@0.9.x", + "_from": "hoek@>=0.9.0-0 <0.10.0-0", "_npmVersion": "1.2.18", "_npmUser": { "name": "hueniverse", diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json index c96e8482ac..ff73fbc12a 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json @@ -42,7 +42,7 @@ "shasum": "fb885f18b0f3aad189f824862536bceeec750900", "tarball": "http://registry.npmjs.org/sntp/-/sntp-0.2.4.tgz" }, - "_from": "sntp@0.2.x", + "_from": "sntp@>=0.2.0-0 <0.3.0-0", "_npmVersion": "1.2.18", "_npmUser": { "name": "hueniverse", diff --git a/deps/npm/node_modules/request/node_modules/http-signature/package.json b/deps/npm/node_modules/request/node_modules/http-signature/package.json index 6d646d4ad0..270f9891bf 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/package.json @@ -32,7 +32,7 @@ "shasum": "1494e4f5000a83c0f11bcc12d6007c530cb99582", "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-0.10.0.tgz" }, - "_from": "http-signature@~0.10.0", + "_from": "http-signature@>=0.10.0-0 <0.11.0-0", "_npmVersion": "1.2.18", "_npmUser": { "name": "mcavage", diff --git a/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json b/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json index 3ddf83680c..2e415ac660 100644 --- a/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json +++ b/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json @@ -32,7 +32,7 @@ "shasum": "4c1f228b5050837eba9d21f50c2e6e320624566e", "tarball": "http://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.0.tgz" }, - "_from": "json-stringify-safe@~5.0.0", + "_from": "json-stringify-safe@>=5.0.0-0 <5.1.0-0", "_npmVersion": "1.3.6", "_npmUser": { "name": "isaacs", diff --git a/deps/npm/node_modules/request/node_modules/mime-types/package.json b/deps/npm/node_modules/request/node_modules/mime-types/package.json index baa79a956c..9d59fb8d9d 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/package.json +++ b/deps/npm/node_modules/request/node_modules/mime-types/package.json @@ -39,7 +39,7 @@ "homepage": "https://github.com/expressjs/mime-types", "_id": "mime-types@1.0.2", "_shasum": "995ae1392ab8affcbfcb2641dd054e943c0d5dce", - "_from": "mime-types@~1.0.1", + "_from": "mime-types@>=1.0.1-0 <1.1.0-0", "_npmVersion": "1.4.21", "_npmUser": { "name": "dougwilson", diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/package.json b/deps/npm/node_modules/request/node_modules/node-uuid/package.json index ee93121fc3..491d93ad4a 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/package.json +++ b/deps/npm/node_modules/request/node_modules/node-uuid/package.json @@ -34,7 +34,7 @@ "shasum": "39aef510e5889a3dca9c895b506c73aae1bac048", "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.1.tgz" }, - "_from": "node-uuid@~1.4.0", + "_from": "node-uuid@>=1.4.0-0 <1.5.0-0", "_npmVersion": "1.3.6", "_npmUser": { "name": "broofa", diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/package.json b/deps/npm/node_modules/request/node_modules/oauth-sign/package.json index d0e82fecb0..16a7645861 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/package.json +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/package.json @@ -30,7 +30,7 @@ "shasum": "f22956f31ea7151a821e5f2fb32c113cad8b9f69", "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.4.0.tgz" }, - "_from": "oauth-sign@~0.4.0", + "_from": "oauth-sign@>=0.4.0-0 <0.5.0-0", "_npmVersion": "1.3.2", "_npmUser": { "name": "mikeal", diff --git a/deps/npm/node_modules/request/node_modules/qs/.jshintrc b/deps/npm/node_modules/request/node_modules/qs/.jshintrc deleted file mode 100644 index 997b3f7d45..0000000000 --- a/deps/npm/node_modules/request/node_modules/qs/.jshintrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "node": true, - - "curly": true, - "latedef": true, - "quotmark": true, - "undef": true, - "unused": true, - "trailing": true -} diff --git a/deps/npm/node_modules/request/node_modules/qs/package.json b/deps/npm/node_modules/request/node_modules/qs/package.json index 7b1917023f..51be52c711 100755 --- a/deps/npm/node_modules/request/node_modules/qs/package.json +++ b/deps/npm/node_modules/request/node_modules/qs/package.json @@ -35,7 +35,7 @@ }, "_id": "qs@1.2.2", "_shasum": "19b57ff24dc2a99ce1f8bdf6afcda59f8ef61f88", - "_from": "qs@~1.2.0", + "_from": "qs@>=1.2.0-0 <1.3.0-0", "_npmVersion": "1.4.21", "_npmUser": { "name": "hueniverse", diff --git a/deps/npm/node_modules/request/node_modules/stringstream/package.json b/deps/npm/node_modules/request/node_modules/stringstream/package.json index f9caf4b843..980932c18b 100644 --- a/deps/npm/node_modules/request/node_modules/stringstream/package.json +++ b/deps/npm/node_modules/request/node_modules/stringstream/package.json @@ -39,7 +39,7 @@ ], "directories": {}, "_shasum": "0f0e3423f942960b5692ac324a57dd093bc41a92", - "_from": "stringstream@~0.0.4", + "_from": "stringstream@>=0.0.4-0 <0.1.0-0", "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.4.tgz", "bugs": { "url": "https://github.com/mhart/StringStream/issues" diff --git a/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc b/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc deleted file mode 100644 index 4c1c8d4972..0000000000 --- a/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "node": true, - "asi": true, - "laxcomma": true -} diff --git a/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json b/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json index 59c7f5cb50..12e2407c09 100644 --- a/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json +++ b/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json @@ -26,7 +26,7 @@ "shasum": "b1184e312ffbcf70b3b4c78e8c219de7ebb1c550", "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.0.tgz" }, - "_from": "tunnel-agent@~0.4.0", + "_from": "tunnel-agent@>=0.4.0-0 <0.5.0-0", "_npmVersion": "1.3.21", "_npmUser": { "name": "mikeal", diff --git a/deps/npm/node_modules/request/package.json b/deps/npm/node_modules/request/package.json index 0e94d8d149..d2db65f595 100755 --- a/deps/npm/node_modules/request/package.json +++ b/deps/npm/node_modules/request/package.json @@ -59,7 +59,7 @@ "homepage": "https://github.com/mikeal/request", "_id": "request@2.42.0", "_shasum": "572bd0148938564040ac7ab148b96423a063304a", - "_from": "request@^2.42.0", + "_from": "request@>=2.42.0-0 <3.0.0-0", "_npmVersion": "1.4.9", "_npmUser": { "name": "mikeal", diff --git a/deps/npm/node_modules/semver/Makefile b/deps/npm/node_modules/semver/Makefile index 5717ccf42b..71af0e9750 100644 --- a/deps/npm/node_modules/semver/Makefile +++ b/deps/npm/node_modules/semver/Makefile @@ -8,12 +8,12 @@ all: $(files) clean: rm -f $(files) -semver.browser.js: head.js semver.js foot.js - ( cat head.js; \ +semver.browser.js: head.js.txt semver.js foot.js.txt + ( cat head.js.txt; \ cat semver.js | \ egrep -v '^ *\/\* nomin \*\/' | \ perl -pi -e 's/debug\([^\)]+\)//g'; \ - cat foot.js ) > semver.browser.js + cat foot.js.txt ) > semver.browser.js semver.min.js: semver.browser.js uglifyjs -m semver.min.js diff --git a/deps/npm/node_modules/semver/README.md b/deps/npm/node_modules/semver/README.md index 4e95b84656..0f8a755a4c 100644 --- a/deps/npm/node_modules/semver/README.md +++ b/deps/npm/node_modules/semver/README.md @@ -41,53 +41,170 @@ A leading `"="` or `"v"` character is stripped off and ignored. ## Ranges -The following range styles are supported: - -* `1.2.3` A specific version. When nothing else will do. Must be a full - version number, with major, minor, and patch versions specified. - Note that build metadata is still ignored, so `1.2.3+build2012` will - satisfy this range. -* `>1.2.3` Greater than a specific version. -* `<1.2.3` Less than a specific version. If there is no prerelease - tag on the version range, then no prerelease version will be allowed - either, even though these are technically "less than". -* `>=1.2.3` Greater than or equal to. Note that prerelease versions - are NOT equal to their "normal" equivalents, so `1.2.3-beta` will - not satisfy this range, but `2.3.0-beta` will. -* `<=1.2.3` Less than or equal to. In this case, prerelease versions - ARE allowed, so `1.2.3-beta` would satisfy. +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + * `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` -* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` "Reasonably close to `1.2.3`". When - using tilde operators, prerelease versions are supported as well, - but a prerelease of the next significant digit will NOT be - satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`. -* `^1.2.3` := `>=1.2.3-0 <2.0.0-0` "Compatible with `1.2.3`". When - using caret operators, anything from the specified version (including - prerelease) will be supported up to, but not including, the next - major version (or its prereleases). `1.5.1` will satisfy `^1.2.3`, - while `1.2.2` and `2.0.0-beta` will not. -* `^0.1.3` := `>=0.1.3-0 <0.2.0-0` "Compatible with `0.1.3`". `0.x.x` versions are - special: the first non-zero component indicates potentially breaking changes, - meaning the caret operator matches any version with the same first non-zero - component starting at the specified version. -* `^0.0.2` := `=0.0.2` "Only the version `0.0.2` is considered compatible" -* `~1.2` := `>=1.2.0-0 <1.3.0-0` "Any version starting with `1.2`" -* `^1.2` := `>=1.2.0-0 <2.0.0-0` "Any version compatible with `1.2`" -* `1.2.x` := `>=1.2.0-0 <1.3.0-0` "Any version starting with `1.2`" -* `1.2.*` Same as `1.2.x`. -* `1.2` Same as `1.2.x`. -* `~1` := `>=1.0.0-0 <2.0.0-0` "Any version starting with `1`" -* `^1` := `>=1.0.0-0 <2.0.0-0` "Any version compatible with `1`" -* `1.x` := `>=1.0.0-0 <2.0.0-0` "Any version starting with `1`" -* `1.*` Same as `1.x`. -* `1` Same as `1.x`. -* `*` Any version whatsoever. -* `x` Same as `*`. -* `""` (just an empty string) Same as `*`. - - -Ranges can be joined with either a space (which implies "and") or a -`||` (which implies "or"). + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +Note: this is the same as the `~>` operator in rubygems. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero digit in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` ## Functions diff --git a/deps/npm/node_modules/semver/bin/semver b/deps/npm/node_modules/semver/bin/semver index 848420630b..41c148fb86 100755 --- a/deps/npm/node_modules/semver/bin/semver +++ b/deps/npm/node_modules/semver/bin/semver @@ -107,8 +107,8 @@ function help () { ,"" ,"-i --increment []" ," Increment a version by the specified level. Level can" - ," be one of: major, minor, patch, or prerelease" - ," Default level is 'patch'." + ," be one of: major, minor, patch, premajor, preminor," + ," prepatch, or prerelease. Default level is 'patch'." ," Only one version may be specified." ,"" ,"-l --loose" diff --git a/deps/npm/node_modules/semver/foot.js b/deps/npm/node_modules/semver/foot.js.txt similarity index 100% rename from deps/npm/node_modules/semver/foot.js rename to deps/npm/node_modules/semver/foot.js.txt diff --git a/deps/npm/node_modules/semver/head.js b/deps/npm/node_modules/semver/head.js.txt similarity index 100% rename from deps/npm/node_modules/semver/head.js rename to deps/npm/node_modules/semver/head.js.txt diff --git a/deps/npm/node_modules/semver/package.json b/deps/npm/node_modules/semver/package.json index b65d866c30..a575f0ebd4 100644 --- a/deps/npm/node_modules/semver/package.json +++ b/deps/npm/node_modules/semver/package.json @@ -1,6 +1,6 @@ { "name": "semver", - "version": "2.3.0", + "version": "4.0.0", "description": "The semantic version parser used by npm.", "main": "semver.js", "browser": "semver.browser.js", @@ -21,13 +21,30 @@ "bin": { "semver": "./bin/semver" }, - "readme": "semver(1) -- The semantic versioner for npm\n===========================================\n\n## Usage\n\n $ npm install semver\n\n semver.valid('1.2.3') // '1.2.3'\n semver.valid('a.b.c') // null\n semver.clean(' =v1.2.3 ') // '1.2.3'\n semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true\n semver.gt('1.2.3', '9.8.7') // false\n semver.lt('1.2.3', '9.8.7') // true\n\nAs a command-line utility:\n\n $ semver -h\n\n Usage: semver [ [...]] [-r | -i | -d ]\n Test if version(s) satisfy the supplied range(s), and sort them.\n\n Multiple versions or ranges may be supplied, unless increment\n or decrement options are specified. In that case, only a single\n version may be used, and it is incremented by the specified level\n\n Program exits successfully if any valid version satisfies\n all supplied ranges, and prints all satisfying versions.\n\n If no versions are valid, or ranges are not satisfied,\n then exits failure.\n\n Versions are printed in ascending order, so supplying\n multiple versions to the utility will just sort them.\n\n## Versions\n\nA \"version\" is described by the `v2.0.0` specification found at\n.\n\nA leading `\"=\"` or `\"v\"` character is stripped off and ignored.\n\n## Ranges\n\nThe following range styles are supported:\n\n* `1.2.3` A specific version. When nothing else will do. Must be a full\n version number, with major, minor, and patch versions specified.\n Note that build metadata is still ignored, so `1.2.3+build2012` will\n satisfy this range.\n* `>1.2.3` Greater than a specific version.\n* `<1.2.3` Less than a specific version. If there is no prerelease\n tag on the version range, then no prerelease version will be allowed\n either, even though these are technically \"less than\".\n* `>=1.2.3` Greater than or equal to. Note that prerelease versions\n are NOT equal to their \"normal\" equivalents, so `1.2.3-beta` will\n not satisfy this range, but `2.3.0-beta` will.\n* `<=1.2.3` Less than or equal to. In this case, prerelease versions\n ARE allowed, so `1.2.3-beta` would satisfy.\n* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`\n* `~1.2.3` := `>=1.2.3-0 <1.3.0-0` \"Reasonably close to `1.2.3`\". When\n using tilde operators, prerelease versions are supported as well,\n but a prerelease of the next significant digit will NOT be\n satisfactory, so `1.3.0-beta` will not satisfy `~1.2.3`.\n* `^1.2.3` := `>=1.2.3-0 <2.0.0-0` \"Compatible with `1.2.3`\". When\n using caret operators, anything from the specified version (including\n prerelease) will be supported up to, but not including, the next\n major version (or its prereleases). `1.5.1` will satisfy `^1.2.3`,\n while `1.2.2` and `2.0.0-beta` will not.\n* `^0.1.3` := `>=0.1.3-0 <0.2.0-0` \"Compatible with `0.1.3`\". `0.x.x` versions are\n special: the first non-zero component indicates potentially breaking changes,\n meaning the caret operator matches any version with the same first non-zero\n component starting at the specified version.\n* `^0.0.2` := `=0.0.2` \"Only the version `0.0.2` is considered compatible\"\n* `~1.2` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with `1.2`\"\n* `^1.2` := `>=1.2.0-0 <2.0.0-0` \"Any version compatible with `1.2`\"\n* `1.2.x` := `>=1.2.0-0 <1.3.0-0` \"Any version starting with `1.2`\"\n* `1.2.*` Same as `1.2.x`.\n* `1.2` Same as `1.2.x`.\n* `~1` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with `1`\"\n* `^1` := `>=1.0.0-0 <2.0.0-0` \"Any version compatible with `1`\"\n* `1.x` := `>=1.0.0-0 <2.0.0-0` \"Any version starting with `1`\"\n* `1.*` Same as `1.x`.\n* `1` Same as `1.x`.\n* `*` Any version whatsoever.\n* `x` Same as `*`.\n* `\"\"` (just an empty string) Same as `*`.\n\n\nRanges can be joined with either a space (which implies \"and\") or a\n`||` (which implies \"or\").\n\n## Functions\n\nAll methods and classes take a final `loose` boolean argument that, if\ntrue, will be more forgiving about not-quite-valid semver strings.\nThe resulting output will always be 100% strict, of course.\n\nStrict-mode Comparators and Ranges will be strict about the SemVer\nstrings that they parse.\n\n* `valid(v)`: Return the parsed version, or null if it's not valid.\n* `inc(v, release)`: Return the version incremented by the release\n type (`major`, `premajor`, `minor`, `preminor`, `patch`,\n `prepatch`, or `prerelease`), or null if it's not valid\n * `premajor` in one call will bump the version up to the next major\n version and down to a prerelease of that major version.\n `preminor`, and `prepatch` work the same way.\n * If called from a non-prerelease version, the `prerelease` will work the\n same as `prepatch`. It increments the patch version, then makes a\n prerelease. If the input version is already a prerelease it simply\n increments it.\n\n### Comparison\n\n* `gt(v1, v2)`: `v1 > v2`\n* `gte(v1, v2)`: `v1 >= v2`\n* `lt(v1, v2)`: `v1 < v2`\n* `lte(v1, v2)`: `v1 <= v2`\n* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,\n even if they're not the exact same string. You already know how to\n compare strings.\n* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.\n* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call\n the corresponding function above. `\"===\"` and `\"!==\"` do simple\n string comparison, but are included for completeness. Throws if an\n invalid comparison string is provided.\n* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if\n `v2` is greater. Sorts in ascending order if passed to `Array.sort()`.\n* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions\n in descending order when passed to `Array.sort()`.\n\n\n### Ranges\n\n* `validRange(range)`: Return the valid range or null if it's not valid\n* `satisfies(version, range)`: Return true if the version satisfies the\n range.\n* `maxSatisfying(versions, range)`: Return the highest version in the list\n that satisfies the range, or `null` if none of them do.\n* `gtr(version, range)`: Return `true` if version is greater than all the\n versions possible in the range.\n* `ltr(version, range)`: Return `true` if version is less than all the\n versions possible in the range.\n* `outside(version, range, hilo)`: Return true if the version is outside\n the bounds of the range in either the high or low direction. The\n `hilo` argument must be either the string `'>'` or `'<'`. (This is\n the function called by `gtr` and `ltr`.)\n\nNote that, since ranges may be non-contiguous, a version might not be\ngreater than a range, less than a range, *or* satisfy a range! For\nexample, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`\nuntil `2.0.0`, so the version `1.2.10` would not be greater than the\nrange (because `2.0.1` satisfies, which is higher), nor less than the\nrange (since `1.2.8` satisfies, which is lower), and it also does not\nsatisfy the range.\n\nIf you want to know if a version satisfies or does not satisfy a\nrange, use the `satisfies(version, range)` function.\n", - "readmeFilename": "README.md", + "gitHead": "f71a46b52f5d413aff1cb3afa7d2f940b23ab1a0", "bugs": { "url": "https://github.com/isaacs/node-semver/issues" }, "homepage": "https://github.com/isaacs/node-semver", - "_id": "semver@2.3.0", - "_shasum": "d31b2903ebe2a1806c05b8e763916a7183108a15", - "_from": "semver@latest" + "_id": "semver@4.0.0", + "_shasum": "7be868416a5e669923a8e3af8bafa5faf62a151a", + "_from": "semver@>=4.0.0-0 <5.0.0-0", + "_npmVersion": "2.0.0-beta.3", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "7be868416a5e669923a8e3af8bafa5faf62a151a", + "tarball": "http://registry.npmjs.org/semver/-/semver-4.0.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/semver/-/semver-4.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/semver/semver.browser.js b/deps/npm/node_modules/semver/semver.browser.js index 0f414c3d8d..afb68ac0c4 100644 --- a/deps/npm/node_modules/semver/semver.browser.js +++ b/deps/npm/node_modules/semver/semver.browser.js @@ -128,18 +128,18 @@ var XRANGEPLAIN = R++; src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:(' + src[PRERELEASE] + ')' + - ')?)?)?'; + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?'; var XRANGEPLAINLOOSE = R++; src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:(' + src[PRERELEASELOOSE] + ')' + - ')?)?)?'; + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?'; -// >=2.x, for example, means >=2.0.0-0 -// <1.x would be the same as "<1.0.0-0", though. var XRANGE = R++; src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; var XRANGELOOSE = R++; @@ -236,7 +236,7 @@ function valid(version, loose) { exports.clean = clean; function clean(version, loose) { - var s = parse(version, loose); + var s = parse(version.trim().replace(/^[=v]+/, ''), loose); return s ? s.version : null; } @@ -348,14 +348,23 @@ SemVer.prototype.comparePre = function(other) { SemVer.prototype.inc = function(release) { switch (release) { case 'premajor': - this.inc('major'); + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; this.inc('pre'); break; case 'preminor': - this.inc('minor'); + this.prerelease.length = 0; + this.patch = 0; + this.minor++; this.inc('pre'); break; case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; this.inc('patch'); this.inc('pre'); break; @@ -366,11 +375,25 @@ SemVer.prototype.inc = function(release) { this.inc('patch'); this.inc('pre'); break; + case 'major': - this.major++; - this.minor = -1; + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) + this.major++; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; case 'minor': - this.minor++; + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) + this.minor++; this.patch = 0; this.prerelease = []; break; @@ -383,8 +406,8 @@ SemVer.prototype.inc = function(release) { this.patch++; this.prerelease = []; break; - // This probably shouldn't be used publically. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) this.prerelease = [0]; @@ -504,8 +527,16 @@ exports.cmp = cmp; function cmp(a, op, b, loose) { var ret; switch (op) { - case '===': ret = a === b; break; - case '!==': ret = a !== b; break; + case '===': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a === b; + break; + case '!==': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a !== b; + break; case '': case '=': case '==': ret = eq(a, b, loose); break; case '!=': ret = neq(a, b, loose); break; case '>': ret = gt(a, b, loose); break; @@ -537,6 +568,8 @@ function Comparator(comp, loose) { this.value = ''; else this.value = this.operator + this.semver.version; + + ; } var ANY = {}; @@ -548,24 +581,14 @@ Comparator.prototype.parse = function(comp) { throw new TypeError('Invalid comparator: ' + comp); this.operator = m[1]; + if (this.operator === '=') + this.operator = ''; + // if it literally is just '>' or '' then allow anything. if (!m[2]) this.semver = ANY; - else { + else this.semver = new SemVer(m[2], this.loose); - - // <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) - // >=1.2.3 DOES NOT allow 1.2.3-beta - // <=1.2.3 DOES allow 1.2.3-beta - // However, <1.2.3 does NOT allow 1.2.3-beta, - // even though `1.2.3-beta < 1.2.3` - // The assumption is that the 1.2.3 version has something you - // *don't* want, so we push the prerelease down to the minimum. - if (this.operator === '<' && !this.semver.prerelease.length) { - this.semver.prerelease = ['0']; - this.semver.format(); - } - } }; Comparator.prototype.inspect = function() { @@ -578,8 +601,14 @@ Comparator.prototype.toString = function() { Comparator.prototype.test = function(version) { ; - return (this.semver === ANY) ? true : - cmp(version, this.operator, this.semver, this.loose); + + if (this.semver === ANY) + return true; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + return cmp(version, this.operator, this.semver, this.loose); }; @@ -716,20 +745,20 @@ function replaceTilde(comp, loose) { if (isX(M)) ret = ''; else if (isX(m)) - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) // ~1.2 == >=1.2.0- <1.3.0- - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else if (pr) { ; if (pr.charAt(0) !== '-') pr = '-' + pr; ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0-0'; + ' <' + M + '.' + (+m + 1) + '.0'; } else - // ~1.2.3 == >=1.2.3-0 <1.3.0-0 - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + M + '.' + (+m + 1) + '.0-0'; + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; ; return ret; @@ -749,6 +778,7 @@ function replaceCarets(comp, loose) { } function replaceCaret(comp, loose) { + ; var r = loose ? re[CARETLOOSE] : re[CARET]; return comp.replace(r, function(_, M, m, p, pr) { ; @@ -757,35 +787,38 @@ function replaceCaret(comp, loose) { if (isX(M)) ret = ''; else if (isX(m)) - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) { if (M === '0') - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else - ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; } else if (pr) { ; if (pr.charAt(0) !== '-') pr = '-' + pr; if (M === '0') { if (m === '0') - ret = '=' + M + '.' + m + '.' + p + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + m + '.' + (+p + 1); else ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0-0'; + ' <' + M + '.' + (+m + 1) + '.0'; } else ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + (+M + 1) + '.0.0-0'; + ' <' + (+M + 1) + '.0.0'; } else { + ; if (M === '0') { if (m === '0') - ret = '=' + M + '.' + m + '.' + p; + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1); else - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; } else - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0'; } ; @@ -814,7 +847,7 @@ function replaceXRange(comp, loose) { gtlt = ''; if (gtlt && anyX) { - // replace X with 0, and then append the -0 min-prerelease + // replace X with 0 if (xM) M = 0; if (xm) @@ -823,9 +856,9 @@ function replaceXRange(comp, loose) { p = 0; if (gtlt === '>') { - // >1 => >=2.0.0-0 - // >1.2 => >=1.3.0-0 - // >1.2.3 => >= 1.2.4-0 + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 gtlt = '>='; if (xM) { // no change @@ -840,17 +873,14 @@ function replaceXRange(comp, loose) { } - ret = gtlt + M + '.' + m + '.' + p + '-0'; + ret = gtlt + M + '.' + m + '.' + p; } else if (xM) { // allow any ret = '*'; } else if (xm) { - // append '-0' onto the version, otherwise - // '1.x.x' matches '2.0.0-beta', since the tag - // *lowers* the version value - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; } else if (xp) { - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; } ; @@ -869,9 +899,9 @@ function replaceStars(comp, loose) { // This function is passed to string.replace(re[HYPHENRANGE]) // M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { @@ -879,18 +909,18 @@ function hyphenReplace($0, if (isX(fM)) from = ''; else if (isX(fm)) - from = '>=' + fM + '.0.0-0'; + from = '>=' + fM + '.0.0'; else if (isX(fp)) - from = '>=' + fM + '.' + fm + '.0-0'; + from = '>=' + fM + '.' + fm + '.0'; else from = '>=' + from; if (isX(tM)) to = ''; else if (isX(tm)) - to = '<' + (+tM + 1) + '.0.0-0'; + to = '<' + (+tM + 1) + '.0.0'; else if (isX(tp)) - to = '<' + tM + '.' + (+tm + 1) + '.0-0'; + to = '<' + tM + '.' + (+tm + 1) + '.0'; else if (tpr) to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; else @@ -904,6 +934,10 @@ function hyphenReplace($0, Range.prototype.test = function(version) { if (!version) return false; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version)) return true; @@ -916,6 +950,31 @@ function testSet(set, version) { if (!set[i].test(version)) return false; } + + if (version.prerelease.length) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (var i = 0; i < set.length; i++) { + ; + if (set[i].semver === ANY) + return true; + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver; + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) + return true; + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false; + } + return true; } diff --git a/deps/npm/node_modules/semver/semver.browser.js.gz b/deps/npm/node_modules/semver/semver.browser.js.gz index 2b07bae519..2d01ad972b 100644 Binary files a/deps/npm/node_modules/semver/semver.browser.js.gz and b/deps/npm/node_modules/semver/semver.browser.js.gz differ diff --git a/deps/npm/node_modules/semver/semver.js b/deps/npm/node_modules/semver/semver.js index a7385b41c5..8b5b93f96d 100644 --- a/deps/npm/node_modules/semver/semver.js +++ b/deps/npm/node_modules/semver/semver.js @@ -138,18 +138,18 @@ var XRANGEPLAIN = R++; src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' + - '(?:(' + src[PRERELEASE] + ')' + - ')?)?)?'; + '(?:' + src[PRERELEASE] + ')?' + + src[BUILD] + '?' + + ')?)?'; var XRANGEPLAINLOOSE = R++; src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' + - '(?:(' + src[PRERELEASELOOSE] + ')' + - ')?)?)?'; + '(?:' + src[PRERELEASELOOSE] + ')?' + + src[BUILD] + '?' + + ')?)?'; -// >=2.x, for example, means >=2.0.0-0 -// <1.x would be the same as "<1.0.0-0", though. var XRANGE = R++; src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'; var XRANGELOOSE = R++; @@ -246,7 +246,7 @@ function valid(version, loose) { exports.clean = clean; function clean(version, loose) { - var s = parse(version, loose); + var s = parse(version.trim().replace(/^[=v]+/, ''), loose); return s ? s.version : null; } @@ -358,14 +358,23 @@ SemVer.prototype.comparePre = function(other) { SemVer.prototype.inc = function(release) { switch (release) { case 'premajor': - this.inc('major'); + this.prerelease.length = 0; + this.patch = 0; + this.minor = 0; + this.major++; this.inc('pre'); break; case 'preminor': - this.inc('minor'); + this.prerelease.length = 0; + this.patch = 0; + this.minor++; this.inc('pre'); break; case 'prepatch': + // If this is already a prerelease, it will bump to the next version + // drop any prereleases that might already exist, since they are not + // relevant at this point. + this.prerelease.length = 0; this.inc('patch'); this.inc('pre'); break; @@ -376,11 +385,25 @@ SemVer.prototype.inc = function(release) { this.inc('patch'); this.inc('pre'); break; + case 'major': - this.major++; - this.minor = -1; + // If this is a pre-major version, bump up to the same major version. + // Otherwise increment major. + // 1.0.0-5 bumps to 1.0.0 + // 1.1.0 bumps to 2.0.0 + if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) + this.major++; + this.minor = 0; + this.patch = 0; + this.prerelease = []; + break; case 'minor': - this.minor++; + // If this is a pre-minor version, bump up to the same minor version. + // Otherwise increment minor. + // 1.2.0-5 bumps to 1.2.0 + // 1.2.1 bumps to 1.3.0 + if (this.patch !== 0 || this.prerelease.length === 0) + this.minor++; this.patch = 0; this.prerelease = []; break; @@ -393,8 +416,8 @@ SemVer.prototype.inc = function(release) { this.patch++; this.prerelease = []; break; - // This probably shouldn't be used publically. - // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction. + // This probably shouldn't be used publicly. + // 1.0.0 "pre" would become 1.0.0 which is the wrong direction. case 'pre': if (this.prerelease.length === 0) this.prerelease = [0]; @@ -514,8 +537,16 @@ exports.cmp = cmp; function cmp(a, op, b, loose) { var ret; switch (op) { - case '===': ret = a === b; break; - case '!==': ret = a !== b; break; + case '===': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a === b; + break; + case '!==': + if (typeof a === 'object') a = a.version; + if (typeof b === 'object') b = b.version; + ret = a !== b; + break; case '': case '=': case '==': ret = eq(a, b, loose); break; case '!=': ret = neq(a, b, loose); break; case '>': ret = gt(a, b, loose); break; @@ -547,6 +578,8 @@ function Comparator(comp, loose) { this.value = ''; else this.value = this.operator + this.semver.version; + + debug('comp', this); } var ANY = {}; @@ -558,24 +591,14 @@ Comparator.prototype.parse = function(comp) { throw new TypeError('Invalid comparator: ' + comp); this.operator = m[1]; + if (this.operator === '=') + this.operator = ''; + // if it literally is just '>' or '' then allow anything. if (!m[2]) this.semver = ANY; - else { + else this.semver = new SemVer(m[2], this.loose); - - // <1.2.3-rc DOES allow 1.2.3-beta (has prerelease) - // >=1.2.3 DOES NOT allow 1.2.3-beta - // <=1.2.3 DOES allow 1.2.3-beta - // However, <1.2.3 does NOT allow 1.2.3-beta, - // even though `1.2.3-beta < 1.2.3` - // The assumption is that the 1.2.3 version has something you - // *don't* want, so we push the prerelease down to the minimum. - if (this.operator === '<' && !this.semver.prerelease.length) { - this.semver.prerelease = ['0']; - this.semver.format(); - } - } }; Comparator.prototype.inspect = function() { @@ -588,8 +611,14 @@ Comparator.prototype.toString = function() { Comparator.prototype.test = function(version) { debug('Comparator.test', version, this.loose); - return (this.semver === ANY) ? true : - cmp(version, this.operator, this.semver, this.loose); + + if (this.semver === ANY) + return true; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + + return cmp(version, this.operator, this.semver, this.loose); }; @@ -726,20 +755,20 @@ function replaceTilde(comp, loose) { if (isX(M)) ret = ''; else if (isX(m)) - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) // ~1.2 == >=1.2.0- <1.3.0- - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else if (pr) { debug('replaceTilde pr', pr); if (pr.charAt(0) !== '-') pr = '-' + pr; ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0-0'; + ' <' + M + '.' + (+m + 1) + '.0'; } else - // ~1.2.3 == >=1.2.3-0 <1.3.0-0 - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + M + '.' + (+m + 1) + '.0-0'; + // ~1.2.3 == >=1.2.3 <1.3.0 + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; debug('tilde return', ret); return ret; @@ -759,6 +788,7 @@ function replaceCarets(comp, loose) { } function replaceCaret(comp, loose) { + debug('caret', comp, loose); var r = loose ? re[CARETLOOSE] : re[CARET]; return comp.replace(r, function(_, M, m, p, pr) { debug('caret', comp, _, M, m, p, pr); @@ -767,35 +797,38 @@ function replaceCaret(comp, loose) { if (isX(M)) ret = ''; else if (isX(m)) - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) { if (M === '0') - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else - ret = '>=' + M + '.' + m + '.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'; } else if (pr) { debug('replaceCaret pr', pr); if (pr.charAt(0) !== '-') pr = '-' + pr; if (M === '0') { if (m === '0') - ret = '=' + M + '.' + m + '.' + p + pr; + ret = '>=' + M + '.' + m + '.' + p + pr + + ' <' + M + '.' + m + '.' + (+p + 1); else ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + M + '.' + (+m + 1) + '.0-0'; + ' <' + M + '.' + (+m + 1) + '.0'; } else ret = '>=' + M + '.' + m + '.' + p + pr + - ' <' + (+M + 1) + '.0.0-0'; + ' <' + (+M + 1) + '.0.0'; } else { + debug('no pr'); if (M === '0') { if (m === '0') - ret = '=' + M + '.' + m + '.' + p; + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + m + '.' + (+p + 1); else - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.' + p + + ' <' + M + '.' + (+m + 1) + '.0'; } else - ret = '>=' + M + '.' + m + '.' + p + '-0' + - ' <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.' + m + '.' + p + + ' <' + (+M + 1) + '.0.0'; } debug('caret return', ret); @@ -824,7 +857,7 @@ function replaceXRange(comp, loose) { gtlt = ''; if (gtlt && anyX) { - // replace X with 0, and then append the -0 min-prerelease + // replace X with 0 if (xM) M = 0; if (xm) @@ -833,9 +866,9 @@ function replaceXRange(comp, loose) { p = 0; if (gtlt === '>') { - // >1 => >=2.0.0-0 - // >1.2 => >=1.3.0-0 - // >1.2.3 => >= 1.2.4-0 + // >1 => >=2.0.0 + // >1.2 => >=1.3.0 + // >1.2.3 => >= 1.2.4 gtlt = '>='; if (xM) { // no change @@ -850,17 +883,14 @@ function replaceXRange(comp, loose) { } - ret = gtlt + M + '.' + m + '.' + p + '-0'; + ret = gtlt + M + '.' + m + '.' + p; } else if (xM) { // allow any ret = '*'; } else if (xm) { - // append '-0' onto the version, otherwise - // '1.x.x' matches '2.0.0-beta', since the tag - // *lowers* the version value - ret = '>=' + M + '.0.0-0 <' + (+M + 1) + '.0.0-0'; + ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; } else if (xp) { - ret = '>=' + M + '.' + m + '.0-0 <' + M + '.' + (+m + 1) + '.0-0'; + ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; } debug('xRange return', ret); @@ -879,9 +909,9 @@ function replaceStars(comp, loose) { // This function is passed to string.replace(re[HYPHENRANGE]) // M, m, patch, prerelease, build -// 1.2 - 3.4.5 => >=1.2.0-0 <=3.4.5 -// 1.2.3 - 3.4 => >=1.2.0-0 <3.5.0-0 Any 3.4.x will do -// 1.2 - 3.4 => >=1.2.0-0 <3.5.0-0 +// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5 +// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do +// 1.2 - 3.4 => >=1.2.0 <3.5.0 function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) { @@ -889,18 +919,18 @@ function hyphenReplace($0, if (isX(fM)) from = ''; else if (isX(fm)) - from = '>=' + fM + '.0.0-0'; + from = '>=' + fM + '.0.0'; else if (isX(fp)) - from = '>=' + fM + '.' + fm + '.0-0'; + from = '>=' + fM + '.' + fm + '.0'; else from = '>=' + from; if (isX(tM)) to = ''; else if (isX(tm)) - to = '<' + (+tM + 1) + '.0.0-0'; + to = '<' + (+tM + 1) + '.0.0'; else if (isX(tp)) - to = '<' + tM + '.' + (+tm + 1) + '.0-0'; + to = '<' + tM + '.' + (+tm + 1) + '.0'; else if (tpr) to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr; else @@ -914,6 +944,10 @@ function hyphenReplace($0, Range.prototype.test = function(version) { if (!version) return false; + + if (typeof version === 'string') + version = new SemVer(version, this.loose); + for (var i = 0; i < this.set.length; i++) { if (testSet(this.set[i], version)) return true; @@ -926,6 +960,31 @@ function testSet(set, version) { if (!set[i].test(version)) return false; } + + if (version.prerelease.length) { + // Find the set of versions that are allowed to have prereleases + // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0 + // That should allow `1.2.3-pr.2` to pass. + // However, `1.2.4-alpha.notready` should NOT be allowed, + // even though it's within the range set by the comparators. + for (var i = 0; i < set.length; i++) { + debug(set[i].semver); + if (set[i].semver === ANY) + return true; + + if (set[i].semver.prerelease.length > 0) { + var allowed = set[i].semver; + if (allowed.major === version.major && + allowed.minor === version.minor && + allowed.patch === version.patch) + return true; + } + } + + // Version has a -pre, but it's not one of the ones we like. + return false; + } + return true; } diff --git a/deps/npm/node_modules/semver/semver.min.js b/deps/npm/node_modules/semver/semver.min.js index 66e13b8633..0dd841cb4e 100644 --- a/deps/npm/node_modules/semver/semver.min.js +++ b/deps/npm/node_modules/semver/semver.min.js @@ -1 +1 @@ -(function(e){if(typeof module==="object"&&module.exports===e)e=module.exports=H;e.SEMVER_SPEC_VERSION="2.0.0";var r=e.re=[];var t=e.src=[];var n=0;var i=n++;t[i]="0|[1-9]\\d*";var s=n++;t[s]="[0-9]+";var a=n++;t[a]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var o=n++;t[o]="("+t[i]+")\\."+"("+t[i]+")\\."+"("+t[i]+")";var f=n++;t[f]="("+t[s]+")\\."+"("+t[s]+")\\."+"("+t[s]+")";var u=n++;t[u]="(?:"+t[i]+"|"+t[a]+")";var c=n++;t[c]="(?:"+t[s]+"|"+t[a]+")";var l=n++;t[l]="(?:-("+t[u]+"(?:\\."+t[u]+")*))";var p=n++;t[p]="(?:-?("+t[c]+"(?:\\."+t[c]+")*))";var h=n++;t[h]="[0-9A-Za-z-]+";var v=n++;t[v]="(?:\\+("+t[h]+"(?:\\."+t[h]+")*))";var m=n++;var g="v?"+t[o]+t[l]+"?"+t[v]+"?";t[m]="^"+g+"$";var w="[v=\\s]*"+t[f]+t[p]+"?"+t[v]+"?";var d=n++;t[d]="^"+w+"$";var y=n++;t[y]="((?:<|>)?=?)";var b=n++;t[b]=t[s]+"|x|X|\\*";var $=n++;t[$]=t[i]+"|x|X|\\*";var j=n++;t[j]="[v=\\s]*("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:\\.("+t[$]+")"+"(?:("+t[l]+")"+")?)?)?";var k=n++;t[k]="[v=\\s]*("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:("+t[p]+")"+")?)?)?";var E=n++;t[E]="^"+t[y]+"\\s*"+t[j]+"$";var x=n++;t[x]="^"+t[y]+"\\s*"+t[k]+"$";var R=n++;t[R]="(?:~>?)";var S=n++;t[S]="(\\s*)"+t[R]+"\\s+";r[S]=new RegExp(t[S],"g");var V="$1~";var I=n++;t[I]="^"+t[R]+t[j]+"$";var T=n++;t[T]="^"+t[R]+t[k]+"$";var A=n++;t[A]="(?:\\^)";var C=n++;t[C]="(\\s*)"+t[A]+"\\s+";r[C]=new RegExp(t[C],"g");var M="$1^";var z=n++;t[z]="^"+t[A]+t[j]+"$";var P=n++;t[P]="^"+t[A]+t[k]+"$";var Z=n++;t[Z]="^"+t[y]+"\\s*("+w+")$|^$";var q=n++;t[q]="^"+t[y]+"\\s*("+g+")$|^$";var L=n++;t[L]="(\\s*)"+t[y]+"\\s*("+w+"|"+t[j]+")";r[L]=new RegExp(t[L],"g");var X="$1$2$3";var _=n++;t[_]="^\\s*("+t[j]+")"+"\\s+-\\s+"+"("+t[j]+")"+"\\s*$";var N=n++;t[N]="^\\s*("+t[k]+")"+"\\s+-\\s+"+"("+t[k]+")"+"\\s*$";var O=n++;t[O]="(<|>)?=?\\s*\\*";for(var B=0;B'};H.prototype.toString=function(){return this.version};H.prototype.compare=function(e){if(!(e instanceof H))e=new H(e,this.loose);return this.compareMain(e)||this.comparePre(e)};H.prototype.compareMain=function(e){if(!(e instanceof H))e=new H(e,this.loose);return Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)};H.prototype.comparePre=function(e){if(!(e instanceof H))e=new H(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Q(t,n)}while(++r)};H.prototype.inc=function(e){switch(e){case"premajor":this.inc("major");this.inc("pre");break;case"preminor":this.inc("minor");this.inc("pre");break;case"prepatch":this.inc("patch");this.inc("pre");break;case"prerelease":if(this.prerelease.length===0)this.inc("patch");this.inc("pre");break;case"major":this.major++;this.minor=-1;case"minor":this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var r=this.prerelease.length;while(--r>=0){if(typeof this.prerelease[r]==="number"){this.prerelease[r]++;r=-2}}if(r===-1)this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=J;function J(e,r,t){try{return new H(e,t).inc(r).version}catch(n){return null}}e.compareIdentifiers=Q;var K=/^[0-9]+$/;function Q(e,r){var t=K.test(e);var n=K.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=U;function U(e,r){return Q(r,e)}e.compare=W;function W(e,r,t){return new H(e,t).compare(r)}e.compareLoose=Y;function Y(e,r){return W(e,r,true)}e.rcompare=er;function er(e,r,t){return W(r,e,t)}e.sort=rr;function rr(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=tr;function tr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=nr;function nr(e,r,t){return W(e,r,t)>0}e.lt=ir;function ir(e,r,t){return W(e,r,t)<0}e.eq=sr;function sr(e,r,t){return W(e,r,t)===0}e.neq=ar;function ar(e,r,t){return W(e,r,t)!==0}e.gte=or;function or(e,r,t){return W(e,r,t)>=0}e.lte=fr;function fr(e,r,t){return W(e,r,t)<=0}e.cmp=ur;function ur(e,r,t,n){var i;switch(r){case"===":i=e===t;break;case"!==":i=e!==t;break;case"":case"=":case"==":i=sr(e,t,n);break;case"!=":i=ar(e,t,n);break;case">":i=nr(e,t,n);break;case">=":i=or(e,t,n);break;case"<":i=ir(e,t,n);break;case"<=":i=fr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=cr;function cr(e,r){if(e instanceof cr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof cr))return new cr(e,r);this.loose=r;this.parse(e);if(this.semver===lr)this.value="";else this.value=this.operator+this.semver.version}var lr={};cr.prototype.parse=function(e){var t=this.loose?r[Z]:r[q];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(!n[2])this.semver=lr;else{this.semver=new H(n[2],this.loose);if(this.operator==="<"&&!this.semver.prerelease.length){this.semver.prerelease=["0"];this.semver.format()}}};cr.prototype.inspect=function(){return''};cr.prototype.toString=function(){return this.value};cr.prototype.test=function(e){return this.semver===lr?true:ur(e,this.operator,this.semver,this.loose)};e.Range=pr;function pr(e,r){if(e instanceof pr&&e.loose===r)return e;if(!(this instanceof pr))return new pr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}pr.prototype.inspect=function(){return''};pr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};pr.prototype.toString=function(){return this.range};pr.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[N]:r[_];e=e.replace(n,kr);e=e.replace(r[L],X);e=e.replace(r[S],V);e=e.replace(r[C],M);e=e.split(/\s+/).join(" ");var i=t?r[Z]:r[q];var s=e.split(" ").map(function(e){return vr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new cr(e,t)});return s};e.toComparators=hr;function hr(e,r){return new pr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function vr(e,r){e=dr(e,r);e=gr(e,r);e=br(e,r);e=jr(e,r);return e}function mr(e){return!e||e.toLowerCase()==="x"||e==="*"}function gr(e,r){return e.trim().split(/\s+/).map(function(e){return wr(e,r)}).join(" ")}function wr(e,t){var n=t?r[T]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(mr(n))s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0-0"}else s=">="+r+"."+t+"."+n+"-0"+" <"+r+"."+(+t+1)+".0-0";return s})}function dr(e,r){return e.trim().split(/\s+/).map(function(e){return yr(e,r)}).join(" ")}function yr(e,t){var n=t?r[P]:r[z];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0-0 <"+(+r+1)+".0.0-0";else if(mr(n)){if(r==="0")s=">="+r+"."+t+".0-0 <"+r+"."+(+t+1)+".0-0";else s=">="+r+"."+t+".0-0 <"+(+r+1)+".0.0-0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s="="+r+"."+t+"."+n+i;else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0-0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0-0"}else{if(r==="0"){if(t==="0")s="="+r+"."+t+"."+n;else s=">="+r+"."+t+"."+n+"-0"+" <"+r+"."+(+t+1)+".0-0"}else s=">="+r+"."+t+"."+n+"-0"+" <"+(+r+1)+".0.0-0"}return s})}function br(e,r){return e.split(/\s+/).map(function(e){return $r(e,r)}).join(" ")}function $r(e,t){e=e.trim();var n=t?r[x]:r[E];return e.replace(n,function(e,r,t,n,i,s){var a=mr(t);var o=a||mr(n);var f=o||mr(i);var u=f;if(r==="="&&u)r="";if(r&&u){if(a)t=0;if(o)n=0;if(f)i=0;if(r===">"){r=">=";if(a){}else if(o){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}e=r+t+"."+n+"."+i+"-0"}else if(a){e="*"}else if(o){e=">="+t+".0.0-0 <"+(+t+1)+".0.0-0"}else if(f){e=">="+t+"."+n+".0-0 <"+t+"."+(+n+1)+".0-0"}return e})}function jr(e,t){return e.trim().replace(r[O],"")}function kr(e,r,t,n,i,s,a,o,f,u,c,l,p){if(mr(t))r="";else if(mr(n))r=">="+t+".0.0-0";else if(mr(i))r=">="+t+"."+n+".0-0";else r=">="+r;if(mr(f))o="";else if(mr(u))o="<"+(+f+1)+".0.0-0";else if(mr(c))o="<"+f+"."+(+u+1)+".0-0";else if(l)o="<="+f+"."+u+"."+c+"-"+l;else o="<="+o;return(r+" "+o).trim()}pr.prototype.test=function(e){if(!e)return false;for(var r=0;r",t)}e.outside=Tr;function Tr(e,r,t,n){e=new H(e,n);r=new pr(r,n);var i,s,a,o,f;switch(t){case">":i=nr;s=fr;a=ir;o=">";f=">=";break;case"<":i=ir;s=or;a=nr;o="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(xr(e,r,n)){return false}for(var u=0;u)?=?)";var b=n++;t[b]=t[s]+"|x|X|\\*";var j=n++;t[j]=t[i]+"|x|X|\\*";var $=n++;t[$]="[v=\\s]*("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:\\.("+t[j]+")"+"(?:"+t[c]+")?"+t[v]+"?"+")?)?";var k=n++;t[k]="[v=\\s]*("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:\\.("+t[b]+")"+"(?:"+t[p]+")?"+t[v]+"?"+")?)?";var E=n++;t[E]="^"+t[d]+"\\s*"+t[$]+"$";var x=n++;t[x]="^"+t[d]+"\\s*"+t[k]+"$";var R=n++;t[R]="(?:~>?)";var S=n++;t[S]="(\\s*)"+t[R]+"\\s+";r[S]=new RegExp(t[S],"g");var V="$1~";var I=n++;t[I]="^"+t[R]+t[$]+"$";var T=n++;t[T]="^"+t[R]+t[k]+"$";var A=n++;t[A]="(?:\\^)";var C=n++;t[C]="(\\s*)"+t[A]+"\\s+";r[C]=new RegExp(t[C],"g");var M="$1^";var z=n++;t[z]="^"+t[A]+t[$]+"$";var P=n++;t[P]="^"+t[A]+t[k]+"$";var Z=n++;t[Z]="^"+t[d]+"\\s*("+w+")$|^$";var q=n++;t[q]="^"+t[d]+"\\s*("+g+")$|^$";var L=n++;t[L]="(\\s*)"+t[d]+"\\s*("+w+"|"+t[$]+")";r[L]=new RegExp(t[L],"g");var X="$1$2$3";var _=n++;t[_]="^\\s*("+t[$]+")"+"\\s+-\\s+"+"("+t[$]+")"+"\\s*$";var N=n++;t[N]="^\\s*("+t[k]+")"+"\\s+-\\s+"+"("+t[k]+")"+"\\s*$";var O=n++;t[O]="(<|>)?=?\\s*\\*";for(var B=0;B'};H.prototype.toString=function(){return this.version};H.prototype.compare=function(e){if(!(e instanceof H))e=new H(e,this.loose);return this.compareMain(e)||this.comparePre(e)};H.prototype.compareMain=function(e){if(!(e instanceof H))e=new H(e,this.loose);return Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)};H.prototype.comparePre=function(e){if(!(e instanceof H))e=new H(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Q(t,n)}while(++r)};H.prototype.inc=function(e){switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre");break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre");break;case"prepatch":this.prerelease.length=0;this.inc("patch");this.inc("pre");break;case"prerelease":if(this.prerelease.length===0)this.inc("patch");this.inc("pre");break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var r=this.prerelease.length;while(--r>=0){if(typeof this.prerelease[r]==="number"){this.prerelease[r]++;r=-2}}if(r===-1)this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=J;function J(e,r,t){try{return new H(e,t).inc(r).version}catch(n){return null}}e.compareIdentifiers=Q;var K=/^[0-9]+$/;function Q(e,r){var t=K.test(e);var n=K.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=U;function U(e,r){return Q(r,e)}e.compare=W;function W(e,r,t){return new H(e,t).compare(r)}e.compareLoose=Y;function Y(e,r){return W(e,r,true)}e.rcompare=er;function er(e,r,t){return W(r,e,t)}e.sort=rr;function rr(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=tr;function tr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=nr;function nr(e,r,t){return W(e,r,t)>0}e.lt=ir;function ir(e,r,t){return W(e,r,t)<0}e.eq=sr;function sr(e,r,t){return W(e,r,t)===0}e.neq=or;function or(e,r,t){return W(e,r,t)!==0}e.gte=ar;function ar(e,r,t){return W(e,r,t)>=0}e.lte=fr;function fr(e,r,t){return W(e,r,t)<=0}e.cmp=ur;function ur(e,r,t,n){var i;switch(r){case"===":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e===t;break;case"!==":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e!==t;break;case"":case"=":case"==":i=sr(e,t,n);break;case"!=":i=or(e,t,n);break;case">":i=nr(e,t,n);break;case">=":i=ar(e,t,n);break;case"<":i=ir(e,t,n);break;case"<=":i=fr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=lr;function lr(e,r){if(e instanceof lr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof lr))return new lr(e,r);this.loose=r;this.parse(e);if(this.semver===cr)this.value="";else this.value=this.operator+this.semver.version}var cr={};lr.prototype.parse=function(e){var t=this.loose?r[Z]:r[q];var n=e.match(t);if(!n)throw new TypeError("Invalid comparator: "+e);this.operator=n[1];if(this.operator==="=")this.operator="";if(!n[2])this.semver=cr;else this.semver=new H(n[2],this.loose)};lr.prototype.inspect=function(){return''};lr.prototype.toString=function(){return this.value};lr.prototype.test=function(e){if(this.semver===cr)return true;if(typeof e==="string")e=new H(e,this.loose);return ur(e,this.operator,this.semver,this.loose)};e.Range=pr;function pr(e,r){if(e instanceof pr&&e.loose===r)return e;if(!(this instanceof pr))return new pr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}pr.prototype.inspect=function(){return''};pr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};pr.prototype.toString=function(){return this.range};pr.prototype.parseRange=function(e){var t=this.loose;e=e.trim();var n=t?r[N]:r[_];e=e.replace(n,kr);e=e.replace(r[L],X);e=e.replace(r[S],V);e=e.replace(r[C],M);e=e.split(/\s+/).join(" ");var i=t?r[Z]:r[q];var s=e.split(" ").map(function(e){return vr(e,t)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new lr(e,t)});return s};e.toComparators=hr;function hr(e,r){return new pr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function vr(e,r){e=yr(e,r);e=gr(e,r);e=br(e,r);e=$r(e,r);return e}function mr(e){return!e||e.toLowerCase()==="x"||e==="*"}function gr(e,r){return e.trim().split(/\s+/).map(function(e){return wr(e,r)}).join(" ")}function wr(e,t){var n=t?r[T]:r[I];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(mr(n))s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0";return s})}function yr(e,r){return e.trim().split(/\s+/).map(function(e){return dr(e,r)}).join(" ")}function dr(e,t){var n=t?r[P]:r[z];return e.replace(n,function(e,r,t,n,i){var s;if(mr(r))s="";else if(mr(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(mr(n)){if(r==="0")s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else s=">="+r+"."+t+".0 <"+(+r+1)+".0.0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+i+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0"}else{if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+(+r+1)+".0.0"}return s})}function br(e,r){return e.split(/\s+/).map(function(e){return jr(e,r)}).join(" ")}function jr(e,t){e=e.trim();var n=t?r[x]:r[E];return e.replace(n,function(e,r,t,n,i,s){var o=mr(t);var a=o||mr(n);var f=a||mr(i);var u=f;if(r==="="&&u)r="";if(r&&u){if(o)t=0;if(a)n=0;if(f)i=0;if(r===">"){r=">=";if(o){}else if(a){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}e=r+t+"."+n+"."+i}else if(o){e="*"}else if(a){e=">="+t+".0.0 <"+(+t+1)+".0.0"}else if(f){e=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0"}return e})}function $r(e,t){return e.trim().replace(r[O],"")}function kr(e,r,t,n,i,s,o,a,f,u,l,c,p){if(mr(t))r="";else if(mr(n))r=">="+t+".0.0";else if(mr(i))r=">="+t+"."+n+".0";else r=">="+r;if(mr(f))a="";else if(mr(u))a="<"+(+f+1)+".0.0";else if(mr(l))a="<"+f+"."+(+u+1)+".0";else if(c)a="<="+f+"."+u+"."+l+"-"+c;else a="<="+a;return(r+" "+a).trim()}pr.prototype.test=function(e){if(!e)return false;if(typeof e==="string")e=new H(e,this.loose);for(var r=0;r0){var n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return true}}return false}return true}e.satisfies=xr;function xr(e,r,t){try{r=new pr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Rr;function Rr(e,r,t){return e.filter(function(e){return xr(e,r,t)}).sort(function(e,r){return er(e,r,t)})[0]||null}e.validRange=Sr;function Sr(e,r){try{return new pr(e,r).range||"*"}catch(t){return null}}e.ltr=Vr;function Vr(e,r,t){return Tr(e,r,"<",t)}e.gtr=Ir;function Ir(e,r,t){return Tr(e,r,">",t)}e.outside=Tr;function Tr(e,r,t,n){e=new H(e,n);r=new pr(r,n);var i,s,o,a,f;switch(t){case">":i=nr;s=fr;o=ir;a=">";f=">=";break;case"<":i=ir;s=ar;o=nr;a="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(xr(e,r,n)){return false}for(var u=0;u=*', '0.2.4'], ['', '1.0.0'], @@ -187,13 +198,10 @@ test('\nrange tests', function(t) { ['>= 1', '1.0.0'], ['<1.2', '1.1.1'], ['< 1.2', '1.1.1'], - ['1', '1.0.0beta', true], ['~v0.5.4-pre', '0.5.5'], ['~v0.5.4-pre', '0.5.4'], ['=0.7.x', '0.7.2'], ['>=0.7.x', '0.7.2'], - ['=0.7.x', '0.7.0-asdf'], - ['>=0.7.x', '0.7.0-asdf'], ['<=0.7.x', '0.6.2'], ['~1.2.1 >=1.2.3', '1.2.3'], ['~1.2.1 =1.2.3', '1.2.3'], @@ -205,17 +213,15 @@ test('\nrange tests', function(t) { ['1.2.3 >=1.2.1', '1.2.3'], ['>=1.2.3 >=1.2.1', '1.2.3'], ['>=1.2.1 >=1.2.3', '1.2.3'], - ['<=1.2.3', '1.2.3-beta'], - ['>1.2', '1.3.0-beta'], ['>=1.2', '1.2.8'], ['^1.2.3', '1.8.1'], - ['^1.2.3', '1.2.3-beta'], ['^0.1.2', '0.1.2'], ['^0.1', '0.1.2'], ['^1.2', '1.4.2'], ['^1.2 ^1', '1.4.2'], - ['^1.2', '1.2.0-pre'], - ['^1.2.3', '1.2.3-pre'] + ['^1.2.3-alpha', '1.2.3-pre'], + ['^1.2.0-alpha', '1.2.0-pre'], + ['^0.0.1-alpha', '0.0.1-beta'] ].forEach(function(v) { var range = v[0]; var ver = v[1]; @@ -229,6 +235,20 @@ test('\nnegative range tests', function(t) { // [range, version] // version should not be included by range [['1.0.0 - 2.0.0', '2.2.3'], + ['1.2.3+asdf - 2.4.3+asdf', '1.2.3-pre.2'], + ['1.2.3+asdf - 2.4.3+asdf', '2.4.3-alpha'], + ['^1.2.3+build', '2.0.0'], + ['^1.2.3+build', '1.2.0'], + ['^1.2.3', '1.2.3-pre'], + ['^1.2', '1.2.0-pre'], + ['>1.2', '1.3.0-beta'], + ['<=1.2.3', '1.2.3-beta'], + ['^1.2.3', '1.2.3-beta'], + ['=0.7.x', '0.7.0-asdf'], + ['>=0.7.x', '0.7.0-asdf'], + ['1', '1.0.0beta', true], + ['<1', '1.0.0beta', true], + ['< 1', '1.0.0beta', true], ['1.0.0', '1.0.1'], ['>=1.0.0', '0.0.0'], ['>=1.0.0', '0.0.1'], @@ -268,8 +288,6 @@ test('\nnegative range tests', function(t) { ['>=1.2', '1.1.1'], ['1', '2.0.0beta', true], ['~v0.5.4-beta', '0.5.4-alpha'], - ['<1', '1.0.0beta', true], - ['< 1', '1.0.0beta', true], ['=0.7.x', '0.8.2'], ['>=0.7.x', '0.6.2'], ['<=0.7.x', '0.7.2'], @@ -327,12 +345,14 @@ test('\nincrement versions test', function(t) { ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'], ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'], ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'], + ['1.2.0', 'prepatch', '1.2.1-0'], + ['1.2.0-1', 'prepatch', '1.2.1-0'], ['1.2.0', 'preminor', '1.3.0-0'], + ['1.2.3-1', 'preminor', '1.3.0-0'], ['1.2.0', 'premajor', '2.0.0-0'], - ['1.2.0', 'preminor', '1.3.0-0'], - ['1.2.0', 'premajor', '2.0.0-0'] - - + ['1.2.3-1', 'premajor', '2.0.0-0'], + ['1.2.0-1', 'minor', '1.2.0'], + ['1.0.0-1', 'major', '1.0.0'] ].forEach(function(v) { var pre = v[0]; var what = v[1]; @@ -351,18 +371,18 @@ test('\nvalid range test', function(t) { // translate ranges into their canonical form [['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'], ['1.0.0', '1.0.0'], - ['>=*', '>=0.0.0-0'], + ['>=*', '>=0.0.0'], ['', '*'], ['*', '*'], ['*', '*'], ['>=1.0.0', '>=1.0.0'], ['>1.0.0', '>1.0.0'], ['<=2.0.0', '<=2.0.0'], - ['1', '>=1.0.0-0 <2.0.0-0'], + ['1', '>=1.0.0 <2.0.0'], ['<=2.0.0', '<=2.0.0'], ['<=2.0.0', '<=2.0.0'], - ['<2.0.0', '<2.0.0-0'], - ['<2.0.0', '<2.0.0-0'], + ['<2.0.0', '<2.0.0'], + ['<2.0.0', '<2.0.0'], ['>= 1.0.0', '>=1.0.0'], ['>= 1.0.0', '>=1.0.0'], ['>= 1.0.0', '>=1.0.0'], @@ -371,56 +391,56 @@ test('\nvalid range test', function(t) { ['<= 2.0.0', '<=2.0.0'], ['<= 2.0.0', '<=2.0.0'], ['<= 2.0.0', '<=2.0.0'], - ['< 2.0.0', '<2.0.0-0'], - ['< 2.0.0', '<2.0.0-0'], + ['< 2.0.0', '<2.0.0'], + ['< 2.0.0', '<2.0.0'], ['>=0.1.97', '>=0.1.97'], ['>=0.1.97', '>=0.1.97'], ['0.1.20 || 1.2.4', '0.1.20||1.2.4'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1-0'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], + ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], ['||', '||'], - ['2.x.x', '>=2.0.0-0 <3.0.0-0'], - ['1.2.x', '>=1.2.0-0 <1.3.0-0'], - ['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], - ['1.2.x || 2.x', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], + ['2.x.x', '>=2.0.0 <3.0.0'], + ['1.2.x', '>=1.2.0 <1.3.0'], + ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], + ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], ['x', '*'], - ['2.*.*', '>=2.0.0-0 <3.0.0-0'], - ['1.2.*', '>=1.2.0-0 <1.3.0-0'], - ['1.2.* || 2.*', '>=1.2.0-0 <1.3.0-0||>=2.0.0-0 <3.0.0-0'], + ['2.*.*', '>=2.0.0 <3.0.0'], + ['1.2.*', '>=1.2.0 <1.3.0'], + ['1.2.* || 2.*', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], ['*', '*'], - ['2', '>=2.0.0-0 <3.0.0-0'], - ['2.3', '>=2.3.0-0 <2.4.0-0'], - ['~2.4', '>=2.4.0-0 <2.5.0-0'], - ['~2.4', '>=2.4.0-0 <2.5.0-0'], - ['~>3.2.1', '>=3.2.1-0 <3.3.0-0'], - ['~1', '>=1.0.0-0 <2.0.0-0'], - ['~>1', '>=1.0.0-0 <2.0.0-0'], - ['~> 1', '>=1.0.0-0 <2.0.0-0'], - ['~1.0', '>=1.0.0-0 <1.1.0-0'], - ['~ 1.0', '>=1.0.0-0 <1.1.0-0'], - ['^0', '>=0.0.0-0 <1.0.0-0'], - ['^ 1', '>=1.0.0-0 <2.0.0-0'], - ['^0.1', '>=0.1.0-0 <0.2.0-0'], - ['^1.0', '>=1.0.0-0 <2.0.0-0'], - ['^1.2', '>=1.2.0-0 <2.0.0-0'], - ['^0.0.1', '=0.0.1'], - ['^0.0.1-beta', '=0.0.1-beta'], - ['^0.1.2', '>=0.1.2-0 <0.2.0-0'], - ['^1.2.3', '>=1.2.3-0 <2.0.0-0'], - ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0-0'], - ['<1', '<1.0.0-0'], - ['< 1', '<1.0.0-0'], - ['>=1', '>=1.0.0-0'], - ['>= 1', '>=1.0.0-0'], - ['<1.2', '<1.2.0-0'], - ['< 1.2', '<1.2.0-0'], - ['1', '>=1.0.0-0 <2.0.0-0'], + ['2', '>=2.0.0 <3.0.0'], + ['2.3', '>=2.3.0 <2.4.0'], + ['~2.4', '>=2.4.0 <2.5.0'], + ['~2.4', '>=2.4.0 <2.5.0'], + ['~>3.2.1', '>=3.2.1 <3.3.0'], + ['~1', '>=1.0.0 <2.0.0'], + ['~>1', '>=1.0.0 <2.0.0'], + ['~> 1', '>=1.0.0 <2.0.0'], + ['~1.0', '>=1.0.0 <1.1.0'], + ['~ 1.0', '>=1.0.0 <1.1.0'], + ['^0', '>=0.0.0 <1.0.0'], + ['^ 1', '>=1.0.0 <2.0.0'], + ['^0.1', '>=0.1.0 <0.2.0'], + ['^1.0', '>=1.0.0 <2.0.0'], + ['^1.2', '>=1.2.0 <2.0.0'], + ['^0.0.1', '>=0.0.1 <0.0.2'], + ['^0.0.1-beta', '>=0.0.1-beta <0.0.2'], + ['^0.1.2', '>=0.1.2 <0.2.0'], + ['^1.2.3', '>=1.2.3 <2.0.0'], + ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0'], + ['<1', '<1.0.0'], + ['< 1', '<1.0.0'], + ['>=1', '>=1.0.0'], + ['>= 1', '>=1.0.0'], + ['<1.2', '<1.2.0'], + ['< 1.2', '<1.2.0'], + ['1', '>=1.0.0 <2.0.0'], ['>01.02.03', '>1.2.3', true], ['>01.02.03', null], - ['~1.2.3beta', '>=1.2.3-beta <1.3.0-0', true], + ['~1.2.3beta', '>=1.2.3-beta <1.3.0', true], ['~1.2.3beta', null], - ['^ 1.2 ^ 1', '>=1.2.0-0 <2.0.0-0 >=1.0.0-0 <2.0.0-0'] + ['^ 1.2 ^ 1', '>=1.2.0 <2.0.0 >=1.0.0 <2.0.0'] ].forEach(function(v) { var pre = v[0]; var wanted = v[1]; @@ -438,7 +458,7 @@ test('\ncomparators test', function(t) { // turn range into a set of individual comparators [['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]], ['1.0.0', [['1.0.0']]], - ['>=*', [['>=0.0.0-0']]], + ['>=*', [['>=0.0.0']]], ['', [['']]], ['*', [['']]], ['*', [['']]], @@ -448,11 +468,11 @@ test('\ncomparators test', function(t) { ['>1.0.0', [['>1.0.0']]], ['>1.0.0', [['>1.0.0']]], ['<=2.0.0', [['<=2.0.0']]], - ['1', [['>=1.0.0-0', '<2.0.0-0']]], + ['1', [['>=1.0.0', '<2.0.0']]], ['<=2.0.0', [['<=2.0.0']]], ['<=2.0.0', [['<=2.0.0']]], - ['<2.0.0', [['<2.0.0-0']]], - ['<2.0.0', [['<2.0.0-0']]], + ['<2.0.0', [['<2.0.0']]], + ['<2.0.0', [['<2.0.0']]], ['>= 1.0.0', [['>=1.0.0']]], ['>= 1.0.0', [['>=1.0.0']]], ['>= 1.0.0', [['>=1.0.0']]], @@ -461,47 +481,48 @@ test('\ncomparators test', function(t) { ['<= 2.0.0', [['<=2.0.0']]], ['<= 2.0.0', [['<=2.0.0']]], ['<= 2.0.0', [['<=2.0.0']]], - ['< 2.0.0', [['<2.0.0-0']]], - ['<\t2.0.0', [['<2.0.0-0']]], + ['< 2.0.0', [['<2.0.0']]], + ['<\t2.0.0', [['<2.0.0']]], ['>=0.1.97', [['>=0.1.97']]], ['>=0.1.97', [['>=0.1.97']]], ['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1-0']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], + ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], ['||', [[''], ['']]], - ['2.x.x', [['>=2.0.0-0', '<3.0.0-0']]], - ['1.2.x', [['>=1.2.0-0', '<1.3.0-0']]], - ['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], - ['1.2.x || 2.x', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], + ['2.x.x', [['>=2.0.0', '<3.0.0']]], + ['1.2.x', [['>=1.2.0', '<1.3.0']]], + ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], ['x', [['']]], - ['2.*.*', [['>=2.0.0-0', '<3.0.0-0']]], - ['1.2.*', [['>=1.2.0-0', '<1.3.0-0']]], - ['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], - ['1.2.* || 2.*', [['>=1.2.0-0', '<1.3.0-0'], ['>=2.0.0-0', '<3.0.0-0']]], + ['2.*.*', [['>=2.0.0', '<3.0.0']]], + ['1.2.*', [['>=1.2.0', '<1.3.0']]], + ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], + ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], ['*', [['']]], - ['2', [['>=2.0.0-0', '<3.0.0-0']]], - ['2.3', [['>=2.3.0-0', '<2.4.0-0']]], - ['~2.4', [['>=2.4.0-0', '<2.5.0-0']]], - ['~2.4', [['>=2.4.0-0', '<2.5.0-0']]], - ['~>3.2.1', [['>=3.2.1-0', '<3.3.0-0']]], - ['~1', [['>=1.0.0-0', '<2.0.0-0']]], - ['~>1', [['>=1.0.0-0', '<2.0.0-0']]], - ['~> 1', [['>=1.0.0-0', '<2.0.0-0']]], - ['~1.0', [['>=1.0.0-0', '<1.1.0-0']]], - ['~ 1.0', [['>=1.0.0-0', '<1.1.0-0']]], - ['~ 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]], - ['~> 1.0.3', [['>=1.0.3-0', '<1.1.0-0']]], - ['<1', [['<1.0.0-0']]], - ['< 1', [['<1.0.0-0']]], - ['>=1', [['>=1.0.0-0']]], - ['>= 1', [['>=1.0.0-0']]], - ['<1.2', [['<1.2.0-0']]], - ['< 1.2', [['<1.2.0-0']]], - ['1', [['>=1.0.0-0', '<2.0.0-0']]], - ['1 2', [['>=1.0.0-0', '<2.0.0-0', '>=2.0.0-0', '<3.0.0-0']]], - ['1.2 - 3.4.5', [['>=1.2.0-0', '<=3.4.5']]], - ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0-0']]] + ['2', [['>=2.0.0', '<3.0.0']]], + ['2.3', [['>=2.3.0', '<2.4.0']]], + ['~2.4', [['>=2.4.0', '<2.5.0']]], + ['~2.4', [['>=2.4.0', '<2.5.0']]], + ['~>3.2.1', [['>=3.2.1', '<3.3.0']]], + ['~1', [['>=1.0.0', '<2.0.0']]], + ['~>1', [['>=1.0.0', '<2.0.0']]], + ['~> 1', [['>=1.0.0', '<2.0.0']]], + ['~1.0', [['>=1.0.0', '<1.1.0']]], + ['~ 1.0', [['>=1.0.0', '<1.1.0']]], + ['~ 1.0.3', [['>=1.0.3', '<1.1.0']]], + ['~> 1.0.3', [['>=1.0.3', '<1.1.0']]], + ['<1', [['<1.0.0']]], + ['< 1', [['<1.0.0']]], + ['>=1', [['>=1.0.0']]], + ['>= 1', [['>=1.0.0']]], + ['<1.2', [['<1.2.0']]], + ['< 1.2', [['<1.2.0']]], + ['1', [['>=1.0.0', '<2.0.0']]], + ['1 2', [['>=1.0.0', '<2.0.0', '>=2.0.0', '<3.0.0']]], + ['1.2 - 3.4.5', [['>=1.2.0', '<=3.4.5']]], + ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0']]], + ['1.2.3 - 3', [['>=1.2.3', '<4.0.0']]] ].forEach(function(v) { var pre = v[0]; var wanted = v[1]; @@ -555,7 +576,7 @@ test('\nstrict vs loose version numbers', function(t) { test('\nstrict vs loose ranges', function(t) { [['>=01.02.03', '>=1.2.3'], - ['~1.02.03beta', '>=1.2.3-beta <1.3.0-0'] + ['~1.02.03beta', '>=1.2.3-beta <1.3.0'] ].forEach(function(v) { var loose = v[0]; var comps = v[1]; diff --git a/deps/npm/node_modules/semver/test/ltr.js b/deps/npm/node_modules/semver/test/ltr.js index a4f503a3c4..ecd1387ddf 100644 --- a/deps/npm/node_modules/semver/test/ltr.js +++ b/deps/npm/node_modules/semver/test/ltr.js @@ -66,6 +66,10 @@ test('\nltr tests', function(t) { ['>1', '1.0.0beta', true], ['> 1', '1.0.0beta', true], ['=0.7.x', '0.6.2'], + ['=0.7.x', '0.7.0-asdf'], + ['^1', '1.0.0-0'], + ['>=0.7.x', '0.7.0-asdf'], + ['1', '1.0.0beta', true], ['>=0.7.x', '0.6.2'] ].forEach(function(tuple) { var range = tuple[0]; @@ -145,24 +149,27 @@ test('\nnegative ltr tests', function(t) { ['>= 1', '1.0.0'], ['<1.2', '1.1.1'], ['< 1.2', '1.1.1'], - ['1', '1.0.0beta', true], ['~v0.5.4-pre', '0.5.5'], ['~v0.5.4-pre', '0.5.4'], ['=0.7.x', '0.7.2'], ['>=0.7.x', '0.7.2'], - ['=0.7.x', '0.7.0-asdf'], - ['>=0.7.x', '0.7.0-asdf'], ['<=0.7.x', '0.6.2'], ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], ['>=0.2.3 <=0.2.4', '0.2.4'], ['1.0.0 - 2.0.0', '2.0.0'], - ['^1', '1.0.0-0'], ['^3.0.0', '4.0.0'], ['^1.0.0 || ~2.0.1', '2.0.0'], ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], - ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'] + ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'], + ['^1.0.0alpha', '1.0.0beta', true], + ['~1.0.0alpha', '1.0.0beta', true], + ['^1.0.0-alpha', '1.0.0beta', true], + ['~1.0.0-alpha', '1.0.0beta', true], + ['^1.0.0-alpha', '1.0.0-beta'], + ['~1.0.0-alpha', '1.0.0-beta'], + ['=0.1.0', '1.0.0'] ].forEach(function(tuple) { var range = tuple[0]; var version = tuple[1]; diff --git a/deps/npm/node_modules/semver/test/no-module.js b/deps/npm/node_modules/semver/test/no-module.js index 96d1cd1fc5..8b50873f13 100644 --- a/deps/npm/node_modules/semver/test/no-module.js +++ b/deps/npm/node_modules/semver/test/no-module.js @@ -4,9 +4,9 @@ var test = tap.test; test('no module system', function(t) { var fs = require('fs'); var vm = require('vm'); - var head = fs.readFileSync(require.resolve('../head.js'), 'utf8'); + var head = fs.readFileSync(require.resolve('../head.js.txt'), 'utf8'); var src = fs.readFileSync(require.resolve('../'), 'utf8'); - var foot = fs.readFileSync(require.resolve('../foot.js'), 'utf8'); + var foot = fs.readFileSync(require.resolve('../foot.js.txt'), 'utf8'); vm.runInThisContext(head + src + foot, 'semver.js'); // just some basic poking to see if it did some stuff diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js index 0ca7705284..630722099e 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js @@ -240,7 +240,7 @@ function howMuchToRead(n, state) { if (state.objectMode) return n === 0 ? 0 : 1; - if (isNaN(n) || n === null) { + if (n === null || isNaN(n)) { // only flow one buffer at a time if (state.flowing && state.buffer.length) return state.buffer[0].length; @@ -275,6 +275,7 @@ Readable.prototype.read = function(n) { var state = this._readableState; state.calledRead = true; var nOrig = n; + var ret; if (typeof n !== 'number' || n > 0) state.emittedReadable = false; @@ -293,9 +294,28 @@ Readable.prototype.read = function(n) { // if we've ended, and we're now clear, then finish it up. if (n === 0 && state.ended) { + ret = null; + + // In cases where the decoder did not receive enough data + // to produce a full chunk, then immediately received an + // EOF, state.buffer will contain [, ]. + // howMuchToRead will see this and coerce the amount to + // read to zero (because it's looking at the length of the + // first in state.buffer), and we'll end up here. + // + // This can only happen via state.decoder -- no other venue + // exists for pushing a zero-length chunk into state.buffer + // and triggering this behavior. In this case, we return our + // remaining data and end the stream, if appropriate. + if (state.length > 0 && state.decoder) { + ret = fromList(n, state); + state.length -= ret.length; + } + if (state.length === 0) endReadable(this); - return null; + + return ret; } // All the actual chunk generation logic needs to be @@ -349,7 +369,6 @@ Readable.prototype.read = function(n) { if (doRead && !state.reading) n = howMuchToRead(nOrig, state); - var ret; if (n > 0) ret = fromList(n, state); else @@ -382,8 +401,7 @@ function chunkInvalid(state, chunk) { 'string' !== typeof chunk && chunk !== null && chunk !== undefined && - !state.objectMode && - !er) { + !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); } return er; @@ -814,7 +832,12 @@ Readable.prototype.wrap = function(stream) { stream.on('data', function(chunk) { if (state.decoder) chunk = state.decoder.write(chunk); - if (!chunk || !state.objectMode && !chunk.length) + + // don't skip over falsy values in objectMode + //if (state.objectMode && util.isNullOrUndefined(chunk)) + if (state.objectMode && (chunk === null || chunk === undefined)) + return; + else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = self.push(chunk); diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js index d0254d5a71..4bdaa4fa49 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js @@ -37,7 +37,6 @@ var util = require('core-util-is'); util.inherits = require('inherits'); /**/ - var Stream = require('stream'); util.inherits(Writable, Stream); diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json index 2b7593c193..2155d11c62 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -35,7 +35,7 @@ "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" }, - "_from": "core-util-is@~1.0.0", + "_from": "core-util-is@>=1.0.0 <1.1.0", "_npmVersion": "1.3.23", "_npmUser": { "name": "isaacs", @@ -49,6 +49,5 @@ ], "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" } diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json index fc7904b67b..04d6a3fd31 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json @@ -47,8 +47,5 @@ ], "directories": {}, "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - } + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" } diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js index 2e44a03e15..b00e54fb79 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js @@ -36,6 +36,14 @@ function assertEncoding(encoding) { } } +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. CESU-8 is handled as part of the UTF-8 encoding. +// +// @TODO Handling all encodings inside a single object makes it very difficult +// to reason about this code, so it should be split up in the future. +// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code +// points as used by CESU-8. var StringDecoder = exports.StringDecoder = function(encoding) { this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); assertEncoding(encoding); @@ -60,37 +68,50 @@ var StringDecoder = exports.StringDecoder = function(encoding) { return; } + // Enough space to store all bytes of a single character. UTF-8 needs 4 + // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). this.charBuffer = new Buffer(6); + // Number of bytes received for the current incomplete multi-byte character. this.charReceived = 0; + // Number of bytes expected for the current incomplete multi-byte character. this.charLength = 0; }; +// write decodes the given buffer and returns it as JS string that is +// guaranteed to not contain any partial multi-byte characters. Any partial +// character found at the end of the buffer is buffered up, and will be +// returned when calling write again with the remaining bytes. +// +// Note: Converting a Buffer containing an orphan surrogate to a String +// currently works, but converting a String to a Buffer (via `new Buffer`, or +// Buffer#write) will replace incomplete surrogates with the unicode +// replacement character. See https://codereview.chromium.org/121173009/ . StringDecoder.prototype.write = function(buffer) { var charStr = ''; - var offset = 0; - // if our last write ended with an incomplete multibyte character while (this.charLength) { // determine how many remaining bytes this buffer has to offer for this char - var i = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; + var available = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, offset, i); - this.charReceived += (i - offset); - offset = i; + buffer.copy(this.charBuffer, this.charReceived, 0, available); + this.charReceived += available; if (this.charReceived < this.charLength) { // still not enough chars in this buffer? wait for more ... return ''; } + // remove bytes belonging to the current character from the buffer + buffer = buffer.slice(available, buffer.length); + // get the character that was split charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - // lead surrogate (D800-DBFF) is also the incomplete character + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character var charCode = charStr.charCodeAt(charStr.length - 1); if (charCode >= 0xD800 && charCode <= 0xDBFF) { this.charLength += this.surrogateSize; @@ -100,34 +121,33 @@ StringDecoder.prototype.write = function(buffer) { this.charReceived = this.charLength = 0; // if there are no more bytes in this buffer, just emit our char - if (i == buffer.length) return charStr; - - // otherwise cut off the characters end from the beginning of this buffer - buffer = buffer.slice(i, buffer.length); + if (buffer.length === 0) { + return charStr; + } break; } - var lenIncomplete = this.detectIncompleteChar(buffer); + // determine and set charLength / charReceived + this.detectIncompleteChar(buffer); var end = buffer.length; if (this.charLength) { // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - lenIncomplete, end); - this.charReceived = lenIncomplete; - end -= lenIncomplete; + buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); + end -= this.charReceived; } charStr += buffer.toString(this.encoding, 0, end); var end = charStr.length - 1; var charCode = charStr.charCodeAt(end); - // lead surrogate (D800-DBFF) is also the incomplete character + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character if (charCode >= 0xD800 && charCode <= 0xDBFF) { var size = this.surrogateSize; this.charLength += size; this.charReceived += size; this.charBuffer.copy(this.charBuffer, size, 0, size); - this.charBuffer.write(charStr.charAt(charStr.length - 1), this.encoding); + buffer.copy(this.charBuffer, 0, 0, size); return charStr.substring(0, end); } @@ -135,6 +155,10 @@ StringDecoder.prototype.write = function(buffer) { return charStr; }; +// detectIncompleteChar determines if there is an incomplete UTF-8 character at +// the end of the given buffer. If so, it sets this.charLength to the byte +// length that character, and sets this.charReceived to the number of bytes +// that are available for this character. StringDecoder.prototype.detectIncompleteChar = function(buffer) { // determine how many bytes we have to check at the end of this buffer var i = (buffer.length >= 3) ? 3 : buffer.length; @@ -164,8 +188,7 @@ StringDecoder.prototype.detectIncompleteChar = function(buffer) { break; } } - - return i; + this.charReceived = i; }; StringDecoder.prototype.end = function(buffer) { @@ -188,13 +211,11 @@ function passThroughWrite(buffer) { } function utf16DetectIncompleteChar(buffer) { - var incomplete = this.charReceived = buffer.length % 2; - this.charLength = incomplete ? 2 : 0; - return incomplete; + this.charReceived = buffer.length % 2; + this.charLength = this.charReceived ? 2 : 0; } function base64DetectIncompleteChar(buffer) { - var incomplete = this.charReceived = buffer.length % 3; - this.charLength = incomplete ? 3 : 0; - return incomplete; + this.charReceived = buffer.length % 3; + this.charLength = this.charReceived ? 3 : 0; } diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json index 2e827f5921..21c9cd535c 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -1,6 +1,6 @@ { "name": "string_decoder", - "version": "0.10.25-1", + "version": "0.10.31", "description": "The string_decoder module from Node core", "main": "index.js", "dependencies": {}, @@ -22,16 +22,14 @@ "browserify" ], "license": "MIT", + "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", "bugs": { "url": "https://github.com/rvagg/string_decoder/issues" }, - "_id": "string_decoder@0.10.25-1", - "dist": { - "shasum": "f387babd95d23a2bb73b1fbf2cb3efab6f78baab", - "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.25-1.tgz" - }, - "_from": "string_decoder@~0.10.x", - "_npmVersion": "1.3.24", + "_id": "string_decoder@0.10.31", + "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "_from": "string_decoder@>=0.10.0 <0.11.0", + "_npmVersion": "1.4.23", "_npmUser": { "name": "rvagg", "email": "rod@vagg.org" @@ -46,8 +44,10 @@ "email": "rod@vagg.org" } ], + "dist": { + "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", + "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + }, "directories": {}, - "_shasum": "f387babd95d23a2bb73b1fbf2cb3efab6f78baab", - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.25-1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" } diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/package.json index 8d8961b95a..7483ebbecf 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/package.json @@ -1,6 +1,6 @@ { "name": "readable-stream", - "version": "1.0.27-1", + "version": "1.0.31", "description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x", "main": "readable.js", "dependencies": { @@ -37,13 +37,10 @@ "url": "https://github.com/isaacs/readable-stream/issues" }, "homepage": "https://github.com/isaacs/readable-stream", - "_id": "readable-stream@1.0.27-1", - "dist": { - "shasum": "6b67983c20357cefd07f0165001a16d710d91078", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.27-1.tgz" - }, - "_from": "readable-stream@1.0", - "_npmVersion": "1.4.3", + "_id": "readable-stream@1.0.31", + "_shasum": "8f2502e0bc9e3b0da1b94520aabb4e2603ecafae", + "_from": "readable-stream@>=1.0.0 <1.1.0", + "_npmVersion": "1.4.9", "_npmUser": { "name": "rvagg", "email": "rod@vagg.org" @@ -62,8 +59,10 @@ "email": "rod@vagg.org" } ], + "dist": { + "shasum": "8f2502e0bc9e3b0da1b94520aabb4e2603ecafae", + "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.31.tgz" + }, "directories": {}, - "_shasum": "6b67983c20357cefd07f0165001a16d710d91078", - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.27-1.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.31.tgz" } diff --git a/deps/npm/node_modules/sha/package.json b/deps/npm/node_modules/sha/package.json index 091919964a..1b8b2aa7ff 100644 --- a/deps/npm/node_modules/sha/package.json +++ b/deps/npm/node_modules/sha/package.json @@ -30,7 +30,7 @@ "shasum": "1f9a377f27b6fdee409b9b858e43da702be48a4d", "tarball": "http://registry.npmjs.org/sha/-/sha-1.2.4.tgz" }, - "_from": "sha@latest", + "_from": "sha@>=1.2.1 <1.3.0", "_npmVersion": "1.4.3", "_npmUser": { "name": "forbeslindesay", diff --git a/deps/npm/node_modules/slide/package.json b/deps/npm/node_modules/slide/package.json index 481ff52656..1c0b30bf2a 100644 --- a/deps/npm/node_modules/slide/package.json +++ b/deps/npm/node_modules/slide/package.json @@ -33,7 +33,7 @@ "_id": "slide@1.1.6", "scripts": {}, "_shasum": "56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707", - "_from": "slide@~1.1.6", + "_from": "slide@>=1.1.6 <1.2.0", "_npmVersion": "2.0.0-beta.3", "_npmUser": { "name": "isaacs", @@ -50,6 +50,5 @@ "tarball": "http://registry.npmjs.org/slide/-/slide-1.1.6.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz" } diff --git a/deps/npm/node_modules/tar/package.json b/deps/npm/node_modules/tar/package.json index 4f66030350..207eaa1fdd 100644 --- a/deps/npm/node_modules/tar/package.json +++ b/deps/npm/node_modules/tar/package.json @@ -26,8 +26,6 @@ "tap": "0.x" }, "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": "476bf6f5882b9c33d1cbf66f175d0f25e3981044", "bugs": { "url": "https://github.com/isaacs/node-tar/issues" @@ -35,5 +33,23 @@ "homepage": "https://github.com/isaacs/node-tar", "_id": "tar@1.0.1", "_shasum": "6075b5a1f236defe0c7e3756d3d9b3ebdad0f19a", - "_from": "tar@latest" + "_from": "tar@1.0.1", + "_npmVersion": "1.4.23", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "6075b5a1f236defe0c7e3756d3d9b3ebdad0f19a", + "tarball": "http://registry.npmjs.org/tar/-/tar-1.0.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/tar/-/tar-1.0.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/package.json b/deps/npm/package.json index a2961a3606..f371e5789d 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "1.4.28", + "version": "2.0.0", "name": "npm", "description": "A package manager for node", "keywords": [ @@ -36,18 +36,20 @@ "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", "archy": "0", + "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.0", + "cmd-shim": "~2.0.1", "columnify": "~1.2.1", "editor": "~0.1.0", + "fs-vacuum": "~1.2.1", "fstream": "~1.0.2", "fstream-npm": "~1.0.0", "github-url-from-git": "~1.4.0", - "github-url-from-username-repo": "~1.0.0", + "github-url-from-username-repo": "~1.0.2", "glob": "~4.0.5", "graceful-fs": "~3.0.0", "inflight": "~1.0.1", @@ -59,23 +61,25 @@ "mkdirp": "~0.5.0", "node-gyp": "~1.0.1", "nopt": "~3.0.1", + "normalize-package-data": "~1.0.1", "npm-cache-filename": "~1.0.1", "npm-install-checks": "~1.0.2", - "npm-registry-client": "~2.0.7", + "npm-package-arg": "~2.1.2", + "npm-registry-client": "~3.2.1", "npm-user-validate": "~0.1.0", - "npmconf": "~1.1.8", + "npmconf": "~2.0.8", "npmlog": "~0.1.1", "once": "~1.3.0", "opener": "~1.3.0", "osenv": "~0.1.0", "path-is-inside": "~1.0.0", "read": "~1.0.4", - "read-installed": "~2.0.5", + "read-installed": "~3.1.2", "read-package-json": "~1.2.7", "request": "~2.42.0", "retry": "~0.6.0", "rimraf": "~2.2.8", - "semver": "~2.3.0", + "semver": "~4.0.0", "sha": "~1.2.1", "slide": "~1.1.6", "sorted-object": "~1.0.0", @@ -90,6 +94,7 @@ "ansicolors", "ansistyles", "archy", + "async-some", "block-stream", "char-spinner", "child-process-close", @@ -97,7 +102,9 @@ "chownr", "cmd-shim", "columnify", + "dezalgo", "editor", + "fs-vacuum", "fstream", "fstream-npm", "github-url-from-git", @@ -114,8 +121,10 @@ "mkdirp", "node-gyp", "nopt", + "normalize-package-data", "npm-cache-filename", "npm-install-checks", + "npm-package-arg", "npm-registry-client", "npm-user-validate", "npmconf", @@ -141,14 +150,12 @@ ], "devDependencies": { "marked": "~0.3.2", - "npm-registry-couchapp": "~2.3.6", + "marked-man": "~0.1.3", + "nock": "~0.34.1", + "npm-registry-couchapp": "~2.5.3", "npm-registry-mock": "~0.6.3", - "ronn": "~0.3.6", - "tap": "~0.4.9" - }, - "engines": { - "node": ">=0.8", - "npm": "1" + "require-inject": "~1.0.0", + "tap": "~0.4.12" }, "scripts": { "test-legacy": "node ./test/run.js", diff --git a/deps/npm/scripts/doc-build.sh b/deps/npm/scripts/doc-build.sh index 9afab0782b..3728259ac0 100755 --- a/deps/npm/scripts/doc-build.sh +++ b/deps/npm/scripts/doc-build.sh @@ -6,26 +6,26 @@ fi set -o errexit set -o pipefail -if ! [ -x node_modules/.bin/ronn ]; then +if ! [ -x node_modules/.bin/marked-man ]; then ps=0 - if [ -f .building_ronn ]; then - pid=$(cat .building_ronn) + if [ -f .building_marked-man ]; then + pid=$(cat .building_marked-man) ps=$(ps -p $pid | grep $pid | wc -l) || true fi - if [ -f .building_ronn ] && [ $ps != 0 ]; then - while [ -f .building_ronn ]; do + if [ -f .building_marked-man ] && [ $ps != 0 ]; then + while [ -f .building_marked-man ]; do sleep 1 done else - # a race to see which make process will be the one to install ronn - echo $$ > .building_ronn + # a race to see which make process will be the one to install marked-man + echo $$ > .building_marked-man sleep 1 - if [ $(cat .building_ronn) == $$ ]; then - make node_modules/.bin/ronn - rm .building_ronn + if [ $(cat .building_marked-man) == $$ ]; then + make node_modules/.bin/marked-man + rm .building_marked-man else - while [ -f .building_ronn ]; do + while [ -f .building_marked-man ]; do sleep 1 done fi @@ -68,7 +68,7 @@ mkdir -p $(dirname $dest) case $dest in *.[1357]) - ./node_modules/.bin/ronn --roff $src \ + ./node_modules/.bin/marked-man --roff $src \ | sed "s|@VERSION@|$version|g" \ | perl -pi -e 's/(npm\\-)?([a-zA-Z\\\.\-]*)\(1\)/npm help \2/g' \ | perl -pi -e 's/(npm\\-)?([a-zA-Z\\\.\-]*)\(([57])\)/npm help \3 \2/g' \ diff --git a/deps/npm/test/common-tap.js b/deps/npm/test/common-tap.js index d6d09ed9bc..3a1f584a73 100644 --- a/deps/npm/test/common-tap.js +++ b/deps/npm/test/common-tap.js @@ -26,7 +26,7 @@ exports.npm = function (cmd, opts, cb) { child.on("error", cb) - child.on("close", function (code, signal) { + child.on("close", function (code) { cb(null, code, stdout, stderr) }) } diff --git a/deps/npm/test/packages/npm-test-optional-deps/package.json b/deps/npm/test/packages/npm-test-optional-deps/package.json index 56c6f09ed0..67545ca9da 100644 --- a/deps/npm/test/packages/npm-test-optional-deps/package.json +++ b/deps/npm/test/packages/npm-test-optional-deps/package.json @@ -5,7 +5,6 @@ { "npm-test-foobarzaaakakaka": "http://example.com/" , "dnode": "10.999.14234" , "sax": "0.3.5" - , "999 invalid name": "1.2.3" , "glob": "some invalid version 99 #! $$ x y z" , "npm-test-failer":"*" } diff --git a/deps/npm/test/run.js b/deps/npm/test/run.js index 008cfbac45..904df5b8e4 100644 --- a/deps/npm/test/run.js +++ b/deps/npm/test/run.js @@ -7,7 +7,7 @@ var path = require("path") , testdir = __dirname , fs = require("graceful-fs") , npmpkg = path.dirname(testdir) - , npmcli = path.join(__dirname, "bin", "npm-cli.js") + , npmcli = path.resolve(npmpkg, "bin", "npm-cli.js") var temp = process.env.TMPDIR || process.env.TMP @@ -63,7 +63,7 @@ function prefix (content, pref) { } var execCount = 0 -function exec (cmd, shouldFail, cb) { +function exec (cmd, cwd, shouldFail, cb) { if (typeof shouldFail === "function") { cb = shouldFail, shouldFail = false } @@ -81,7 +81,10 @@ function exec (cmd, shouldFail, cb) { cmd = cmd.replace(/^npm /, npmReplace + " ") cmd = cmd.replace(/^node /, nodeReplace + " ") - child_process.exec(cmd, {env: env}, function (er, stdout, stderr) { + console.error("$$$$$$ cd %s; PATH=%s %s", cwd, env.PATH, cmd) + + child_process.exec(cmd, {cwd: cwd, env: env}, function (er, stdout, stderr) { + console.error("$$$$$$ after command", cmd, cwd) if (stdout) { console.error(prefix(stdout, " 1> ")) } @@ -102,10 +105,8 @@ function exec (cmd, shouldFail, cb) { } function execChain (cmds, cb) { - chain(cmds.reduce(function (l, r) { - return l.concat(r) - }, []).map(function (cmd) { - return [exec, cmd] + chain(cmds.map(function (args) { + return [exec].concat(args) }), cb) } @@ -118,9 +119,8 @@ function flatten (arr) { function setup (cb) { cleanup(function (er) { if (er) return cb(er) - execChain([ "node \""+path.resolve(npmpkg, "bin", "npm-cli.js") - + "\" install \""+npmpkg+"\"" - , "npm config set package-config:foo boo" + execChain([ [ "node \""+npmcli+"\" install \""+npmpkg+"\"", root ], + [ "npm config set package-config:foo boo", root ] ], cb) }) } @@ -134,6 +134,7 @@ function main (cb) { failures = 0 process.chdir(testdir) + var base = path.resolve(root, path.join("lib", "node_modules")) // get the list of packages var packages = fs.readdirSync(path.resolve(testdir, "packages")) @@ -150,17 +151,17 @@ function main (cb) { packagesToRm.push("npm") } - chain - ( [ setup - , [ exec, "npm install "+npmpkg ] + chain( + [ setup + , [ exec, "npm install "+npmpkg, testdir ] , [ execChain, packages.map(function (p) { - return "npm install packages/"+p + return [ "npm install packages/"+p, testdir ] }) ] , [ execChain, packages.map(function (p) { - return "npm test "+p + return [ "npm test -ddd", path.resolve(base, p) ] }) ] , [ execChain, packagesToRm.map(function (p) { - return "npm rm " + p + return [ "npm rm "+p, root ] }) ] , installAndTestEach ] @@ -171,15 +172,15 @@ function main (cb) { function installAndTestEach (cb) { var thingsToChain = [ setup - , [ execChain, packages.map(function (p) { - return [ "npm install packages/"+p - , "npm test "+p - , "npm rm "+p ] - }) ] + , [ execChain, flatten(packages.map(function (p) { + return [ [ "npm install packages/"+p, testdir ] + , [ "npm test", path.resolve(base, p) ] + , [ "npm rm "+p, root ] ] + })) ] ] if (process.platform !== "win32") { // Windows can't handle npm rm npm due to file-in-use issues. - thingsToChain.push([exec, "npm rm npm"]) + thingsToChain.push([exec, "npm rm npm", testdir]) } chain(thingsToChain, cb) diff --git a/deps/npm/test/tap/00-verify-ls-ok.js b/deps/npm/test/tap/00-verify-ls-ok.js new file mode 100644 index 0000000000..7209e7db7e --- /dev/null +++ b/deps/npm/test/tap/00-verify-ls-ok.js @@ -0,0 +1,15 @@ +var test = require("tap").test +var node = process.execPath +var path = require("path") +var cwd = path.resolve(__dirname, "..", "..") +var npm = path.resolve(cwd, "cli.js") +var spawn = require("child_process").spawn + +test("npm ls in npm", function (t) { + var opt = { cwd: cwd, stdio: [ "ignore", "ignore", 2 ] } + var child = spawn(node, [npm, "ls"], opt) + child.on("close", function (code) { + t.notOk(code) + t.end() + }) +}) diff --git a/deps/npm/test/tap/cache-add-localdir-fallback.js b/deps/npm/test/tap/cache-add-localdir-fallback.js new file mode 100644 index 0000000000..6b036c3809 --- /dev/null +++ b/deps/npm/test/tap/cache-add-localdir-fallback.js @@ -0,0 +1,76 @@ +var path = require("path") +var test = require("tap").test +var npm = require("../../lib/npm.js") +var requireInject = require("require-inject") + +npm.load({loglevel : "silent"}, function () { + var resolved = path.resolve(__dirname, "dir-with-package") + var resolvedPackage = path.join(resolved, "package.json") + + var cache = requireInject("../../lib/cache.js", { + "graceful-fs": { + stat: function (file, cb) { + process.nextTick(function () { + switch (file) { + case "named": + cb(new Error("ENOENT")) + break + case "file.tgz": + cb(null, { isDirectory: function () { return false } }) + break + case "dir-no-package": + cb(null, { isDirectory: function () { return true } }) + break + case "dir-no-package/package.json": + cb(new Error("ENOENT")) + break + case "dir-with-package": + cb(null, { isDirectory: function () { return true } }) + break + case "dir-with-package/package.json": + cb(null, {}) + break + case resolved: + cb(null, { isDirectory: function () { return true } }) + break + case resolvedPackage: + cb(null, {}) + break + default: + throw new Error("Unknown test file passed to stat: " + file) + } + }) + } + }, + "../../lib/cache/add-named.js": function addNamed (name, version, data, cb) { + cb(null, "addNamed") + }, + "../../lib/cache/add-local.js": function addLocal (name, data, cb) { + cb(null, "addLocal") + } + }) + + test("npm install localdir fallback", function (t) { + t.plan(10) + cache.add("named", null, null, false, function (er, which) { + t.ifError(er, "named was cached") + t.is(which, "addNamed", "registry package name") + }) + cache.add("file.tgz", null, null, false, function (er, which) { + t.ifError(er, "file.tgz was cached") + t.is(which, "addLocal", "local file") + }) + cache.add("dir-no-package", null, null, false, function (er, which) { + t.ifError(er, "local directory was cached") + t.is(which, "addNamed", "local directory w/o package.json") + }) + cache.add("dir-with-package", null, null, false, function (er, which) { + t.ifError(er, "local directory with package was cached") + t.is(which,"addLocal", "local directory with package.json") + }) + cache.add("file:./dir-with-package", null, __dirname, false, function (er, which) { + t.ifError(er, "local directory (as URI) with package was cached") + t.is(which, "addLocal", "file: URI to local directory with package.json") + }) + }) +}) diff --git a/deps/npm/test/tap/cache-shasum.js b/deps/npm/test/tap/cache-shasum.js index 2139d8fb79..7450d3e608 100644 --- a/deps/npm/test/tap/cache-shasum.js +++ b/deps/npm/test/tap/cache-shasum.js @@ -1,7 +1,6 @@ var npm = require.resolve("../../") 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") @@ -44,7 +43,7 @@ test("compare", function(t) { var d = path.resolve(__dirname, "cache-shasum/request") var p = path.resolve(d, "2.27.0/package.tgz") var r = require("./cache-shasum/localhost_1337/request/.cache.json") - var rshasum = r.versions['2.27.0'].dist.shasum + var rshasum = r.versions["2.27.0"].dist.shasum sha.get(p, function (er, pshasum) { if (er) throw er diff --git a/deps/npm/test/tap/config-meta.js b/deps/npm/test/tap/config-meta.js index 75a66604cf..26ca6f2b05 100644 --- a/deps/npm/test/tap/config-meta.js +++ b/deps/npm/test/tap/config-meta.js @@ -16,8 +16,13 @@ var CONFS = {} var DOC = {} var exceptions = [ + path.resolve(lib, "adduser.js"), path.resolve(lib, "config.js"), - path.resolve(lib, "utils", "lifecycle.js") + path.resolve(lib, "publish.js"), + path.resolve(lib, "utils", "lifecycle.js"), + path.resolve(lib, "utils", "map-to-registry.js"), + path.resolve(nm, "npm-registry-client", "lib", "publish.js"), + path.resolve(nm, "npm-registry-client", "lib", "request.js") ] test("get files", function (t) { @@ -46,7 +51,7 @@ test("get files", function (t) { test("get lines", function (t) { FILES.forEach(function (f) { - var lines = fs.readFileSync(f, 'utf8').split('\n') + var lines = fs.readFileSync(f, 'utf8').split(/\r|\n/) lines.forEach(function (l, i) { var matches = l.split(/conf(?:ig)?\.get\(/g) matches.shift() @@ -71,7 +76,7 @@ test("get lines", function (t) { }) test("get docs", function (t) { - var d = fs.readFileSync(doc, "utf8").split("\n") + var d = fs.readFileSync(doc, "utf8").split(/\r|\n/) // walk down until the "## Config Settings" section for (var i = 0; i < d.length && d[i] !== "## Config Settings"; i++); i++ @@ -100,7 +105,7 @@ test("check configs", function (t) { } for (var c in DOC) { - if (c !== "versions" && c !== "version") { + if (c !== "versions" && c !== "version" && c !== "init.version") { t.ok(CONFS[c], "config in doc should be used somewhere " + c) t.ok(types.indexOf(c) !== -1, "should be defined in npmconf " + c) t.ok(defaults.indexOf(c) !== -1, "should have default in npmconf " + c) diff --git a/deps/npm/test/tap/git-cache-permissions.js b/deps/npm/test/tap/git-cache-permissions.js new file mode 100644 index 0000000000..27905fba5e --- /dev/null +++ b/deps/npm/test/tap/git-cache-permissions.js @@ -0,0 +1,80 @@ +var test = require("tap").test + , fs = require("fs") + , path = require("path") + , rimraf = require("rimraf") + , mkdirp = require("mkdirp") + , spawn = require("child_process").spawn + , npm = require("../../lib/npm") + , npmCli = require.resolve("../../bin/npm-cli.js") + , node = process.execPath + , pkg = path.resolve(__dirname, "git-cache-permissions") + , tmp = path.join(pkg, "tmp") + , cache = path.join(pkg, "cache") + + +test("setup", function (t) { + rimraf.sync(pkg) + mkdirp.sync(pkg) + mkdirp.sync(cache) + mkdirp.sync(tmp) + mkdirp.sync(path.resolve(pkg, 'node_modules')) + t.end() +}) + +test("git-cache-permissions: install a git dependency", function (t) { + + // disable git integration tests on Travis. + if (process.env.TRAVIS) return t.end() + + var command = [ npmCli + , "install" + , "git://github.com/nigelzor/npm-4503-a.git" + ] + var child = spawn(node, command, { + cwd: pkg, + env: { + npm_config_cache: cache, + npm_config_tmp: tmp, + npm_config_prefix: pkg, + npm_config_global: "false", + npm_config_umask: "00", + HOME: process.env.HOME, + Path: process.env.PATH, + PATH: process.env.PATH + }, + stdio: "inherit" + }) + + child.on("close", function (code) { + t.equal(code, 0, "npm install should succeed") + + // verify permissions on git hooks + var repoDir = "git-github-com-nigelzor-npm-4503-a-git-40c5cb24" + var hooksPath = path.join(cache, "_git-remotes", repoDir, "hooks") + fs.readdir(hooksPath, function (err, files) { + if (err) { + t.ok(false, "error reading hooks: " + err) + t.end() + } + + files.forEach(function (file) { + var stats = fs.statSync(path.join(hooksPath, file)) + var message = "hook [" + file + "] should have correct permissions" + + // Possible error conditions and the resulting file modes on hooks + // npm.modes.file is used directly -> "100666" + // permissions are left untouched -> "100755" + // we do not want permissions left untouched because of + // https://github.com/npm/npm/issues/3117 + t.equal(stats.mode.toString(8), "100777", message) + }) + + t.end() + }) + }) +}) + +test('cleanup', function(t) { + rimraf.sync(pkg) + t.end() +}) diff --git a/deps/npm/test/tap/ignore-install-link.js b/deps/npm/test/tap/ignore-install-link.js index 2c90b9a6d4..44ae541538 100644 --- a/deps/npm/test/tap/ignore-install-link.js +++ b/deps/npm/test/tap/ignore-install-link.js @@ -4,20 +4,17 @@ if (process.platform === "win32") { } var common = require("../common-tap.js") var test = require("tap").test -var npm = require.resolve("../../bin/npm-cli.js") -var node = process.execPath var path = require("path") var fs = require("fs") var rimraf = require("rimraf") var mkdirp = require("mkdirp") -var spawn = require("child_process").spawn var root = path.resolve(__dirname, "ignore-install-link") var pkg = path.resolve(root, "pkg") var dep = path.resolve(root, "dep") var target = path.resolve(pkg, "node_modules", "dep") var cache = path.resolve(root, "cache") -var global = path.resolve(root, "global") +var globalPath = path.resolve(root, "global") var pkgj = { "name":"pkg", "version": "1.2.3" , "dependencies": { "dep": "1.2.3" } } @@ -34,7 +31,7 @@ test("setup", function (t) { mkdirp.sync(path.resolve(pkg, "node_modules")) mkdirp.sync(dep) mkdirp.sync(cache) - mkdirp.sync(global) + mkdirp.sync(globalPath) fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify(pkgj)) fs.writeFileSync(path.resolve(dep, "package.json"), JSON.stringify(depj)) fs.symlinkSync(dep, target, "dir") @@ -47,13 +44,13 @@ test("ignore install if package is linked", function (t) { env: { PATH: process.env.PATH || process.env.Path, HOME: process.env.HOME, - npm_config_prefix: global, - npm_config_cache: cache, - npm_config_registry: common.registry, - npm_config_loglevel: "silent" + "npm_config_prefix": globalPath, + "npm_config_cache": cache, + "npm_config_registry": common.registry, + "npm_config_loglevel": "silent" }, stdio: "inherit" - }, function (er, code, stdout, stderr) { + }, function (er, code) { if (er) throw er t.equal(code, 0) t.end() diff --git a/deps/npm/test/tap/install-at-locally.js b/deps/npm/test/tap/install-at-locally.js index 18ea6c3a60..f6290e1089 100644 --- a/deps/npm/test/tap/install-at-locally.js +++ b/deps/npm/test/tap/install-at-locally.js @@ -1,7 +1,6 @@ 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') diff --git a/deps/npm/test/tap/install-from-local.js b/deps/npm/test/tap/install-from-local.js new file mode 100644 index 0000000000..2dc3b57721 --- /dev/null +++ b/deps/npm/test/tap/install-from-local.js @@ -0,0 +1,38 @@ +var test = require("tap").test +var npm = require("../../") +var path = require("path") +var fs = require("fs") +var rimraf = require("rimraf") +var pkg = path.join(__dirname, "install-from-local", "package-with-local-paths") + +test("setup", function (t) { + process.chdir(pkg) + t.end() +}) + +test('"npm install" should install local packages', function (t) { + npm.load({loglevel : "silent"}, function () { + npm.commands.install(["."], function (err) { + t.ifError(err, "local packages installed") + 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")) + t.end() +}) diff --git a/deps/npm/test/tap/install-from-local/package-local-dependency/package.json b/deps/npm/test/tap/install-from-local/package-local-dependency/package.json new file mode 100644 index 0000000000..a524d82624 --- /dev/null +++ b/deps/npm/test/tap/install-from-local/package-local-dependency/package.json @@ -0,0 +1,5 @@ +{ + "name": "package-local-dependency", + "version": "0.0.0", + "description": "Test for local installs" +} diff --git a/deps/npm/test/tap/install-from-local/package-local-dev-dependency/package.json b/deps/npm/test/tap/install-from-local/package-local-dev-dependency/package.json new file mode 100644 index 0000000000..23f3ad6824 --- /dev/null +++ b/deps/npm/test/tap/install-from-local/package-local-dev-dependency/package.json @@ -0,0 +1,5 @@ +{ + "name": "package-local-dev-dependency", + "version": "0.0.0", + "description": "Test for local installs" +} diff --git a/deps/npm/test/tap/install-from-local/package-with-local-paths/package.json b/deps/npm/test/tap/install-from-local/package-with-local-paths/package.json new file mode 100644 index 0000000000..bf4a3e946c --- /dev/null +++ b/deps/npm/test/tap/install-from-local/package-with-local-paths/package.json @@ -0,0 +1,10 @@ +{ + "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" + } +} diff --git a/deps/npm/test/tap/install-save-exact.js b/deps/npm/test/tap/install-save-exact.js index cf25b779bc..c9f4866601 100644 --- a/deps/npm/test/tap/install-save-exact.js +++ b/deps/npm/test/tap/install-save-exact.js @@ -1,7 +1,6 @@ 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') diff --git a/deps/npm/test/tap/install-save-local.js b/deps/npm/test/tap/install-save-local.js new file mode 100644 index 0000000000..52396f4bed --- /dev/null +++ b/deps/npm/test/tap/install-save-local.js @@ -0,0 +1,68 @@ +var test = require("tap").test +var npm = require("../../") +var path = require("path") +var fs = require("fs") +var rimraf = require("rimraf") +var pkg = path.join(__dirname, "install-save-local", "package") + +test("setup", function (t) { + resetPackageJSON(pkg) + process.chdir(pkg) + t.end() +}) +test('"npm install --save ../local/path" should install local package and save to package.json', function(t) { + resetPackageJSON(pkg) + npm.load({loglevel : "silent"}, function() { + npm.config.set("save", true) + npm.commands.install(["../package-local-dependency"], function(err) { + t.ifError(err) + + 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" + }) + npm.config.set("save", undefined) + + t.end() + }) + }) +}) + +test('"npm install --save-dev ../local/path" should install local package and save to package.json', function(t) { + resetPackageJSON(pkg) + npm.load({loglevel : "silent"}, function() { + npm.config.set("save-dev", true) + npm.commands.install(["../package-local-dev-dependency"], function(err) { + t.ifError(err) + + 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" + }) + npm.config.set("save", undefined) + + t.end() + }) + }) +}) + +test("cleanup", function(t) { + resetPackageJSON(pkg) + process.chdir(__dirname) + rimraf.sync(path.resolve(pkg, "node_modules")) + 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") +} diff --git a/deps/npm/test/tap/install-save-local/package-local-dependency/package.json b/deps/npm/test/tap/install-save-local/package-local-dependency/package.json new file mode 100644 index 0000000000..a524d82624 --- /dev/null +++ b/deps/npm/test/tap/install-save-local/package-local-dependency/package.json @@ -0,0 +1,5 @@ +{ + "name": "package-local-dependency", + "version": "0.0.0", + "description": "Test for local installs" +} diff --git a/deps/npm/test/tap/install-save-local/package-local-dev-dependency/package.json b/deps/npm/test/tap/install-save-local/package-local-dev-dependency/package.json new file mode 100644 index 0000000000..23f3ad6824 --- /dev/null +++ b/deps/npm/test/tap/install-save-local/package-local-dev-dependency/package.json @@ -0,0 +1,5 @@ +{ + "name": "package-local-dev-dependency", + "version": "0.0.0", + "description": "Test for local installs" +} diff --git a/deps/npm/test/tap/install-save-local/package/package.json b/deps/npm/test/tap/install-save-local/package/package.json new file mode 100644 index 0000000000..c6a5cb99d5 --- /dev/null +++ b/deps/npm/test/tap/install-save-local/package/package.json @@ -0,0 +1,4 @@ +{ + "name": "package", + "version": "0.0.0" +} diff --git a/deps/npm/test/tap/install-save-prefix.js b/deps/npm/test/tap/install-save-prefix.js index bbdeddf3fe..0e78005b6e 100644 --- a/deps/npm/test/tap/install-save-prefix.js +++ b/deps/npm/test/tap/install-save-prefix.js @@ -1,7 +1,6 @@ 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') diff --git a/deps/npm/test/tap/install-scoped-link.js b/deps/npm/test/tap/install-scoped-link.js new file mode 100644 index 0000000000..c411b664d7 --- /dev/null +++ b/deps/npm/test/tap/install-scoped-link.js @@ -0,0 +1,52 @@ +var exec = require("child_process").exec +var existsSync = require("fs").existsSync +var join = require("path").join +// var resolve = require("path").resolve + +var test = require("tap").test +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") + +var npm = require("../../") + +var pkg = join(__dirname, "install-scoped") +var work = join(__dirname, "install-scoped-TEST") +var modules = join(work, "node_modules") + +test("setup", function (t) { + mkdirp.sync(modules) + process.chdir(work) + + t.end() +}) + +test("installing package with links", function (t) { + npm.load(function() { + npm.commands.install([pkg], function (err) { + t.ifError(err, "install ran to completion without error") + + t.ok( + existsSync(join(modules, "@scoped", "package", "package.json")), + "package installed" + ) + t.ok(existsSync(join(modules, ".bin")), "binary link directory exists") + + var hello = 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") + + t.end() + }) + }) + }) +}) + +test("cleanup", function(t) { + process.chdir(__dirname) + rimraf.sync(work) + t.end() +}) diff --git a/deps/npm/test/tap/install-scoped/package.json b/deps/npm/test/tap/install-scoped/package.json new file mode 100644 index 0000000000..32700cf6af --- /dev/null +++ b/deps/npm/test/tap/install-scoped/package.json @@ -0,0 +1,7 @@ +{ + "name": "@scoped/package", + "version": "0.0.0", + "bin": { + "hello": "./world.js" + } +} diff --git a/deps/npm/test/tap/install-scoped/world.js b/deps/npm/test/tap/install-scoped/world.js new file mode 100644 index 0000000000..f6333ba5b1 --- /dev/null +++ b/deps/npm/test/tap/install-scoped/world.js @@ -0,0 +1 @@ +console.log("hello blrbld") diff --git a/deps/npm/test/tap/lifecycle-path.js b/deps/npm/test/tap/lifecycle-path.js new file mode 100644 index 0000000000..34684a0c39 --- /dev/null +++ b/deps/npm/test/tap/lifecycle-path.js @@ -0,0 +1,61 @@ +var test = require("tap").test +var common = require("../common-tap.js") +var path = require("path") +var rimraf = require("rimraf") +var mkdirp = require("mkdirp") +var pkg = path.resolve(__dirname, "lifecycle-path") +var fs = require("fs") +var link = path.resolve(pkg, "node-bin") + +// Without the path to the shell, nothing works usually. +var PATH +if (process.platform === "win32") { + PATH = "C:\\Windows\\system32;C:\\Windows" +} else { + PATH = "/bin:/usr/bin" +} + +test("setup", function (t) { + rimraf.sync(link) + fs.symlinkSync(path.dirname(process.execPath), link, "dir") + t.end() +}) + +test("make sure the path is correct", function (t) { + common.npm(["run-script", "path"], { + cwd: pkg, + env: { + PATH: PATH, + stdio: [ 0, "pipe", 2 ] + } + }, function (er, code, stdout, stderr) { + if (er) throw er + 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 actual = stdout.split(pathSplit).map(function (p) { + if (p.indexOf(root) === 0) { + p = "{{ROOT}}" + p.substr(root.length) + } + 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" + ].concat(PATH.split(pathSplit).map(function (p) { + return p.replace(/\\/g, "/") + })) + t.same(actual, expect) + t.end() + }) +}) + +test("clean", function (t) { + rimraf.sync(link) + t.end() +}) + diff --git a/deps/npm/test/tap/lifecycle-path/package.json b/deps/npm/test/tap/lifecycle-path/package.json new file mode 100644 index 0000000000..42e792e467 --- /dev/null +++ b/deps/npm/test/tap/lifecycle-path/package.json @@ -0,0 +1 @@ +{"name":"glorb","version":"1.2.3","scripts":{"path":"./node-bin/node print-path.js"}} diff --git a/deps/npm/test/tap/lifecycle-path/print-path.js b/deps/npm/test/tap/lifecycle-path/print-path.js new file mode 100644 index 0000000000..c7ad00b3d3 --- /dev/null +++ b/deps/npm/test/tap/lifecycle-path/print-path.js @@ -0,0 +1 @@ +console.log(process.env.PATH) diff --git a/deps/npm/test/tap/maybe-github.js b/deps/npm/test/tap/maybe-github.js index 8b7105e6ea..52a62e11bb 100644 --- a/deps/npm/test/tap/maybe-github.js +++ b/deps/npm/test/tap/maybe-github.js @@ -4,15 +4,15 @@ 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') +var remoteGitPath = require.resolve("../../lib/cache/add-remote-git.js") require("module")._cache[remoteGitPath] = { id: remoteGitPath, - exports: function stub(_, error, __, cb) { + exports: function stub(_, __, cb) { if (found) { cb(null, {}) } else { - cb(error) + cb(new Error("not on filesystem")) } } } @@ -24,23 +24,19 @@ test("should throw with no parameters", function (t) { t.plan(1) t.throws(function () { - maybeGithub(); + maybeGithub() }, "throws when called without parameters") }) test("should throw with wrong parameter types", function (t) { - t.plan(3) + t.plan(2) t.throws(function () { - maybeGithub({}, new Error(), function () {}) + maybeGithub({}, function () {}) }, "expects only a package name") t.throws(function () { - maybeGithub("npm/xxx-noexist", null, function () {}) - }, "expects to be called after a previous check already failed") - - t.throws(function () { - maybeGithub("npm/xxx-noexist", new Error(), "ham") + maybeGithub("npm/xxx-noexist", "ham") }, "is always async") }) @@ -49,7 +45,7 @@ test("should find an existing package on Github", function (t) { npm.load({}, function (error) { t.notOk(error, "bootstrapping succeeds") t.doesNotThrow(function () { - maybeGithub("npm/npm", new Error("not on filesystem"), function (error, data) { + maybeGithub("npm/npm", function (error, data) { t.notOk(error, "no issues in looking things up") t.ok(data, "received metadata from Github") t.end() @@ -62,7 +58,7 @@ test("shouldn't find a nonexistent package on Github", function (t) { found = false npm.load({}, function () { t.doesNotThrow(function () { - maybeGithub("npm/xxx-noexist", new Error("not on filesystem"), function (error, data) { + maybeGithub("npm/xxx-noexist", function (error, data) { t.equal( error.message, "not on filesystem", diff --git a/deps/npm/test/tap/nested-extraneous.js b/deps/npm/test/tap/nested-extraneous.js new file mode 100644 index 0000000000..fcba0418e6 --- /dev/null +++ b/deps/npm/test/tap/nested-extraneous.js @@ -0,0 +1,53 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var mkdirp = require("mkdirp") +var fs = require("fs") +var rimraf = require("rimraf") +var path = require("path") + +var pkg = path.resolve(__dirname, "nested-extraneous") +var pj = { + name: "nested-extraneous", + version: "1.2.3" +} + +var dep = path.resolve(pkg, "node_modules", "dep") +var deppj = { + name: "nested-extraneous-dep", + version: "1.2.3", + dependencies: { + "nested-extra-depdep": "*" + } +} + +var depdep = path.resolve(dep, "node_modules", "depdep") +var depdeppj = { + name: "nested-extra-depdep", + version: "1.2.3" +} + +test("setup", function (t) { + rimraf.sync(pkg) + mkdirp.sync(depdep) + fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify(pj)) + fs.writeFileSync(path.resolve(dep, "package.json"), JSON.stringify(deppj)) + fs.writeFileSync(path.resolve(depdep, "package.json"), JSON.stringify(depdeppj)) + t.end() +}) + +test("test", function (t) { + common.npm(["ls"], { + cwd: pkg + }, function (er, code, sto, ste) { + if (er) throw er + t.notEqual(code, 0) + t.notSimilar(ste, /depdep/) + t.notSimilar(sto, /depdep/) + t.end() + }) +}) + +test("clean", function (t) { + rimraf.sync(pkg) + t.end() +}) diff --git a/deps/npm/test/tap/optional-metadep-rollback-collision.js b/deps/npm/test/tap/optional-metadep-rollback-collision.js new file mode 100644 index 0000000000..29db793bc4 --- /dev/null +++ b/deps/npm/test/tap/optional-metadep-rollback-collision.js @@ -0,0 +1,56 @@ +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) { + cleanup() + 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" + }, + stdio: [ 0, "pipe", 2 ] + }, function (er, code, sout) { + if (er) throw er + t.equal(code, 0) + t.equal(sout, "ok\nok\n") + t.notOk(/not ok/.test(sout), "should not contain the string 'not ok'") + t.end() + }) +}) + +test("verify results", function (t) { + t.throws(function () { + fs.statSync(nm) + }) + t.end() +}) + +test("cleanup", function (t) { + cleanup() + t.end() +}) + +function cleanup () { + try { + var pid = +fs.readFileSync(pidfile) + process.kill(pid, "SIGKILL") + } catch (er) {} + + rimraf.sync(cache) + rimraf.sync(nm) + rimraf.sync(pidfile) +} diff --git a/deps/npm/test/tap/optional-metadep-rollback-collision/deps/d1/package.json b/deps/npm/test/tap/optional-metadep-rollback-collision/deps/d1/package.json new file mode 100644 index 0000000000..26cd1dea32 --- /dev/null +++ b/deps/npm/test/tap/optional-metadep-rollback-collision/deps/d1/package.json @@ -0,0 +1,13 @@ +{ + "name": "d1", + "version": "1.0.0", + "description": "I FAIL CONSTANTLY", + "scripts": { + "preinstall": "sleep 1" + }, + "dependencies": { + "foo": "http://localhost:8080/" + }, + "author": "Forrest L Norvell ", + "license": "ISC" +} diff --git a/deps/npm/test/tap/optional-metadep-rollback-collision/deps/d2/blart.js b/deps/npm/test/tap/optional-metadep-rollback-collision/deps/d2/blart.js new file mode 100644 index 0000000000..c69b8a5d08 --- /dev/null +++ b/deps/npm/test/tap/optional-metadep-rollback-collision/deps/d2/blart.js @@ -0,0 +1,52 @@ +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) +}) diff --git a/deps/npm/test/tap/optional-metadep-rollback-collision/deps/d2/package.json b/deps/npm/test/tap/optional-metadep-rollback-collision/deps/d2/package.json new file mode 100644 index 0000000000..08eeba4f7e --- /dev/null +++ b/deps/npm/test/tap/optional-metadep-rollback-collision/deps/d2/package.json @@ -0,0 +1,15 @@ +{ + "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 ", + "license": "ISC" +} diff --git a/deps/npm/test/tap/optional-metadep-rollback-collision/deps/opdep/bad-server.js b/deps/npm/test/tap/optional-metadep-rollback-collision/deps/opdep/bad-server.js new file mode 100644 index 0000000000..4818884c49 --- /dev/null +++ b/deps/npm/test/tap/optional-metadep-rollback-collision/deps/opdep/bad-server.js @@ -0,0 +1,35 @@ +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") +} diff --git a/deps/npm/test/tap/optional-metadep-rollback-collision/deps/opdep/package.json b/deps/npm/test/tap/optional-metadep-rollback-collision/deps/opdep/package.json new file mode 100644 index 0000000000..3289c123e8 --- /dev/null +++ b/deps/npm/test/tap/optional-metadep-rollback-collision/deps/opdep/package.json @@ -0,0 +1,15 @@ +{ + "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 ", + "license": "ISC" +} diff --git a/deps/npm/test/tap/optional-metadep-rollback-collision/package.json b/deps/npm/test/tap/optional-metadep-rollback-collision/package.json new file mode 100644 index 0000000000..0d812a6e00 --- /dev/null +++ b/deps/npm/test/tap/optional-metadep-rollback-collision/package.json @@ -0,0 +1,10 @@ +{ + "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 ", + "license": "ISC" +} diff --git a/deps/npm/test/tap/outdated-notarget.js b/deps/npm/test/tap/outdated-notarget.js index 79fb88c67c..782f6f7d59 100644 --- a/deps/npm/test/tap/outdated-notarget.js +++ b/deps/npm/test/tap/outdated-notarget.js @@ -1,23 +1,23 @@ // Fixes Issue #1770 -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 pkg = path.resolve(__dirname, 'outdated-notarget') -var cache = path.resolve(pkg, 'cache') -var mr = require('npm-registry-mock') +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 pkg = path.resolve(__dirname, "outdated-notarget") +var cache = path.resolve(pkg, "cache") +var mr = require("npm-registry-mock") -test('outdated-target: if no viable version is found, show error', function(t) { +test("outdated-target: if no viable version is found, show error", function(t) { t.plan(1) setup() mr({port: common.port}, function(s) { npm.load({ cache: cache, registry: common.registry}, function() { - npm.commands.update(function(er, d) { - t.equal(er.code, 'ETARGET') + npm.commands.update(function(er) { + t.equal(er.code, "ETARGET") s.close() t.end() }) @@ -25,7 +25,7 @@ test('outdated-target: if no viable version is found, show error', function(t) { }) }) -test('cleanup', function(t) { +test("cleanup", function(t) { process.chdir(osenv.tmpdir()) rimraf.sync(pkg) t.end() @@ -34,14 +34,14 @@ test('cleanup', function(t) { function setup() { mkdirp.sync(pkg) mkdirp.sync(cache) - fs.writeFileSync(path.resolve(pkg, 'package.json'), JSON.stringify({ - author: 'Evan Lucas', - name: 'outdated-notarget', - version: '0.0.0', - description: 'Test for outdated-target', + fs.writeFileSync(path.resolve(pkg, "package.json"), JSON.stringify({ + author: "Evan Lucas", + name: "outdated-notarget", + version: "0.0.0", + description: "Test for outdated-target", dependencies: { - underscore: '~199.7.1' + underscore: "~199.7.1" } - }), 'utf8') + }), "utf8") process.chdir(pkg) } diff --git a/deps/npm/test/tap/pack-scoped.js b/deps/npm/test/tap/pack-scoped.js new file mode 100644 index 0000000000..05a77a0f0f --- /dev/null +++ b/deps/npm/test/tap/pack-scoped.js @@ -0,0 +1,91 @@ +// verify that prepublish runs on pack and publish +var test = require("tap").test +var fs = require("graceful-fs") +var join = require("path").join +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var path = require("path") + +var pkg = join(__dirname, "scoped_package") +var manifest = join(pkg, "package.json") +var tmp = join(pkg, "tmp") +var cache = join(pkg, "cache") + +var data = { + name : "@scope/generic-package", + version : "90000.100001.5" +} + +test("setup", function (t) { + var n = 0 + + mkdirp(pkg, then()) + mkdirp(cache, then()) + mkdirp(tmp, then()) + + function then () { + n++ + return function (er) { + if (er) throw er + if (--n === 0) next() + } + } + + function next () { + fs.writeFile(manifest, JSON.stringify(data), "ascii", done) + } + + function done (er) { + if (er) throw er + + t.pass("setup done") + t.end() + } +}) + +test("test", function (t) { + var spawn = require("child_process").spawn + var node = process.execPath + var npm = path.resolve(__dirname, "../../cli.js") + var env = { + "npm_config_cache" : cache, + "npm_config_tmp" : tmp, + "npm_config_prefix" : pkg, + "npm_config_global" : "false" + } + + for (var i in process.env) { + if (!/^npm_config_/.test(i)) env[i] = process.env[i] + } + + var child = spawn(node, [npm, "pack"], {cwd : pkg, env : env}) + + child.stdout.setEncoding("utf8") + child.stderr.on("data", onerr) + child.stdout.on("data", ondata) + child.on("close", onend) + + var c = "", e = "" + function ondata (chunk) { c += chunk } + function onerr (chunk) { e += chunk } + + function onend () { + if (e) { + throw new Error("got stderr data: " + JSON.stringify("" + e)) + } + c = c.trim() + var regex = new RegExp("scope-generic-package-90000.100001.5.tgz", "ig") + + t.ok(c.match(regex), "found package") + t.end() + } +}) + +test("cleanup", function (t) { + rimraf(pkg, function (er) { + if (er) throw er + + t.pass("cleaned up") + t.end() + }) +}) diff --git a/deps/npm/test/tap/prepublish.js b/deps/npm/test/tap/prepublish.js index f80085d92c..ad71eab5cd 100644 --- a/deps/npm/test/tap/prepublish.js +++ b/deps/npm/test/tap/prepublish.js @@ -1,68 +1,66 @@ // verify that prepublish runs on pack and publish -var test = require('tap').test -var npm = require('../../') -var fs = require('fs') -var pkg = __dirname + '/prepublish_package' -var tmp = pkg + '/tmp' -var cache = pkg + '/cache' -var mkdirp = require('mkdirp') -var rimraf = require('rimraf') -var path = require('path') -var os = require('os') +var test = require("tap").test +var fs = require("graceful-fs") +var join = require("path").join +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var path = require("path") -test('setup', function (t) { +var pkg = join(__dirname, "prepublish_package") +var tmp = join(pkg, "tmp") +var cache = join(pkg, "cache") + +test("setup", function (t) { var n = 0 mkdirp(pkg, then()) mkdirp(cache, then()) mkdirp(tmp, then()) - function then (er) { - n ++ + function then () { + n++ return function (er) { - if (er) - throw er - if (--n === 0) - next() + if (er) throw er + if (--n === 0) next() } } function next () { - fs.writeFile(pkg + '/package.json', JSON.stringify({ - name: 'npm-test-prepublish', - version: '1.2.5', - scripts: { prepublish: 'echo ok' } - }), 'ascii', function (er) { - if (er) - throw er - t.pass('setup done') + fs.writeFile(join(pkg, "package.json"), JSON.stringify({ + name: "npm-test-prepublish", + version: "1.2.5", + scripts: { prepublish: "echo ok" } + }), "ascii", function (er) { + if (er) throw er + + t.pass("setup done") t.end() }) } }) -test('test', function (t) { - var spawn = require('child_process').spawn +test("test", function (t) { + var spawn = require("child_process").spawn var node = process.execPath - var npm = path.resolve(__dirname, '../../cli.js') + var npm = path.resolve(__dirname, "../../cli.js") var 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" } for (var i in process.env) { if (!/^npm_config_/.test(i)) env[i] = process.env[i] } - var child = spawn(node, [npm, 'pack'], { + var child = spawn(node, [npm, "pack"], { cwd: pkg, env: env }) - child.stdout.setEncoding('utf8') - child.stderr.on('data', onerr) - child.stdout.on('data', ondata) - child.on('close', onend) - var c = '' - , e = '' + child.stdout.setEncoding("utf8") + child.stderr.on("data", onerr) + child.stdout.on("data", ondata) + child.on("close", onend) + var c = "" + , e = "" function ondata (chunk) { c += chunk } @@ -71,7 +69,7 @@ test('test', function (t) { } function onend () { if (e) { - throw new Error('got stderr data: ' + JSON.stringify('' + e)) + throw new Error("got stderr data: " + JSON.stringify("" + e)) } c = c.trim() var regex = new RegExp("" + @@ -86,12 +84,11 @@ test('test', function (t) { } }) -test('cleanup', function (t) { - rimraf(pkg, function(er) { - if (er) - throw er - t.pass('cleaned up') +test("cleanup", function (t) { + rimraf(pkg, function (er) { + if (er) throw er + + t.pass("cleaned up") t.end() }) }) - diff --git a/deps/npm/test/tap/publish-config.js b/deps/npm/test/tap/publish-config.js index 3c4624eeaf..39d6e83113 100644 --- a/deps/npm/test/tap/publish-config.js +++ b/deps/npm/test/tap/publish-config.js @@ -7,11 +7,17 @@ pkg += '/npm-test-publish-config' require('mkdirp').sync(pkg) -fs.writeFileSync(pkg + '/package.json', JSON.stringify({ - name: 'npm-test-publish-config', - version: '1.2.3', +fs.writeFileSync(pkg + "/package.json", JSON.stringify({ + name: "npm-test-publish-config", + version: "1.2.3", publishConfig: { registry: common.registry } -}), 'utf8') +}), "utf8") + +fs.writeFileSync(pkg + "/fixture_npmrc", + "//localhost:1337/:email = fancy@feast.net\n" + + "//localhost:1337/:username = fancy\n" + + "//localhost:1337/:_password = " + new Buffer("feast").toString("base64") + "\n" + + "registry = http://localhost:1337/") var spawn = require('child_process').spawn var npm = require.resolve('../../bin/npm-cli.js') @@ -36,8 +42,9 @@ test(function (t) { // itself functions normally. // // Make sure that we don't sit around waiting for lock files - child = spawn(node, [npm, 'publish', '--email=fancy', '--_auth=feast'], { + child = spawn(node, [npm, "publish", "--userconfig=" + pkg + "/fixture_npmrc"], { cwd: pkg, + stdio: "inherit", env: { npm_config_cache_lock_stale: 1000, npm_config_cache_lock_wait: 1000, diff --git a/deps/npm/test/tap/publish-scoped.js b/deps/npm/test/tap/publish-scoped.js new file mode 100644 index 0000000000..7547c91f1b --- /dev/null +++ b/deps/npm/test/tap/publish-scoped.js @@ -0,0 +1,71 @@ +var fs = require("fs") +var path = require("path") + +var test = require("tap").test +var mkdirp = require("mkdirp") +var rimraf = require("rimraf") +var nock = require("nock") + +var npm = require("../../") +var common = require("../common-tap.js") + +var pkg = path.join(__dirname, "prepublish_package") + +test("setup", function (t) { + mkdirp(path.join(pkg, "cache"), next) + + function next () { + process.chdir(pkg) + fs.writeFile( + path.join(pkg, "package.json"), + JSON.stringify({ + name: "@bigco/publish-organized", + version: "1.2.5" + }), + "ascii", + function (er) { + t.ifError(er) + + t.pass("setup done") + t.end() + } + ) + } +}) + +test("npm publish should honor scoping", function (t) { + var put = nock(common.registry).put("/@bigco%2fpublish-organized").reply(201, {ok: true}) + + var configuration = { + cache : path.join(pkg, "cache"), + loglevel : "silent", + registry : "http://nonexistent.lvh.me", + "//localhost:1337/:username" : "username", + "//localhost:1337/:_password" : new Buffer("password").toString("base64"), + "//localhost:1337/:email" : "ogd@aoaioxxysz.net" + } + + npm.load(configuration, onload) + + function onload (er) { + t.ifError(er, "npm bootstrapped successfully") + + npm.config.set("@bigco:registry", common.registry) + npm.commands.publish([], false, function (er) { + t.ifError(er, "published without error") + + put.done() + + t.end() + }) + } +}) + +test("cleanup", function(t) { + process.chdir(__dirname) + rimraf(pkg, function (er) { + t.ifError(er) + + t.end() + }) +}) diff --git a/deps/npm/test/tap/pwd-prefix.js b/deps/npm/test/tap/pwd-prefix.js new file mode 100644 index 0000000000..e041552e7d --- /dev/null +++ b/deps/npm/test/tap/pwd-prefix.js @@ -0,0 +1,35 @@ +// This test ensures that a few commands do the same +// thing when the cwd is where package.json is, and when +// the package.json is one level up. + +var test = require("tap").test +var common = require("../common-tap.js") +var path = require("path") +var root = path.resolve(__dirname, "../..") +var lib = path.resolve(root, "lib") +var commands = ["run", "version"] + +commands.forEach(function (cmd) { + // Should get the same stdout and stderr each time + var stdout, stderr + + test(cmd + " in root", function (t) { + common.npm([cmd], {cwd: root}, function(er, code, so, se) { + if (er) throw er + t.equal(code, 0) + stdout = so + stderr = se + t.end() + }) + }) + + test(cmd + " in lib", function (t) { + common.npm([cmd], {cwd: lib}, function(er, code, so, se) { + if (er) throw er + t.equal(code, 0) + t.equal(so, stdout) + t.equal(se, stderr) + t.end() + }) + }) +}) diff --git a/deps/npm/test/tap/registry.js b/deps/npm/test/tap/registry.js index 8ea1c2f2da..adcb8f48b1 100644 --- a/deps/npm/test/tap/registry.js +++ b/deps/npm/test/tap/registry.js @@ -9,7 +9,6 @@ var path = require("path") var ca = path.resolve(__dirname, "../../node_modules/npm-registry-couchapp") var which = require("which") -var hasCouch = false which("couchdb", function(er, couch) { if (er) { @@ -23,6 +22,10 @@ which("couchdb", function(er, couch) { }) function runTests () { + var env = {} + for (var i in process.env) env[i] = process.env[i] + env.npm = npmExec + spawn(process.execPath, [ npmExec, "install" ], { @@ -31,14 +34,11 @@ function runTests () { }).on("close", function (code, sig) { if (code || sig) { return test("need install to work", function (t) { - t.fail("install failed with: " (code || sig)) + t.fail("install failed with: " + (code || sig)) t.end() }) } else { - var env = {} - for (var i in process.env) env[i] = process.env[i] - env.npm = npmExec spawn(process.execPath, [ npmExec, "test" @@ -47,7 +47,15 @@ function runTests () { env: env, stdio: "inherit" }).on("close", function (code, sig) { - process.exit(code || sig) + spawn(process.execPath, [ + npmExec, "prune", "--production" + ], { + cwd: ca, + env: env, + stdio: "inherit" + }).on("close", function (code2, sig2) { + process.exit(code || code2 || 0) + }) }) } diff --git a/deps/npm/test/tap/run-script.js b/deps/npm/test/tap/run-script.js new file mode 100644 index 0000000000..a308b5ffe9 --- /dev/null +++ b/deps/npm/test/tap/run-script.js @@ -0,0 +1,62 @@ +var common = require('../common-tap') + , test = require('tap').test + , path = require('path') + , spawn = require('child_process').spawn + , rimraf = require('rimraf') + , mkdirp = require('mkdirp') + , pkg = __dirname + '/run-script' + , cache = pkg + '/cache' + , tmp = pkg + '/tmp' + , node = process.execPath + , npm = path.resolve(__dirname, '../../cli.js') + , opts = { cwd: pkg } + +function testOutput (t, command, er, code, stdout, stderr) { + if (er) + throw er + + if (stderr) + throw new Error('npm ' + command + ' stderr: ' + stderr.toString()) + + stdout = stdout.trim().split('\n') + stdout = stdout[stdout.length - 1] + t.equal(stdout, command) + t.end() +} + +function cleanup () { + rimraf.sync(pkg + '/cache') + rimraf.sync(pkg + '/tmp') +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg + '/cache') + mkdirp.sync(pkg + '/tmp') + t.end() +}) + +test('npm run-script', function (t) { + common.npm(['run-script', 'start'], opts, testOutput.bind(null, t, "start")) +}) + +test('npm run-script with args', function (t) { + common.npm(["run-script", "start", "--", "stop"], opts, testOutput.bind(null, t, "stop")) +}) + +test('npm run-script with args that contain spaces', function(t) { + common.npm(["run-script", "start", "--", "hello world"], opts, testOutput.bind(null, t, "hello world")) +}) + +test('npm run-script with args that contain single quotes', function(t) { + common.npm(["run-script", "start", "--", "they're awesome"], opts, testOutput.bind(null, t, "they're awesome")) +}) + +test('npm run-script with args that contain double quotes', function(t) { + common.npm(["run-script", "start", "--", "what's \"up\"?"], opts, testOutput.bind(null, t, "what's \"up\"?")) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/run-script/package.json b/deps/npm/test/tap/run-script/package.json new file mode 100644 index 0000000000..49b8636683 --- /dev/null +++ b/deps/npm/test/tap/run-script/package.json @@ -0,0 +1,6 @@ +{"name":"runscript" +,"version":"1.2.3" +,"scripts":{ + "start":"node -e 'console.log(process.argv[1] || \"start\")'" + } +} diff --git a/deps/npm/test/tap/semver-tag.js b/deps/npm/test/tap/semver-tag.js new file mode 100644 index 0000000000..7633e55426 --- /dev/null +++ b/deps/npm/test/tap/semver-tag.js @@ -0,0 +1,15 @@ +// should not allow tagging with a valid semver range +var common = require("../common-tap.js") +var test = require("tap").test + +test("try to tag with semver range as tag name", function (t) { + var cmd = ["tag", "zzzz@1.2.3", "v2.x", "--registry=http://localhost"] + common.npm(cmd, { + stdio: "pipe", + }, function (er, code, so, se) { + if (er) throw er + t.similar(se, /Tag name must not be a valid SemVer range: v2.x\n/) + t.equal(code, 1) + t.end() + }) +}) diff --git a/deps/npm/test/tap/url-dependencies.js b/deps/npm/test/tap/url-dependencies.js index 7f8cc78644..34a77f4bca 100644 --- a/deps/npm/test/tap/url-dependencies.js +++ b/deps/npm/test/tap/url-dependencies.js @@ -7,7 +7,7 @@ var spawn = require("child_process").spawn var npm = require.resolve("../../bin/npm-cli.js") var node = process.execPath var pkg = path.resolve(__dirname, "url-dependencies") -var common = require('../common-tap') +var common = require("../common-tap") var mockRoutes = { "get": { @@ -19,9 +19,9 @@ test("url-dependencies: download first time", function(t) { cleanup() performInstall(function(output){ - if(!tarballWasFetched(output)){ + if (!tarballWasFetched(output)){ t.fail("Tarball was not fetched") - }else{ + } else { t.pass("Tarball was fetched") } t.end() @@ -33,9 +33,9 @@ test("url-dependencies: do not download subsequent times", function(t) { performInstall(function(){ performInstall(function(output){ - if(tarballWasFetched(output)){ + if (tarballWasFetched(output)){ t.fail("Tarball was fetched second time around") - }else{ + } else { t.pass("Tarball was not fetched") } t.end() @@ -44,7 +44,7 @@ test("url-dependencies: do not download subsequent times", function(t) { }) function tarballWasFetched(output){ - return output.indexOf("http GET " + common.registry + "/underscore/-/underscore-1.3.1.tgz") > -1 + return output.indexOf("http fetch GET " + common.registry + "/underscore/-/underscore-1.3.1.tgz") > -1 } function performInstall (cb) { @@ -53,10 +53,10 @@ function performInstall (cb) { , child = spawn(node, [npm, "install"], { cwd: pkg, env: { - npm_config_registry: common.registry, - npm_config_cache_lock_stale: 1000, - npm_config_cache_lock_wait: 1000, - npm_config_loglevel: "http", + "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 diff --git a/deps/npm/test/tap/whoami.js b/deps/npm/test/tap/whoami.js new file mode 100644 index 0000000000..e4ed30df77 --- /dev/null +++ b/deps/npm/test/tap/whoami.js @@ -0,0 +1,77 @@ +var common = require("../common-tap.js") + +var fs = require("fs") +var path = require("path") +var createServer = require("http").createServer + +var test = require("tap").test +var rimraf = require("rimraf") + +var opts = { cwd: __dirname } + +var FIXTURE_PATH = path.resolve(__dirname, "fixture_npmrc") + +test("npm whoami with basic auth", function (t) { + var s = "//registry.lvh.me/:username = wombat\n" + + "//registry.lvh.me/:_password = YmFkIHBhc3N3b3Jk\n" + + "//registry.lvh.me/:email = lindsay@wdu.org.au\n" + fs.writeFileSync(FIXTURE_PATH, s, "ascii") + fs.chmodSync(FIXTURE_PATH, "0444") + + common.npm( + [ + "whoami", + "--userconfig=" + FIXTURE_PATH, + "--registry=http://registry.lvh.me/" + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err) + + t.equal(stderr, "", "got nothing on stderr") + t.equal(code, 0, "exit ok") + t.equal(stdout, "wombat\n", "got username") + rimraf.sync(FIXTURE_PATH) + t.end() + } + ) +}) + +test("npm whoami with bearer auth", {timeout : 2 * 1000}, function (t) { + var s = "//localhost:" + common.port + + "/:_authToken = wombat-developers-union\n" + fs.writeFileSync(FIXTURE_PATH, s, "ascii") + fs.chmodSync(FIXTURE_PATH, "0444") + + function verify(req, res) { + t.equal(req.method, "GET") + t.equal(req.url, "/whoami") + + res.setHeader("content-type", "application/json") + res.writeHeader(200) + res.end(JSON.stringify({username : "wombat"}), "utf8") + } + + var server = createServer(verify) + + server.listen(common.port, function () { + common.npm( + [ + "whoami", + "--userconfig=" + FIXTURE_PATH, + "--registry=http://localhost:" + common.port + "/" + ], + opts, + function (err, code, stdout, stderr) { + t.ifError(err) + + t.equal(stderr, "", "got nothing on stderr") + t.equal(code, 0, "exit ok") + t.equal(stdout, "wombat\n", "got username") + rimraf.sync(FIXTURE_PATH) + server.close() + t.end() + } + ) + }) +}) diff --git a/tools/upgrade-npm.sh b/tools/upgrade-npm.sh new file mode 100755 index 0000000000..02700324c9 --- /dev/null +++ b/tools/upgrade-npm.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -xe + +rm -rf deps/npm + +(cd deps && curl https://registry.npmjs.org/npm/-/npm-$1.tgz | tar xz && mv package npm)