diff --git a/.eslintrc b/.eslintrc index cf1f7682cdcf91..bf3fc3378f2d92 100644 --- a/.eslintrc +++ b/.eslintrc @@ -70,6 +70,11 @@ rules: # require space after keywords, eg 'for (..)' space-after-keywords: 2 + # ECMAScript 6 + # list: http://eslint.org/docs/rules/#ecmascript-6 + ## Suggest using 'const' wherever possible + prefer-const: 2 + # Strict Mode # list: https://github.com/eslint/eslint/tree/master/docs/rules#strict-mode ## 'use strict' on top @@ -82,6 +87,8 @@ rules: # Custom rules in tools/eslint-rules require-buffer: 2 + new-with-error: [2, "Error", "RangeError", "TypeError", "SyntaxError", "ReferenceError"] + # Global scoped method and vars globals: diff --git a/.gitignore b/.gitignore index 18240c442e00cf..931bf8c024dc3b 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ icu_config.gypi # various stuff that VC++ produces/uses Debug/ -!node_modules/debug/ +!deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug !deps/v8/src/debug/ Release/ !doc/blog/** @@ -44,6 +44,7 @@ ipch/ /config.mk /config.gypi +/config_fips.gypi *-nodegyp* /gyp-mac-tool /dist-osx diff --git a/CHANGELOG.md b/CHANGELOG.md index a1a164265cdec6..4860135b18cc43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,562 @@ - # Node.js ChangeLog +## 2015-12-08, Version 5.2.0 (Stable), @rvagg + +### Notable changes + +* + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). + +### Commits + +* [[`08a3f29fd4`](https://github.com/nodejs/node/commit/08a3f29fd4)] - **buffer**: fix range checking for slowToString (Matt Loring) [#4019](https://github.com/nodejs/node/pull/4019) +* [[`e3a8e8bba4`](https://github.com/nodejs/node/commit/e3a8e8bba4)] - **buffer**: Prevent Buffer constructor deopt (Bryce Baril) [#4158](https://github.com/nodejs/node/pull/4158) +* [[`0e18e68324`](https://github.com/nodejs/node/commit/0e18e68324)] - **buffer**: fix writeInt{B,L}E for some neg values (Peter A. Bigot) [#3994](https://github.com/nodejs/node/pull/3994) +* [[`ab5b529dd2`](https://github.com/nodejs/node/commit/ab5b529dd2)] - **buffer**: default to UTF8 in byteLength() (Tom Gallacher) [#4010](https://github.com/nodejs/node/pull/4010) +* [[`fcf0e8ebdf`](https://github.com/nodejs/node/commit/fcf0e8ebdf)] - **buffer**: move checkFloat from lib into src (Matt Loring) [#3763](https://github.com/nodejs/node/pull/3763) +* [[`12649f4496`](https://github.com/nodejs/node/commit/12649f4496)] - **build**: add "--partly-static" build options (Super Zheng) [#4152](https://github.com/nodejs/node/pull/4152) +* [[`a76d788119`](https://github.com/nodejs/node/commit/a76d788119)] - **build**: update signtool description, add url (Rod Vagg) [#4011](https://github.com/nodejs/node/pull/4011) +* [[`ed255abdc1`](https://github.com/nodejs/node/commit/ed255abdc1)] - **(SEMVER-MINOR)** **build,src**: add Intel Vtune profiling support (Chunyang Dai) [#3785](https://github.com/nodejs/node/pull/3785) +* [[`7793c364fc`](https://github.com/nodejs/node/commit/7793c364fc)] - **child_process**: flush consuming streams (Dave) [#4071](https://github.com/nodejs/node/pull/4071) +* [[`f29c5d6e70`](https://github.com/nodejs/node/commit/f29c5d6e70)] - **configure**: `v8_use_snapshot` should be `true` (Fedor Indutny) [#3962](https://github.com/nodejs/node/pull/3962) +* [[`da5ac55c83`](https://github.com/nodejs/node/commit/da5ac55c83)] - **(SEMVER-MINOR)** **crypto**: simplify using pre-existing keys with ECDH (Michael Ruddy) [#3511](https://github.com/nodejs/node/pull/3511) +* [[`cfc97641ee`](https://github.com/nodejs/node/commit/cfc97641ee)] - **crypto**: fix native module compilation with FIPS (Stefan Budeanu) [#4023](https://github.com/nodejs/node/pull/4023) +* [[`b81b45dabd`](https://github.com/nodejs/node/commit/b81b45dabd)] - **crypto**: update root certificates (Ben Noordhuis) [#3951](https://github.com/nodejs/node/pull/3951) +* [[`def681a07e`](https://github.com/nodejs/node/commit/def681a07e)] - **crypto**: disable crypto.createCipher in FIPS mode (Stefan Budeanu) [#3754](https://github.com/nodejs/node/pull/3754) +* [[`ce423f3624`](https://github.com/nodejs/node/commit/ce423f3624)] - **debugger**: introduce exec method for debugger (Jackson Tian) +* [[`99fd1ec28d`](https://github.com/nodejs/node/commit/99fd1ec28d)] - **deps**: backport 819b40a from V8 upstream (Michaël Zasso) [#3937](https://github.com/nodejs/node/pull/3937) +* [[`634c5f1f81`](https://github.com/nodejs/node/commit/634c5f1f81)] - **doc**: url.format - true slash postfix behaviour (fansworld-claudio) [#4119](https://github.com/nodejs/node/pull/4119) +* [[`6f957a70d8`](https://github.com/nodejs/node/commit/6f957a70d8)] - **doc**: s/node.js/Node.js in readme (Rod Vagg) [#3998](https://github.com/nodejs/node/pull/3998) +* [[`0cd4a52392`](https://github.com/nodejs/node/commit/0cd4a52392)] - **doc**: improve child_process.markdown wording (yorkie) [#4138](https://github.com/nodejs/node/pull/4138) +* [[`fd5ed6888d`](https://github.com/nodejs/node/commit/fd5ed6888d)] - **doc**: add JungMinu to collaborators (Minwoo Jung) [#4143](https://github.com/nodejs/node/pull/4143) +* [[`fa0cdf75d9`](https://github.com/nodejs/node/commit/fa0cdf75d9)] - **doc**: add iarna to collaborators (Rebecca Turner) [#4144](https://github.com/nodejs/node/pull/4144) +* [[`424eb962b1`](https://github.com/nodejs/node/commit/424eb962b1)] - **doc**: add zkat to collaborators (Kat Marchán) [#4142](https://github.com/nodejs/node/pull/4142) +* [[`85b601224b`](https://github.com/nodejs/node/commit/85b601224b)] - **doc**: add HTTP working group (James M Snell) [#3919](https://github.com/nodejs/node/pull/3919) +* [[`f4164bd8df`](https://github.com/nodejs/node/commit/f4164bd8df)] - **doc**: update links to use https where possible (jpersson) [#4054](https://github.com/nodejs/node/pull/4054) +* [[`3169eed1e3`](https://github.com/nodejs/node/commit/3169eed1e3)] - **doc**: add links and backticks around names (jpersson) [#4054](https://github.com/nodejs/node/pull/4054) +* [[`f3417e2574`](https://github.com/nodejs/node/commit/f3417e2574)] - **doc**: standardize references to node.js in docs (Scott Buchanan) [#4136](https://github.com/nodejs/node/pull/4136) +* [[`95dd60c657`](https://github.com/nodejs/node/commit/95dd60c657)] - **doc**: reword https.Agent example text (Jan Krems) [#4075](https://github.com/nodejs/node/pull/4075) +* [[`c61237d3ea`](https://github.com/nodejs/node/commit/c61237d3ea)] - **doc**: fix internal link to child.send() (Luigi Pinca) [#4089](https://github.com/nodejs/node/pull/4089) +* [[`aaeced915e`](https://github.com/nodejs/node/commit/aaeced915e)] - **doc**: fix the exception description (yorkie) [#3658](https://github.com/nodejs/node/pull/3658) +* [[`a2b7596ac0`](https://github.com/nodejs/node/commit/a2b7596ac0)] - **doc**: fix color of linked code blocks (jpersson) [#4068](https://github.com/nodejs/node/pull/4068) +* [[`f3c50f5fb5`](https://github.com/nodejs/node/commit/f3c50f5fb5)] - **doc**: fix rare case of misaligned columns (Roman Reiss) [#3948](https://github.com/nodejs/node/pull/3948) +* [[`f0a2e2cdec`](https://github.com/nodejs/node/commit/f0a2e2cdec)] - **doc**: message.header duplication correction (Bryan English) [#3997](https://github.com/nodejs/node/pull/3997) +* [[`b1dfa8bebb`](https://github.com/nodejs/node/commit/b1dfa8bebb)] - **doc**: fix typo in README (Rich Trott) [#4000](https://github.com/nodejs/node/pull/4000) +* [[`4602e01221`](https://github.com/nodejs/node/commit/4602e01221)] - **doc**: replace sane with reasonable (Lewis Cowper) [#3980](https://github.com/nodejs/node/pull/3980) +* [[`4849a54386`](https://github.com/nodejs/node/commit/4849a54386)] - **doc**: Adding best practises for crypto.pbkdf2 (Tom Gallacher) [#3290](https://github.com/nodejs/node/pull/3290) +* [[`77251d99de`](https://github.com/nodejs/node/commit/77251d99de)] - **doc**: numeric flags to fs.open (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) +* [[`f4ca007b42`](https://github.com/nodejs/node/commit/f4ca007b42)] - **doc**: clarify that fs streams expect blocking fd (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) +* [[`26eeae8016`](https://github.com/nodejs/node/commit/26eeae8016)] - **doc**: fix broken references (Alexander Gromnitsky) [#3944](https://github.com/nodejs/node/pull/3944) +* [[`f90227b0e8`](https://github.com/nodejs/node/commit/f90227b0e8)] - **doc**: move fs.existsSync() deprecation message (Martin Forsberg) [#3942](https://github.com/nodejs/node/pull/3942) +* [[`bbcb2a2e65`](https://github.com/nodejs/node/commit/bbcb2a2e65)] - **doc**: clarify module loading behavior (cjihrig) [#3920](https://github.com/nodejs/node/pull/3920) +* [[`0997178037`](https://github.com/nodejs/node/commit/0997178037)] - **doc**: add reference for buffer.inspect() (cjihrig) [#3921](https://github.com/nodejs/node/pull/3921) +* [[`6c16c40283`](https://github.com/nodejs/node/commit/6c16c40283)] - **doc**: clarify v5.1.1 notable items (Rod Vagg) [#4156](https://github.com/nodejs/node/pull/4156) +* [[`4c8800c2de`](https://github.com/nodejs/node/commit/4c8800c2de)] - **fs,doc**: use `target` instead of `destination` (yorkie) [#3912](https://github.com/nodejs/node/pull/3912) +* [[`1f0e8dca8e`](https://github.com/nodejs/node/commit/1f0e8dca8e)] - **installer**: install the tick processor (Matt Loring) [#3032](https://github.com/nodejs/node/pull/3032) +* [[`e8e4e0718b`](https://github.com/nodejs/node/commit/e8e4e0718b)] - **meta**: remove use of profanity in source (Myles Borins) [#4122](https://github.com/nodejs/node/pull/4122) +* [[`13834caa28`](https://github.com/nodejs/node/commit/13834caa28)] - **module**: fix column offsets in errors (Tristian Flanagan) [#2867](https://github.com/nodejs/node/pull/2867) +* [[`8988e1e117`](https://github.com/nodejs/node/commit/8988e1e117)] - **module,repl**: remove repl require() hack (Ben Noordhuis) [#4026](https://github.com/nodejs/node/pull/4026) +* [[`baac81d95f`](https://github.com/nodejs/node/commit/baac81d95f)] - **net**: add local address/port for better errors (Jan Schär) [#3946](https://github.com/nodejs/node/pull/3946) +* [[`12754c5dc3`](https://github.com/nodejs/node/commit/12754c5dc3)] - **net**: small code cleanup (Jan Schär) [#3943](https://github.com/nodejs/node/pull/3943) +* [[`8a5e4345fd`](https://github.com/nodejs/node/commit/8a5e4345fd)] - **node**: s/doNTCallbackX/nextTickCallbackWithXArgs/ (Rod Vagg) [#4167](https://github.com/nodejs/node/pull/4167) +* [[`0869ef3c55`](https://github.com/nodejs/node/commit/0869ef3c55)] - **(SEMVER-MINOR)** **repl**: allow leading period in multiline input (Zirak) [#3835](https://github.com/nodejs/node/pull/3835) +* [[`aaab108dfe`](https://github.com/nodejs/node/commit/aaab108dfe)] - **repl**: attach location info to syntax errors (cjihrig) [#4013](https://github.com/nodejs/node/pull/4013) +* [[`9e9346fa32`](https://github.com/nodejs/node/commit/9e9346fa32)] - **src**: use GetCurrentProcessId() for process.pid (Ben Noordhuis) [#4163](https://github.com/nodejs/node/pull/4163) +* [[`d969c0965c`](https://github.com/nodejs/node/commit/d969c0965c)] - **src**: define Is* util functions with macros (cjihrig) [#4118](https://github.com/nodejs/node/pull/4118) +* [[`458facdf66`](https://github.com/nodejs/node/commit/458facdf66)] - **src**: define getpid() based on OS (cjihrig) [#4146](https://github.com/nodejs/node/pull/4146) +* [[`7e18f2ec62`](https://github.com/nodejs/node/commit/7e18f2ec62)] - **(SEMVER-MINOR)** **src**: add BE support to StringBytes::Encode() (Bryon Leung) [#3410](https://github.com/nodejs/node/pull/3410) +* [[`756ab9caad`](https://github.com/nodejs/node/commit/756ab9caad)] - **stream**: be less eager with readable flag (Brian White) [#4141](https://github.com/nodejs/node/pull/4141) +* [[`8f845ba28a`](https://github.com/nodejs/node/commit/8f845ba28a)] - **stream_wrap**: error if stream has StringDecoder (Fedor Indutny) [#4031](https://github.com/nodejs/node/pull/4031) +* [[`1c1af81ea0`](https://github.com/nodejs/node/commit/1c1af81ea0)] - **streams**: update .readable/.writable to false (Brian White) [#4083](https://github.com/nodejs/node/pull/4083) +* [[`1d50819c85`](https://github.com/nodejs/node/commit/1d50819c85)] - **test**: check range fix for slowToString (Sakthipriyan Vairamani) [#4019](https://github.com/nodejs/node/pull/4019) +* [[`0c2a0dc859`](https://github.com/nodejs/node/commit/0c2a0dc859)] - **test**: skip long path tests on non-Windows (Rafał Pocztarski) [#4116](https://github.com/nodejs/node/pull/4116) +* [[`8a60aa1303`](https://github.com/nodejs/node/commit/8a60aa1303)] - **test**: don't check the # of chunks in test-http-1.0 (Santiago Gimeno) [#3961](https://github.com/nodejs/node/pull/3961) +* [[`e84aeec883`](https://github.com/nodejs/node/commit/e84aeec883)] - **test**: mark test-cluster-shared-leak flaky (Rich Trott) [#4162](https://github.com/nodejs/node/pull/4162) +* [[`b3f3b2e157`](https://github.com/nodejs/node/commit/b3f3b2e157)] - **test**: fix cluster-worker-isdead (Santiago Gimeno) [#3954](https://github.com/nodejs/node/pull/3954) +* [[`da6be4d31a`](https://github.com/nodejs/node/commit/da6be4d31a)] - **test**: fix time resolution constraint (Gireesh Punathil) [#3981](https://github.com/nodejs/node/pull/3981) +* [[`9d16729b20`](https://github.com/nodejs/node/commit/9d16729b20)] - **test**: skip instead of fail when mem constrained (Michael Cornacchia) [#3697](https://github.com/nodejs/node/pull/3697) +* [[`be41eb751b`](https://github.com/nodejs/node/commit/be41eb751b)] - **test**: refactor test-http-exit-delay (Rich Trott) [#4055](https://github.com/nodejs/node/pull/4055) +* [[`4b43bf0385`](https://github.com/nodejs/node/commit/4b43bf0385)] - **test**: fix flaky test-net-socket-local-address (Rich Trott) [#4109](https://github.com/nodejs/node/pull/4109) +* [[`cb55c67a00`](https://github.com/nodejs/node/commit/cb55c67a00)] - **test**: improve cluster-disconnect-handles test (Brian White) [#4084](https://github.com/nodejs/node/pull/4084) +* [[`2b5b127e14`](https://github.com/nodejs/node/commit/2b5b127e14)] - **test**: fix cluster-disconnect-handles flakiness (Santiago Gimeno) [#4009](https://github.com/nodejs/node/pull/4009) +* [[`430264817b`](https://github.com/nodejs/node/commit/430264817b)] - **test**: add test for repl.defineCommand() (Bryan English) [#3908](https://github.com/nodejs/node/pull/3908) +* [[`22b0971222`](https://github.com/nodejs/node/commit/22b0971222)] - **test**: eliminate multicast test FreeBSD flakiness (Rich Trott) [#4042](https://github.com/nodejs/node/pull/4042) +* [[`c50003746b`](https://github.com/nodejs/node/commit/c50003746b)] - **test**: mark test flaky on FreeBSD (Rich Trott) [#4016](https://github.com/nodejs/node/pull/4016) +* [[`69c95bbdb7`](https://github.com/nodejs/node/commit/69c95bbdb7)] - **test**: move ArrayStream to common (cjihrig) [#4027](https://github.com/nodejs/node/pull/4027) +* [[`d94a70ec51`](https://github.com/nodejs/node/commit/d94a70ec51)] - **test**: fix test-domain-exit-dispose-again (Julien Gilli) [#3990](https://github.com/nodejs/node/pull/3990) +* [[`00b839a2b8`](https://github.com/nodejs/node/commit/00b839a2b8)] - **test**: use platform-based timeout for reliability (Rich Trott) [#4015](https://github.com/nodejs/node/pull/4015) +* [[`054a216b6f`](https://github.com/nodejs/node/commit/054a216b6f)] - **test**: mark cluster-net-send test flaky on windows (Rich Trott) [#4006](https://github.com/nodejs/node/pull/4006) +* [[`d0621c5649`](https://github.com/nodejs/node/commit/d0621c5649)] - **test**: mark fork regression test flaky on windows (Rich Trott) [#4005](https://github.com/nodejs/node/pull/4005) +* [[`19ed33df80`](https://github.com/nodejs/node/commit/19ed33df80)] - **test**: skip test if in FreeBSD jail (Rich Trott) [#3995](https://github.com/nodejs/node/pull/3995) +* [[`a863e8d667`](https://github.com/nodejs/node/commit/a863e8d667)] - **test**: remove flaky status for cluster test (Rich Trott) [#3975](https://github.com/nodejs/node/pull/3975) +* [[`dd0d15fc47`](https://github.com/nodejs/node/commit/dd0d15fc47)] - **test**: add TAP diagnostic message for retried tests (Rich Trott) [#3960](https://github.com/nodejs/node/pull/3960) +* [[`1fe4d30efc`](https://github.com/nodejs/node/commit/1fe4d30efc)] - **test**: retry on smartos if ECONNREFUSED (Rich Trott) [#3941](https://github.com/nodejs/node/pull/3941) +* [[`665a35d45e`](https://github.com/nodejs/node/commit/665a35d45e)] - **test**: address flaky test-http-client-timeout-event (Rich Trott) [#3968](https://github.com/nodejs/node/pull/3968) +* [[`f9fe0aee53`](https://github.com/nodejs/node/commit/f9fe0aee53)] - **test**: numeric flags to fs.open (Carl Lei) [#3641](https://github.com/nodejs/node/pull/3641) +* [[`54aafa17af`](https://github.com/nodejs/node/commit/54aafa17af)] - **test**: http complete list of non-concat headers (Bryan English) [#3930](https://github.com/nodejs/node/pull/3930) +* [[`788541b40c`](https://github.com/nodejs/node/commit/788541b40c)] - **test**: fix race condition in unrefd interval test (Michael Cornacchia) [#3550](https://github.com/nodejs/node/pull/3550) +* [[`e129d83996`](https://github.com/nodejs/node/commit/e129d83996)] - **test**: skip/replace weak crypto tests in FIPS mode (Stefan Budeanu) [#3757](https://github.com/nodejs/node/pull/3757) +* [[`bc27379453`](https://github.com/nodejs/node/commit/bc27379453)] - **test**: avoid test timeouts on rpi (Stefan Budeanu) [#3902](https://github.com/nodejs/node/pull/3902) +* [[`272732e76b`](https://github.com/nodejs/node/commit/272732e76b)] - **test**: fix flaky test-child-process-spawnsync-input (Rich Trott) [#3889](https://github.com/nodejs/node/pull/3889) +* [[`781f8c0d1e`](https://github.com/nodejs/node/commit/781f8c0d1e)] - **test**: add OS X to module loading error test (Evan Lucas) [#3901](https://github.com/nodejs/node/pull/3901) +* [[`f99c6363de`](https://github.com/nodejs/node/commit/f99c6363de)] - **test**: module loading error fix solaris #3798 (fansworld-claudio) [#3855](https://github.com/nodejs/node/pull/3855) +* [[`1279adc756`](https://github.com/nodejs/node/commit/1279adc756)] - **timers**: optimize callback call: bind -> arrow (Andrei Sedoi) [#4038](https://github.com/nodejs/node/pull/4038) +* [[`d7a7d3e6f7`](https://github.com/nodejs/node/commit/d7a7d3e6f7)] - **tools**: update certdata.txt (Ben Noordhuis) [#3951](https://github.com/nodejs/node/pull/3951) +* [[`1b434e0654`](https://github.com/nodejs/node/commit/1b434e0654)] - **util**: determine object types in C++ (cjihrig) [#4100](https://github.com/nodejs/node/pull/4100) +* [[`c93e2678f0`](https://github.com/nodejs/node/commit/c93e2678f0)] - **util**: fix constructor/instanceof checks (Brian White) [#3385](https://github.com/nodejs/node/pull/3385) +* [[`098a3113e1`](https://github.com/nodejs/node/commit/098a3113e1)] - **util**: move .decorateErrorStack to internal/util (Ben Noordhuis) [#4026](https://github.com/nodejs/node/pull/4026) +* [[`e68ea16c32`](https://github.com/nodejs/node/commit/e68ea16c32)] - **util**: add decorateErrorStack() (cjihrig) [#4013](https://github.com/nodejs/node/pull/4013) +* [[`c584c3e08f`](https://github.com/nodejs/node/commit/c584c3e08f)] - **util,src**: allow lookup of hidden values (cjihrig) [#3988](https://github.com/nodejs/node/pull/3988) + +## 2015-12-04, Version 5.1.1 (Stable), @rvagg + +### Notable changes + +* **http**: Fix CVE-2015-8027, a bug whereby an HTTP socket may no longer have a parser associated with it but a pipelined request attempts to trigger a pause or resume on the non-existent parser, a potential denial-of-service vulnerability. (Fedor Indutny) +* **openssl**: Upgrade to 1.0.2e, containing fixes for: + - CVE-2015-3193 "BN_mod_exp may produce incorrect results on x86_64", an attack may be possible against a Node.js TLS server using DHE key exchange. Details are available at . + - CVE-2015-3194 "Certificate verify crash with missing PSS parameter", a potential denial-of-service vector for Node.js TLS servers using client certificate authentication; TLS clients are also impacted. Details are available at . + (Shigeki Ohtsu) [#4134](https://github.com/nodejs/node/pull/4134) +* **v8**: Backport fix for CVE-2015-6764, a bug in `JSON.stringify()` that can result in out-of-bounds reads for arrays. (Ben Noordhuis) + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). + +### Commits + +* [[`678398f250`](https://github.com/nodejs/node/commit/678398f250)] - **deps**: backport a7e50a5 from upstream v8 (Ben Noordhuis) +* [[`76a552c938`](https://github.com/nodejs/node/commit/76a552c938)] - **deps**: backport 6df9a1d from upstream v8 (Ben Noordhuis) +* [[`533881f889`](https://github.com/nodejs/node/commit/533881f889)] - **deps**: upgrade openssl sources to 1.0.2e (Shigeki Ohtsu) [#4134](https://github.com/nodejs/node/pull/4134) +* [[`12e70fafd3`](https://github.com/nodejs/node/commit/12e70fafd3)] - **http**: fix pipeline regression (Fedor Indutny) + +## 2015-11-17, Version 5.1.0 (Stable), @Fishrock123 + +### Notable changes + +* **buffer**: The `noAssert` option for many buffer functions will now silently drop invalid write values rather than crashing (P.S.V.R) [#3767](https://github.com/nodejs/node/pull/3767). + - This makes the behavior match what the docs suggest. +* **child_process**: `child.send()` now properly returns a boolean like the docs suggest (Rich Trott) [#3577](https://github.com/nodejs/node/pull/3577). +* **doc**: All of the API docs have been re-ordered so as to read in alphabetical order (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662). +* **http_parser**: update http-parser to 2.6.0 from 2.5.0 (James M Snell) [#3569](https://github.com/nodejs/node/pull/3569). + - Now supports the following HTTP methods: `LINK`, `UNLINK`, `BIND`, `REBIND`, `UNBIND`. + - Also added ACL and IPv6 Zone ID support. +* **npm**: upgrade npm to 3.3.12 from v3.3.6 (Rebecca Turner) [#3685](https://github.com/nodejs/node/pull/3685). + - See the release notes for [v3.3.7](https://github.com/npm/npm/releases/tag/v3.3.7), [v3.3.8](https://github.com/npm/npm/releases/tag/v3.3.8), [v3.3.9](https://github.com/npm/npm/releases/tag/v3.3.9), [v3.3.10](https://github.com/npm/npm/releases/tag/v3.3.10), [v3.3.11](https://github.com/npm/npm/releases/tag/v3.3.11), and [v3.3.12](https://github.com/npm/npm/releases/tag/v3.3.12) for more details. +* **repl**: The REPL no longer crashes if the [persistent history](https://nodejs.org/api/repl.html#repl_persistent_history) file cannot be opened (Evan Lucas) [#3630](https://github.com/nodejs/node/pull/3630). +* **tls**: The default `sessionIdContext` now uses SHA1 in FIPS mode rather than MD5 (Stefan Budeanu) [#3755](https://github.com/nodejs/node/pull/3755). +* **v8**: Added some more useful post-mortem data (Fedor Indutny) [#3779](https://github.com/nodejs/node/pull/3779). + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). + +### Commits + +* [[`b663d2bbb5`](https://github.com/nodejs/node/commit/b663d2bbb5)] - **async_wrap**: call callback in destructor (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) +* [[`eccbec99ea`](https://github.com/nodejs/node/commit/eccbec99ea)] - **async_wrap**: new instances get uid (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) +* [[`5d34c81a5c`](https://github.com/nodejs/node/commit/5d34c81a5c)] - **async_wrap**: allow some hooks to be optional (Trevor Norris) [#3461](https://github.com/nodejs/node/pull/3461) +* [[`7bff0138e2`](https://github.com/nodejs/node/commit/7bff0138e2)] - **buffer**: let WriteFloatGeneric silently drop values (P.S.V.R) [#3767](https://github.com/nodejs/node/pull/3767) +* [[`56673693cd`](https://github.com/nodejs/node/commit/56673693cd)] - **buffer**: neuter external `nullptr` buffers (Fedor Indutny) [#3624](https://github.com/nodejs/node/pull/3624) +* [[`2d0ca0293a`](https://github.com/nodejs/node/commit/2d0ca0293a)] - **build**: fix configuring with prebuilt libraries (Markus Tzoe) [#3135](https://github.com/nodejs/node/pull/3135) +* [[`2a69b6820f`](https://github.com/nodejs/node/commit/2a69b6820f)] - **build**: fix --with-intl=system-icu for x-compile (Steven R. Loomis) [#3808](https://github.com/nodejs/node/pull/3808) +* [[`8f5a2550a7`](https://github.com/nodejs/node/commit/8f5a2550a7)] - **build**: omit -gline-tables-only for --enable-asan (Ben Noordhuis) [#3680](https://github.com/nodejs/node/pull/3680) +* [[`84bb74547d`](https://github.com/nodejs/node/commit/84bb74547d)] - **child_process**: add safety checks on stdio access (cjihrig) [#3799](https://github.com/nodejs/node/pull/3799) +* [[`e888471a11`](https://github.com/nodejs/node/commit/e888471a11)] - **child_process**: don't fork bomb ourselves from -e (Ben Noordhuis) [#3575](https://github.com/nodejs/node/pull/3575) +* [[`47f3735e88`](https://github.com/nodejs/node/commit/47f3735e88)] - **cluster**: send suicide message on disconnect (cjihrig) [#3720](https://github.com/nodejs/node/pull/3720) +* [[`d64a56cba5`](https://github.com/nodejs/node/commit/d64a56cba5)] - **cluster**: remove handles when disconnecting worker (Ben Noordhuis) [#3677](https://github.com/nodejs/node/pull/3677) +* [[`5ed30da5a0`](https://github.com/nodejs/node/commit/5ed30da5a0)] - **console**: use 'label' argument for time and timeEnd (Roman Reiss) [#3590](https://github.com/nodejs/node/pull/3590) +* [[`7a290abea6`](https://github.com/nodejs/node/commit/7a290abea6)] - **crypto**: DSA parameter validation in FIPS mode (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) +* [[`2c9fb147be`](https://github.com/nodejs/node/commit/2c9fb147be)] - **crypto**: Improve error checking and reporting (Stefan Budeanu) [#3753](https://github.com/nodejs/node/pull/3753) +* [[`66dccaf0cd`](https://github.com/nodejs/node/commit/66dccaf0cd)] - **debugger**: also exit when the repl emits 'exit' (Felix Böhm) [#2369](https://github.com/nodejs/node/pull/2369) +* [[`fd0253be4d`](https://github.com/nodejs/node/commit/fd0253be4d)] - **deps**: backport bc2e393 from v8 upstream (evan.lucas) [#3792](https://github.com/nodejs/node/pull/3792) +* [[`59077acc3d`](https://github.com/nodejs/node/commit/59077acc3d)] - **deps**: cherry-pick 68e89fb from v8's upstream (Fedor Indutny) [#3779](https://github.com/nodejs/node/pull/3779) +* [[`9ef81ff5d3`](https://github.com/nodejs/node/commit/9ef81ff5d3)] - **deps**: update V8 to 4.6.85.31 (Michaël Zasso) [#3698](https://github.com/nodejs/node/pull/3698) +* [[`b48dbf9fce`](https://github.com/nodejs/node/commit/b48dbf9fce)] - **deps**: upgrade npm to 3.3.12 (Rebecca Turner) [#3685](https://github.com/nodejs/node/pull/3685) +* [[`7caeb14e11`](https://github.com/nodejs/node/commit/7caeb14e11)] - **(SEMVER-MINOR)** **deps**: update http-parser to 2.6.0 (James M Snell) [#3569](https://github.com/nodejs/node/pull/3569) +* [[`08e0de59fa`](https://github.com/nodejs/node/commit/08e0de59fa)] - **deps**: upgrade npm to 3.3.10 (Rebecca Turner) [#3599](https://github.com/nodejs/node/pull/3599) +* [[`ac9e4ffe8e`](https://github.com/nodejs/node/commit/ac9e4ffe8e)] - **dns**: prevent undefined values in results (Junliang Yan) [#3696](https://github.com/nodejs/node/pull/3696) +* [[`ea67d870f4`](https://github.com/nodejs/node/commit/ea67d870f4)] - **doc**: document release types in readme (Rod Vagg) [#3482](https://github.com/nodejs/node/pull/3482) +* [[`60d3daa65c`](https://github.com/nodejs/node/commit/60d3daa65c)] - **doc**: replace head of readme with updated text (Rod Vagg) [#3482](https://github.com/nodejs/node/pull/3482) +* [[`df1fdba2ae`](https://github.com/nodejs/node/commit/df1fdba2ae)] - **doc**: sort repl alphabetically (Tristian Flanagan) [#3859](https://github.com/nodejs/node/pull/3859) +* [[`7ecd5422c8`](https://github.com/nodejs/node/commit/7ecd5422c8)] - **doc**: address use of profanity in code of conduct (James M Snell) [#3827](https://github.com/nodejs/node/pull/3827) +* [[`c2393d1f2a`](https://github.com/nodejs/node/commit/c2393d1f2a)] - **doc**: consistent reference-style links (Bryan English) [#3845](https://github.com/nodejs/node/pull/3845) +* [[`96f53c6b02`](https://github.com/nodejs/node/commit/96f53c6b02)] - **doc**: add link to \[customizing util.inspect colors\]. (Jesse McCarthy) [#3749](https://github.com/nodejs/node/pull/3749) +* [[`132297d3f6`](https://github.com/nodejs/node/commit/132297d3f6)] - **doc**: Updated streams simplified constructor API (Tom Gallacher) [#3602](https://github.com/nodejs/node/pull/3602) +* [[`d137f0fd28`](https://github.com/nodejs/node/commit/d137f0fd28)] - **doc**: add warning about Windows process groups (Roman Klauke) [#3681](https://github.com/nodejs/node/pull/3681) +* [[`45ff31cf94`](https://github.com/nodejs/node/commit/45ff31cf94)] - **doc**: added what buf.copy returns (Manuel B) [#3555](https://github.com/nodejs/node/pull/3555) +* [[`5d1faa28cb`](https://github.com/nodejs/node/commit/5d1faa28cb)] - **doc**: reword message.headers to indicate they are not read-only (Tristian Flanagan) [#3814](https://github.com/nodejs/node/pull/3814) +* [[`25c3807051`](https://github.com/nodejs/node/commit/25c3807051)] - **doc**: clarify duplicate header handling (Bryan English) [#3810](https://github.com/nodejs/node/pull/3810) +* [[`ae2d1ee302`](https://github.com/nodejs/node/commit/ae2d1ee302)] - **doc**: repl: add defineComand and displayPrompt (Bryan English) [#3765](https://github.com/nodejs/node/pull/3765) +* [[`09e524d013`](https://github.com/nodejs/node/commit/09e524d013)] - **doc**: sort tls alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`7e60b81c81`](https://github.com/nodejs/node/commit/7e60b81c81)] - **doc**: sort stream alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`cd931a8a13`](https://github.com/nodejs/node/commit/cd931a8a13)] - **doc**: sort net alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`cfa8198af8`](https://github.com/nodejs/node/commit/cfa8198af8)] - **doc**: sort process alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`e1a512607a`](https://github.com/nodejs/node/commit/e1a512607a)] - **doc**: sort zlib alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`0996b97240`](https://github.com/nodejs/node/commit/0996b97240)] - **doc**: sort util alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`df07072b66`](https://github.com/nodejs/node/commit/df07072b66)] - **doc**: sort https alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`6e9d01c7d8`](https://github.com/nodejs/node/commit/6e9d01c7d8)] - **doc**: sort http alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`18da02fa0f`](https://github.com/nodejs/node/commit/18da02fa0f)] - **doc**: sort modules alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`29054ffc0c`](https://github.com/nodejs/node/commit/29054ffc0c)] - **doc**: sort readline alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`389ead37ef`](https://github.com/nodejs/node/commit/389ead37ef)] - **doc**: sort repl alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`d383d624de`](https://github.com/nodejs/node/commit/d383d624de)] - **doc**: sort string_decoder alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`0d2262887c`](https://github.com/nodejs/node/commit/0d2262887c)] - **doc**: sort timers alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`14b5a95d03`](https://github.com/nodejs/node/commit/14b5a95d03)] - **doc**: sort tty alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`d4dda77e4a`](https://github.com/nodejs/node/commit/d4dda77e4a)] - **doc**: sort url alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`39b8259bd5`](https://github.com/nodejs/node/commit/39b8259bd5)] - **doc**: sort vm alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`d357b3090e`](https://github.com/nodejs/node/commit/d357b3090e)] - **doc**: sort querystring alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`1f56abaa98`](https://github.com/nodejs/node/commit/1f56abaa98)] - **doc**: sort punycode alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`bc63667456`](https://github.com/nodejs/node/commit/bc63667456)] - **doc**: sort path alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`22961e011c`](https://github.com/nodejs/node/commit/22961e011c)] - **doc**: sort os alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`4ba18489d3`](https://github.com/nodejs/node/commit/4ba18489d3)] - **doc**: sort globals alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`c3f5ea704f`](https://github.com/nodejs/node/commit/c3f5ea704f)] - **doc**: sort fs alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`ce3ac8dd1e`](https://github.com/nodejs/node/commit/ce3ac8dd1e)] - **doc**: sort events alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`63a78749b8`](https://github.com/nodejs/node/commit/63a78749b8)] - **doc**: sort errors alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`488326da8d`](https://github.com/nodejs/node/commit/488326da8d)] - **doc**: sort dgram alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`e1c357e881`](https://github.com/nodejs/node/commit/e1c357e881)] - **doc**: sort crypto alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`4118fd5794`](https://github.com/nodejs/node/commit/4118fd5794)] - **doc**: sort dns alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`3e046acc50`](https://github.com/nodejs/node/commit/3e046acc50)] - **doc**: sort console alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`05f1af7124`](https://github.com/nodejs/node/commit/05f1af7124)] - **doc**: sort cluster alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`5c30e5dada`](https://github.com/nodejs/node/commit/5c30e5dada)] - **doc**: sort child_process alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`fb6a09cd0e`](https://github.com/nodejs/node/commit/fb6a09cd0e)] - **doc**: sort buffer alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`c7c05d8f02`](https://github.com/nodejs/node/commit/c7c05d8f02)] - **doc**: sort assert alphabetically (Tristian Flanagan) [#3662](https://github.com/nodejs/node/pull/3662) +* [[`f2c2e53321`](https://github.com/nodejs/node/commit/f2c2e53321)] - **doc**: add note to util.isBuffer (Evan Lucas) [#3790](https://github.com/nodejs/node/pull/3790) +* [[`35fb9f91eb`](https://github.com/nodejs/node/commit/35fb9f91eb)] - **doc**: Describe FIPSDIR environment variable (Stefan Budeanu) [#3752](https://github.com/nodejs/node/pull/3752) +* [[`da911f158b`](https://github.com/nodejs/node/commit/da911f158b)] - **doc**: update lts description in the collaborator guide (James M Snell) [#3668](https://github.com/nodejs/node/pull/3668) +* [[`597f8751d1`](https://github.com/nodejs/node/commit/597f8751d1)] - **doc**: add note on tls connection meta data methods (Tyler Henkel) [#3746](https://github.com/nodejs/node/pull/3746) +* [[`a32d9e31dc`](https://github.com/nodejs/node/commit/a32d9e31dc)] - **doc**: add romankl to collaborators (Roman Klauke) [#3725](https://github.com/nodejs/node/pull/3725) +* [[`e5b9109d12`](https://github.com/nodejs/node/commit/e5b9109d12)] - **doc**: add thealphanerd to collaborators (Myles Borins) [#3723](https://github.com/nodejs/node/pull/3723) +* [[`a05a0b47e3`](https://github.com/nodejs/node/commit/a05a0b47e3)] - **doc**: add saghul as a collaborator (Saúl Ibarra Corretgé) [#3724](https://github.com/nodejs/node/pull/3724) +* [[`b14d9c5f16`](https://github.com/nodejs/node/commit/b14d9c5f16)] - **doc**: add method links in events.markdown (Alejandro Oviedo) [#3187](https://github.com/nodejs/node/pull/3187) +* [[`44f779b112`](https://github.com/nodejs/node/commit/44f779b112)] - **doc**: add caveats of algs and key size in crypto (Shigeki Ohtsu) [#3479](https://github.com/nodejs/node/pull/3479) +* [[`a0db5fb355`](https://github.com/nodejs/node/commit/a0db5fb355)] - **doc**: stdout/stderr can block when directed to file (Ben Noordhuis) [#3170](https://github.com/nodejs/node/pull/3170) +* [[`409f29972e`](https://github.com/nodejs/node/commit/409f29972e)] - **doc**: rename iojs-* groups to nodejs-* (Steven R. Loomis) [#3634](https://github.com/nodejs/node/pull/3634) +* [[`801866280e`](https://github.com/nodejs/node/commit/801866280e)] - **doc**: fix wrong date and known issue in changelog.md (James M Snell) [#3650](https://github.com/nodejs/node/pull/3650) +* [[`325c4c7af5`](https://github.com/nodejs/node/commit/325c4c7af5)] - **doc**: fix function param order in assert doc (David Woods) [#3533](https://github.com/nodejs/node/pull/3533) +* [[`045e04e531`](https://github.com/nodejs/node/commit/045e04e531)] - **doc**: typo fix in readme.md (Sam P Gallagher-Bishop) [#3649](https://github.com/nodejs/node/pull/3649) +* [[`7fd8f1371e`](https://github.com/nodejs/node/commit/7fd8f1371e)] - **doc**: add note about timeout delay > TIMEOUT_MAX (Guilherme Souza) [#3512](https://github.com/nodejs/node/pull/3512) +* [[`7d0b589644`](https://github.com/nodejs/node/commit/7d0b589644)] - **doc**: fix crypto spkac function descriptions (Jason Gerfen) [#3614](https://github.com/nodejs/node/pull/3614) +* [[`efa19bdcb5`](https://github.com/nodejs/node/commit/efa19bdcb5)] - **doc**: add final full stop in CONTRIBUTING.md (Emily Aviva Kapor-Mater) [#3576](https://github.com/nodejs/node/pull/3576) +* [[`90723afe32`](https://github.com/nodejs/node/commit/90723afe32)] - **doc**: made code spans more visible in the API docs (phijohns) [#3573](https://github.com/nodejs/node/pull/3573) +* [[`530bb9144f`](https://github.com/nodejs/node/commit/530bb9144f)] - **docs**: improve discoverability of Code of Conduct (Ashley Williams) [#3774](https://github.com/nodejs/node/pull/3774) +* [[`73e40f0327`](https://github.com/nodejs/node/commit/73e40f0327)] - **docs**: fs - change links to buffer encoding to Buffer class anchor (fansworld-claudio) [#2796](https://github.com/nodejs/node/pull/2796) +* [[`7a84fa6c60`](https://github.com/nodejs/node/commit/7a84fa6c60)] - **docs**: fs - remove encoding list and link to buffer (fansworld-claudio) [#2796](https://github.com/nodejs/node/pull/2796) +* [[`2aa6a6d998`](https://github.com/nodejs/node/commit/2aa6a6d998)] - **fs**: return null error on readFile() success (Zheng Chaoping) [#3740](https://github.com/nodejs/node/pull/3740) +* [[`c96400c572`](https://github.com/nodejs/node/commit/c96400c572)] - **gitignore**: don't ignore 'debug' in deps/npm (Rebecca Turner) [#3599](https://github.com/nodejs/node/pull/3599) +* [[`a7f28a098e`](https://github.com/nodejs/node/commit/a7f28a098e)] - **http**: remove unneeded cb check from setTimeout() (Ashok Suthar) [#3631](https://github.com/nodejs/node/pull/3631) +* [[`d2b5dcb2de`](https://github.com/nodejs/node/commit/d2b5dcb2de)] - **lib**: return boolean from child.send() (Rich Trott) [#3577](https://github.com/nodejs/node/pull/3577) +* [[`5c54fa0095`](https://github.com/nodejs/node/commit/5c54fa0095)] - **module**: cache regular expressions (Evan Lucas) [#3869](https://github.com/nodejs/node/pull/3869) +* [[`89285db128`](https://github.com/nodejs/node/commit/89285db128)] - **module**: remove unnecessary JSON.stringify (Andres Suarez) [#3578](https://github.com/nodejs/node/pull/3578) +* [[`fd3f0d8e6e`](https://github.com/nodejs/node/commit/fd3f0d8e6e)] - **querystring**: Parse multiple separator characters (Yosuke Furukawa) [#3807](https://github.com/nodejs/node/pull/3807) +* [[`75dbafc3f8`](https://github.com/nodejs/node/commit/75dbafc3f8)] - **repl**: To exit, press ^C again or type .exit. (Hemanth.HM) [#3368](https://github.com/nodejs/node/pull/3368) +* [[`5073da0481`](https://github.com/nodejs/node/commit/5073da0481)] - **repl**: don't crash if cannot open history file (Evan Lucas) [#3630](https://github.com/nodejs/node/pull/3630) +* [[`59cd28114d`](https://github.com/nodejs/node/commit/59cd28114d)] - **src**: Add missing va_end before return (Ömer Fadıl Usta) [#3565](https://github.com/nodejs/node/pull/3565) +* [[`02e012e984`](https://github.com/nodejs/node/commit/02e012e984)] - **src**: force line buffering for stderr (Rich Trott) [#3701](https://github.com/nodejs/node/pull/3701) +* [[`2498e29344`](https://github.com/nodejs/node/commit/2498e29344)] - **src**: Revert "nix stdin _readableState.reading" (Roman Reiss) [#3490](https://github.com/nodejs/node/pull/3490) +* [[`65cd03cda6`](https://github.com/nodejs/node/commit/65cd03cda6)] - **src**: wrap source before doing syntax check (Evan Lucas) [#3587](https://github.com/nodejs/node/pull/3587) +* [[`d72bb1e96a`](https://github.com/nodejs/node/commit/d72bb1e96a)] - ***Revert*** "**src**: fix stuck debugger process" (Ben Noordhuis) [#3585](https://github.com/nodejs/node/pull/3585) +* [[`047abbd6eb`](https://github.com/nodejs/node/commit/047abbd6eb)] - **test**: move test-specific function out of common (Rich Trott) [#3871](https://github.com/nodejs/node/pull/3871) +* [[`19a36ff355`](https://github.com/nodejs/node/commit/19a36ff355)] - **test**: fix flaky SmartOS test (Rich Trott) [#3830](https://github.com/nodejs/node/pull/3830) +* [[`4bb27baf8d`](https://github.com/nodejs/node/commit/4bb27baf8d)] - **test**: skip test if FreeBSD jail will break it (Rich Trott) [#3839](https://github.com/nodejs/node/pull/3839) +* [[`1c1e70864b`](https://github.com/nodejs/node/commit/1c1e70864b)] - **test**: fix path to module for repl test on Windows (Michael Cornacchia) [#3608](https://github.com/nodejs/node/pull/3608) +* [[`413ca53107`](https://github.com/nodejs/node/commit/413ca53107)] - **test**: increase crypto strength for FIPS standard (Stefan Budeanu) [#3758](https://github.com/nodejs/node/pull/3758) +* [[`2ec5e17d16`](https://github.com/nodejs/node/commit/2ec5e17d16)] - **test**: add test-zlib-flush-drain (Myles Borins) [#3534](https://github.com/nodejs/node/pull/3534) +* [[`de707f0876`](https://github.com/nodejs/node/commit/de707f0876)] - **test**: add hasFipsCrypto to test/common.js (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) +* [[`828b786e48`](https://github.com/nodejs/node/commit/828b786e48)] - **test**: add test for invalid DSA key size (Stefan Budeanu) [#3756](https://github.com/nodejs/node/pull/3756) +* [[`252e810059`](https://github.com/nodejs/node/commit/252e810059)] - **test**: Fix test-cluster-worker-exit.js for AIX (Imran Iqbal) [#3666](https://github.com/nodejs/node/pull/3666) +* [[`91248b1094`](https://github.com/nodejs/node/commit/91248b1094)] - **test**: run pipeline flood test in parallel (Rich Trott) [#3811](https://github.com/nodejs/node/pull/3811) +* [[`583f58e5d6`](https://github.com/nodejs/node/commit/583f58e5d6)] - **test**: stronger crypto in test fixtures (Stefan Budeanu) [#3759](https://github.com/nodejs/node/pull/3759) +* [[`2e67db3104`](https://github.com/nodejs/node/commit/2e67db3104)] - **test**: refactor test-http-pipeline-flood (Rich Trott) [#3636](https://github.com/nodejs/node/pull/3636) +* [[`1ab59ab9b3`](https://github.com/nodejs/node/commit/1ab59ab9b3)] - **test**: fix flaky test test-http-pipeline-flood (Devin Nakamura) [#3636](https://github.com/nodejs/node/pull/3636) +* [[`1c8a7c6351`](https://github.com/nodejs/node/commit/1c8a7c6351)] - **test**: enhance fs-watch-recursive test (Sakthipriyan Vairamani) [#2599](https://github.com/nodejs/node/pull/2599) +* [[`81997840f2`](https://github.com/nodejs/node/commit/81997840f2)] - **test**: fix test-module-loading-error for musl (Hugues Malphettes) [#3657](https://github.com/nodejs/node/pull/3657) +* [[`9cdceac782`](https://github.com/nodejs/node/commit/9cdceac782)] - **test**: use really invalid hostname (Sakthipriyan Vairamani) [#3711](https://github.com/nodejs/node/pull/3711) +* [[`f3594e77b2`](https://github.com/nodejs/node/commit/f3594e77b2)] - **test**: fix test-net-persistent-keepalive for AIX (Imran Iqbal) [#3646](https://github.com/nodejs/node/pull/3646) +* [[`81522480f1`](https://github.com/nodejs/node/commit/81522480f1)] - **test**: more regression tests for minDHSize option (Ben Noordhuis) [#3629](https://github.com/nodejs/node/pull/3629) +* [[`935b97769e`](https://github.com/nodejs/node/commit/935b97769e)] - **test**: add regression test for 512 bits DH key (Ben Noordhuis) [#3629](https://github.com/nodejs/node/pull/3629) +* [[`e302c33bb0`](https://github.com/nodejs/node/commit/e302c33bb0)] - **test**: mark http-pipeline-flood flaky (Rich Trott) [#3616](https://github.com/nodejs/node/pull/3616) +* [[`5977963bce`](https://github.com/nodejs/node/commit/5977963bce)] - **test**: remove flaky designation from ls-no-sslv3 (Rich Trott) [#3620](https://github.com/nodejs/node/pull/3620) +* [[`1e98d90db8`](https://github.com/nodejs/node/commit/1e98d90db8)] - **test**: add regression test for --debug-brk -e 0 (Ben Noordhuis) [#3585](https://github.com/nodejs/node/pull/3585) +* [[`2f16be2b70`](https://github.com/nodejs/node/commit/2f16be2b70)] - **tls**: Use SHA1 for sessionIdContext in FIPS mode (Stefan Budeanu) [#3755](https://github.com/nodejs/node/pull/3755) +* [[`05f0549b50`](https://github.com/nodejs/node/commit/05f0549b50)] - **tls**: copy client CAs and cert store on CertCb (Fedor Indutny) [#3537](https://github.com/nodejs/node/pull/3537) +* [[`bea35424a2`](https://github.com/nodejs/node/commit/bea35424a2)] - **tools**: add tap output to cpplint (Johan Bergström) [#3448](https://github.com/nodejs/node/pull/3448) +* [[`d036b35349`](https://github.com/nodejs/node/commit/d036b35349)] - **tools**: enforce `throw new Error()` with lint rule (Rich Trott) [#3714](https://github.com/nodejs/node/pull/3714) +* [[`38bb0d864e`](https://github.com/nodejs/node/commit/38bb0d864e)] - **tools**: Use `throw new Error()` consistently (Rich Trott) [#3714](https://github.com/nodejs/node/pull/3714) +* [[`e40d28283a`](https://github.com/nodejs/node/commit/e40d28283a)] - **tools**: update npm test tooling for 3.3.10+ (Rebecca Turner) [#3599](https://github.com/nodejs/node/pull/3599) +* [[`cbd358ce33`](https://github.com/nodejs/node/commit/cbd358ce33)] - **tools**: fix gyp to work on MacOSX without XCode (Shigeki Ohtsu) [iojs/io.js#1325](https://github.com/iojs/io.js/pull/1325) +* [[`3137e46cb8`](https://github.com/nodejs/node/commit/3137e46cb8)] - **tools**: update gyp to b3cef02 (Imran Iqbal) [#3487](https://github.com/nodejs/node/pull/3487) +* [[`d61cb90ee3`](https://github.com/nodejs/node/commit/d61cb90ee3)] - **util**: use Object.create(null) for dictionary object (Minwoo Jung) [#3831](https://github.com/nodejs/node/pull/3831) +* [[`9a45c21e6c`](https://github.com/nodejs/node/commit/9a45c21e6c)] - **util**: use regexp instead of str.replace().join() (qinjia) [#3689](https://github.com/nodejs/node/pull/3689) +* [[`33ffc62670`](https://github.com/nodejs/node/commit/33ffc62670)] - **zlib**: only apply drain listener if given callback (Craig Cavalier) [#3534](https://github.com/nodejs/node/pull/3534) +* [[`d70deabf90`](https://github.com/nodejs/node/commit/d70deabf90)] - **zlib**: pass kind to recursive calls to flush (Myles Borins) [#3534](https://github.com/nodejs/node/pull/3534) + +## 2015-11-03, Version 4.2.2 'Argon' (LTS), @jasnell + +### Notable changes + +This is an LTS maintenance release that addresses a number of issues: + +* [[`1d0f2cbf87`](https://github.com/nodejs/node/commit/1d0f2cbf87)] - **buffer**: fix value check for writeUInt{B,L}E (Trevor Norris) [#3500](https://github.com/nodejs/node/pull/3500) +* [[`2a45b72b4a`](https://github.com/nodejs/node/commit/2a45b72b4a)] - **buffer**: don't CHECK on zero-sized realloc (Ben Noordhuis) [#3499](https://github.com/nodejs/node/pull/3499) +* [[`a6469e901a`](https://github.com/nodejs/node/commit/a6469e901a)] - **deps**: backport 010897c from V8 upstream (Ali Ijaz Sheikh) [#3520](https://github.com/nodejs/node/pull/3520) +* [[`cadee67c25`](https://github.com/nodejs/node/commit/cadee67c25)] - **deps**: backport 8d6a228 from the v8's upstream (Fedor Indutny) [#3549](https://github.com/nodejs/node/pull/3549) +* [[`46c8c94055`](https://github.com/nodejs/node/commit/46c8c94055)] - **fs**: reduced duplicate code in fs.write() (ronkorving) [#2947](https://github.com/nodejs/node/pull/2947) +* [[`0427cdf094`](https://github.com/nodejs/node/commit/0427cdf094)] - **http**: fix stalled pipeline bug (Fedor Indutny) [#3342](https://github.com/nodejs/node/pull/3342) +* [[`2109708186`](https://github.com/nodejs/node/commit/2109708186)] - **lib**: fix cluster handle leak (Rich Trott) [#3510](https://github.com/nodejs/node/pull/3510) +* [[`f49c7c6955`](https://github.com/nodejs/node/commit/f49c7c6955)] - **lib**: avoid REPL exit on completion error (Rich Trott) [#3358](https://github.com/nodejs/node/pull/3358) +* [[`8a2c4aeeaa`](https://github.com/nodejs/node/commit/8a2c4aeeaa)] - **repl**: handle comments properly (Sakthipriyan Vairamani) [#3515](https://github.com/nodejs/node/pull/3515) +* [[`a04408acce`](https://github.com/nodejs/node/commit/a04408acce)] - **repl**: limit persistent history correctly on load (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) +* [[`3bafe1a59b`](https://github.com/nodejs/node/commit/3bafe1a59b)] - **src**: fix race condition in debug signal on exit (Ben Noordhuis) [#3528](https://github.com/nodejs/node/pull/3528) +* [[`fe01d0df7a`](https://github.com/nodejs/node/commit/fe01d0df7a)] - **src**: fix exception message encoding on Windows (Brian White) [#3288](https://github.com/nodejs/node/pull/3288) +* [[`4bac5d9ddf`](https://github.com/nodejs/node/commit/4bac5d9ddf)] - **stream**: avoid unnecessary concat of a single buffer. (Calvin Metcalf) [#3300](https://github.com/nodejs/node/pull/3300) +* [[`8d78d687d5`](https://github.com/nodejs/node/commit/8d78d687d5)] - **timers**: reuse timer in `setTimeout().unref()` (Fedor Indutny) [#3407](https://github.com/nodejs/node/pull/3407) +* [[`e69c869399`](https://github.com/nodejs/node/commit/e69c869399)] - **tls**: TLSSocket options default isServer false (Yuval Brik) [#2614](https://github.com/nodejs/node/pull/2614) + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). + +### Commits + +* [[`1d0f2cbf87`](https://github.com/nodejs/node/commit/1d0f2cbf87)] - **buffer**: fix value check for writeUInt{B,L}E (Trevor Norris) [#3500](https://github.com/nodejs/node/pull/3500) +* [[`2a45b72b4a`](https://github.com/nodejs/node/commit/2a45b72b4a)] - **buffer**: don't CHECK on zero-sized realloc (Ben Noordhuis) [#3499](https://github.com/nodejs/node/pull/3499) +* [[`dc655e1dd2`](https://github.com/nodejs/node/commit/dc655e1dd2)] - **build**: rectify --link-module help text (P.S.V.R) [#3379](https://github.com/nodejs/node/pull/3379) +* [[`a6469e901a`](https://github.com/nodejs/node/commit/a6469e901a)] - **deps**: backport 010897c from V8 upstream (Ali Ijaz Sheikh) [#3520](https://github.com/nodejs/node/pull/3520) +* [[`cadee67c25`](https://github.com/nodejs/node/commit/cadee67c25)] - **deps**: backport 8d6a228 from the v8's upstream (Fedor Indutny) [#3549](https://github.com/nodejs/node/pull/3549) +* [[`1ebd35550b`](https://github.com/nodejs/node/commit/1ebd35550b)] - **doc**: fix typos in changelog (reggi) [#3291](https://github.com/nodejs/node/pull/3291) +* [[`fbd93d4c1c`](https://github.com/nodejs/node/commit/fbd93d4c1c)] - **doc**: more use-cases for promise events (Domenic Denicola) [#3438](https://github.com/nodejs/node/pull/3438) +* [[`6ceb9af407`](https://github.com/nodejs/node/commit/6ceb9af407)] - **doc**: remove old note, 'cluster' is marked stable (Balázs Galambosi) [#3314](https://github.com/nodejs/node/pull/3314) +* [[`a5f0d64ddc`](https://github.com/nodejs/node/commit/a5f0d64ddc)] - **doc**: createServer's key option can be an array (Sakthipriyan Vairamani) [#3123](https://github.com/nodejs/node/pull/3123) +* [[`317e0ec6b3`](https://github.com/nodejs/node/commit/317e0ec6b3)] - **doc**: binary encoding is not deprecated (Trevor Norris) [#3441](https://github.com/nodejs/node/pull/3441) +* [[`b422f6ee1a`](https://github.com/nodejs/node/commit/b422f6ee1a)] - **doc**: mention the behaviour if URL is invalid (Sakthipriyan Vairamani) [#2966](https://github.com/nodejs/node/pull/2966) +* [[`bc29aad22b`](https://github.com/nodejs/node/commit/bc29aad22b)] - **doc**: fix indent in tls resumption example (Roman Reiss) [#3372](https://github.com/nodejs/node/pull/3372) +* [[`313877bd8f`](https://github.com/nodejs/node/commit/313877bd8f)] - **doc**: fix typo in changelog (Timothy Gu) [#3353](https://github.com/nodejs/node/pull/3353) +* [[`4be432862a`](https://github.com/nodejs/node/commit/4be432862a)] - **doc**: show keylen in pbkdf2 as a byte length (calebboyd) [#3334](https://github.com/nodejs/node/pull/3334) +* [[`23a1140ddb`](https://github.com/nodejs/node/commit/23a1140ddb)] - **doc**: add information about Assert behavior and maintenance (Rich Trott) [#3330](https://github.com/nodejs/node/pull/3330) +* [[`e04cb1e1fc`](https://github.com/nodejs/node/commit/e04cb1e1fc)] - **doc**: clarify API buffer.concat (Martii) [#3255](https://github.com/nodejs/node/pull/3255) +* [[`eae714c370`](https://github.com/nodejs/node/commit/eae714c370)] - **doc**: clarify the use of `option.detached` (Kyle Smith) [#3250](https://github.com/nodejs/node/pull/3250) +* [[`b884899e67`](https://github.com/nodejs/node/commit/b884899e67)] - **doc**: label v4.2.1 as LTS in changelog heading (Phillip Johnsen) [#3360](https://github.com/nodejs/node/pull/3360) +* [[`9120a04981`](https://github.com/nodejs/node/commit/9120a04981)] - **docs**: add missing shell option to execSync (fansworld-claudio) [#3440](https://github.com/nodejs/node/pull/3440) +* [[`46c8c94055`](https://github.com/nodejs/node/commit/46c8c94055)] - **fs**: reduced duplicate code in fs.write() (ronkorving) [#2947](https://github.com/nodejs/node/pull/2947) +* [[`0427cdf094`](https://github.com/nodejs/node/commit/0427cdf094)] - **http**: fix stalled pipeline bug (Fedor Indutny) [#3342](https://github.com/nodejs/node/pull/3342) +* [[`2109708186`](https://github.com/nodejs/node/commit/2109708186)] - **lib**: fix cluster handle leak (Rich Trott) [#3510](https://github.com/nodejs/node/pull/3510) +* [[`f49c7c6955`](https://github.com/nodejs/node/commit/f49c7c6955)] - **lib**: avoid REPL exit on completion error (Rich Trott) [#3358](https://github.com/nodejs/node/pull/3358) +* [[`8a2c4aeeaa`](https://github.com/nodejs/node/commit/8a2c4aeeaa)] - **repl**: handle comments properly (Sakthipriyan Vairamani) [#3515](https://github.com/nodejs/node/pull/3515) +* [[`a04408acce`](https://github.com/nodejs/node/commit/a04408acce)] - **repl**: limit persistent history correctly on load (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) +* [[`5d1f1c5fa8`](https://github.com/nodejs/node/commit/5d1f1c5fa8)] - **src**: wrap source before doing syntax check (Evan Lucas) [#3587](https://github.com/nodejs/node/pull/3587) +* [[`3bafe1a59b`](https://github.com/nodejs/node/commit/3bafe1a59b)] - **src**: fix race condition in debug signal on exit (Ben Noordhuis) [#3528](https://github.com/nodejs/node/pull/3528) +* [[`fe01d0df7a`](https://github.com/nodejs/node/commit/fe01d0df7a)] - **src**: fix exception message encoding on Windows (Brian White) [#3288](https://github.com/nodejs/node/pull/3288) +* [[`4bac5d9ddf`](https://github.com/nodejs/node/commit/4bac5d9ddf)] - **stream**: avoid unnecessary concat of a single buffer. (Calvin Metcalf) [#3300](https://github.com/nodejs/node/pull/3300) +* [[`117fb47a16`](https://github.com/nodejs/node/commit/117fb47a16)] - **stream**: fix signature of _write() in a comment (Fábio Santos) [#3248](https://github.com/nodejs/node/pull/3248) +* [[`c563a34427`](https://github.com/nodejs/node/commit/c563a34427)] - **test**: split independent tests into separate files (Rich Trott) [#3548](https://github.com/nodejs/node/pull/3548) +* [[`3f62952d42`](https://github.com/nodejs/node/commit/3f62952d42)] - **test**: add node::MakeCallback() test coverage (Ben Noordhuis) [#3478](https://github.com/nodejs/node/pull/3478) +* [[`6b75f10d8a`](https://github.com/nodejs/node/commit/6b75f10d8a)] - **test**: use port number from env in tls socket test (Stefan Budeanu) [#3557](https://github.com/nodejs/node/pull/3557) +* [[`39ff44e94f`](https://github.com/nodejs/node/commit/39ff44e94f)] - **test**: fix heap-profiler link error LNK1194 on win (Junliang Yan) [#3572](https://github.com/nodejs/node/pull/3572) +* [[`a2786dd408`](https://github.com/nodejs/node/commit/a2786dd408)] - **test**: fix missing unistd.h on windows (Junliang Yan) [#3532](https://github.com/nodejs/node/pull/3532) +* [[`5e6f7c9a23`](https://github.com/nodejs/node/commit/5e6f7c9a23)] - **test**: add regression test for --debug-brk -e 0 (Ben Noordhuis) [#3585](https://github.com/nodejs/node/pull/3585) +* [[`7cad182cb6`](https://github.com/nodejs/node/commit/7cad182cb6)] - **test**: port domains regression test from v0.10 (Jonas Dohse) [#3356](https://github.com/nodejs/node/pull/3356) +* [[`78d854c6ce`](https://github.com/nodejs/node/commit/78d854c6ce)] - **test**: remove util from common (Rich Trott) [#3324](https://github.com/nodejs/node/pull/3324) +* [[`c566c8b8c0`](https://github.com/nodejs/node/commit/c566c8b8c0)] - **test**: remove util properties from common (Rich Trott) [#3304](https://github.com/nodejs/node/pull/3304) +* [[`eb7c3fb2f4`](https://github.com/nodejs/node/commit/eb7c3fb2f4)] - **test**: split up buffer tests for reliability (Rich Trott) [#3323](https://github.com/nodejs/node/pull/3323) +* [[`b398a85e19`](https://github.com/nodejs/node/commit/b398a85e19)] - **test**: parallelize long-running test (Rich Trott) [#3287](https://github.com/nodejs/node/pull/3287) +* [[`b5f3b4956b`](https://github.com/nodejs/node/commit/b5f3b4956b)] - **test**: change call to deprecated util.isError() (Rich Trott) [#3084](https://github.com/nodejs/node/pull/3084) +* [[`32149cacb5`](https://github.com/nodejs/node/commit/32149cacb5)] - **test**: improve tests for util.inherits (Michaël Zasso) [#3507](https://github.com/nodejs/node/pull/3507) +* [[`5be686fab8`](https://github.com/nodejs/node/commit/5be686fab8)] - **test**: print helpful err msg on test-dns-ipv6.js (Junliang Yan) [#3501](https://github.com/nodejs/node/pull/3501) +* [[`0429131e32`](https://github.com/nodejs/node/commit/0429131e32)] - **test**: fix domain with abort-on-uncaught on PPC (Julien Gilli) [#3354](https://github.com/nodejs/node/pull/3354) +* [[`788106eee9`](https://github.com/nodejs/node/commit/788106eee9)] - **test**: cleanup, improve repl-persistent-history (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) +* [[`ea58fa0bac`](https://github.com/nodejs/node/commit/ea58fa0bac)] - **test**: add Symbol test for assert.deepEqual() (Rich Trott) [#3327](https://github.com/nodejs/node/pull/3327) +* [[`d409ac473b`](https://github.com/nodejs/node/commit/d409ac473b)] - **test**: disable test-tick-processor - aix and be ppc (Michael Dawson) [#3491](https://github.com/nodejs/node/pull/3491) +* [[`c1623039dd`](https://github.com/nodejs/node/commit/c1623039dd)] - **test**: harden test-child-process-fork-regr-gh-2847 (Michael Dawson) [#3459](https://github.com/nodejs/node/pull/3459) +* [[`3bb4437abb`](https://github.com/nodejs/node/commit/3bb4437abb)] - **test**: fix test-net-keepalive for AIX (Imran Iqbal) [#3458](https://github.com/nodejs/node/pull/3458) +* [[`af55641a69`](https://github.com/nodejs/node/commit/af55641a69)] - **test**: wrap assert.fail when passed to callback (Myles Borins) [#3453](https://github.com/nodejs/node/pull/3453) +* [[`7c7ef01e65`](https://github.com/nodejs/node/commit/7c7ef01e65)] - **test**: skip test-dns-ipv6.js if ipv6 is unavailable (Junliang Yan) [#3444](https://github.com/nodejs/node/pull/3444) +* [[`a4d1510ba4`](https://github.com/nodejs/node/commit/a4d1510ba4)] - **test**: repl-persistent-history is no longer flaky (Jeremiah Senkpiel) [#3437](https://github.com/nodejs/node/pull/3437) +* [[`a5d968b8a2`](https://github.com/nodejs/node/commit/a5d968b8a2)] - **test**: fix flaky test-child-process-emfile (Rich Trott) [#3430](https://github.com/nodejs/node/pull/3430) +* [[`eac2acca76`](https://github.com/nodejs/node/commit/eac2acca76)] - **test**: remove flaky status from eval_messages test (Rich Trott) [#3420](https://github.com/nodejs/node/pull/3420) +* [[`155c778584`](https://github.com/nodejs/node/commit/155c778584)] - **test**: fix flaky test for symlinks (Rich Trott) [#3418](https://github.com/nodejs/node/pull/3418) +* [[`74eb632483`](https://github.com/nodejs/node/commit/74eb632483)] - **test**: apply correct assert.fail() arguments (Rich Trott) [#3378](https://github.com/nodejs/node/pull/3378) +* [[`0a4323dd82`](https://github.com/nodejs/node/commit/0a4323dd82)] - **test**: replace util with backtick strings (Myles Borins) [#3359](https://github.com/nodejs/node/pull/3359) +* [[`93847694ec`](https://github.com/nodejs/node/commit/93847694ec)] - **test**: add test-child-process-emfile fail message (Rich Trott) [#3335](https://github.com/nodejs/node/pull/3335) +* [[`8d78d687d5`](https://github.com/nodejs/node/commit/8d78d687d5)] - **timers**: reuse timer in `setTimeout().unref()` (Fedor Indutny) [#3407](https://github.com/nodejs/node/pull/3407) +* [[`e69c869399`](https://github.com/nodejs/node/commit/e69c869399)] - **tls**: TLSSocket options default isServer false (Yuval Brik) [#2614](https://github.com/nodejs/node/pull/2614) +* [[`0b32bbbf69`](https://github.com/nodejs/node/commit/0b32bbbf69)] - **v8**: pull fix for builtin code size on PPC (Michael Dawson) [#3474](https://github.com/nodejs/node/pull/3474) + +## 2015-10-29, Version 5.0.0 (Stable), @rvagg + +### Notable Changes + +* **buffer**: _(Breaking)_ Removed both `'raw'` and `'raws'` encoding types from `Buffer`, these have been deprecated for a long time (Sakthipriyan Vairamani) [#2859](https://github.com/nodejs/node/pull/2859). +* **console**: _(Breaking)_ Values reported by `console.time()` now have 3 decimals of accuracy added (Michaël Zasso) [#3166](https://github.com/nodejs/node/pull/3166). +* **fs**: + - `fs.readFile*()`, `fs.writeFile*()`, and `fs.appendFile*()` now also accept a file descriptor as their first argument (Johannes Wüller) [#3163](https://github.com/nodejs/node/pull/3163). + - _(Breaking)_ In `fs.readFile()`, if an encoding is specified and the internal `toString()` fails the error is no longer _thrown_ but is passed to the callback (Evan Lucas) [#3485](https://github.com/nodejs/node/pull/3485). + - _(Breaking)_ In `fs.read()` (using the `fs.read(fd, length, position, encoding, callback)` form), if the internal `toString()` fails the error is no longer _thrown_ but is passed to the callback (Evan Lucas) [#3503](https://github.com/nodejs/node/pull/3503). +* **http**: + - Fixed a bug where pipelined http requests would stall (Fedor Indutny) [#3342](https://github.com/nodejs/node/pull/3342). + - _(Breaking)_ When parsing HTTP, don't add duplicates of the following headers: `Retry-After`, `ETag`, `Last-Modified`, `Server`, `Age`, `Expires`. This is in addition to the following headers which already block duplicates: `Content-Type`, `Content-Length`, `User-Agent`, `Referer`, `Host`, `Authorization`, `Proxy-Authorization`, `If-Modified-Since`, `If-Unmodified-Since`, `From`, `Location`, `Max-Forwards` (James M Snell) [#3090](https://github.com/nodejs/node/pull/3090). + - _(Breaking)_ The `callback` argument to `OutgoingMessage#setTimeout()` must be a function or a `TypeError` is thrown (James M Snell) [#3090](https://github.com/nodejs/node/pull/3090). + - _(Breaking)_ HTTP methods and header names must now conform to the RFC 2616 "token" rule, a list of allowed characters that excludes control characters and a number of _separator_ characters. Specifically, methods and header names must now match ```/^[a-zA-Z0-9_!#$%&'*+.^`|~-]+$/``` or a `TypeError` will be thrown (James M Snell) [#2526](https://github.com/nodejs/node/pull/2526). +* **node**: + - _(Breaking)_ Deprecated the `_linklist` module (Rich Trott) [#3078](https://github.com/nodejs/node/pull/3078). + - _(Breaking)_ Removed `require.paths` and `require.registerExtension()`, both had been previously set to throw `Error` when accessed (Sakthipriyan Vairamani) [#2922](https://github.com/nodejs/node/pull/2922). +* **npm**: Upgraded to version 3.3.6 from 2.14.7, see https://github.com/npm/npm/releases/tag/v3.3.6 for more details. This is a major version bump for npm and it has seen a significant amount of change. Please see the original [npm v3.0.0 release notes](https://github.com/npm/npm/blob/master/CHANGELOG.md#v300-2015-06-25) for a list of major changes (Rebecca Turner) [#3310](https://github.com/nodejs/node/pull/3310). +* **src**: _(Breaking)_ Bumped `NODE_MODULE_VERSION` to `47` from `46`, this is necessary due to the V8 upgrade. Native add-ons will need to be recompiled (Rod Vagg) [#3400](https://github.com/nodejs/node/pull/3400). +* **timers**: Attempt to reuse the timer handle for `setTimeout().unref()`. This fixes a long-standing known issue where unrefed timers would perviously hold `beforeExit` open (Fedor Indutny) [#3407](https://github.com/nodejs/node/pull/3407). +* **tls**: + - Added ALPN Support (Shigeki Ohtsu) [#2564](https://github.com/nodejs/node/pull/2564). + - TLS options can now be passed in an object to `createSecurePair()` (Коренберг Марк) [#2441](https://github.com/nodejs/node/pull/2441). + - _(Breaking)_ The default minimum DH key size for `tls.connect()` is now 1024 bits and a warning is shown when DH key size is less than 2048 bits. This a security consideration to prevent "logjam" attacks. A new `minDHSize` TLS option can be used to override the default. (Shigeki Ohtsu) [#1831](https://github.com/nodejs/node/pull/1831). +* **util**: + - _(Breaking)_ `util.p()` was deprecated for years, and has now been removed (Wyatt Preul) [#3432](https://github.com/nodejs/node/pull/3432). + - _(Breaking)_ `util.inherits()` can now work with ES6 classes. This is considered a breaking change because of potential subtle side-effects caused by a change from directly reassigning the prototype of the constructor using `ctor.prototype = Object.create(superCtor.prototype, { constructor: { ... } })` to using `Object.setPrototypeOf(ctor.prototype, superCtor.prototype)` (Michaël Zasso) [#3455](https://github.com/nodejs/node/pull/3455). +* **v8**: _(Breaking)_ Upgraded to 4.6.85.25 from 4.5.103.35 (Ali Ijaz Sheikh) [#3351](https://github.com/nodejs/node/pull/3351). + - Implements the spread operator, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_operator for further information. + - Implements `new.target`, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/new.target for further information. +* **zlib**: Decompression now throws on truncated input (e.g. unexpected end of file) (Yuval Brik) [#2595](https://github.com/nodejs/node/pull/2595). + +### Known issues + +* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690) +* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894) +* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435). +* Unicode characters in filesystem paths are not handled consistently across platforms or Node.js APIs. See [#2088](https://github.com/nodejs/node/issues/2088), [#3401](https://github.com/nodejs/node/issues/3401) and [#3519](https://github.com/nodejs/node/issues/3519). + + +### Commits + +* [[`6a04cc0a43`](https://github.com/nodejs/node/commit/6a04cc0a43)] - **buffer**: fix value check for writeUInt{B,L}E (Trevor Norris) [#3500](https://github.com/nodejs/node/pull/3500) +* [[`1a41feb559`](https://github.com/nodejs/node/commit/1a41feb559)] - **buffer**: don't CHECK on zero-sized realloc (Ben Noordhuis) [#3499](https://github.com/nodejs/node/pull/3499) +* [[`5f6579d366`](https://github.com/nodejs/node/commit/5f6579d366)] - **(SEMVER-MAJOR)** **buffer**: remove raw & raws encoding (Sakthipriyan Vairamani) [#2859](https://github.com/nodejs/node/pull/2859) +* [[`70fca2a81e`](https://github.com/nodejs/node/commit/70fca2a81e)] - **build**: Updates for AIX npm support - part 1 (Michael Dawson) [#3114](https://github.com/nodejs/node/pull/3114) +* [[`b36b4f385a`](https://github.com/nodejs/node/commit/b36b4f385a)] - **build**: rectify --link-module help text (P.S.V.R) [#3379](https://github.com/nodejs/node/pull/3379) +* [[`a89eeca590`](https://github.com/nodejs/node/commit/a89eeca590)] - **console**: rename argument of time and timeEnd (Michaël Zasso) [#3166](https://github.com/nodejs/node/pull/3166) +* [[`870108aaa8`](https://github.com/nodejs/node/commit/870108aaa8)] - **(SEMVER-MAJOR)** **console**: sub-millisecond accuracy for console.time (Michaël Zasso) [#3166](https://github.com/nodejs/node/pull/3166) +* [[`0a43697ce8`](https://github.com/nodejs/node/commit/0a43697ce8)] - **deps**: backport 010897c from V8 upstream (Ali Ijaz Sheikh) [#3520](https://github.com/nodejs/node/pull/3520) +* [[`8c0318ce8d`](https://github.com/nodejs/node/commit/8c0318ce8d)] - **deps**: backport 8d6a228 from the v8's upstream (Fedor Indutny) [#3549](https://github.com/nodejs/node/pull/3549) +* [[`2974debc6e`](https://github.com/nodejs/node/commit/2974debc6e)] - **deps**: update V8 to 4.6.85.28 (Michaël Zasso) [#3484](https://github.com/nodejs/node/pull/3484) +* [[`f76af49b13`](https://github.com/nodejs/node/commit/f76af49b13)] - **deps**: fix upgrade to npm 3.3.6 (Rebecca Turner) [#3494](https://github.com/nodejs/node/pull/3494) +* [[`32b51c97ec`](https://github.com/nodejs/node/commit/32b51c97ec)] - **deps**: upgrade npm to 3.3.6 (Rebecca Turner) [#3310](https://github.com/nodejs/node/pull/3310) +* [[`770cd229f9`](https://github.com/nodejs/node/commit/770cd229f9)] - **deps**: upgrade V8 to 4.6.85.25 (Ali Ijaz Sheikh) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`972a0c8515`](https://github.com/nodejs/node/commit/972a0c8515)] - **deps**: backport 0d01728 from v8's upstream (Fedor Indutny) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`1fdec65203`](https://github.com/nodejs/node/commit/1fdec65203)] - **deps**: improve ArrayBuffer performance in v8 (Fedor Indutny) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`5cd1fd836a`](https://github.com/nodejs/node/commit/5cd1fd836a)] - **deps**: backport 56a0a79 from V8 upstream (Julien Gilli) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`7fb128d8df`](https://github.com/nodejs/node/commit/7fb128d8df)] - **deps**: cherry-pick backports to V8 (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`d8011d1683`](https://github.com/nodejs/node/commit/d8011d1683)] - **(SEMVER-MAJOR)** **deps**: upgrade V8 to 4.6.85.23 (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`a334ddc467`](https://github.com/nodejs/node/commit/a334ddc467)] - ***Revert*** "**deps**: backport 03ef3cd from V8 upstream" (Ali Ijaz Sheikh) [#3237](https://github.com/nodejs/node/pull/3237) +* [[`6fff47ffac`](https://github.com/nodejs/node/commit/6fff47ffac)] - **deps**: backport 03ef3cd from V8 upstream (Ali Ijaz Sheikh) [#3165](https://github.com/nodejs/node/pull/3165) +* [[`680dda8023`](https://github.com/nodejs/node/commit/680dda8023)] - **dns**: remove nonexistant exports.ADNAME (Roman Reiss) [#3051](https://github.com/nodejs/node/pull/3051) +* [[`239ad899a3`](https://github.com/nodejs/node/commit/239ad899a3)] - **doc**: add LTS info to COLLABORATOR_GUIDE.md (Myles Borins) [#3442](https://github.com/nodejs/node/pull/3442) +* [[`5e76587fdf`](https://github.com/nodejs/node/commit/5e76587fdf)] - **doc**: createServer's key option can be an array (Sakthipriyan Vairamani) [#3123](https://github.com/nodejs/node/pull/3123) +* [[`0317c880da`](https://github.com/nodejs/node/commit/0317c880da)] - **doc**: add TSC meeting minutes 2015-10-21 (Rod Vagg) [#3480](https://github.com/nodejs/node/pull/3480) +* [[`cd245b12e0`](https://github.com/nodejs/node/commit/cd245b12e0)] - **doc**: clarify API buffer.concat (Martii) [#3255](https://github.com/nodejs/node/pull/3255) +* [[`ff9ef893fd`](https://github.com/nodejs/node/commit/ff9ef893fd)] - **doc**: add TSC meeting minutes 2015-10-14 (Rod Vagg) [#3463](https://github.com/nodejs/node/pull/3463) +* [[`605c5a7754`](https://github.com/nodejs/node/commit/605c5a7754)] - **doc**: clarify the use of `option.detached` (Kyle Smith) [#3250](https://github.com/nodejs/node/pull/3250) +* [[`cf75a175e5`](https://github.com/nodejs/node/commit/cf75a175e5)] - **doc**: more use-cases for promise events (Domenic Denicola) [#3438](https://github.com/nodejs/node/pull/3438) +* [[`1b75d4bda3`](https://github.com/nodejs/node/commit/1b75d4bda3)] - **doc**: update WORKING_GROUPS.md - add missing groups (Michael Dawson) [#3450](https://github.com/nodejs/node/pull/3450) +* [[`c658de2f99`](https://github.com/nodejs/node/commit/c658de2f99)] - **doc**: add TSC meeting minutes 2015-09-30 (Rod Vagg) [#3235](https://github.com/nodejs/node/pull/3235) +* [[`d0b8c5d3a4`](https://github.com/nodejs/node/commit/d0b8c5d3a4)] - **doc**: add TSC meeting minutes 2015-10-07 (Rod Vagg) [#3364](https://github.com/nodejs/node/pull/3364) +* [[`b483afcb20`](https://github.com/nodejs/node/commit/b483afcb20)] - **doc**: binary encoding is not deprecated (Trevor Norris) [#3441](https://github.com/nodejs/node/pull/3441) +* [[`b607366a1c`](https://github.com/nodejs/node/commit/b607366a1c)] - **doc**: add information about Assert behavior and maintenance (Rich Trott) [#3330](https://github.com/nodejs/node/pull/3330) +* [[`086103b32e`](https://github.com/nodejs/node/commit/086103b32e)] - **doc**: show keylen in pbkdf2 as a byte length (calebboyd) [#3334](https://github.com/nodejs/node/pull/3334) +* [[`f6ebc8277b`](https://github.com/nodejs/node/commit/f6ebc8277b)] - **doc**: reword description of console.time (Michaël Zasso) [#3166](https://github.com/nodejs/node/pull/3166) +* [[`503f279527`](https://github.com/nodejs/node/commit/503f279527)] - **doc**: fix indent in tls resumption example (Roman Reiss) [#3372](https://github.com/nodejs/node/pull/3372) +* [[`dae9fae0fe`](https://github.com/nodejs/node/commit/dae9fae0fe)] - **doc**: label v4.2.1 as LTS in changelog heading (Phillip Johnsen) [#3360](https://github.com/nodejs/node/pull/3360) +* [[`4fc638804c`](https://github.com/nodejs/node/commit/4fc638804c)] - **doc**: update V8 options in man page (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`a441aa6e1d`](https://github.com/nodejs/node/commit/a441aa6e1d)] - **doc**: update WORKING_GROUPS.md to include Intl (Steven R. Loomis) [#3251](https://github.com/nodejs/node/pull/3251) +* [[`81503e597b`](https://github.com/nodejs/node/commit/81503e597b)] - **doc**: fix typo in changelog (Timothy Gu) [#3353](https://github.com/nodejs/node/pull/3353) +* [[`3ef2e4acf3`](https://github.com/nodejs/node/commit/3ef2e4acf3)] - **doc**: fix typos in changelog (reggi) [#3291](https://github.com/nodejs/node/pull/3291) +* [[`b9279aa193`](https://github.com/nodejs/node/commit/b9279aa193)] - **doc**: remove old note, 'cluster' is marked stable (Balázs Galambosi) [#3314](https://github.com/nodejs/node/pull/3314) +* [[`cdfa271164`](https://github.com/nodejs/node/commit/cdfa271164)] - **doc**: update AUTHORS list (Rod Vagg) +* [[`47b06f6bb1`](https://github.com/nodejs/node/commit/47b06f6bb1)] - **docs**: add missing shell option to execSync (fansworld-claudio) [#3440](https://github.com/nodejs/node/pull/3440) +* [[`4c9abbd1bb`](https://github.com/nodejs/node/commit/4c9abbd1bb)] - **fs**: reduced duplicate code in fs.write() (ronkorving) [#2947](https://github.com/nodejs/node/pull/2947) +* [[`2bb147535e`](https://github.com/nodejs/node/commit/2bb147535e)] - **(SEMVER-MAJOR)** **fs**: don't throw in read if buffer too big (Evan Lucas) [#3503](https://github.com/nodejs/node/pull/3503) +* [[`7added3b39`](https://github.com/nodejs/node/commit/7added3b39)] - **(SEMVER-MAJOR)** **fs**: pass err to callback if buffer is too big (Evan Lucas) [#3485](https://github.com/nodejs/node/pull/3485) +* [[`5e0759f6fd`](https://github.com/nodejs/node/commit/5e0759f6fd)] - **(SEMVER-MINOR)** **fs**: add file descriptor support to *File() funcs (Johannes Wüller) [#3163](https://github.com/nodejs/node/pull/3163) +* [[`d1a2e5357e`](https://github.com/nodejs/node/commit/d1a2e5357e)] - **gitignore**: don't ignore debug source directory in V8 (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`ab03635fb1`](https://github.com/nodejs/node/commit/ab03635fb1)] - **http**: fix stalled pipeline bug (Fedor Indutny) [#3342](https://github.com/nodejs/node/pull/3342) +* [[`e655a437b3`](https://github.com/nodejs/node/commit/e655a437b3)] - **(SEMVER-MAJOR)** **http**: do not allow multiple instances of certain response headers (James M Snell) [#3090](https://github.com/nodejs/node/pull/3090) +* [[`0094a8dad7`](https://github.com/nodejs/node/commit/0094a8dad7)] - **(SEMVER-MAJOR)** **http**: add callback is function check (James M Snell) [#3090](https://github.com/nodejs/node/pull/3090) +* [[`6192c9892f`](https://github.com/nodejs/node/commit/6192c9892f)] - **(SEMVER-MAJOR)** **http**: add checkIsHttpToken check for header fields (James M Snell) [#2526](https://github.com/nodejs/node/pull/2526) +* [[`c9786bb680`](https://github.com/nodejs/node/commit/c9786bb680)] - **(SEMVER-MAJOR)** http{s}: don't connect to localhost on invalid URL (Sakthipriyan Vairamani) [#2967](https://github.com/nodejs/node/pull/2967) +* [[`1929d5be73`](https://github.com/nodejs/node/commit/1929d5be73)] - **lib**: fix cluster handle leak (Rich Trott) [#3510](https://github.com/nodejs/node/pull/3510) +* [[`97d081709e`](https://github.com/nodejs/node/commit/97d081709e)] - **lib**: avoid REPL exit on completion error (Rich Trott) [#3358](https://github.com/nodejs/node/pull/3358) +* [[`f236b3a904`](https://github.com/nodejs/node/commit/f236b3a904)] - **(SEMVER-MINOR)** **lib,doc**: return boolean from child.send() (Rich Trott) [#3516](https://github.com/nodejs/node/pull/3516) +* [[`6e887cc630`](https://github.com/nodejs/node/commit/6e887cc630)] - **lib,test**: update let to const where applicable (Sakthipriyan Vairamani) [#3152](https://github.com/nodejs/node/pull/3152) +* [[`47befffc53`](https://github.com/nodejs/node/commit/47befffc53)] - **(SEMVER-MAJOR)** **lib,test**: deprecate _linklist (Rich Trott) [#3078](https://github.com/nodejs/node/pull/3078) +* [[`d5ce53458e`](https://github.com/nodejs/node/commit/d5ce53458e)] - **lttng**: update flags for gc tracing (Glen Keane) [#3388](https://github.com/nodejs/node/pull/3388) +* [[`6ad458b752`](https://github.com/nodejs/node/commit/6ad458b752)] - **(SEMVER-MAJOR)** **module**: remove unnecessary property and method (Sakthipriyan Vairamani) [#2922](https://github.com/nodejs/node/pull/2922) +* [[`ae196175f4`](https://github.com/nodejs/node/commit/ae196175f4)] - **node**: improve GetActiveRequests performance (Trevor Norris) [#3375](https://github.com/nodejs/node/pull/3375) +* [[`bd4311bc9c`](https://github.com/nodejs/node/commit/bd4311bc9c)] - **repl**: handle comments properly (Sakthipriyan Vairamani) [#3515](https://github.com/nodejs/node/pull/3515) +* [[`ce391ed849`](https://github.com/nodejs/node/commit/ce391ed849)] - **(SEMVER-MAJOR)** **repl**: event ordering: delay 'close' until 'flushHistory' (Jeremiah Senkpiel) [#3435](https://github.com/nodejs/node/pull/3435) +* [[`4c80c02ac7`](https://github.com/nodejs/node/commit/4c80c02ac7)] - **repl**: limit persistent history correctly on load (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) +* [[`134a60c785`](https://github.com/nodejs/node/commit/134a60c785)] - **src**: fix race condition in debug signal on exit (Ben Noordhuis) [#3528](https://github.com/nodejs/node/pull/3528) +* [[`bf7c3dabb4`](https://github.com/nodejs/node/commit/bf7c3dabb4)] - **(SEMVER-MAJOR)** **src**: bump NODE_MODULE_VERSION To 47 (Rod Vagg) [#3400](https://github.com/nodejs/node/pull/3400) +* [[`2d3560767e`](https://github.com/nodejs/node/commit/2d3560767e)] - **src**: fix exception message encoding on Windows (Brian White) [#3288](https://github.com/nodejs/node/pull/3288) +* [[`ff877e93e1`](https://github.com/nodejs/node/commit/ff877e93e1)] - **src**: fix stuck debugger process (Liang-Chi Hsieh) [#2778](https://github.com/nodejs/node/pull/2778) +* [[`8854183fe5`](https://github.com/nodejs/node/commit/8854183fe5)] - **stream**: avoid unnecessary concat of a single buffer. (Calvin Metcalf) [#3300](https://github.com/nodejs/node/pull/3300) +* [[`85b74de9de`](https://github.com/nodejs/node/commit/85b74de9de)] - **stream**: fix signature of _write() in a comment (Fábio Santos) [#3248](https://github.com/nodejs/node/pull/3248) +* [[`b8cea49c88`](https://github.com/nodejs/node/commit/b8cea49c88)] - **test**: fix heap-profiler link error LNK1194 on win (Junliang Yan) [#3572](https://github.com/nodejs/node/pull/3572) +* [[`4a5dbeab43`](https://github.com/nodejs/node/commit/4a5dbeab43)] - **test**: fix missing unistd.h on windows (Junliang Yan) [#3532](https://github.com/nodejs/node/pull/3532) +* [[`74e2328b3a`](https://github.com/nodejs/node/commit/74e2328b3a)] - **test**: split independent tests into separate files (Rich Trott) [#3548](https://github.com/nodejs/node/pull/3548) +* [[`8c6c0f915a`](https://github.com/nodejs/node/commit/8c6c0f915a)] - **test**: use port number from env in tls socket test (Stefan Budeanu) [#3557](https://github.com/nodejs/node/pull/3557) +* [[`1a968e67a5`](https://github.com/nodejs/node/commit/1a968e67a5)] - **test**: improve tests for util.inherits (Michaël Zasso) [#3507](https://github.com/nodejs/node/pull/3507) +* [[`9d8d752456`](https://github.com/nodejs/node/commit/9d8d752456)] - **test**: print helpful err msg on test-dns-ipv6.js (Junliang Yan) [#3501](https://github.com/nodejs/node/pull/3501) +* [[`60de9f8d7b`](https://github.com/nodejs/node/commit/60de9f8d7b)] - **test**: wrap assert.fail when passed to callback (Myles Borins) [#3453](https://github.com/nodejs/node/pull/3453) +* [[`cd83f7ed7f`](https://github.com/nodejs/node/commit/cd83f7ed7f)] - **test**: add node::MakeCallback() test coverage (Ben Noordhuis) [#3478](https://github.com/nodejs/node/pull/3478) +* [[`08da5c2a06`](https://github.com/nodejs/node/commit/08da5c2a06)] - **test**: disable test-tick-processor - aix and be ppc (Michael Dawson) [#3491](https://github.com/nodejs/node/pull/3491) +* [[`7c35fbcb14`](https://github.com/nodejs/node/commit/7c35fbcb14)] - **test**: harden test-child-process-fork-regr-gh-2847 (Michael Dawson) [#3459](https://github.com/nodejs/node/pull/3459) +* [[`ad2b272417`](https://github.com/nodejs/node/commit/ad2b272417)] - **test**: fix test-net-keepalive for AIX (Imran Iqbal) [#3458](https://github.com/nodejs/node/pull/3458) +* [[`04fb14cc35`](https://github.com/nodejs/node/commit/04fb14cc35)] - **test**: fix flaky test-child-process-emfile (Rich Trott) [#3430](https://github.com/nodejs/node/pull/3430) +* [[`eef0f0cd63`](https://github.com/nodejs/node/commit/eef0f0cd63)] - **test**: remove flaky status from eval_messages test (Rich Trott) [#3420](https://github.com/nodejs/node/pull/3420) +* [[`bbbd81eab2`](https://github.com/nodejs/node/commit/bbbd81eab2)] - **test**: skip test-dns-ipv6.js if ipv6 is unavailable (Junliang Yan) [#3444](https://github.com/nodejs/node/pull/3444) +* [[`f78c8e7426`](https://github.com/nodejs/node/commit/f78c8e7426)] - **test**: fix flaky test for symlinks (Rich Trott) [#3418](https://github.com/nodejs/node/pull/3418) +* [[`28e9a4f41b`](https://github.com/nodejs/node/commit/28e9a4f41b)] - **test**: repl-persistent-history is no longer flaky (Jeremiah Senkpiel) [#3437](https://github.com/nodejs/node/pull/3437) +* [[`9e981556e5`](https://github.com/nodejs/node/commit/9e981556e5)] - **test**: cleanup, improve repl-persistent-history (Jeremiah Senkpiel) [#2356](https://github.com/nodejs/node/pull/2356) +* [[`ee2e641e0a`](https://github.com/nodejs/node/commit/ee2e641e0a)] - **test**: add Symbol test for assert.deepEqual() (Rich Trott) [#3327](https://github.com/nodejs/node/pull/3327) +* [[`e2b8393ee8`](https://github.com/nodejs/node/commit/e2b8393ee8)] - **test**: port domains regression test from v0.10 (Jonas Dohse) [#3356](https://github.com/nodejs/node/pull/3356) +* [[`676e61872f`](https://github.com/nodejs/node/commit/676e61872f)] - **test**: apply correct assert.fail() arguments (Rich Trott) [#3378](https://github.com/nodejs/node/pull/3378) +* [[`bbdbef9274`](https://github.com/nodejs/node/commit/bbdbef9274)] - **test**: fix tests after V8 upgrade (Michaël Zasso) [#3351](https://github.com/nodejs/node/pull/3351) +* [[`6c032a8333`](https://github.com/nodejs/node/commit/6c032a8333)] - **test**: replace util with backtick strings (Myles Borins) [#3359](https://github.com/nodejs/node/pull/3359) +* [[`f45c315763`](https://github.com/nodejs/node/commit/f45c315763)] - **test**: fix domain with abort-on-uncaught on PPC (Julien Gilli) [#3354](https://github.com/nodejs/node/pull/3354) +* [[`e3d9d25083`](https://github.com/nodejs/node/commit/e3d9d25083)] - **test**: add test-child-process-emfile fail message (Rich Trott) [#3335](https://github.com/nodejs/node/pull/3335) +* [[`6f14b3a7db`](https://github.com/nodejs/node/commit/6f14b3a7db)] - **test**: remove util from common (Rich Trott) [#3324](https://github.com/nodejs/node/pull/3324) +* [[`7d94611ac9`](https://github.com/nodejs/node/commit/7d94611ac9)] - **test**: split up buffer tests for reliability (Rich Trott) [#3323](https://github.com/nodejs/node/pull/3323) +* [[`3202456baa`](https://github.com/nodejs/node/commit/3202456baa)] - **test**: remove util properties from common (Rich Trott) [#3304](https://github.com/nodejs/node/pull/3304) +* [[`31c971d641`](https://github.com/nodejs/node/commit/31c971d641)] - **test**: parallelize long-running test (Rich Trott) [#3287](https://github.com/nodejs/node/pull/3287) +* [[`5bbc6df7de`](https://github.com/nodejs/node/commit/5bbc6df7de)] - **test**: change call to deprecated util.isError() (Rich Trott) [#3084](https://github.com/nodejs/node/pull/3084) +* [[`522e3d3cd3`](https://github.com/nodejs/node/commit/522e3d3cd3)] - **timers**: reuse timer in `setTimeout().unref()` (Fedor Indutny) [#3407](https://github.com/nodejs/node/pull/3407) +* [[`b64ce5960f`](https://github.com/nodejs/node/commit/b64ce5960f)] - **tls**: remove util and calls to util.format (Myles Borins) [#3456](https://github.com/nodejs/node/pull/3456) +* [[`c64af7d99e`](https://github.com/nodejs/node/commit/c64af7d99e)] - **tls**: TLSSocket options default isServer false (Yuval Brik) [#2614](https://github.com/nodejs/node/pull/2614) +* [[`2296a4fc0f`](https://github.com/nodejs/node/commit/2296a4fc0f)] - **(SEMVER-MINOR)** **tls**: add `options` argument to createSecurePair (Коренберг Марк) [#2441](https://github.com/nodejs/node/pull/2441) +* [[`0140e1b5e3`](https://github.com/nodejs/node/commit/0140e1b5e3)] - **tls**: output warning of setDHParam to console.trace (Shigeki Ohtsu) [#1831](https://github.com/nodejs/node/pull/1831) +* [[`f72e178a78`](https://github.com/nodejs/node/commit/f72e178a78)] - **(SEMVER-MAJOR)** **tls**: add minDHSize option to tls.connect() (Shigeki Ohtsu) [#1831](https://github.com/nodejs/node/pull/1831) +* [[`6d92ebac11`](https://github.com/nodejs/node/commit/6d92ebac11)] - **tls**: add TLSSocket.getEphemeralKeyInfo() (Shigeki Ohtsu) [#1831](https://github.com/nodejs/node/pull/1831) +* [[`62ad1d0113`](https://github.com/nodejs/node/commit/62ad1d0113)] - **(SEMVER-MINOR)** **tls, crypto**: add ALPN Support (Shigeki Ohtsu) [#2564](https://github.com/nodejs/node/pull/2564) +* [[`5029f41b2f`](https://github.com/nodejs/node/commit/5029f41b2f)] - **(SEMVER-MINOR)** **tls,crypto**: move NPN protcol data to hidden value (Shigeki Ohtsu) [#2564](https://github.com/nodejs/node/pull/2564) +* [[`701e38c25f`](https://github.com/nodejs/node/commit/701e38c25f)] - **tools**: enable prefer-const eslint rule (Sakthipriyan Vairamani) [#3152](https://github.com/nodejs/node/pull/3152) +* [[`6e78382605`](https://github.com/nodejs/node/commit/6e78382605)] - **tools**: ensure npm always uses the local node (Jeremiah Senkpiel) [#3489](https://github.com/nodejs/node/pull/3489) +* [[`3c3435d017`](https://github.com/nodejs/node/commit/3c3435d017)] - **tools**: update test-npm to work with npm 3 (Rebecca Turner) [#3489](https://github.com/nodejs/node/pull/3489) +* [[`b4f4c24539`](https://github.com/nodejs/node/commit/b4f4c24539)] - **tools**: use absolute paths in test-npm (Rebecca Turner) [#3309](https://github.com/nodejs/node/pull/3309) +* [[`80573153b8`](https://github.com/nodejs/node/commit/80573153b8)] - **(SEMVER-MAJOR)** **util**: make inherits work with classes (Michaël Zasso) [#3455](https://github.com/nodejs/node/pull/3455) +* [[`412252ca04`](https://github.com/nodejs/node/commit/412252ca04)] - **(SEMVER-MAJOR)** **util**: Remove p, has been deprecated for years (Wyatt Preul) [#3432](https://github.com/nodejs/node/pull/3432) +* [[`718c304a4f`](https://github.com/nodejs/node/commit/718c304a4f)] - **v8**: pull fix for builtin code size on PPC (Michael Dawson) [#3474](https://github.com/nodejs/node/pull/3474) +* [[`6936468de2`](https://github.com/nodejs/node/commit/6936468de2)] - **vm**: remove Watchdog dependency on Environment (Ido Ben-Yair) [#3274](https://github.com/nodejs/node/pull/3274) +* [[`80169b1f0a`](https://github.com/nodejs/node/commit/80169b1f0a)] - **(SEMVER-MAJOR)** **zlib**: decompression throw on truncated input (Yuval Brik) [#2595](https://github.com/nodejs/node/pull/2595) + ## 2015-10-13, Version 4.2.1 'Argon' (LTS), @jasnell ### Notable changes diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000000..015c2b9d692f9c --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,38 @@ +## Code of Conduct + +This Code of Conduct is adapted from [Rust's wonderful +CoC](http://www.rust-lang.org/conduct.html). + +* We are committed to providing a friendly, safe and welcoming + environment for all, regardless of gender, sexual orientation, + disability, ethnicity, religion, or similar personal characteristic. +* Please avoid using overtly sexual nicknames or other nicknames that + might detract from a friendly, safe and welcoming environment for + all. +* Please be kind and courteous. There's no need to be mean or rude. +* Respect that some individuals and cultures consider the casual use of + profanity offensive and off-putting. +* Respect that people have differences of opinion and that every + design or implementation choice carries a trade-off and numerous + costs. There is seldom a right answer. +* Please keep unstructured critique to a minimum. If you have solid + ideas you want to experiment with, make a fork and see how it works. +* We will exclude you from interaction if you insult, demean or harass + anyone. That is not welcome behavior. We interpret the term + "harassment" as including the definition in the [Citizen Code of + Conduct](http://citizencodeofconduct.org/); if you have any lack of + clarity about what might be included in that concept, please read + their definition. In particular, we don't tolerate behavior that + excludes people in socially marginalized groups. +* Private harassment is also unacceptable. No matter who you are, if + you feel you have been or are being harassed or made uncomfortable + by a community member, please contact one of the channel ops or any + of the TSC members immediately with a capture (log, photo, email) of + the harassment if possible. Whether you're a regular contributor or + a newcomer, we care about making this community a safe place for you + and we've got your back. +* Likewise any spamming, trolling, flaming, baiting or other + attention-stealing behavior is not welcome. +* Avoid the use of personal pronouns in code comments or + documentation. There is no need to address persons when explaining + code (e.g. "When the developer"). diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index c5a13a5c9f2f09..4475a910ff85d5 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -8,6 +8,7 @@ * [Landing Pull Requests](#landing-pull-requests) - [Technical HOWTO](#technical-howto) - [I Just Made a Mistake](#i-just-made-a-mistake) + - [Long Term Support](#long-term-support) This document contains information for Collaborators of the Node.js project regarding maintaining the code, documentation and issues. @@ -227,3 +228,93 @@ messages. However, you are only allowed to force push to any Node.js branch within 10 minutes from your original push. If someone else pushes to the branch or the 10 minute period passes, consider the commit final. + +### Long Term Support + +#### What is LTS? + +Long Term Support (often referred to as *LTS*) guarantees application developers +a 30 month support cycle with specific versions of Node.js. + +You can find more information [in the full LTS plan](https://github.com/nodejs/lts#lts-plan). + +#### How does LTS work? + +Once a stable branch enters LTS, changes in that branch are limited to bug +fixes, security updates, possible npm updates, documentation updates, and +certain performance improvements that can be demonstrated to not break existing +applications. Semver-minor changes are only permitted if required for bug fixes +and then only on a case-by-case basis with LTS WG and possibly Core Technical +Committee (CTC) review. Semver-major changes are permitted only if required for +security related fixes. + +Once a stable branch moves into Maintenance mode, only **critical** bugs, +**critical** security fixes, and documentation updates will be permitted. + +#### Landing semver-minor commits in LTS + +The default policy is to not land semver-minor or higher commits in any LTS +branch. However, the LTS WG or CTC can evaluate any individual semver-minor +commit and decide whether a special exception ought to be made. It is +expected that such exceptions would be evaluated, in part, on the scope +and impact of the changes on the code, the risk to ecosystem stability +incurred by accepting the change, and the expected benefit that landing the +commit will have for the ecosystem. + +Any collaborator who feels a semver-minor commit should be landed in an LTS +branch should attach the `lts-agenda` label to the pull request. The LTS WG +will discuss the issue and, if necessary, will escalate the issue up to the +CTC for further discussion. + +#### How are LTS Branches Managed? + +There are currently three LTS branches: `v4.x`, `v0.10`, and `v0.12`. Each +of these is paired with a "staging" branch: `v4.x-staging`, `v0.10-staging`, +and `v0.12-staging`. + +As commits land in `master`, they are cherry-picked back to each staging +branch as appropriate. If the commit applies only to the LTS branch, the +PR must be opened against the *staging* branch. Commits are selectively +pulled from the staging branch into the LTS branch only when a release is +being prepared and may be pulled into the LTS branch in a different order +than they were landed in staging. + +Any collaborator may land commits into a staging branch, but only the release +team should land commits into the LTS branch while preparing a new +LTS release. + +#### How can I help? + +When you send your pull request, consider including information about +whether your change is breaking. If you think your patch can be backported, +please feel free to include that information in the PR thread. + +Several LTS related issue and PR labels have been provided: + +* `lts-watch-v4.x` - tells the LTS WG that the issue/PR needs to be considered + for landing in the `v4.x-staging` branch. +* `lts-watch-v0.10` - tells the LTS WG that the issue/PR needs to be considered + for landing in the `v0.10-staging` branch. +* `lts-watch-v0.12` - tells the LTS WG that the issue/PR needs to be considered + for landing in the `v0.12-staging` branch. +* `land-on-v4.x` - tells the release team that the commit should be landed + in a future v4.x release +* `land-on-v0.10` - tells the release team that the commit should be landed + in a future v0.10 release +* `land-on-v0.12` - tells the release team that the commit should be landed + in a future v0.12 release + +Any collaborator can attach these labels to any PR/issue. As commits are +landed into the staging branches, the `lts-watch-` label will be removed. +Likewise, as commits are landed in a LTS release, the `land-on-` label will +be removed. + +Collaborators are encouraged to help the LTS WG by attaching the appropriate +`lts-watch-` label to any PR that may impact an LTS release. + +#### How is an LTS release cut? + +When the LTS working group determines that a new LTS release is required, +selected commits will be picked from the staging branch to be included in the +release. This process of making a release will be a collaboration between the +LTS working group and the Release team. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3b3bf08b538707..e78100bc810c77 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,11 @@ # Contributing to Node.js +## Code of Conduct + +The Code of Conduct explains the *bare minimum* behavior +expectations the Node Foundation requires of its contributors. +[Please read it before participating.](./CODE_OF_CONDUCT.md) + ## Issue Contributions When opening new issues or commenting on existing issues on this repository @@ -45,21 +51,21 @@ and built upon. The rules for the master branch are less strict; consult the [stability index](./doc/api/documentation.markdown#stability-index) for details. -In a nutshell, modules are at varying levels of API stability. Bug fixes are +In a nutshell, modules are at varying levels of API stability. Bug fixes are always welcome but API or behavioral changes to modules at stability level 3 (Locked) are off-limits. #### Dependencies Node.js has several bundled dependencies in the *deps/* and the *tools/* -directories that are not part of the project proper. Any changes to files +directories that are not part of the project proper. Any changes to files in those directories or its subdirectories should be sent to their respective -projects. Do not send your patch to us, we cannot accept it. +projects. Do not send your patch to us, we cannot accept it. In case of doubt, open an issue in the [issue tracker](https://github.com/nodejs/node/issues/) or contact one of the [project Collaborators](https://github.com/nodejs/node/#current-project-team-members). -([IRC](http://webchat.freenode.net/?channels=io.js) is often the best medium.) Especially do so if you plan to work on something big. Nothing is more +([IRC](http://webchat.freenode.net/?channels=io.js) is often the best medium.) Especially do so if you plan to work on something big. Nothing is more frustrating than seeing your hard work go to waste because your vision does not align with the project team. @@ -81,8 +87,8 @@ $ git config --global user.name "J. Random User" $ git config --global user.email "j.random.user@example.com" ``` -Writing good commit logs is important. A commit log should describe what -changed and why. Follow these guidelines when writing one: +Writing good commit logs is important. A commit log should describe what +changed and why. Follow these guidelines when writing one: 1. The first line should be 50 characters or less and contain a short description of the change prefixed with the name of the changed @@ -124,15 +130,15 @@ $ git rebase upstream/master ### Step 5: Test -Bug fixes and features **should come with tests**. Add your tests in the -test/parallel/ directory. Look at other tests to see how they should be +Bug fixes and features **should come with tests**. Add your tests in the +test/parallel/ directory. Look at other tests to see how they should be structured (license boilerplate, common includes, etc.). ```text $ ./configure && make -j8 test ``` -Make sure the linter is happy and that all tests pass. Please, do not submit +Make sure the linter is happy and that all tests pass. Please, do not submit patches that fail either check. If you are updating tests and just want to run a single test to check it, you @@ -160,9 +166,9 @@ $ git push origin my-feature-branch Go to https://github.com/yourusername/node and select your feature branch. Click the 'Pull Request' button and fill out the form. -Pull requests are usually reviewed within a few days. If there are comments +Pull requests are usually reviewed within a few days. If there are comments to address, apply your changes in a separate commit and push that to your -feature branch. Post a comment in the pull request afterwards; GitHub does +feature branch. Post a comment in the pull request afterwards; GitHub does not send out notifications when you add commits. @@ -181,41 +187,3 @@ By making a contribution to this project, I certify that: different license), as indicated in the file; or * (c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it. - - -## Code of Conduct - -This Code of Conduct is adapted from [Rust's wonderful -CoC](http://www.rust-lang.org/conduct.html). - -* We are committed to providing a friendly, safe and welcoming - environment for all, regardless of gender, sexual orientation, - disability, ethnicity, religion, or similar personal characteristic. -* Please avoid using overtly sexual nicknames or other nicknames that - might detract from a friendly, safe and welcoming environment for - all. -* Please be kind and courteous. There's no need to be mean or rude. -* Respect that people have differences of opinion and that every - design or implementation choice carries a trade-off and numerous - costs. There is seldom a right answer. -* Please keep unstructured critique to a minimum. If you have solid - ideas you want to experiment with, make a fork and see how it works. -* We will exclude you from interaction if you insult, demean or harass - anyone. That is not welcome behavior. We interpret the term - "harassment" as including the definition in the [Citizen Code of - Conduct](http://citizencodeofconduct.org/); if you have any lack of - clarity about what might be included in that concept, please read - their definition. In particular, we don't tolerate behavior that - excludes people in socially marginalized groups. -* Private harassment is also unacceptable. No matter who you are, if - you feel you have been or are being harassed or made uncomfortable - by a community member, please contact one of the channel ops or any - of the TC members immediately with a capture (log, photo, email) of - the harassment if possible. Whether you're a regular contributor or - a newcomer, we care about making this community a safe place for you - and we've got your back. -* Likewise any spamming, trolling, flaming, baiting or other - attention-stealing behavior is not welcome. -* Avoid the use of personal pronouns in code comments or - documentation. There is no need to address persons when explaining - code (e.g. "When the developer") diff --git a/Makefile b/Makefile index 02619fac98ddd7..a99b112508c448 100644 --- a/Makefile +++ b/Makefile @@ -74,7 +74,7 @@ clean: distclean: -rm -rf out - -rm -f config.gypi icu_config.gypi + -rm -f config.gypi icu_config.gypi config_fips.gypi -rm -f config.mk -rm -rf $(NODE_EXE) $(NODE_G_EXE) -rm -rf node_modules diff --git a/README.md b/README.md index 7e7b17470f4513..9cc24ad94bae60 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,56 @@ - Node.js -===== +======= [![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/nodejs/node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -This repository began as a GitHub fork of -[joyent/node](https://github.com/joyent/node). - -Node.js contributions, releases, and contributorship are under an -[open governance model](./GOVERNANCE.md). -We intend to land, with increasing regularity, releases which are -compatible with the npm ecosystem that has been built to date for -Node.js. +The Node.js project is supported by the +[Node.js Foundation](https://nodejs.org/en/foundation/). Contributions, +policies and releases are managed under an +[open governance model](./GOVERNANCE.md). We are also bound by a +[Code of Conduct](./CODE_OF_CONDUCT.md). + +If you need help using or installing Node.js, please use the +[nodejs/help](https://github.com/nodejs/help) issue tracker. + +## Release Types + +The Node.js project maintains multiple types of releases: + +* **Stable**: Released from active development branches of this repository, + versioned by [SemVer](http://semver.org/) and signed by a member of the + [Release Team](#release-team). + Code for Stable releases is organized in this repository by major version + number, For example: [v4.x](https://github.com/nodejs/node/tree/v4.x). + The major version number of Stable releases will increment every 6 months + allowing for breaking changes to be introduced. This happens in April and + October every year. Stable release lines beginning in October each year have + a maximum support life of 8 months. Stable release lines beginning in April + each year will convert to LTS (see below) after 6 months and receive further + support for 30 months. +* **LTS**: Releases that receive Long-term Support, with a focus on stability + and security. Every second Stable release line (major version) will become an + LTS line and receive 18 months of _Active LTS_ support and a further 12 + months of _Maintenance_. LTS release lines are given alphabetically + ordered codenames, begining with v4 Argon. LTS releases are less frequent + and will attempt to maintain consistent major and minor version numbers, + only incrementing patch version numbers. There are no breaking changes or + feature additions, except in some special circumstances. More information + can be found in the [LTS README](https://github.com/nodejs/LTS/). +* **Nightly**: Versions of code in this repository on the current Stable + branch, automatically built every 24-hours where changes exist. Use with + caution. ## Download Binaries, installers, and source tarballs are available at . -**Releases** are available at , listed under -their version string. The symlink -will point to the latest release directory. +**Stable** and **LTS** releases are available at +, listed under their version strings. +The [latest](https://nodejs.org/download/release/latest/) directory is an +alias for the latest Stable release. The latest LTS release from an LTS +line is available in the form: latest-lts-_codename_. For example: + **Nightly** builds are available at , listed under their version @@ -28,11 +58,12 @@ string which includes their date (in UTC time) and the commit SHA at the HEAD of the release. **API documentation** is available in each release and nightly -directory under _docs_. points to the latest version. +directory under _docs_. points to the API +documentation of the latest stable version. ### Verifying Binaries -Release and nightly download directories all contain a *SHASUM256.txt* +Stable, LTS and Nightly download directories all contain a *SHASUM256.txt* file that lists the SHA checksums for each file available for download. To check that a downloaded file matches the checksum, run it through `sha256sum` with a command such as: @@ -44,9 +75,9 @@ $ grep node-vx.y.z.tar.gz SHASUMS256.txt | sha256sum -c - _(Where "node-vx.y.z.tar.gz" is the name of the file you have downloaded)_ -Additionally, releases (not nightlies) have GPG signed copies of -SHASUM256.txt files available as SHASUM256.txt.asc. You can use `gpg` -to verify that the file has not been tampered with. +Additionally, Stable and LTS releases (not Nightlies) have GPG signed +copies of SHASUM256.txt files available as SHASUM256.txt.asc. You can use +`gpg` to verify that the file has not been tampered with. To verify a SHASUM256.txt.asc, you will first need to import all of the GPG keys of individuals authorized to create releases. They are @@ -116,7 +147,7 @@ $ man doc/node.1 To test if Node.js was built correctly: ``` -$ node -e "console.log('Hello from node.js ' + process.version)" +$ node -e "console.log('Hello from Node.js ' + process.version)" ``` ### Windows @@ -143,7 +174,7 @@ To run the tests: To test if Node.js was built correctly: ``` -$ node -e "console.log('Hello from node.js ' + process.version)" +$ node -e "console.log('Hello from Node.js ' + process.version)" ``` ### Android / Android based devices, aka. Firefox OS @@ -226,6 +257,9 @@ Windows: $ pkg-config --modversion icu-i18n && ./configure --with-intl=system-icu ``` +If you are cross compiling, your `pkg-config` must be able to supply a path +that works for both your host and target environments. + #### Build with a specific ICU: You can find other ICU releases at @@ -295,7 +329,9 @@ Instructions: Appendix A in the [security policy] (http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf). The only exception is that `./config no-asm` can be - used in place of `./config` ) + used in place of `./config`, and the FIPSDIR environment variable + may be used to specify a non-standard install folder for the + validated module, as per User Guide sections 4.2.1, 4.2.2, and 4.2.3. 6. Get into Node.js checkout folder 7. `./configure --openssl-fips=/path/to/openssl-fips/installdir` For example on ubuntu 12 the installation directory was @@ -305,6 +341,7 @@ Instructions: ## Resources for Newcomers +* [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) * [CONTRIBUTING.md](./CONTRIBUTING.md) * [GOVERNANCE.md](./GOVERNANCE.md) * IRC: @@ -313,10 +350,10 @@ Instructions: ## Security -All security bugs in node.js are taken seriously and should be reported by +All security bugs in Node.js are taken seriously and should be reported by emailing security@nodejs.org. This will be delivered to a subset of the project team who handle security issues. Please don't disclose security bugs -public until they have been handled by the security team. +publicly until they have been handled by the security team. Your email will be acknowledged within 24 hours, and you’ll receive a more detailed response to your email within 48 hours indicating the next steps in @@ -352,10 +389,12 @@ information about the governance of the Node.js project, see * [domenic](https://github.com/domenic) - **Domenic Denicola** <d@domenic.me> * [evanlucas](https://github.com/evanlucas) - **Evan Lucas** <evanlucas@me.com> * [geek](https://github.com/geek) - **Wyatt Preul** <wpreul@gmail.com> +* [iarna](https://github.com/iarna) - **Rebecca Turner** <me@re-becca.org> * [isaacs](https://github.com/isaacs) - **Isaac Z. Schlueter** <i@izs.me> * [jbergstroem](https://github.com/jbergstroem) - **Johan Bergström** <bugs@bergstroem.nu> * [joaocgreis](https://github.com/joaocgreis) - **João Reis** <reis@janeasystems.com> * [julianduque](https://github.com/julianduque) - **Julian Duque** <julianduquej@gmail.com> +* [JungMinu](https://github.com/JungMinu) - **Minwoo Jung** <jmwsoft@gmail.com> * [lxe](https://github.com/lxe) - **Aleksey Smolenchuk** <lxe@lxe.co> * [mhdawson](https://github.com/mhdawson) - **Michael Dawson** <michael_dawson@ca.ibm.com> * [micnic](https://github.com/micnic) - **Nicu Micleușanu** <micnic90@gmail.com> @@ -367,18 +406,22 @@ information about the governance of the Node.js project, see * [qard](https://github.com/qard) - **Stephen Belanger** <admin@stephenbelanger.com> * [rlidwka](https://github.com/rlidwka) - **Alex Kocharin** <alex@kocharin.ru> * [robertkowalski](https://github.com/robertkowalski) - **Robert Kowalski** <rok@kowalski.gd> +* [romankl](https://github.com/romankl) - **Roman Klauke** <romaaan.git@gmail.com> +* [saghul](https://github.com/saghul) - **Saúl Ibarra Corretgé** <saghul@gmail.com> * [sam-github](https://github.com/sam-github) - **Sam Roberts** <vieuxtech@gmail.com> * [seishun](https://github.com/seishun) - **Nikolai Vavilov** <vvnicholas@gmail.com> * [silverwind](https://github.com/silverwind) - **Roman Reiss** <me@silverwind.io> * [srl295](https://github.com/srl295) - **Steven R Loomis** <srloomis@us.ibm.com> * [targos](https://github.com/targos) - **Michaël Zasso** <mic.besace@gmail.com> * [tellnes](https://github.com/tellnes) - **Christian Tellnes** <christian@tellnes.no> +* [thealphanerd](http://github.com/thealphanerd) - **Myles Borins** <myles.borins@gmail.com> * [thefourtheye](https://github.com/thefourtheye) - **Sakthipriyan Vairamani** <thechargingvolcano@gmail.com> * [thlorenz](https://github.com/thlorenz) - **Thorsten Lorenz** <thlorenz@gmx.de> * [Trott](https://github.com/Trott) - **Rich Trott** <rtrott@gmail.com> * [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe** <m.j.tunnicliffe@gmail.com> * [vkurchatkin](https://github.com/vkurchatkin) - **Vladimir Kurchatkin** <vladimir.kurchatkin@gmail.com> * [yosuke-furukawa](https://github.com/yosuke-furukawa) - **Yosuke Furukawa** <yosuke.furukawa@gmail.com> +* [zkat](https://github.com/zkat) - **Kat Marchán** <kzm@sykosomatic.org> Collaborators & TSC members follow the [COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md) in maintaining the Node.js project. @@ -387,7 +430,7 @@ maintaining the Node.js project. Releases of Node.js and io.js will be signed with one of the following GPG keys: -* **Chris Dickinson** <christopher.s.dickinson@gmail.com>: `9554F04D7259F04124DE6B476D5A82AC7E37093B` +* **Chris Dickinson** <christopher.s.dickinson@gmail.com> `9554F04D7259F04124DE6B476D5A82AC7E37093B` * **Colin Ihrig** <cjihrig@gmail.com> `94AE36675C464D64BAFA68DD7434390BDBE9B9C5` * **Sam Roberts** <octetcloud@keybase.io> `0034A06D9D9B0064CE8ADF6BF1747F4AD2306D93` * **Jeremiah Senkpiel** <fishrock@keybase.io> `FD3A5288F042B6850C66B31F09FE44734EB7990E` diff --git a/WORKING_GROUPS.md b/WORKING_GROUPS.md index f3cdc84ba765d9..aa573844b790a9 100644 --- a/WORKING_GROUPS.md +++ b/WORKING_GROUPS.md @@ -27,9 +27,15 @@ back in to the TSC. * [Roadmap](#roadmap) * [Docker](#docker) * [Addon API](#addon-api) +* [Benchmarking](#benchmarking) +* [Post-mortem](#post-mortem) +* [Intl](#intl) +* [HTTP](#http) + +#### Process: + * [Starting a Working Group](#starting-a-wg) * [Bootstrap Governance](#bootstrap-governance) -* [Intl](#Intl) ### [Website](https://github.com/nodejs/website) @@ -108,40 +114,40 @@ Note that the i18n working groups are distinct from the [Intl](#Intl) working gr Each language community maintains its own membership. -* [iojs-ar - Arabic (اللغة العربية)](https://github.com/nodejs/iojs-ar) -* [iojs-bg - Bulgarian (български език)](https://github.com/nodejs/iojs-bg) -* [iojs-bn - Bengali (বাংলা)](https://github.com/nodejs/iojs-bn) -* [iojs-cn - Chinese (中文)](https://github.com/nodejs/iojs-cn) -* [iojs-cs - Czech (Český Jazyk)](https://github.com/nodejs/iojs-cs) -* [iojs-da - Danish (Dansk)](https://github.com/nodejs/iojs-da) -* [iojs-de - German (Deutsch)](https://github.com/nodejs/iojs-de) -* [iojs-el - Greek (Ελληνικά)](https://github.com/nodejs/iojs-el) -* [iojs-es - Spanish (Español)](https://github.com/nodejs/iojs-es) -* [iojs-fa - Persian (فارسی)](https://github.com/nodejs/iojs-fa) -* [iojs-fi - Finnish (Suomi)](https://github.com/nodejs/iojs-fi) -* [iojs-fr - French (Français)](https://github.com/nodejs/iojs-fr) -* [iojs-he - Hebrew (עברית)](https://github.com/nodejs/iojs-he) -* [iojs-hi - Hindi (फिजी बात)](https://github.com/nodejs/iojs-hi) -* [iojs-hu - Hungarian (Magyar)](https://github.com/nodejs/iojs-hu) -* [iojs-id - Indonesian (Bahasa Indonesia)](https://github.com/nodejs/iojs-id) -* [iojs-it - Italian (Italiano)](https://github.com/nodejs/iojs-it) -* [iojs-ja - Japanese (日本語)](https://github.com/nodejs/iojs-ja) -* [iojs-ka - Georgian (ქართული)](https://github.com/nodejs/iojs-ka) -* [iojs-ko - Korean (조선말)](https://github.com/nodejs/iojs-ko) -* [iojs-mk - Macedonian (Mакедонски)](https://github.com/nodejs/iojs-mk) -* [iojs-ms - Malay (بهاس ملايو)](https://github.com/nodejs/iojs-ms) -* [iojs-nl - Dutch (Nederlands)](https://github.com/nodejs/iojs-nl) -* [iojs-no - Norwegian (Norsk)](https://github.com/nodejs/iojs-no) -* [iojs-pl - Polish (Język Polski)](https://github.com/nodejs/iojs-pl) -* [iojs-pt - Portuguese (Português)](https://github.com/nodejs/iojs-pt) -* [iojs-ro - Romanian (Română)](https://github.com/nodejs/iojs-ro) -* [iojs-ru - Russian (Русский)](https://github.com/nodejs/iojs-ru) -* [iojs-sv - Swedish (Svenska)](https://github.com/nodejs/iojs-sv) -* [iojs-ta - Tamil (தமிழ்)](https://github.com/nodejs/iojs-ta) -* [iojs-tr - Turkish (Türkçe)](https://github.com/nodejs/iojs-tr) -* [iojs-tw - Taiwanese (Hō-ló)](https://github.com/nodejs/iojs-tw) -* [iojs-uk - Ukrainian (Українська)](https://github.com/nodejs/iojs-uk) -* [iojs-vi - Vietnamese (Tiếng Việtnam)](https://github.com/nodejs/iojs-vi) +* [nodejs-ar - Arabic (اللغة العربية)](https://github.com/nodejs/nodejs-ar) +* [nodejs-bg - Bulgarian (български език)](https://github.com/nodejs/nodejs-bg) +* [nodejs-bn - Bengali (বাংলা)](https://github.com/nodejs/nodejs-bn) +* [nodejs-zh-CN - Chinese (中文)](https://github.com/nodejs/nodejs-zh-CN) +* [nodejs-cs - Czech (Český Jazyk)](https://github.com/nodejs/nodejs-cs) +* [nodejs-da - Danish (Dansk)](https://github.com/nodejs/nodejs-da) +* [nodejs-de - German (Deutsch)](https://github.com/nodejs/nodejs-de) +* [nodejs-el - Greek (Ελληνικά)](https://github.com/nodejs/nodejs-el) +* [nodejs-es - Spanish (Español)](https://github.com/nodejs/nodejs-es) +* [nodejs-fa - Persian (فارسی)](https://github.com/nodejs/nodejs-fa) +* [nodejs-fi - Finnish (Suomi)](https://github.com/nodejs/nodejs-fi) +* [nodejs-fr - French (Français)](https://github.com/nodejs/nodejs-fr) +* [nodejs-he - Hebrew (עברית)](https://github.com/nodejs/nodejs-he) +* [nodejs-hi - Hindi (फिजी बात)](https://github.com/nodejs/nodejs-hi) +* [nodejs-hu - Hungarian (Magyar)](https://github.com/nodejs/nodejs-hu) +* [nodejs-id - Indonesian (Bahasa Indonesia)](https://github.com/nodejs/nodejs-id) +* [nodejs-it - Italian (Italiano)](https://github.com/nodejs/nodejs-it) +* [nodejs-ja - Japanese (日本語)](https://github.com/nodejs/nodejs-ja) +* [nodejs-ka - Georgian (ქართული)](https://github.com/nodejs/nodejs-ka) +* [nodejs-ko - Korean (조선말)](https://github.com/nodejs/nodejs-ko) +* [nodejs-mk - Macedonian (Mакедонски)](https://github.com/nodejs/nodejs-mk) +* [nodejs-ms - Malay (بهاس ملايو)](https://github.com/nodejs/nodejs-ms) +* [nodejs-nl - Dutch (Nederlands)](https://github.com/nodejs/nodejs-nl) +* [nodejs-no - Norwegian (Norsk)](https://github.com/nodejs/nodejs-no) +* [nodejs-pl - Polish (Język Polski)](https://github.com/nodejs/nodejs-pl) +* [nodejs-pt - Portuguese (Português)](https://github.com/nodejs/nodejs-pt) +* [nodejs-ro - Romanian (Română)](https://github.com/nodejs/nodejs-ro) +* [nodejs-ru - Russian (Русский)](https://github.com/nodejs/nodejs-ru) +* [nodejs-sv - Swedish (Svenska)](https://github.com/nodejs/nodejs-sv) +* [nodejs-ta - Tamil (தமிழ்)](https://github.com/nodejs/nodejs-ta) +* [nodejs-tr - Turkish (Türkçe)](https://github.com/nodejs/nodejs-tr) +* [nodejs-zh-TW - Taiwanese (Hō-ló)](https://github.com/nodejs/nodejs-zh-TW) +* [nodejs-uk - Ukrainian (Українська)](https://github.com/nodejs/nodejs-uk) +* [nodejs-vi - Vietnamese (Tiếng Việtnam)](https://github.com/nodejs/nodejs-vi) ### [Intl](https://github.com/nodejs/Intl) @@ -168,6 +174,19 @@ Their responsibilities are: * Publishing regular update summaries and other promotional content. +### [HTTP](https://github.com/nodejs/http) + +The HTTP working group is chartered for the support and improvement of the +HTTP implementation in Node. It's responsibilities are: + +* Addressing HTTP issues on the Node.js issue tracker. +* Authoring and editing HTTP documentation within the Node.js project. +* Reviewing changes to HTTP functionality within the Node.js project. +* Working with the ecosystem of HTTP related module developers to evolve the + HTTP implementation and APIs in core. +* Advising the CTC on all HTTP related issues and discussions. +* Messaging about the future of HTTP to give the community advance notice of + changes. ### [Roadmap](https://github.com/nodejs/roadmap) @@ -219,6 +238,38 @@ Their responsibilities are: The current members can be found in their [README](https://github.com/nodejs/nan#collaborators). +### [Benchmarking](https://github.com/nodejs/benchmarking) + +The purpose of the Benchmark working group is to gain consensus +for an agreed set of benchmarks that can be used to: + ++ track and evangelize performance gains made between Node releases ++ avoid performance regressions between releases + +Its responsibilities are: + ++ Identify 1 or more benchmarks that reflect customer usage. + Likely need more than one to cover typical Node use cases + including low-latency and high concurrency ++ Work to get community consensus on the list chosen ++ Add regular execution of chosen benchmarks to Node builds ++ Track/publicize performance between builds/releases + +### [Post-mortem](https://github.com/nodejs/post-mortem) + +The Post-mortem Diagnostics working group is dedicated to the support +and improvement of postmortem debugging for Node.js. It seeks to +elevate the role of postmortem debugging for Node, to assist in the +development of techniques and tools, and to make techniques and tools +known and available to Node.js users. + +Its responsibilities are: + ++ Defining and adding interfaces/APIs in order to allow dumps + to be generated when needed ++ Defining and adding common structures to the dumps generated + in order to support tools that want to introspect those dumps + ## Starting a WG A Working Group is established by first defining a charter that can be diff --git a/benchmark/http_simple_bench.sh b/benchmark/http_simple_bench.sh index 30bd050b6486b8..ade6a8d10eb0ff 100755 --- a/benchmark/http_simple_bench.sh +++ b/benchmark/http_simple_bench.sh @@ -42,7 +42,7 @@ ab_hello_world() { data_fn="$dir/$date.data" echo "Bench $name starts in 3 seconds..." - # let shit calm down + # let things calm down sleep 3 # hammer that as hard as it can for 10 seconds. diff --git a/common.gypi b/common.gypi index dc7f9b67577d03..5b8b2c09d6b4a9 100644 --- a/common.gypi +++ b/common.gypi @@ -183,7 +183,6 @@ '-fsanitize=address', '-DLEAK_SANITIZER' ], - 'cflags_cc+': [ '-gline-tables-only' ], 'cflags!': [ '-fomit-frame-pointer' ], 'ldflags': [ '-fsanitize=address' ], }], diff --git a/configure b/configure index b4936f148a2b9c..811303ed452d7f 100755 --- a/configure +++ b/configure @@ -84,13 +84,28 @@ parser.add_option("--fully-static", action="store_true", dest="fully_static", help="Generate an executable without external dynamic libraries. This " - "will not work on OSX when using default compilation environment") + "will not work on OSX when using the default compilation environment") + +parser.add_option("--partly-static", + action="store_true", + dest="partly_static", + help="Generate an executable with libgcc and libstdc++ libraries. This " + "will not work on OSX when using the default compilation environment") + +parser.add_option("--enable-vtune-profiling", + action="store_true", + dest="enable_vtune_profiling", + help="Enable profiling support for Intel Vtune profiler to profile" + "JavaScript code executed in nodejs. This feature is only available " + "for ia32, x32 or x64 platform.") + parser.add_option("--link-module", action="append", dest="linked_module", help="Path to a JS file to be bundled in the binary as a builtin." - "This module will be referenced by basename without extension." + "This module will be referenced by path without extension." + "e.g. /root/x/y.js will be referenced via require('root/x/y')." "Can be used multiple times") parser.add_option("--openssl-no-asm", @@ -674,6 +689,19 @@ def configure_node(o): elif target_arch in ('mips', 'mipsel'): configure_mips(o) + if flavor == 'aix': + o['variables']['node_core_target_name'] = 'node_base' + o['variables']['node_target_type'] = 'static_library' + + if target_arch in ('x86', 'x64', 'ia32', 'x32'): + o['variables']['node_enable_v8_vtunejit'] = b(options.enable_vtune_profiling) + elif options.enable_vtune_profiling: + raise Exception( + 'vtune profiler for JavaScript is only supported on x86, x32 or x64 ' + 'platform.') + else: + o['variables']['node_enable_v8_vtunejit'] = 'false' + if flavor in ('solaris', 'mac', 'linux', 'freebsd'): use_dtrace = not options.without_dtrace # Don't enable by default on linux and freebsd @@ -748,11 +776,15 @@ def configure_library(lib, output): if pkg_cflags: output['include_dirs'] += ( filter(None, map(str.strip, pkg_cflags.split('-I')))) + elif options.__dict__[shared_lib + '_includes']: + output['include_dirs'] += [options.__dict__[shared_lib + '_includes']] # libpath needs to be provided ahead libraries if pkg_libpath: - output['libraries'] += ( - filter(None, map(str.strip, pkg_cflags.split('-L')))) + output['libraries'] += [pkg_libpath] + elif options.__dict__[shared_lib + '_libpath']: + output['libraries'] += [ + '-L%s' % options.__dict__[shared_lib + '_libpath']] default_libs = getattr(options, shared_lib + '_libname') default_libs = map('-l{0}'.format, default_libs.split(',')) @@ -768,7 +800,7 @@ def configure_v8(o): o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs. o['variables']['v8_optimized_debug'] = 0 # Compile with -O0 in debug builds. o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables. - o['variables']['v8_use_snapshot'] = 0 if options.without_snapshot else 1 + o['variables']['v8_use_snapshot'] = 'false' if options.without_snapshot else 'true' def configure_openssl(o): o['variables']['node_use_openssl'] = b(not options.without_ssl) @@ -778,7 +810,7 @@ def configure_openssl(o): o['variables']['openssl_fips'] = options.openssl_fips fips_dir = os.path.join(root_dir, 'deps', 'openssl', 'fips') fips_ld = os.path.abspath(os.path.join(fips_dir, 'fipsld')) - o['make_global_settings'] = [ + o['make_fips_settings'] = [ ['LINK', fips_ld + ' <(openssl_fips)/bin/fipsld'], ] else: @@ -790,12 +822,19 @@ def configure_openssl(o): configure_library('openssl', o) -def configure_fullystatic(o): - if options.fully_static: - o['libraries'] += ['-static'] +def configure_static(o): + if options.fully_static or options.partly_static: if flavor == 'mac': print("Generation of static executable will not work on OSX " - "when using default compilation environment") + "when using the default compilation environment") + return + + if options.fully_static: + o['libraries'] += ['-static'] + elif options.partly_static: + o['libraries'] += ['-static-libgcc', '-static-libstdc++'] + if options.enable_asan: + o['libraries'] += ['-static-libasan'] def configure_winsdk(o): @@ -1093,13 +1132,22 @@ configure_v8(output) configure_openssl(output) configure_winsdk(output) configure_intl(output) -configure_fullystatic(output) +configure_static(output) # variables should be a root level element, # move everything else to target_defaults variables = output['variables'] del output['variables'] +# make_global_settings for special FIPS linking +# should not be used to compile modules in node-gyp +config_fips = { 'make_global_settings' : [] } +if 'make_fips_settings' in output: + config_fips['make_global_settings'] = output['make_fips_settings'] + del output['make_fips_settings'] + write('config_fips.gypi', do_not_edit + + pprint.pformat(config_fips, indent=2) + '\n') + # make_global_settings should be a root level element too if 'make_global_settings' in output: make_global_settings = output['make_global_settings'] diff --git a/deps/http_parser/AUTHORS b/deps/http_parser/AUTHORS index 8e2df1d06e6f69..5323b685caefb9 100644 --- a/deps/http_parser/AUTHORS +++ b/deps/http_parser/AUTHORS @@ -65,3 +65,4 @@ Romain Giraud Jay Satiro Arne Steen Kjell Schubert +Olivier Mengué diff --git a/deps/http_parser/Makefile b/deps/http_parser/Makefile index 373709c6672e31..33c8ba0239d741 100644 --- a/deps/http_parser/Makefile +++ b/deps/http_parser/Makefile @@ -19,7 +19,19 @@ # IN THE SOFTWARE. PLATFORM ?= $(shell sh -c 'uname -s | tr "[A-Z]" "[a-z]"') -SONAME ?= libhttp_parser.so.2.5.0 +HELPER ?= +BINEXT ?= +ifeq (darwin,$(PLATFORM)) +SONAME ?= libhttp_parser.2.6.0.dylib +SOEXT ?= dylib +else ifeq (wine,$(PLATFORM)) +CC = winegcc +BINEXT = .exe.so +HELPER = wine +else +SONAME ?= libhttp_parser.so.2.6.0 +SOEXT ?= so +endif CC?=gcc AR?=ar @@ -53,8 +65,8 @@ LDFLAGS_LIB += -Wl,-soname=$(SONAME) endif test: test_g test_fast - ./test_g - ./test_fast + $(HELPER) ./test_g$(BINEXT) + $(HELPER) ./test_fast$(BINEXT) test_g: http_parser_g.o test_g.o $(CC) $(CFLAGS_DEBUG) $(LDFLAGS) http_parser_g.o test_g.o -o $@ @@ -81,7 +93,7 @@ http_parser.o: http_parser.c http_parser.h Makefile $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) -c http_parser.c test-run-timed: test_fast - while(true) do time ./test_fast > /dev/null; done + while(true) do time $(HELPER) ./test_fast$(BINEXT) > /dev/null; done test-valgrind: test_g valgrind ./test_g @@ -102,10 +114,10 @@ url_parser_g: http_parser_g.o contrib/url_parser.c $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o $@ parsertrace: http_parser.o contrib/parsertrace.c - $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o parsertrace + $(CC) $(CPPFLAGS_FAST) $(CFLAGS_FAST) $^ -o parsertrace$(BINEXT) parsertrace_g: http_parser_g.o contrib/parsertrace.c - $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o parsertrace_g + $(CC) $(CPPFLAGS_DEBUG) $(CFLAGS_DEBUG) $^ -o parsertrace_g$(BINEXT) tags: http_parser.c http_parser.h test.c ctags $^ @@ -113,12 +125,12 @@ tags: http_parser.c http_parser.h test.c install: library $(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h $(INSTALL) -D $(SONAME) $(LIBDIR)/$(SONAME) - ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.so + ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.$(SOEXT) install-strip: library $(INSTALL) -D http_parser.h $(INCLUDEDIR)/http_parser.h $(INSTALL) -D -s $(SONAME) $(LIBDIR)/$(SONAME) - ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.so + ln -s $(LIBDIR)/$(SONAME) $(LIBDIR)/libhttp_parser.$(SOEXT) uninstall: rm $(INCLUDEDIR)/http_parser.h @@ -128,7 +140,8 @@ uninstall: clean: rm -f *.o *.a tags test test_fast test_g \ http_parser.tar libhttp_parser.so.* \ - url_parser url_parser_g parsertrace parsertrace_g + url_parser url_parser_g parsertrace parsertrace_g \ + *.exe *.exe.so contrib/url_parser.c: http_parser.h contrib/parsertrace.c: http_parser.h diff --git a/deps/http_parser/README.md b/deps/http_parser/README.md index 7c54dd42d087c3..abee9469338424 100644 --- a/deps/http_parser/README.md +++ b/deps/http_parser/README.md @@ -94,7 +94,7 @@ The Special Problem of Upgrade ------------------------------ HTTP supports upgrading the connection to a different protocol. An -increasingly common example of this is the Web Socket protocol which sends +increasingly common example of this is the WebSocket protocol which sends a request like GET /demo HTTP/1.1 @@ -106,8 +106,8 @@ a request like followed by non-HTTP data. -(See http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-75 for more -information the Web Socket protocol.) +(See [RFC6455](https://tools.ietf.org/html/rfc6455) for more information the +WebSocket protocol.) To support this, the parser will treat this as a normal HTTP message without a body, issuing both on_headers_complete and on_message_complete callbacks. However @@ -137,6 +137,69 @@ There are two types of callbacks: Callbacks must return 0 on success. Returning a non-zero value indicates error to the parser, making it exit immediately. +For cases where it is necessary to pass local information to/from a callback, +the `http_parser` object's `data` field can be used. +An example of such a case is when using threads to handle a socket connection, +parse a request, and then give a response over that socket. By instantiation +of a thread-local struct containing relevant data (e.g. accepted socket, +allocated memory for callbacks to write into, etc), a parser's callbacks are +able to communicate data between the scope of the thread and the scope of the +callback in a threadsafe manner. This allows http-parser to be used in +multi-threaded contexts. + +Example: +``` + typedef struct { + socket_t sock; + void* buffer; + int buf_len; + } custom_data_t; + + +int my_url_callback(http_parser* parser, const char *at, size_t length) { + /* access to thread local custom_data_t struct. + Use this access save parsed data for later use into thread local + buffer, or communicate over socket + */ + parser->data; + ... + return 0; +} + +... + +void http_parser_thread(socket_t sock) { + int nparsed = 0; + /* allocate memory for user data */ + custom_data_t *my_data = malloc(sizeof(custom_data_t)); + + /* some information for use by callbacks. + * achieves thread -> callback information flow */ + my_data->sock = sock; + + /* instantiate a thread-local parser */ + http_parser *parser = malloc(sizeof(http_parser)); + http_parser_init(parser, HTTP_REQUEST); /* initialise parser */ + /* this custom data reference is accessible through the reference to the + parser supplied to callback functions */ + parser->data = my_data; + + http_parser_settings settings; / * set up callbacks */ + settings.on_url = my_url_callback; + + /* execute parser */ + nparsed = http_parser_execute(parser, &settings, buf, recved); + + ... + /* parsed information copied from callback. + can now perform action on data copied into thread-local memory from callbacks. + achieves callback -> thread information flow */ + my_data->buffer; + ... +} + +``` + In case you parse HTTP message in chunks (i.e. `read()` request line from socket, parse, read half headers, parse, etc) your data callbacks may be called more than once. Http-parser guarantees that data pointer is only diff --git a/deps/http_parser/contrib/url_parser.c b/deps/http_parser/contrib/url_parser.c index 6650b414af9065..f235bed9e483dc 100644 --- a/deps/http_parser/contrib/url_parser.c +++ b/deps/http_parser/contrib/url_parser.c @@ -35,6 +35,7 @@ int main(int argc, char ** argv) { connect = strcmp("connect", argv[1]) == 0 ? 1 : 0; printf("Parsing %s, connect %d\n", argv[2], connect); + http_parser_url_init(&u); result = http_parser_parse_url(argv[2], len, connect, &u); if (result != 0) { printf("Parse error : %d\n", result); @@ -43,4 +44,4 @@ int main(int argc, char ** argv) { printf("Parse ok, result : \n"); dump_url(argv[2], &u); return 0; -} \ No newline at end of file +} diff --git a/deps/http_parser/http_parser.c b/deps/http_parser/http_parser.c index 0fa1c362729c4f..b3037d7e3d61e8 100644 --- a/deps/http_parser/http_parser.c +++ b/deps/http_parser/http_parser.c @@ -400,6 +400,8 @@ enum http_host_state , s_http_host , s_http_host_v6 , s_http_host_v6_end + , s_http_host_v6_zone_start + , s_http_host_v6_zone , s_http_host_port_start , s_http_host_port }; @@ -957,21 +959,23 @@ size_t http_parser_execute (http_parser *parser, parser->method = (enum http_method) 0; parser->index = 1; switch (ch) { + case 'A': parser->method = HTTP_ACL; break; + case 'B': parser->method = HTTP_BIND; break; case 'C': parser->method = HTTP_CONNECT; /* or COPY, CHECKOUT */ break; case 'D': parser->method = HTTP_DELETE; break; case 'G': parser->method = HTTP_GET; break; case 'H': parser->method = HTTP_HEAD; break; - case 'L': parser->method = HTTP_LOCK; break; + case 'L': parser->method = HTTP_LOCK; /* or LINK */ break; case 'M': parser->method = HTTP_MKCOL; /* or MOVE, MKACTIVITY, MERGE, M-SEARCH, MKCALENDAR */ break; case 'N': parser->method = HTTP_NOTIFY; break; case 'O': parser->method = HTTP_OPTIONS; break; case 'P': parser->method = HTTP_POST; /* or PROPFIND|PROPPATCH|PUT|PATCH|PURGE */ break; - case 'R': parser->method = HTTP_REPORT; break; + case 'R': parser->method = HTTP_REPORT; /* or REBIND */ break; case 'S': parser->method = HTTP_SUBSCRIBE; /* or SEARCH */ break; case 'T': parser->method = HTTP_TRACE; break; - case 'U': parser->method = HTTP_UNLOCK; /* or UNSUBSCRIBE */ break; + case 'U': parser->method = HTTP_UNLOCK; /* or UNSUBSCRIBE, UNBIND, UNLINK */ break; default: SET_ERRNO(HPE_INVALID_METHOD); goto error; @@ -1027,16 +1031,32 @@ size_t http_parser_execute (http_parser *parser, SET_ERRNO(HPE_INVALID_METHOD); goto error; } - } else if (parser->index == 1 && parser->method == HTTP_POST) { - if (ch == 'R') { - parser->method = HTTP_PROPFIND; /* or HTTP_PROPPATCH */ - } else if (ch == 'U') { - parser->method = HTTP_PUT; /* or HTTP_PURGE */ - } else if (ch == 'A') { - parser->method = HTTP_PATCH; - } else { - SET_ERRNO(HPE_INVALID_METHOD); - goto error; + } else if (parser->method == HTTP_REPORT) { + if (parser->index == 2 && ch == 'B') { + parser->method = HTTP_REBIND; + } else { + SET_ERRNO(HPE_INVALID_METHOD); + goto error; + } + } else if (parser->index == 1) { + if (parser->method == HTTP_POST) { + if (ch == 'R') { + parser->method = HTTP_PROPFIND; /* or HTTP_PROPPATCH */ + } else if (ch == 'U') { + parser->method = HTTP_PUT; /* or HTTP_PURGE */ + } else if (ch == 'A') { + parser->method = HTTP_PATCH; + } else { + SET_ERRNO(HPE_INVALID_METHOD); + goto error; + } + } else if (parser->method == HTTP_LOCK) { + if (ch == 'I') { + parser->method = HTTP_LINK; + } else { + SET_ERRNO(HPE_INVALID_METHOD); + goto error; + } } } else if (parser->index == 2) { if (parser->method == HTTP_PUT) { @@ -1049,6 +1069,8 @@ size_t http_parser_execute (http_parser *parser, } else if (parser->method == HTTP_UNLOCK) { if (ch == 'S') { parser->method = HTTP_UNSUBSCRIBE; + } else if(ch == 'B') { + parser->method = HTTP_UNBIND; } else { SET_ERRNO(HPE_INVALID_METHOD); goto error; @@ -1059,6 +1081,8 @@ size_t http_parser_execute (http_parser *parser, } } else if (parser->index == 4 && parser->method == HTTP_PROPFIND && ch == 'P') { parser->method = HTTP_PROPPATCH; + } else if (parser->index == 3 && parser->method == HTTP_UNLOCK && ch == 'I') { + parser->method = HTTP_UNLINK; } else { SET_ERRNO(HPE_INVALID_METHOD); goto error; @@ -1828,11 +1852,12 @@ size_t http_parser_execute (http_parser *parser, case s_headers_done: { + int hasBody; STRICT_CHECK(ch != LF); parser->nread = 0; - int hasBody = parser->flags & F_CHUNKED || + hasBody = parser->flags & F_CHUNKED || (parser->content_length > 0 && parser->content_length != ULLONG_MAX); if (parser->upgrade && (parser->method == HTTP_CONNECT || (parser->flags & F_SKIPBODY) || !hasBody)) { @@ -1857,8 +1882,7 @@ size_t http_parser_execute (http_parser *parser, /* Content-Length header given and non-zero */ UPDATE_STATE(s_body_identity); } else { - if (parser->type == HTTP_REQUEST || - !http_message_needs_eof(parser)) { + if (!http_message_needs_eof(parser)) { /* Assume content-length 0 - read the next */ UPDATE_STATE(NEW_MESSAGE()); CALLBACK_NOTIFY(message_complete); @@ -2153,15 +2177,13 @@ http_parser_settings_init(http_parser_settings *settings) const char * http_errno_name(enum http_errno err) { - assert(((size_t) err) < - (sizeof(http_strerror_tab) / sizeof(http_strerror_tab[0]))); + assert(((size_t) err) < ARRAY_SIZE(http_strerror_tab)); return http_strerror_tab[err].name; } const char * http_errno_description(enum http_errno err) { - assert(((size_t) err) < - (sizeof(http_strerror_tab) / sizeof(http_strerror_tab[0]))); + assert(((size_t) err) < ARRAY_SIZE(http_strerror_tab)); return http_strerror_tab[err].description; } @@ -2214,6 +2236,23 @@ http_parse_host_char(enum http_host_state s, const char ch) { return s_http_host_v6; } + if (s == s_http_host_v6 && ch == '%') { + return s_http_host_v6_zone_start; + } + break; + + case s_http_host_v6_zone: + if (ch == ']') { + return s_http_host_v6_end; + } + + /* FALLTHROUGH */ + case s_http_host_v6_zone_start: + /* RFC 6874 Zone ID consists of 1*( unreserved / pct-encoded) */ + if (IS_ALPHANUM(ch) || ch == '%' || ch == '.' || ch == '-' || ch == '_' || + ch == '~') { + return s_http_host_v6_zone; + } break; case s_http_host_port: @@ -2232,6 +2271,7 @@ http_parse_host_char(enum http_host_state s, const char ch) { static int http_parse_host(const char * buf, struct http_parser_url *u, int found_at) { + assert(u->field_set & (1 << UF_HOST)); enum http_host_state s; const char *p; @@ -2263,6 +2303,11 @@ http_parse_host(const char * buf, struct http_parser_url *u, int found_at) { u->field_data[UF_HOST].len++; break; + case s_http_host_v6_zone_start: + case s_http_host_v6_zone: + u->field_data[UF_HOST].len++; + break; + case s_http_host_port: if (s != s_http_host_port) { u->field_data[UF_PORT].off = p - buf; @@ -2292,6 +2337,8 @@ http_parse_host(const char * buf, struct http_parser_url *u, int found_at) { case s_http_host_start: case s_http_host_v6_start: case s_http_host_v6: + case s_http_host_v6_zone_start: + case s_http_host_v6_zone: case s_http_host_port_start: case s_http_userinfo: case s_http_userinfo_start: @@ -2303,6 +2350,11 @@ http_parse_host(const char * buf, struct http_parser_url *u, int found_at) { return 0; } +void +http_parser_url_init(struct http_parser_url *u) { + memset(u, 0, sizeof(*u)); +} + int http_parser_parse_url(const char *buf, size_t buflen, int is_connect, struct http_parser_url *u) @@ -2376,7 +2428,12 @@ http_parser_parse_url(const char *buf, size_t buflen, int is_connect, /* host must be present if there is a schema */ /* parsing http:///toto will fail */ - if ((u->field_set & ((1 << UF_SCHEMA) | (1 << UF_HOST))) != 0) { + if ((u->field_set & (1 << UF_SCHEMA)) && + (u->field_set & (1 << UF_HOST)) == 0) { + return 1; + } + + if (u->field_set & (1 << UF_HOST)) { if (http_parse_host(buf, u, found_at) != 0) { return 1; } diff --git a/deps/http_parser/http_parser.h b/deps/http_parser/http_parser.h index eb71bf99219315..34bebf3d36a176 100644 --- a/deps/http_parser/http_parser.h +++ b/deps/http_parser/http_parser.h @@ -26,11 +26,12 @@ extern "C" { /* Also update SONAME in the Makefile whenever you change these. */ #define HTTP_PARSER_VERSION_MAJOR 2 -#define HTTP_PARSER_VERSION_MINOR 5 +#define HTTP_PARSER_VERSION_MINOR 6 #define HTTP_PARSER_VERSION_PATCH 0 #include -#if defined(_WIN32) && !defined(__MINGW32__) && (!defined(_MSC_VER) || _MSC_VER<1600) +#if defined(_WIN32) && !defined(__MINGW32__) && \ + (!defined(_MSC_VER) || _MSC_VER<1600) && !defined(__WINE__) #include #include typedef __int8 int8_t; @@ -95,7 +96,7 @@ typedef int (*http_cb) (http_parser*); XX(5, CONNECT, CONNECT) \ XX(6, OPTIONS, OPTIONS) \ XX(7, TRACE, TRACE) \ - /* webdav */ \ + /* WebDAV */ \ XX(8, COPY, COPY) \ XX(9, LOCK, LOCK) \ XX(10, MKCOL, MKCOL) \ @@ -104,21 +105,28 @@ typedef int (*http_cb) (http_parser*); XX(13, PROPPATCH, PROPPATCH) \ XX(14, SEARCH, SEARCH) \ XX(15, UNLOCK, UNLOCK) \ + XX(16, BIND, BIND) \ + XX(17, REBIND, REBIND) \ + XX(18, UNBIND, UNBIND) \ + XX(19, ACL, ACL) \ /* subversion */ \ - XX(16, REPORT, REPORT) \ - XX(17, MKACTIVITY, MKACTIVITY) \ - XX(18, CHECKOUT, CHECKOUT) \ - XX(19, MERGE, MERGE) \ + XX(20, REPORT, REPORT) \ + XX(21, MKACTIVITY, MKACTIVITY) \ + XX(22, CHECKOUT, CHECKOUT) \ + XX(23, MERGE, MERGE) \ /* upnp */ \ - XX(20, MSEARCH, M-SEARCH) \ - XX(21, NOTIFY, NOTIFY) \ - XX(22, SUBSCRIBE, SUBSCRIBE) \ - XX(23, UNSUBSCRIBE, UNSUBSCRIBE) \ + XX(24, MSEARCH, M-SEARCH) \ + XX(25, NOTIFY, NOTIFY) \ + XX(26, SUBSCRIBE, SUBSCRIBE) \ + XX(27, UNSUBSCRIBE, UNSUBSCRIBE) \ /* RFC-5789 */ \ - XX(24, PATCH, PATCH) \ - XX(25, PURGE, PURGE) \ + XX(28, PATCH, PATCH) \ + XX(29, PURGE, PURGE) \ /* CalDAV */ \ - XX(26, MKCALENDAR, MKCALENDAR) \ + XX(30, MKCALENDAR, MKCALENDAR) \ + /* RFC-2068, section 19.6.1.2 */ \ + XX(31, LINK, LINK) \ + XX(32, UNLINK, UNLINK) \ enum http_method { @@ -144,7 +152,7 @@ enum flags /* Map for errno-related constants - * + * * The provided argument should be a macro that takes 2 arguments. */ #define HTTP_ERRNO_MAP(XX) \ @@ -325,6 +333,9 @@ const char *http_errno_name(enum http_errno err); /* Return a string description of the given error */ const char *http_errno_description(enum http_errno err); +/* Initialize all http_parser_url members to 0 */ +void http_parser_url_init(struct http_parser_url *u); + /* Parse a URL; return nonzero on failure */ int http_parser_parse_url(const char *buf, size_t buflen, int is_connect, diff --git a/deps/http_parser/test.c b/deps/http_parser/test.c index 4c00571eba60bc..c63b8f0b0b1cd7 100644 --- a/deps/http_parser/test.c +++ b/deps/http_parser/test.c @@ -1101,6 +1101,58 @@ const struct message requests[] = ,.body= "" } +/* Examples from the Internet draft for LINK/UNLINK methods: + * https://tools.ietf.org/id/draft-snell-link-method-01.html#rfc.section.5 + */ + +#define LINK_REQUEST 40 +, {.name = "link request" + ,.type= HTTP_REQUEST + ,.raw= "LINK /images/my_dog.jpg HTTP/1.1\r\n" + "Host: example.com\r\n" + "Link: ; rel=\"tag\"\r\n" + "Link: ; rel=\"tag\"\r\n" + "\r\n" + ,.should_keep_alive= TRUE + ,.message_complete_on_eof= FALSE + ,.http_major= 1 + ,.http_minor= 1 + ,.method= HTTP_LINK + ,.request_path= "/images/my_dog.jpg" + ,.request_url= "/images/my_dog.jpg" + ,.query_string= "" + ,.fragment= "" + ,.num_headers= 3 + ,.headers= { { "Host", "example.com" } + , { "Link", "; rel=\"tag\"" } + , { "Link", "; rel=\"tag\"" } + } + ,.body= "" + } + +#define UNLINK_REQUEST 41 +, {.name = "link request" + ,.type= HTTP_REQUEST + ,.raw= "UNLINK /images/my_dog.jpg HTTP/1.1\r\n" + "Host: example.com\r\n" + "Link: ; rel=\"tag\"\r\n" + "\r\n" + ,.should_keep_alive= TRUE + ,.message_complete_on_eof= FALSE + ,.http_major= 1 + ,.http_minor= 1 + ,.method= HTTP_UNLINK + ,.request_path= "/images/my_dog.jpg" + ,.request_url= "/images/my_dog.jpg" + ,.query_string= "" + ,.fragment= "" + ,.num_headers= 2 + ,.headers= { { "Host", "example.com" } + , { "Link", "; rel=\"tag\"" } + } + ,.body= "" + } + , {.name= NULL } /* sentinel */ }; @@ -2918,6 +2970,59 @@ const struct url_test url_tests[] = ,.rv=1 /* s_dead */ } +, {.name="ipv6 address with Zone ID" + ,.url="http://[fe80::a%25eth0]/" + ,.is_connect=0 + ,.u= + {.field_set= (1< Isaac Z. Schlueter isaacs Jake Verbaten James Sanders +James Treworgy Jason Smith Jonas Weber Julien Meddah @@ -42,7 +43,9 @@ Rebecca Turner Rebecca Turner Ryan Emery Sam Mikes +Stephanie Snopek Takaya Kobayashi +Thomas Reggi Timo Weiß Tony Trent Mick diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml index d555682984faf5..d0cde08d369054 100644 --- a/deps/npm/.travis.yml +++ b/deps/npm/.travis.yml @@ -1,5 +1,7 @@ language: node_js node_js: + - "4.1" + - "4.0" - iojs - "0.12" - "0.10" @@ -8,7 +10,7 @@ env: - DEPLOY_VERSION=testing before_install: - "npm config set spin false" - - "npm install -g npm/npm#2.x" + - "node . install -g ." - "sudo mkdir -p /var/run/couchdb" script: "npm run-script test-all" notifications: diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index 9b03dc4d363c9f..6ed24fdd6f907c 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -291,11 +291,12 @@ Eduardo Pinho Rachel Hutchison Ryan Temple Eugene Sharygin -Nick Heiner James Talmage jane arc Joseph Dykstra +Andrew Crites Joshua Egan +Carlos Alberto Thomas Cort Thaddee Tyl Steve Klabnik @@ -308,7 +309,18 @@ murgatroid99 Marcin Cieslak João Reis Matthew Hasbach -Anna Henningsen Jon Hall +Anna Henningsen +James Treworgy James Hartig -snopeks +Stephanie Snopek +Kent C. Dodds +Aaron Krause +Daniel K O'Leary +fscherwi +Thomas Reggi +Thomas Michael McTiernan +Jason Kurian +Sebastiaan Deckers +lady3bean +Tomi Carr diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index 8a8dbbca445cd5..c12eb8fbc2c630 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,330 @@ +### v3.3.12 (2015-11-02): + +Hi, a little hot-fix release for a bug introduced in 3.3.11. The ENOENT fix +last week ([`f0e2088`](https://github.com/npm/npm/commit/f0e2088)) broke +upgrades of modules that have bundled dependencies (like `npm`, augh!) + +* [`aedf7cf`](https://github.com/npm/npm/commit/aedf7cf) + [#10192](//github.com/npm/npm/pull/10192) + If a bundled module is going to be replacing a module that's currently on + disk (for instance, when you upgrade a module that includes bundled + dependencies) we want to select the version from the bundle in preference + over the one that was there previously. + ([@iarna](https://github.com/iarna)) + +### v3.3.11 (2015-10-29): + +This is a dependency update week, so that means no PRs from our lovely +users. Look for those next week. As it happens, the dependencies updated +were just devdeps, so nothing for you all to worry about. + +But the bug fixes, oh geez, I tracked down some really long standing stuff +this week!! The headliner is those intermittent `ENOENT` errors that no one +could reproduce consistently? I think they're nailed! But also pretty +important, the bug where `hapi` would install w/ a dep missing? Squashed! + +#### EEEEEEENOENT + +* [`f0e2088`](https://github.com/npm/npm/commit/f0e2088) + [#10026](https://github.com/npm/npm/issues/10026) + Eliminate some, if not many, of the EONENT errors `npm@3` has seen over + the past few months. This was happening when npm would, in its own mind, + correct a bundled dependency, due to a `package.json` specifying an + incompatible version. Then, when npm extracted the bundled version, what + was on disk didn't match its mind and… well, when it tried to act on what + was in its mind, we got an `ENOENT` because it didn't actually exist on + disk. + ([@iarna](https://github.com/iarna)) + +#### PARTIAL SHRINKWRAPS, NO LONGER A BAD DAY + +* [`712fd9c`](https://github.com/npm/npm/commit/712fd9c) + [#10153](https://github.com/npm/npm/pull/10153) + Imagine that you have a module, let's call it `fun-time`, and it depends + on two dependencies, `need-fun@1` and `need-time`. Further, `need-time` + requires `need-fun@2`. So after install the logical tree will look like + this: + + ``` + fun-time + ├── need-fun@1 + └── need-time + └── need-fun@2 + ``` + + Now, the `fun-time` author also distributes a shrinkwrap, but it only includes + the `need-fun@1` in it. + + Resolving dependencies would look something like this: + + 1. Require `need-fun@1`: Use version from shrinkwrap (ignoring version) + 2. Require `need-time`: User version in package.json + 1. Require `need-fun@2`: Use version from shrinkwrap, which oh hey, is + already installed at the top level, so no further action is needed. + + Which results in this tree: + + ``` + fun-time + ├── need-fun@1 + └── need-time + ``` + + We're ignoring the version check on things specified in the shrinkwrap + so that you can override the version that will be installed. This is + because you may want to use a different version than is specified + by your dependencies' dependencies' `package.json` files. + + To fix this, we now only allow overrides of a dependency version when + that dependency is a child (in the tree) of the thing that requires it. + This means that when we're looking for `need-fun@2` we'll see `need-fun@1` + and reject it because, although it's from a shrinkwrap, it's parent is + `fun-time` and the package doing the requiring is `need-time`. + + ([@iarna](https://github.com/iarna)) + +#### STRING `package.bin` AND NON-NPMJS REGISTRIES + +* [`3de1463`](https://github.com/npm/npm/commit/3de1463) + [#9187](https://github.com/npm/npm/issues/9187) + If you were using a module with the `bin` field in your `package.json` set + to a string on a non-npmjs registry then npm would crash, due to the our + expectation that the `bin` field would be an object. We now pass all + `package.json` data through a routine that normalizes the format, + including the `bin` field. (This is the same routine that your + `package.json` is passed through when read off of disk or sent to the + registry for publication.) Doing this also ensures that older modules on + npm's own registry will be treated exactly the same as new ones. (In the + past we weren't always super careful about scrubbing `package.json` data + on publish. And even when we were, those rules have subtly changed over + time.) + ([@iarna](https://github.com/iarna)) + +### v3.3.10 (2015-10-22): + +Hey you all! Welcome to a busy bug fix and PR week. We've got changes +to how `npm install` replaces dependencies during updates, improvements +to shrinkwrap behavior, and all sorts of doc updates. + +In other news, `npm@3` landed in node master in preparation for `node@5` +with [`41923c0`](https://github.com/nodejs/node/commit/41923c0). + +#### UPDATED DEPS NOW MAKE MORE SENSE + +* [`971fd47`](https://github.com/npm/npm/commit/971fd47) + [#9929](https://github.com/npm/npm/pull/9929) + Make the tree more consistent by doing updates in place. This means + that trees after a dependency version update will more often look + the same as after a fresh install. + ([@iarna](https://github.com/iarna)) + +#### SHRINKWRAP + DEV DEPS NOW RESPECTED + +* [`eb28a8c`](https://github.com/npm/npm/commit/eb28a8c) + [#9647](https://github.com/npm/npm/issues/9647) + If a shrinkwrap already has dev deps, don't throw them away when + someone later runs `npm install --save`. + ([@iarna](https://github.com/iarna)) + +#### FANTASTIC DOCUMENTATION UPDATES + +* [`291162c`](https://github.com/npm/npm/commit/291162c) + [#10021](https://github.com/npm/npm/pull/10021) + Improve wording in the FAQ to be more empathetic and less jokey. + ([@TaMe3971](https://github.com/TaMe3971)) +* [`9a28c54`](https://github.com/npm/npm/commit/9a28c54) + [#10020](https://github.com/npm/npm/pull/10020) + Document the command to see the list of config defaults in the section + on config defaults. + ([@lady3bean](https://github.com/lady3bean)) +* [`8770b0a`](https://github.com/npm/npm/commit/8770b0a) + [#7600](https://github.com/npm/npm/issues/7600) + Add shortcuts to all command documentation. + ([@RichardLitt](https://github.com/RichardLitt)) +* [`e9b7d0d`](https://github.com/npm/npm/commit/e9b7d0d) + [#9950](https://github.com/npm/npm/pull/9950) + On errors that can be caused by outdated node & npm, suggest updating + as a part of the error message. + ([@ForbesLindesay](https://github.com/ForbesLindesay)) + +#### NEW STANDARD HAS ALWAYS BEEN STANDARD + +* [`40c1b0f`](https://github.com/npm/npm/commit/40c1b0f) + [#9954](https://github.com/npm/npm/pull/9954) + Update to `standard@5` and reformat the source to work with it. + ([@cbas](https://github.com/cbas)) + +### v3.3.9 (2015-10-15): + +This week sees a few small changes ready to land: + +#### TRAVIS NODE 0.8 BUILDS REJOICE + +* [`25a234b`](https://github.com/npm/npm/commit/25a234b) + [#9668](https://github.com/npm/npm/issues/9668) + Install `npm@3`'s bundled dependencies with `npm@2`, so that the ancient npm + that ships with node 0.8 can install `npm@3` directly. + ([@othiym23](https://github.com/othiym23)) + +#### SMALL ERROR MESSAGE IMPROVEMENT + +* [`a332f61`](https://github.com/npm/npm/commit/a332f61) + [#9927](https://github.com/npm/npm/pull/9927) + Update error messages where we report a list of versions that you could + have installed to show this as a comma separated list instead of as JSON. + ([@iarna](https://github.com/iarna)) + +#### DEPENDENCY UPDATES + +* [`4cd74b0`](https://github.com/npm/npm/commit/4cd74b0) + `nock@2.15.0` + ([@pgte](https://github.com/pgte)) +* [`9360976`](https://github.com/npm/npm/commit/9360976) + `tap@2.1.1` + ([@isaacs](https://github.com/isaacs)) +* [`1ead0a4`](https://github.com/npm/npm/commit/1ead0a4) + `which@1.2.0` + ([@isaacs](https://github.com/isaacs)) +* [`759f88a`](https://github.com/npm/npm/commit/759f88a) + `has-unicode@1.0.1` + ([@iarna](https://github.com/iarna)) + +### v3.3.8 (2015-10-12): + +This is a small update release, we're reverting +[`22a3af0`](https://github.com/npm/npm/commit/22a3af0) from last week's +release, as it is resulting in crashes. We'll revisit this PR during this +week. + +* [`ddde1d5`](https://github.com/npm/npm/commit/ddde1d5) + Revert "lifecycle: Swap out custom logic with add-to-path module" + ([@iarna](https://github.com/iarna)) + +### v3.3.7 (2015-10-08): + +So, as Kat mentioned in last week's 2.x release, we're now swapping weeks +between accepting PRs and doing dependency updates, in an effort to keep +release management work from taking over our lives. This week is a PR week, +so we've got a bunch of goodies for you. + +Relatedly, this week means 3.3.6 is now `latest` and it is WAY faster than +previous 3.x releases. Give it or this a look! + +#### OPTIONAL DEPS, MORE OPTIONAL + +* [`2289234`](https://github.com/npm/npm/commit/2289234) + [#9643](https://github.com/npm/npm/issues/9643) + [#9664](https://github.com/npm/npm/issues/9664) + `npm@3` was triggering `npm@2`'s build mechanics when it was linking bin files + into the tree. This was originally intended to trigger rebuilds of + bundled modules, but `npm@3`'s flat module structure confused it. This + caused two seemingly unrelated issues. First, failing optional + dependencies could under some circumstances (if they were built during + this phase) trigger a full build failure. And second, rebuilds were being + triggered of already installed modules, again, in some circumstances. + Both of these are fixed by disabling the `npm@2` mechanics and adding a + special rebuild phase for the initial installation of bundled modules. + ([@iarna](https://github.com/iarna)) + +#### BAD NAME, NO CRASH + +* [`b78fec9`](https://github.com/npm/npm/commit/b78fec9) + [#9766](https://github.com/npm/npm/issues/9766) + Refactor all attempts to read the module name or package name to go via a + single function, with appropriate guards unusual circumstances where they + aren't where we expect them. This ultimately will ensure we don't see any + more recurrences of the `localeCompare` error and related crashers. + ([@iarna](https://github.com/iarna)) + +#### MISCELLANEOUS BUG FIXES + +* [`22a3af0`](https://github.com/npm/npm/commit/22a3af0) + [#9553](https://github.com/npm/npm/pull/9553) + Factor the lifecycle code to manage paths out into its own module and use that. + ([@kentcdodds](https://github.com/kentcdodds)) +* [`6a29fe3`](https://github.com/npm/npm/commit/6a29fe3) + [#9677](https://github.com/npm/npm/pull/9677) + Start testing our stuff in node 4 on travis + ([@fscherwi](https://github.com/fscherwi)) +* [`508c6a4`](https://github.com/npm/npm/commit/508c6a4) + [#9669](https://github.com/npm/npm/issues/9669) + Make `recalculateMetadata` more resilient to unexpectedly bogus dependency specifiers. + ([@tmct](https://github.com/tmct)) +* [`3c44763`](https://github.com/npm/npm/commit/3c44763) + [#9643](https://github.com/npm/npm/issues/9463) + Update `install --only` to ignore the `NODE_ENV` var and _just_ use the only + value, if specified. + ([@watilde](https://github.com/watilde)) +* [`87336c3`](https://github.com/npm/npm/commit/87336c3) + [#9879](https://github.com/npm/npm/pull/9879) + `npm@3`'s shrinkwrap was refusing to shrinkwrap if an optional dependency + was missing– patch it to allow this. + ([@mantoni](https://github.com/mantoni)) + +#### DOCUMENTATION UPDATES + +* [`82659fd`](https://github.com/npm/npm/commit/82659fd) + [#9208](https://github.com/npm/npm/issues/9208) + Correct the npm style guide around quote usage + ([@aaroncrows](https://github.com/aaroncrows)) +* [`a69c83a`](https://github.com/npm/npm/commit/a69c83a) + [#9645](https://github.com/npm/npm/pull/9645) + Fix spelling error in README + ([@dkoleary88](https://github.com/dkoleary88)) +* [`f2cf054`](https://github.com/npm/npm/commit/f2cf054) + [#9714](https://github.com/npm/npm/pull/9714) + Fix typos in our documentation + ([@reggi](https://github.com/reggi)) +* [`7224bef`](https://github.com/npm/npm/commit/7224bef) + [#9759](https://github.com/npm/npm/pull/9759) + Fix typo in npm-team docs + ([@zkat](https://github.com/zkat)) +* [`7e6e007`](https://github.com/npm/npm/commit/7e6e007) + [#9820](https://github.com/npm/npm/pull/9820) + Correct documentation as to `binding.gyp` + ([@KenanY](https://github.com/KenanY)) + +### v2.14.8 (2015-10-08): + +#### SLOWLY RECOVERING FROM FEELINGS + +OS&F is definitely my favorite convention I've gone to. Y'all should check it +out next year! Rebecca and Kat are back, although Forrest is out at +[&yet conf](http://andyetconf.com/). + +This week sees another tiny LTS release with non-code-related patches -- just +CI/release things. + +Meanwhile, have you heard? `npm@3` is much faster now! Go upgrade with `npm +install -g npm@latest` and give it a whirl if you haven't already! + +#### IF YOU CHANGE CASING ON A FILE, YOU ARE NOT MY FRIEND + +Seriously. I love me some case-sensitive filesystems, but a lot of us have to +deal with `git` and its funky support for case normalizing systems. Have mercy +and just don't bother if all you're changing is casing, please? Otherwise, I +have to do this little dance to prevent horrible conflicts. + +* [`c3a7b61`](https://github.com/npm/npm/commit/c3a7b619786650a45653c8b55b8741fc7bb5cfda) + [#9804](https://github.com/npm/npm/pulls/9804) Remove the readme file with + weird casing. + ([@zkat](https://github.com/zkat)) +* [`f3f619e`](https://github.com/npm/npm/commit/f3f619e06e4be1378dbf286f897b50e9c69c9557) + [#9804](https://github.com/npm/npm/pulls/9804) Add the readme file back in, + with desired casing. + ([@zkat](https://github.com/zkat)) + +#### IDK. OUR CI DOESN'T EVEN FULLY WORK YET BUT SURE + +Either way, it's nice to make sure we're running stuff on the latest Node. `4.2` +is getting released very soon, though (this week?), and that'll be the first +official LTS release! + +* [`bd0b9ab`](https://github.com/npm/npm/commit/bd0b9ab6e60a31448794bbd88f94672572c3cb55) + [#9827](https://github.com/npm/npm/pulls/9827) Add node `4.0` and `4.1` to + TravisCI + ([@JaKXz](https://github.com/JaKXz)) + ### v2.14.7 (2015-10-01): #### MORE RELEASE STAGGERING?! @@ -45,6 +372,122 @@ Anyway -- here's your version bump! :) `nock@2.13.0` ([@pgte](https://github.com/pgte)) +### v3.3.6 (2015-09-30): + +I have the most exciting news for you this week. YOU HAVE NO IDEA. Well, +ok, maybe you do if you follow my twitter. + +Performance just got 5 bazillion times better (under some circumstances, +ymmv, etc). So– my test scenario is our very own website. In `npm@2`, on my +macbook running `npm ls` takes about 5 seconds. Personally it's more than +I'd like, but it's entire workable. In `npm@3` it has been taking _50_ seconds, +which is appalling. But after doing some work on Monday isolating the performance +issues I've been able to reduce `npm@3`'s run time back down to 5 seconds. + +Other scenarios were even worse, there was one that until now in `npm@3` that +took almost 6 minutes, and has been reduced to 14 seconds. + +* [`7bc0d4c`](https://github.com/npm/npm/commit/7bc0d4c) + [`cf42217`](https://github.com/npm/npm/commit/cf42217) + [#8826](https://github.com/npm/npm/issues/8826) + Stop using deepclone on super big datastructures. Avoid cloning + all-together even when that means mutating things, when possible. + Otherwise use a custom written tree-copying function that understands + the underlying datastructure well enough to only copy what we absolutely + need to. + ([@iarna](https://github.com/iarna)) + +In other news, look for us this Friday and Saturday at the amazing +[Open Source and Feelings](https://osfeels.com) conference, where something like a +third of the company will be attending. + +#### And finally a dependency update + +* [`a6a4437`](https://github.com/npm/npm/commit/a6a4437) + `glob@5.0.15` + ([@isaacs](https://github.com/isaacs)) + +#### And some subdep updates + +* [`cc5e6a0`](https://github.com/npm/npm/commit/cc5e6a0) + `hoek@2.16.3` + ([@nlf](https://github.com/nlf)) +* [`912a516`](https://github.com/npm/npm/commit/912a516) + `boom@2.9.0` + ([@arb](https://github.com/arb)) +* [`63944e9`](https://github.com/npm/npm/commit/63944e9) + `bluebird@2.10.1` + ([@petkaantonov](https://github.com/petkaantonov)) +* [`ef16003`](https://github.com/npm/npm/commit/ef16003) + `mime-types@2.1.7` & `mime-db@1.19.0` + ([@dougwilson](https://github.com/dougwilson)) +* [`2b8c0dd`](https://github.com/npm/npm/commit/2b8c0dd) + `request@2.64.0` + ([@simov](https://github.com/simov)) +* [`8139124`](https://github.com/npm/npm/commit/8139124) + `brace-expansion@1.1.1` + ([@juliangruber](https://github.com/juliangruber)) + +### v3.3.5 (2015-09-24): + +Some of you all may not be aware, but npm is ALSO a company. I tell you this +'cause npm-the-company had an all-staff get together this week, flying in +our remote folks from around the world. That was great, but it also +basically eliminated normal work on Monday and Tuesday. + +Still, we've got a couple of really important bug fixes this week. Plus a +lil bit from the [now LTS 2.x branch](https://github.com/npm/npm/releases/tag/v2.14.6). + +#### ATTENTION WINDOWS USERS + +If you previously updated to npm 3 and you try to update again, you may get +an error messaging telling you that npm won't install npm into itself. Until you +are at 3.3.5 or greater, you can get around this with `npm install -f -g npm`. + +* [`bef06f5`](https://github.com/npm/npm/commit/bef06f5) + [#9741](https://github.com/npm/npm/pull/9741) Uh... so... er... it + seems that since `npm@3.2.0` on Windows with a default configuration, it's + been impossible to update npm. Well, that's not actually true, there's a + work around (see above), but it shouldn't be complaining in the first + place. + ([@iarna](https://github.com/iarna)) + +#### STACK OVERFLOWS ON PUBLISH + +* [`330b496`](https://github.com/npm/npm/commit/330b496) + [#9667](https://github.com/npm/npm/pull/9667) + We were keeping track of metadata about your project while packing the + tree in a way that resulted in this data being written to packed tar files + headers. When this metadata included cycles, it resulted in the the tar + file entering an infinite recursive loop and eventually crashing with a + stack overflow. + + I've patched this by keeping track of your metadata by closing over the + variables in question instead, and I've further restricted gathering and + tracking the metadata to times when it's actually needed. (Which is only + if you need bundled modules.) + ([@iarna](https://github.com/iarna)) + +#### LESS CRASHY ERROR MESSAGES ON BAD PACKAGES + +* [`829921f`](https://github.com/npm/npm/commit/829921f) + [#9741](https://github.com/npm/npm/pull/9741) + Packages with invalid names or versions were crashing the installer. These + are now captured and warned as was originally intended. + ([@iarna](https://github.com/iarna)) + +#### ONE DEPENDENCY UPDATE + +* [`963295c`](https://github.com/npm/npm/commit/963295c) + `npm-install-checks@2.0.1` + ([@iarna](https://github.com/iarna)) + +#### AND ONE SUBDEPENDENCY + +* [`448737d`](https://github.com/npm/npm/commit/448737d) + `request@2.63.0` + ([@simov](https://github.com/simov)) + ### v2.14.6 (2015-09-24): #### `¯\_(ツ)_/¯` @@ -65,12 +508,70 @@ Still, we're bringing you a couple of tiny little changes this week! making `json` requests. ([@simov](https://github.com/simov)) +### v3.3.4 (2015-09-17): + +This is a relatively quiet release, bringing a few bug fixes and +some module updates, plus via the +[2.14.5 release](https://github.com/npm/npm/releases/tag/v2.14.5) +some forward compatibility fixes with versions of Node that +aren't yet released. + +#### NO BETA NOTICE THIS TIME!! + +But, EXCITING NEWS FRIENDS, this week marks the exit of `npm@3` +from beta. This means that the week of this release, +[v3.3.3](https://github.com/npm/npm/releases/tag/v3.3.3) will +become `latest` and this version (v3.3.4) will become `next`!! + +#### CRUFT FOR THE CRUFT GODS + +What I call "cruft", by which I mean, files sitting around in +your `node_modules` folder, will no longer produce warnings in +`npm ls` nor during `npm install`. This brings `npm@3`'s behavior +in line with `npm@2`. + +* [`a127801`](https://github.com/npm/npm/commit/a127801) + [#9285](https://github.com/npm/npm/pull/9586) + Stop warning about cruft in module directories. + ([@iarna](https://github.com/iarna)) + +#### BETTER ERROR MESSAGE + +* [`95ee92c`](https://github.com/npm/npm/commit/95ee92c) + [#9433](https://github.com/npm/npm/issues/9433) + Give better error messages for invalid urls in the dependecy + list. + ([@jamietre](https://github.com/jamietre)) + +#### MODULE UPDATES + +* [`ebb92ca`](https://github.com/npm/npm/commit/ebb92ca) + `retry@0.8.0` ([@tim-kos](https://github.com/tim-kos)) +* [`55f1285`](https://github.com/npm/npm/commit/55f1285) + `normalize-package-data@2.3.4` ([@zkat](https://github.com/zkat)) +* [`6d4ebff`](https://github.com/npm/npm/commit/6d4ebff) + `sha@2.0.1` ([@ForbesLindesay](https://github.com/ForbesLindesay)) +* [`09a9c7a`](https://github.com/npm/npm/commit/09a9c7a) + `semver@5.0.3` ([@isaacs](https://github.com/isaacs)) +* [`745000f`](https://github.com/npm/npm/commit/745000f) + `node-gyp@3.0.3` ([@rvagg](https://github.com/rvagg)) + +#### SUB DEP MODULE UPDATES + +* [`578ca25`](https://github.com/npm/npm/commit/578ca25) + `request@2.62.0` ([@simov](https://github.com/simov)) +* [`1d8996e`](https://github.com/npm/npm/commit/1d8996e) + `jju@1.2.1` ([@rlidwka](https://github.com/rlidwka)) +* [`6da1ba4`](https://github.com/npm/npm/commit/6da1ba4) + `hoek@2.16.2` ([@nlf](https://github.com/nlf)) + ### v2.14.5 (2015-09-17): #### NPM IS DEAD. LONG LIVE NPM -That's right folks. As of this week, `npm@latest` is `npm@3`! There's some -really great shiny new things over there, and you should really take a look. +That's right folks. As of this week, `npm@next` is `npm@3`, which means it'll be +`npm@latest` next week! There's some really great shiny new things over there, +and you should really take a look. Many kudos to [@iarna](https://github.com/iarna) for her hard work on `npm@3`! @@ -138,6 +639,141 @@ bunch of patches to get the latest npm working. `semver@5.0.3`: Removed uglify-js dead code. ([@isaacs](https://github.com/isaacs)) +### v3.3.3 (2015-09-10): + +This short week brought us brings us a few small bug fixes, a +doc change and a whole lotta dependency updates. + +Plus, as usual, this includes a forward port of everything in +[`npm@2.14.4`](https://github.com/npm/npm/releases/tag/v2.14.4). + +#### BETA BUT NOT FOREVER + +**_THIS IS BETA SOFTWARE_**. `npm@3` will remain in beta until +we're confident that it's stable and have assessed the effect of +the breaking changes on the community. During that time we will +still be doing `npm@2` releases, with `npm@2` tagged as `latest` +and `next`. We'll _also_ be publishing new releases of `npm@3` +as `npm@v3.x-next` and `npm@v3.x-latest` alongside those +versions until we're ready to switch everyone over to `npm@3`. +We need your help to find and fix its remaining bugs. It's a +significant rewrite, so we are _sure_ there still significant +bugs remaining. So do us a solid and deploy it in non-critical +CI environments and for day-to-day use, but maybe don't use it +for production maintenance or frontline continuous deployment +just yet. + +#### REMOVE INSTALLED BINARIES ON WINDOWS + +So waaaay back at the start of August, I fixed a bug with +[#9198](https://github.com/npm/npm/pull/9198). That fix made it +so that if you had two modules installed that both installed the +same binary (eg `gulp` & `gulp-cli`), that removing one wouldn't +remove the binary if it was owned by the other. + +It did this by doing some hocus-pocus that, turns out, was +Unix-specific, so on Windows it just threw up its hands and +stopped removing installed binaries at all. Not great. + +So today we're fixing that– it let us maintain the same safety +that we added in #9198, but ALSO works with windows. + +* [`25fbaed`](https://github.com/npm/npm/commit/25fbaed) + [#9394](https://github.com/npm/npm/issues/9394) + Treat cmd-shims the same way we treat symlinks + ([@iarna](https://github.com/iarna)) + +#### API DOCUMENTATION HAS BEEN SACRIFICED THE API GOD + +The documentation of the internal APIs of npm is going away, +because it would lead people into thinking they should integrate +with npm by using it. Please don't do that! In the future, we'd +like to give you a suite of stand alone modules that provide +better, more stand alone APIs for your applications to build on. +But for now, call the npm binary with `process.exec` or +`process.spawn` instead. + +* [`2fb60bf`](https://github.com/npm/npm/commit/2fb60bf) + Remove misleading API documentation + ([@othiym23](https://github.com/othiym23)) + +#### ALLOW `npm link` ON WINDOWS W/ PRERELEASE VERSIONS OF NODE + +We never meant to have this be a restriction in the first place +and it was only just discovered with the recent node 4.0.0 +release candidate. + +* [`6665e54`](https://github.com/npm/npm/commit/6665e54) + [#9505](https://github.com/npm/npm/pull/9505) + Allow npm link to run on windows with prerelease versions of + node + ([@jon-hall](https://github.com/jon-hall)) + +#### graceful-fs update + +We're updating all of npm's deps to use the most recent +`graceful-fs`. This turns out to be important for future not yet +released versions of node, because older versions monkey-patch +`fs` in ways that will break in the future. Plus it ALSO makes +use of `process.binding` which is an internal API that npm +definitely shouldn't have been using. We're not done yet, but +this is the bulk of them. + +* [`e7bc98e`](https://github.com/npm/npm/commit/e7bc98e) + `write-file-atomic@1.1.3` + ([@iarna](https://github.com/iarna)) +* [`7417600`](https://github.com/npm/npm/commit/7417600) + `tar@2.2.1` + ([@zkat](https://github.com/zkat)) +* [`e4e9d40`](https://github.com/npm/npm/commit/e4e9d40) + `read-package-json@2.0.1` + ([@zkat](https://github.com/zkat)) +* [`481611d`](https://github.com/npm/npm/commit/481611d) + `read-installed@4.0.3` + ([@zkat](https://github.com/zkat)) +* [`0dabbda`](https://github.com/npm/npm/commit/0dabbda) + `npm-registry-client@7.0.4` + ([@zkat](https://github.com/zkat)) +* [`c075a91`](https://github.com/npm/npm/commit/c075a91) + `fstream@1.0.8` + ([@zkat](https://github.com/zkat)) +* [`2e4341a`](https://github.com/npm/npm/commit/2e4341a) + `fs-write-stream-atomic@1.0.4` + ([@zkat](https://github.com/zkat)) +* [`18ad16e`](https://github.com/npm/npm/commit/18ad16e) + `fs-vacuum@1.2.7` + ([@zkat](https://github.com/zkat)) + +#### DEPENDENCY UPDATES + +* [`9d6666b`](https://github.com/npm/npm/commit/9d6666b) + `node-gyp@3.0.1` + ([@rvagg](https://github.com/rvagg)) +* [`349c4df`](https://github.com/npm/npm/commit/349c4df) + `retry@0.7.0` + ([@tim-kos](https://github.com/tim-kos)) +* [`f507551`](https://github.com/npm/npm/commit/f507551) + `which@1.1.2` + ([@isaacs](https://github.com/isaacs)) +* [`e5b6743`](https://github.com/npm/npm/commit/e5b6743) + `nopt@3.0.4` + ([@zkat](https://github.com/zkat)) + +#### THE DEPENDENCIES OF OUR DEPENDENCIES ARE OUR DEPENDENCIES UPDATES + +* [`316382d`](https://github.com/npm/npm/commit/316382d) + `mime-types@2.1.6` & `mime-db@1.18.0` +* [`64b741e`](https://github.com/npm/npm/commit/64b741e) + `spdx-correct@1.0.1` +* [`fff62ac`](https://github.com/npm/npm/commit/fff62ac) + `process-nextick-args@1.0.3` +* [`9d6488c`](https://github.com/npm/npm/commit/9d6488c) + `cryptiles@2.0.5` +* [`1912012`](https://github.com/npm/npm/commit/1912012) + `bluebird@2.10.0` +* [`4d09402`](https://github.com/npm/npm/commit/4d09402) + `readdir-scoped-modules@1.0.2` + ### v2.14.4 (2015-09-10): #### THE GREAT NODEv4 SAGA @@ -219,6 +855,41 @@ updates related to this: `nopt@3.0.4`: Minor clarifications to docs about how array and errors work. ([@zkat](https://github.com/zkat)) +### v3.3.2 (2015-09-04): + +#### PLEASE HOLD FOR THE NEXT AVAILABLE MAINTAINER + +This is a tiny little maintenance release, both to update dependencies and to +keep `npm@3` up to date with changes made to `npm@2`. +[@othiym23](https://github.com/othiym23) is putting out this release (again) as +his esteemed colleague [@iarna](https://github.com/iarna) finishes relocating +herself, her family, and her sizable anime collection all the way across North +America. It contains [all the goodies in +`npm@2.14.3`](https://github.com/npm/npm/releases/tag/v2.14.3) and one other +dependency update. + +#### BETA WARNINGS FOR FUN AND PROFIT + +**_THIS IS BETA SOFTWARE_**. `npm@3` will remain in beta until we're +confident that it's stable and have assessed the effect of the breaking +changes on the community. During that time we will still be doing `npm@2` +releases, with `npm@2` tagged as `latest` and `next`. We'll _also_ be +publishing new releases of `npm@3` as `npm@v3.x-next` and `npm@v3.x-latest` +alongside those versions until we're ready to switch everyone over to +`npm@3`. We need your help to find and fix its remaining bugs. It's a +significant rewrite, so we are _sure_ there still significant bugs +remaining. So do us a solid and deploy it in non-critical CI environments +and for day-to-day use, but maybe don't use it for production maintenance or +frontline continuous deployment just yet. + +That said, it's getting there! It will be leaving beta very soon! + +#### ONE OTHER DEPENDENCY UPDATE + +* [`bb5de34`](https://github.com/npm/npm/commit/bb5de3493531228df0bd3f0742d5493c826be6dd) + `is-my-json-valid@2.12.2`: Upgrade to a new, modernized version of + `json-pointer`. ([@mafintosh](https://github.com/mafintosh)) + ### v2.14.3 (2015-09-03): #### TEAMS AND ORGS STILL BETA. CLI CODE STILL SOLID. @@ -261,6 +932,101 @@ No actual dep updates this week, but we're bumping a couple of devDeps: `deep-equal@1.0.1`: Make `null == undefined` in non-strict mode ([@isaacs](https://github.com/isaacs)) +### v3.3.1 (2015-08-27): + +Hi all, this `npm@3` update brings you another round of bug fixes. The +headliner here is that `npm update` works again. We're running down the +clock on blocker 3.x issues! Shortly after that hits zero we'll be +promoting 3.x to latest!! + +And of course, we have changes that were brought forward from 2.x. Check out +the release notes for +[2.14.1](https://github.com/npm/npm/releases/tag/v2.14.1) and +[2.14.2](https://github.com/npm/npm/releases/tag/v2.14.2). + +#### BETA WARNINGS FOR FUN AND PROFIT + +**_THIS IS BETA SOFTWARE_**. `npm@3` will remain in beta until we're +confident that it's stable and have assessed the effect of the breaking +changes on the community. During that time we will still be doing `npm@2` +releases, with `npm@2` tagged as `latest` and `next`. We'll _also_ be +publishing new releases of `npm@3` as `npm@v3.x-next` and `npm@v3.x-latest` +alongside those versions until we're ready to switch everyone over to +`npm@3`. We need your help to find and fix its remaining bugs. It's a +significant rewrite, so we are _sure_ there still significant bugs +remaining. So do us a solid and deploy it in non-critical CI environments +and for day-to-day use, but maybe don't use it for production maintenance or +frontline continuous deployment just yet. + +#### NPM UPDATE, NOW AGAIN YOUR FRIEND + +* [`f130a00`](https://github.com/npm/npm/commit/f130a00) + [#9095](https://github.com/npm/npm/issues/9095) + `npm update` once again works! Previously, after selecting packages + to update, it would then pick the wrong location to run the install + from. ([@iarna](https://github.com/iarna)) + +#### MORE VERBOSING FOR YOUR VERBOSE LIFECYCLES + +* [`d088b7d`](https://github.com/npm/npm/commit/d088b7d) + [#9227](https://github.com/npm/npm/pull/9227) + Add some additional logging at the verbose and silly levels + when running lifecycle scripts. Hopefully this will make + debugging issues with them a bit easier! + ([@saper](https://github.com/saper)) + +#### AND SOME OTHER BUG FIXES… + +* [`f4a5784`](https://github.com/npm/npm/commit/f4a5784) + [#9308](https://github.com/npm/npm/issues/9308) + Make fetching metadata for local modules faster! This ALSO means + that doing things like running `npm repo` won't build your + module and maybe run `prepublish`. + ([@iarna](https://github.com/iarna)) + +* [`4468c92`](https://github.com/npm/npm/commit/4468c92) + [#9205](https://github.com/npm/npm/issues/9205) + Fix a bug where local modules would sometimes not resolve relative + links using the correct base path. + ([@iarna](https://github.com/iarna)) + +* [`d395a6b`](https://github.com/npm/npm/commit/d395a6b) + [#8995](https://github.com/npm/npm/issues/8995) + Certain combinations of packages could result in different install orders for their + initial installation than for reinstalls run on the same folder. + ([@iarna](https://github.com/iarna)) + +* [`d119ea6`](https://github.com/npm/npm/commit/d119ea6) + [#9113](https://github.com/npm/npm/issues/9113) + Make extraneous packages _always_ up in `npm ls`. Previously, if an + extraneous package had a dependency that depended back on the original + package this would result in the package not showing up in `ls`. + ([@iarna](https://github.com/iarna)) + +* [`02420dc`](https://github.com/npm/npm/commit/02420dc) + [#9113](https://github.com/npm/npm/issues/9113) + Stop warning about missing top level package.json files. Errors in said + files will still be reported. + ([@iarna](https://github.com/iarna)) + +#### SOME DEP UPDATES + +* [`1ed1364`](https://github.com/npm/npm/commit/1ed1364) `rimraf@2.4.3` + ([@isaacs](https://github.com/isaacs)) Added EPERM to delay/retry loop +* [`e7b8315`](https://github.com/npm/npm/commit/e7b8315) `read@1.0.7` + Smaller distribution package, better metadata + ([@isaacs](https://github.com/isaacs)) + +#### SOME DEPS OF DEPS UPDATES + +* [`b273bcc`](https://github.com/npm/npm/commit/b273bcc) `mime-types@2.1.5` +* [`df6e225`](https://github.com/npm/npm/commit/df6e225) `mime-db@1.17.0` +* [`785f2ad`](https://github.com/npm/npm/commit/785f2ad) `is-my-json-valid@2.12.1` +* [`88170dd`](https://github.com/npm/npm/commit/88170dd) `form-data@1.0.0-rc3` +* [`af5357b`](https://github.com/npm/npm/commit/af5357b) `request@2.61.0` +* [`337f96a`](https://github.com/npm/npm/commit/337f96a) `chalk@1.1.1` +* [`3dfd74d`](https://github.com/npm/npm/commit/3dfd74d) `async@1.4.2` + ### v2.14.2 (2015-08-27): #### GETTING THAT PESKY `preferGlobal` WARNING RIGHT @@ -402,6 +1168,106 @@ appreciate everybody's patience and understanding tremendously. `request@2.61.0`: Bug fixes and keep-alive tweaks. ([@simov](https://github.com/simov)) +### v3.3.0 (2015-08-13): + +This is a pretty EXCITING week. But I may be a little excitable– or +possibly sleep deprived, it's sometimes hard to tell them apart. =D So +[Kat](https://github.com/zkat) really went the extra mile this week and got +the client side support for teams and orgs out in this week's 2.x release. +You can't use that just yet, 'cause we have to turn on some server side +stuff too, but this way it'll be there for you all the moment we do! Check +out the details over in the [2.14.0 release +notes](https://github.com/npm/npm/releases/tag/v2.14.0)! + +But we over here in 3.x ALSO got a new feature this week, check out the new +`--only` and `--also` flags for better control over when dev and production +dependencies are used by various npm commands. + +That, and some important bug fixes round out this week. Enjoy everyone! + +#### NEVER SHALL NOT BETA THE BETA + +**_THIS IS BETA SOFTWARE_**. EXCITING NEW BETA WARNING!!! Ok, I fibbed, +EXACTLY THE SAME BETA WARNINGS: `npm@3` will remain in beta until we're +confident that it's stable and have assessed the effect of the breaking +changes on the community. During that time we will still be doing `npm@2` +releases, with `npm@2` tagged as `latest` and `next`. We'll _also_ be +publishing new releases of `npm@3` as `npm@v3.x-next` and `npm@v3.x-latest` +alongside those versions until we're ready to switch everyone over to +`npm@3`. We need your help to find and fix its remaining bugs. It's a +significant rewrite, so we are _sure_ there still significant bugs +remaining. So do us a solid and deploy it in non-critical CI environments +and for day-to-day use, but maybe don't use it for production maintenance or +frontline continuous deployment just yet. + +#### ONLY ALSO DEV + +Hey we've got a SUPER cool new feature for you all, thanks to the fantastic +work of [@davglass](https://github.com/davglass) and +[@bengl](https://github.com/bengl) we have `--only=prod`, +`--only=dev`, `--also=prod` and `--also=dev` options. These apply in +various ways to: `npm install`, `npm ls`, `npm outdated` and `npm update`. + +So for instance: + +``` +npm install --only=dev +``` + +Only installs dev dependencies. By contrast: + +``` +npm install --only=prod +``` + +Will only install prod dependencies and is very similar to `--production` +but differs in that it doesn't set the environment variables that +`--production` does. + +The related new flag, `--also` is most useful with things like: + +``` +npm shrinkwrap --also=dev +``` + +As shrinkwraps don't include dev deps by default. This replaces passing in +`--dev` in that scenario. + +And that leads into the fact that this deprecates `--dev` as its semantics +across commands were inconsistent and confusing. + +* [`3ab1eea`](https://github.com/npm/npm/commit/3ab1eea) + [#9024](https://github.com/npm/npm/pull/9024) + Add support for `--only`, `--also` and deprecate `--dev` + ([@bengl](https://github.com/bengl)) + +#### DON'T TOUCH! THAT'S NOT YOUR BIN + +* [`b31812e`](https://github.com/npm/npm/commit/b31812e) + [#8996](https://github.com/npm/npm/pull/8996) + When removing a module that has bin files, if one that we're going to + remove is a symlink to a DIFFERENT module, leave it alone. This only happens + when you have two modules that try to provide the same bin. + ([@iarna](https://github.com/iarna)) + +#### THERE'S AN END IN SIGHT + +* [`d2178a9`](https://github.com/npm/npm/commit/d2178a9) + [#9223](https://github.com/npm/npm/pull/9223) + Close a bunch of infinite loops that could show up with symlink cycles in your dependencies. + ([@iarna](https://github.com/iarna)) + +#### OOPS DIDN'T MEAN TO FIX THAT + +Well, not _just_ yet. This was scheduled for next week, but it snuck into +2.x this week. + +* [`139dd92`](https://github.com/npm/npm/commit/139dd92) + [#8716](https://github.com/npm/npm/pull/8716) + `npm init` will now only pick up the modules you install, not everything + else that got flattened with them. + ([@iarna](https://github.com/iarna)) + ### v2.14.0 (2015-08-13): #### IT'S HERE! KINDA! @@ -455,6 +1321,69 @@ All of these changes were done under [`#9011`](https://github.com/npm/npm/pull/9 around semver range, thus making it valid semver. ([@KenanY](https://github.com/KenanY)) +### v3.2.2 (2015-08-08): + +Lot's of lovely bug fixes for `npm@3`. I'm also suuuuper excited that I +think we have a handle on stack explosions that effect a small portion of +our users. We also have some tantalizing clues as to where some low hanging +fruit may be for performance issues. + +And of course, in addition to the `npm@3` specific bug fixes, there are some +great one's coming in from `npm@2`! [@othiym23](https://github.com/othiym23) +put together that release this week– check out its +[release notes](https://github.com/npm/npm/releases/tag/v2.13.4) for the deets. + +#### AS ALWAYS STILL BETA + +**_THIS IS BETA SOFTWARE_**. Just like the airline safety announcements, +we're not taking this plane off till we finish telling you: `npm@3` will +remain in beta until we're confident that it's stable and have assessed the +effect of the breaking changes on the community. During that time we will +still be doing `npm@2` releases, with `npm@2` tagged as `latest` and `next`. +We'll _also_ be publishing new releases of `npm@3` as `npm@v3.x-next` and +`npm@v3.x-latest` alongside those versions until we're ready to switch +everyone over to `npm@3`. We need your help to find and fix its remaining +bugs. It's a significant rewrite, so we are _sure_ there still significant +bugs remaining. So do us a solid and deploy it in non-critical CI +environments and for day-to-day use, but maybe don't use it for production +maintenance or frontline continuous deployment just yet. + +#### BUG FIXES + +* [`a8c8a13`](https://github.com/npm/npm/commit/a8c8a13) + [#9050](https://github.com/npm/npm/issues/9050) + Resolve peer deps relative to the parent of the requirer + ([@iarna](http://github.com/iarna)) +* [`05f0226`](https://github.com/npm/npm/commit/05f0226) + [#9077](https://github.com/npm/npm/issues/9077) + Fix crash when saving `git+ssh` urls + ([@iarna](http://github.com/iarna)) +* [`e4a3808`](https://github.com/npm/npm/commit/e4a3808) + [#8951](https://github.com/npm/npm/issues/8951) + Extend our patch to allow `*` to match something when a package only has + prerelease versions to everything and not just the cache. + ([@iarna](http://github.com/iarna)) +* [`d135abf`](https://github.com/npm/npm/commit/d135abf) + [#8871](https://github.com/npm/npm/issues/8871) + Don't warn about a missing `package.json` or missing fields in the global + install directory. + ([@iarna](http://github.com/iarna)) + +#### DEP VERSION BUMPS + +* [`990ee4f`](https://github.com/npm/npm/commit/990ee4f) + `path-is-inside@1.0.1` ([@domenic](https://github.com/domenic)) +* [`1f71ec0`](https://github.com/npm/npm/commit/1f71ec0) + `lodash.clonedeep@3.0.2` ([@jdalton](https://github.com/jdalton)) +* [`a091354`](https://github.com/npm/npm/commit/a091354) + `marked@0.3.5` ([@chjj](https://github.com/chjj)) +* [`fc51f28`](https://github.com/npm/npm/commit/fc51f28) + `tap@1.3.2` ([@isaacs](https://github.com/isaacs)) +* [`3569ec0`](https://github.com/npm/npm/commit/3569ec0) + `nock@2.10.0` ([@pgte](https://github.com/pgte)) +* [`ad5f6fd`](https://github.com/npm/npm/commit/ad5f6fd) + `npm-registry-mock@1.0.1` ([@isaacs](https://github.com/isaacs)) + ### v2.13.5 (2015-08-07): This is another quiet week for the `npm@2` release. @@ -505,6 +1434,51 @@ like _you_, which we think is swell. Thanks! * [`4bbc86e`](https://github.com/npm/npm/commit/4bbc86e3825e2eee9a8758ba26bdea0cb6a2581e) `nock@2.10.0` ([@pgte](https://github.com/pgte)) +### v3.2.1 (2015-07-31): + +#### AN EXTRA QUIET RELEASE + +A bunch of stuff got deferred for various reasons, which just means more +branches to land next week! + +Don't forget to check out [Kat's 2.x release](https://github.com/npm/npm/releases/tag/v2.13.4) for other quiet goodies. + +#### AS ALWAYS STILL BETA + +**_THIS IS BETA SOFTWARE_**. Yes, we're still reminding you of this. No, +you can't be excused. `npm@3` will remain in beta until we're confident +that it's stable and have assessed the effect of the breaking changes on the +community. During that time we will still be doing `npm@2` releases, with +`npm@2` tagged as `latest` and `next`. We'll _also_ be publishing new +releases of `npm@3` as `npm@v3.x-next` and `npm@v3.x-latest` alongside those +versions until we're ready to switch everyone over to `npm@3`. We need your +help to find and fix its remaining bugs. It's a significant rewrite, so we +are _sure_ there still significant bugs remaining. So do us a solid and +deploy it in non-critical CI environments and for day-to-day use, but maybe +don't use it for production maintenance or frontline continuous deployment +just yet. + + +#### MAKING OUR TESTS TEST THE THING THEY TEST + +* [`6e53c3d`](https://github.com/npm/npm/commit/6e53c3d) + [#8985](https://github.com/npm/npm/pull/8985) + Many thanks to @bengl for noticing that one of our tests wasn't testing + what it claimed it was testing! ([@bengl](https://github.com/bengl)) + +#### MY PACKAGE.JSON WAS ALREADY IN THE RIGHT ORDER + +* [`eb2c7aa`](https://github.com/npm/npm/commit/d00d0f) + [#9068](https://github.com/npm/npm/pull/9079) + Stop sorting keys in the `package.json` that we haven't edited. Many + thanks to [@Qix-](https://github.com/Qix-) for bringing this up and + providing a first pass at a patch for this. + ([@iarna](https://github.com/iarna)) + +#### DEV DEP UPDATE + +* [`555f60c`](https://github.com/npm/npm/commit/555f60c) `marked@0.3.4` + ### v2.13.4 (2015-07-30): #### JULY ENDS ON A FAIRLY QUIET NOTE @@ -533,9 +1507,106 @@ So here it is. The patch. Hope it helps. (Thanks, Hooray. * [`d204683`](https://github.com/npm/npm/commit/d2046839d471322e61e3ceb0f00e78e5c481f967) - nock@2.9.1 + `nock@2.9.1` ([@pgte](https://github.com/pgte)) +### v3.2.0 (2015-07-24): + +#### MORE CONFIG, BETTER WINDOWS AND A BUG FIX + +This is a smallish release with a new config option and some bug fixes. And +lots of module updates. + +#### BETA BETAS ON + +**_THIS IS BETA SOFTWARE_**. Yes, we're still reminding you of this. No, +you can't be excused. `npm@3` will remain in beta until we're confident +that it's stable and have assessed the effect of the breaking changes on the +community. During that time we will still be doing `npm@2` releases, with +`npm@2` tagged as `latest` and `next`. We'll _also_ be publishing new +releases of `npm@3` as `npm@v3.x-next` and `npm@v3.x-latest` alongside those +versions until we're ready to switch everyone over to `npm@3`. We need your +help to find and fix its remaining bugs. It's a significant rewrite, so we +are _sure_ there still significant bugs remaining. So do us a solid and +deploy it in non-critical CI environments and for day-to-day use, but maybe +don't use it for production maintenance or frontline continuous deployment +just yet. + + +#### NEW CONFIGS, LESS PROGRESS + +* [`423d8f7`](https://github.com/npm/npm/commit/423d8f7) + [#8704](https://github.com/npm/npm/issues/8704) + Add the ability to disable the new progress bar with `--no-progress` + ([@iarna](https://github.com/iarna)) + +#### AND BUG FIXES + +* [`b3ee452`](https://github.com/npm/npm/commit/b3ee452) + [#9038](https://github.com/npm/npm/pull/9038) + We previously disabled the use of the new `fs.access` API on Windows, but + the bug we were seeing is fixed in `io.js@1.5.0` so we now use `fs.access` + if you're using that version or greater. + ([@iarna](https://github.com/iarna)) + +* [`b181fa3`](https://github.com/npm/npm/commit/b181fa3) + [#8921](https://github.com/npm/npm/issues/8921) + [#8637](https://github.com/npm/npm/issues/8637) + Rejigger how we validate modules for install. This allow is to fix + a problem where arch/os checking wasn't being done at all. + It also made it easy to add back in a check that declines to + install a module in itself unless you force it. + ([@iarna](https://github.com/iarna)) + +#### AND A WHOLE BUNCH OF SUBDEP VERSIONS + +These are all development dependencies and semver-compatible subdep +upgrades, so they should not have visible impact on users. + +* [`6b3f6d9`](https://github.com/npm/npm/commit/6b3f6d9) `standard@4.3.3` +* [`f4e22e5`](https://github.com/npm/npm/commit/f4e22e5) `readable-stream@2.0.2` (inside concat-stream) +* [`f130bfc`](https://github.com/npm/npm/commit/f130bfc) `minimatch@2.0.10` (inside node-gyp's copy of glob) +* [`36c6a0d`](https://github.com/npm/npm/commit/36c6a0d) `caseless@0.11.0` +* [`80df59c`](https://github.com/npm/npm/commit/80df59c) `chalk@1.1.0` +* [`ea935d9`](https://github.com/npm/npm/commit/ea935d9) `bluebird@2.9.34` +* [`3588a0c`](https://github.com/npm/npm/commit/3588a0c) `extend@3.0.0` +* [`c6a8450`](https://github.com/npm/npm/commit/c6a8450) `form-data@1.0.0-rc2` +* [`a04925b`](https://github.com/npm/npm/commit/a04925b) `har-validator@1.8.0` +* [`ee7c095`](https://github.com/npm/npm/commit/ee7c095) `has-ansi@2.0.0` +* [`944fc34`](https://github.com/npm/npm/commit/944fc34) `hawk@3.1.0` +* [`783dc7b`](https://github.com/npm/npm/commit/783dc7b) `lodash._basecallback@3.3.1` +* [`acef0fe`](https://github.com/npm/npm/commit/acef0fe) `lodash._baseclone@3.3.0` +* [`dfe959a`](https://github.com/npm/npm/commit/dfe959a) `lodash._basedifference@3.0.3` +* [`a03bc76`](https://github.com/npm/npm/commit/a03bc76) `lodash._baseflatten@3.1.4` +* [`8a07d50`](https://github.com/npm/npm/commit/8a07d50) `lodash._basetostring@3.0.1` +* [`7785e3f`](https://github.com/npm/npm/commit/7785e3f) `lodash._baseuniq@3.0.3` +* [`826fb35`](https://github.com/npm/npm/commit/826fb35) `lodash._createcache@3.1.2` +* [`76030b3`](https://github.com/npm/npm/commit/76030b3) `lodash._createpadding@3.6.1` +* [`1a49ec6`](https://github.com/npm/npm/commit/1a49ec6) `lodash._getnative@3.9.1` +* [`eebe47f`](https://github.com/npm/npm/commit/eebe47f) `lodash.isarguments@3.0.4` +* [`09994d4`](https://github.com/npm/npm/commit/09994d4) `lodash.isarray@3.0.4` +* [`b6f8dbf`](https://github.com/npm/npm/commit/b6f8dbf) `lodash.keys@3.1.2` +* [`c67dd6b`](https://github.com/npm/npm/commit/c67dd6b) `lodash.pad@3.1.1` +* [`4add042`](https://github.com/npm/npm/commit/4add042) `lodash.repeat@3.0.1` +* [`e04993c`](https://github.com/npm/npm/commit/e04993c) `lru-cache@2.6.5` +* [`2ed7da4`](https://github.com/npm/npm/commit/2ed7da4) `mime-db@1.15.0` +* [`ae08244`](https://github.com/npm/npm/commit/ae08244) `mime-types@2.1.3` +* [`e71410e`](https://github.com/npm/npm/commit/e71410e) `os-homedir@1.0.1` +* [`67c13e0`](https://github.com/npm/npm/commit/67c13e0) `process-nextick-args@1.0.2` +* [`12ee041`](https://github.com/npm/npm/commit/12ee041) `qs@4.0.0` +* [`15564a6`](https://github.com/npm/npm/commit/15564a6) `spdx-license-ids@1.0.2` +* [`8733bff`](https://github.com/npm/npm/commit/8733bff) `supports-color@2.0.0` +* [`230943c`](https://github.com/npm/npm/commit/230943c) `tunnel-agent@0.4.1` +* [`26a4653`](https://github.com/npm/npm/commit/26a4653) `ansi-styles@2.1.0` +* [`3d27081`](https://github.com/npm/npm/commit/3d27081) `bl@1.0.0` +* [`9efa110`](https://github.com/npm/npm/commit/9efa110) `async@1.4.0` + +#### MERGED FORWARD + +* As usual, we've ported all the `npm@2` goodies in this week's + [v2.13.3](https://github.com/npm/npm/releases/tag/v2.13.3) + release. + ### v2.13.3 (2015-07-23): #### I'M SAVING THE GOOD JOKES FOR MORE INTERESTING RELEASES @@ -635,6 +1706,79 @@ And some other version bumps for good measure. Fixes this thing where Kat decided to save `nock` as a regular dependency ;) ([@othiym23](https://github.com/othiym23)) +### v3.1.3 (2015-07-17): + +Rebecca: So Kat, I hear this week's other release uses a dialog between us to +explain what changed? + +Kat: Well, you could say that… + +Rebecca: I would! This week I fixed more `npm@3` bugs! + +Kat: That sounds familiar. + +Rebecca: Eheheheh, well, before we look at those, a word from our sponsor… + +#### BETA IS AS BETA DOES + +**_THIS IS BETA SOFTWARE_**. Yes, we're still reminding you of this. No, +you can't be excused. `npm@3` will remain in beta until we're confident +that it's stable and have assessed the effect of the breaking changes on the +community. During that time we will still be doing `npm@2` releases, with +`npm@2` tagged as `latest` and `next`. We'll _also_ be publishing new +releases of `npm@3` as `npm@v3.x-next` and `npm@v3.x-latest` alongside those +versions until we're ready to switch everyone over to `npm@3`. We need your +help to find and fix its remaining bugs. It's a significant rewrite, so we +are _sure_ there still significant bugs remaining. So do us a solid and +deploy it in non-critical CI environments and for day-to-day use, but maybe +don't use it for production maintenance or frontline continuous deployment +just yet. + +Rebecca: Ok, enough of the dialoguing, that's Kat's schtick. But do remember +kids, betas hide in dark hallways waiting to break your stuff, stuff like… + +#### SO MANY LINKS YOU COULD MAKE A CHAIN + +* [`6d69ec9`](https://github.com/npm/npm/6d69ec9) + [#8967](https://github.com/npm/npm/issues/8967) + Removing a module linked into your globals would result in having + all of its subdeps removed. Since the npm release process does + exactly this, it burned me -every- -single- -week-. =D + While we're here, we also removed extraneous warns that used to + spill out when you'd remove a symlink. + ([@iarna](https://github.com/iarna)) + +* [`fdb360f`](https://github.com/npm/npm/fdb360f) + [#8874](https://github.com/npm/npm/issues/8874) + Linking scoped modules was failing outright, but this fixes that + and updates our tests so we don't do it again. + ([@iarna](https://github.com/iarna)) + +#### WE'LL TRY NOT TO CRACK YOUR WINDOWS + +* [`9fafb18`](https://github.com/npm/npm/9fafb18) + [#8701](https://github.com/npm/npm/issues/8701) + `npm@3` introduced permissions checks that run before it actually tries to + do something. This saves you from having an install fail half way + through. We did this using the shiny new `fs.access` function available + in `node 0.12` and `io.js`, with fallback options for older nodes. Unfortunately + the way we implemented the fallback caused racey problems for Windows systems. + This fixes that by ensuring we only ever run any one check on a directory once. + BUT it turns out there are bugs in `fs.access` on Windows. So this ALSO just disables + the use of `fs.access` on Windows entirely until that settles out. + ([@iarna](https://github.com/iarna)) + +#### ZOOM ZOOM, DEP UPDATES + +* [`5656baa`](https://github.com/npm/npm/5656baa) + `gauge@1.2.2`: Better handle terminal resizes while printing the progress bar + ([@iarna](https://github.com/iarna)) + +#### MERGED FORWARD + +* Check out Kat's [super-fresh release notes for v2.13.2](https://github.com/npm/npm/releases/tag/v2.13.2) + and see all the changes we ported from `npm@2`. + ### v2.13.2 (2015-07-16): #### HOLD ON TO YOUR TENTACLES... IT'S NPM RELEASE TIME! @@ -708,6 +1852,92 @@ Both: Stay Freeesh~ `node-gyp@2.0.2`: Fixes an issue with long paths on Win32 ([@TooTallNate](https://github.com/TooTallNate)) +### v3.1.2 + +#### SO VERY BETA RELEASE + +So, `v3.1.1` managed to actually break installing local modules. And then +immediately after I drove to an island for the weekend. 😁 So let's get +this fixed outside the usual release train! + +Fortunately it didn't break installing _global_ modules and so you could +swap it out for another version at least. + +#### DISCLAIMER MEANS WHAT IT SAYS + +**_THIS IS BETA SOFTWARE_**. Yes, we're still reminding you of this. No, +you can't be excused. `npm@3` will remain in beta until we're confident +that it's stable and have assessed the effect of the breaking changes on the +community. During that time we will still be doing `npm@2` releases, with +`npm@2` tagged as `latest` and `next`. We'll _also_ be publishing new +releases of `npm@3` as `npm@v3.x-next` and `npm@v3.x-latest` alongside those +versions until we're ready to switch everyone over to `npm@3`. We need your +help to find and fix its remaining bugs. It's a significant rewrite, so we +are _sure_ there still significant bugs remaining. So do us a solid and +deploy it in non-critical CI environments and for day-to-day use, but maybe +don't use it for production maintenance or frontline continuous deployment +just yet. + +#### THIS IS IT, THE REASON + +* [`f5e19df`](https://github.com/npm/npm/commit/f5e19df) + [#8893](https://github.com/npm/npm/issues/8893) + Fix crash when installing local modules introduced by the fix for + [#8608](https://github.com/npm/npm/issues/8608) + ([@iarna](https://github.com/iarna) + +### v3.1.1 + +#### RED EYE RELEASE + +Rebecca's up too late writing tests, so you can have `npm@3` bug fixes! Lots +of great new issues from you all! ❤️️ Keep it up! + +#### YUP STILL BETA, PLEASE PAY ATTENTION + +**_THIS IS BETA SOFTWARE_**. Yes, we're still reminding you of this. No, +you can't be excused. `npm@3` will remain in beta until we're confident +that it's stable and have assessed the effect of the breaking changes on the +community. During that time we will still be doing `npm@2` releases, with +`npm@2` tagged as `latest` and `next`. We'll _also_ be publishing new +releases of `npm@3` as `npm@v3.x-next` and `npm@v3.x-latest` alongside those +versions until we're ready to switch everyone over to `npm@3`. We need your +help to find and fix its remaining bugs. It's a significant rewrite, so we +are _sure_ there still significant bugs remaining. So do us a solid and +deploy it in non-critical CI environments and for day-to-day use, but maybe +don't use it for production maintenance or frontline continuous deployment +just yet. + +#### BOOGS + +* [`9badfd6`](https://github.com/npm/npm/commit/9babfd63f19f2d80b2d2624e0963b0bdb0d76ef4) + [#8608](https://github.com/npm/npm/issues/8608) + Make global installs and uninstalls MUCH faster by only reading the directories of + modules referred to by arguments. + ([@iarna](https://github.com/iarna) +* [`075a5f0`](https://github.com/npm/npm/commit/075a5f046ab6837f489b08d44cb601e9fdb369b7) + [#8660](https://github.com/npm/npm/issues/8660) + Failed optional deps would still result in the optional deps own + dependencies being installed. We now find them and fail them out of the + tree. + ([@iarna](https://github.com/iarna) +* [`c9fbbb5`](https://github.com/npm/npm/commit/c9fbbb540083396ea58fd179d81131d959d8e049) + [#8863](https://github.com/npm/npm/issues/8863) + The "no compatible version found" error message was including only the + version requested, not the name of the package we wanted. Ooops! + ([@iarna](https://github.com/iarna) +* [`32e6bbd`](https://github.com/npm/npm/commit/32e6bbd21744dcbe8c0720ab53f60caa7f2a0588) + [#8806](https://github.com/npm/npm/issues/8806) + The "uninstall" lifecycle was being run after all of a module's dependencies has been + removed. This reverses that order-- this means "uninstall" lifecycles can make use + of the package's dependencies. + ([@iarna](https://github.com/iarna) + +#### MERGED FORWARD + +* Check out the [v2.13.1 release notes](https://github.com/npm/npm/releases/tag/v2.13.1) + and see all the changes we ported from `npm@2`. + ### v2.13.1 (2015-07-09): #### KAUAI WAS NICE. I MISS IT. @@ -758,6 +1988,120 @@ updated at their own pace. * [`b168e33`](https://github.com/npm/npm/commit/b168e33ad46faf47020a45f72ba8cec8c644bdb9) undeduplicate `strip-ansi` ([@othiym23](https://github.com/othiym23)) +### v3.1.0 (2015-07-02): + +This has been a brief week of bug fixes, plus some fun stuff merged forward +from this weeks 2.x release. See the +[2.13.0 release notes](https://github.com/npm/npm/releases/tag/v2.13.0) +for details on that. + +You all have been AWESOME with +[all](https://github.com/npm/npm/milestones/3.x) +[the](https://github.com/npm/npm/milestones/3.2.0) +`npm@3` bug reports! Thank you and keep up the great work! + +#### NEW PLACE, SAME CODE + +Remember how last week we said `npm@3` would go to `3.0-next` and latest +tags? Yeaaah, no, please use `npm@v3.x-next` and `npm@v3.x-latest` going forward. + +I dunno why we said "suuure, we'll never do a feature release till we're out +of beta" when we're still forward porting `npm@2.x` features. `¯\_(ツ)_/¯` + +If you do accidentally use the old tag names, I'll be maintaining them +for a few releases, but they won't be around forever. + +#### YUP STILL BETA, PLEASE PAY ATTENTION + +**_THIS IS BETA SOFTWARE_**. `npm@3` will remain in beta until we're +confident that it's stable and have assessed the effect of the breaking +changes on the community. During that time we will still be doing `npm@2` +releases, with `npm@2` tagged as `latest` and `next`. We'll _also_ be +publishing new releases of `npm@3` as `npm@v3.x-next` and `npm@v3.x-latest` +alongside those versions until we're ready to switch everyone over to +`npm@3`. We need your help to find and fix its remaining bugs. It's a +significant rewrite, so we are _sure_ there still significant bugs +remaining. So do us a solid and deploy it in non-critical CI environments +and for day-to-day use, but maybe don't use it for production maintenance +or frontline continuous deployment just yet. + +#### BUGS ON THE WINDOWS + + * [`0030ade`](https://github.com/npm/npm/commit/0030ade) + [#8685](https://github.com/npm/npm/issues/8685) + Windows would hang when trying to clone git repos + ([@euprogramador](https://github.com/npm/npm/pull/8777)) + * [`b259bcc`](https://github.com/npm/npm/commit/b259bcc) + [#8786](https://github.com/npm/npm/pull/8786) + Windows permissions checks would cause installations to fail under some + circumstances. We're disabling the checks entirely for this release. + I'm hoping to check back with this next week to get a Windows friendly + fix in. + ([@iarna](https://github.com/iarna)) + +#### SO MANY BUGS SQUASHED, JUST CALL US RAID + + * [`0848698`](https://github.com/npm/npm/commit/0848698) + [#8686](https://github.com/npm/npm/pull/8686) + Stop leaving progress bar cruft on the screen during publication + ([@ajcrites](https://github.com/ajcrites)) + * [`57c3cea`](https://github.com/npm/npm/commit/57c3cea) + [#8695](https://github.com/npm/npm/pull/8695) + Remote packages with shrinkwraps made npm cause node + iojs to explode + and catch fire. NO MORE. + ([@iarna](https://github.com/iarna)) + * [`2875ba3`](https://github.com/npm/npm/commit/2875ba3) + [#8723](https://github.com/npm/npm/pull/8723) + I uh, told you that engineStrict checking had gone away last week. + TURNS OUT I LIED. So this is making that actually be true. + ([@iarna](https://github.com/iarna)) + * [`28064e5`](https://github.com/npm/npm/commit/28064e5) + [#3358](https://github.com/npm/npm/issues/3358) + Consistently allow Unicode BOMs at the start of package.json files. + Previously this was allowed some of time, like when you were installing + modules, but not others, like running npm version or installing w/ + `--save`. + ([@iarna](https://github.com/iarna)) + * [`3cb6ad2`](https://github.com/npm/npm/commit/3cb6ad2) + [#8736](https://github.com/npm/npm/issues/8766) + `npm@3` wasn't running the "install" lifecycle in your current (toplevel) + module. This broke modules that relied on C compilation. BOO. + ([@iarna](https://github.com/iarna)) + * [`68da583`](https://github.com/npm/npm/commit/68da583) + [#8766](https://github.com/npm/npm/issues/8766) + To my great shame, `npm link package` wasn't working AT ALL if you + didn't have `package` already installed. + ([@iarna](https://github.com/iarna)) + * [`edd7448`](https://github.com/npm/npm/commit/edd7448) + `read-package-tree@5.0.0`: This update makes read-package-tree not explode + when there's bad data in your node_modules folder. `npm@2` silently + ignores this sort of thing. + ([@iarna](https://github.com/iarna)) + * [`0bb08c8`](https://github.com/npm/npm/commit/0bb08c8) + [#8778](https://github.com/npm/npm/pull/8778) + RELATEDLY, we now show any errors from your node_modules folder after + your installation completes as warnings. We're also reporting these in + `npm ls` now. + ([@iarna](https://github.com/iarna)) + * [`6c248ff`](https://github.com/npm/npm/commit/6c248ff) + [#8779](https://github.com/npm/npm/pull/8779) + Hey, you know how we used to complain if your `package.json` was + missing stuff? Well guess what, we are again. I know, I know, you can + thank me later. + ([@iarna](https://github.com/iarna)) + * [`d6f7c98`](https://github.com/npm/npm/commit/d6f7c98) + So, when we were rolling back after errors we had untested code that + tried to undo moves. Being untested it turns out it was very broken. + I've removed it until we have time to do this right. + ([@iarna](https://github.com/iarna)) + +#### NEW VERSION + +Just the one. Others came in via the 2.x release. Do check out its +changelog, immediately following this message. + + * [`4e602c5`](https://github.com/npm/npm/commit/4e602c5) `lodash@3.2.2` + ### v2.13.0 (2015-07-02): #### FORREST IS OUT! LET'S SNEAK IN ALL THE THINGS! @@ -918,6 +2262,311 @@ with this fix. * [`151904a`](https://github.com/npm/npm/commit/151904af39dc24567f8c98529a2a64a4dbcc960a) `nopt@3.0.3` ([@isaacs](https://github.com/isaacs)) +### v3.0.0 (2015-06-25): + +Wow, it's finally here! This has been a long time coming. We are all +delighted and proud to be getting this out into the world, and are looking +forward to working with the npm user community to get it production-ready +as quickly as possible. + +`npm@3` constitutes a nearly complete rewrite of npm's installer to be +easier to maintain, and to bring a bunch of valuable new features and +design improvements to you all. + +[@othiym23](https://github.com/othiym23) and +[@isaacs](https://github.com/isaacs) have been +[talking about the changes](http://blog.npmjs.org/post/91303926460/npm-cli-roadmap-a-periodic-update) +in this release for well over a year, and it's been the primary focus of +[@iarna](https://github.com/iarna) since she joined the team. + +Given that this is a near-total rewrite, all changes listed here are +[@iarna](https://github.com/iarna)'s work unless otherwise specified. + +#### NO, REALLY, READ THIS PARAGRAPH. IT'S THE IMPORTANT ONE. + +**_THIS IS BETA SOFTWARE_**. `npm@3` will remain in beta until we're +confident that it's stable and have assessed the effect of the breaking +changes on the community. During that time we will still be doing `npm@2` +releases, with `npm@2` tagged as `latest` and `next`. We'll _also_ be +publishing new releases of `npm@3` as `npm@3.0-next` and `npm@3.0-latest` +alongside those versions until we're ready to switch everyone over to +`npm@3`. We need your help to find and fix its remaining bugs. It's a +significant rewrite, so we are _sure_ there still significant bugs +remaining. So do us a solid and deploy it in non-critical CI environments +and for day-to-day use, but maybe don't use it for production maintenance +or frontline continuous deployment just yet. + +#### BREAKING CHANGES + +##### `peerDependencies` + +`grunt`, `gulp`, and `broccoli` plugin maintainers take note! You will be +affected by this change! + +* [#6930](https://github.com/npm/npm/issues/6930) + ([#6565](https://github.com/npm/npm/issues/6565)) + `peerDependencies` no longer cause _anything_ to be implicitly installed. + Instead, npm will now warn if a packages `peerDependencies` are missing, + but it's up to the consumer of the module (i.e. you) to ensure the peers + get installed / are included in `package.json` as direct `dependencies` + or `devDependencies` of your package. +* [#3803](https://github.com/npm/npm/issues/3803) + npm also no longer checks `peerDependencies` until after it has fully + resolved the tree. + +This shifts the responsibility for fulfilling peer dependencies from library +/ framework / plugin maintainers to application authors, and is intended to +get users out of the dependency hell caused by conflicting `peerDependency` +constraints. npm's job is to keep you _out_ of dependency hell, not put you +in it. + +##### `engineStrict` + +* [#6931](https://github.com/npm/npm/issues/6931) The rarely-used + `package.json` option `engineStrict` has been deprecated for several + months, producing warnings when it was used. Starting with `npm@3`, the + value of the field is ignored, and engine violations will only produce + warnings. If you, as a user, want strict `engines` field enforcement, + just run `npm config set engine-strict true`. + +As with the peer dependencies change, this is about shifting control from +module authors to application authors. It turns out `engineStrict` was very +difficult to understand even harder to use correctly, and more often than +not just made modules using it difficult to deploy. + +##### `npm view` + +* [`77f1aec`](https://github.com/npm/npm/commit/77f1aec) With `npm view` (aka + `npm info`), always return arrays for versions, maintainers, etc. Previously + npm would return a plain value if there was only one, and multiple values if + there were more. ([@KenanY](https://github.com/KenanY)) + +#### KNOWN BUGS + +Again, this is a _**BETA RELEASE**_, so not everything is working just yet. +Here are the issues that we already know about. If you run into something +that isn't on this list, +[let us know](https://github.com/npm/npm/issues/new)! + +* [#8575](https://github.com/npm/npm/issues/8575) + Circular deps will never be removed by the prune-on-uninstall code. +* [#8588](https://github.com/npm/npm/issues/8588) + Local deps where the dep name and the name in the package.json differ + don't result in an error. +* [#8637](https://github.com/npm/npm/issues/8637) + Modules can install themselves as direct dependencies. `npm@2` declined to + do this. +* [#8660](https://github.com/npm/npm/issues/8660) + Dependencies of failed optional dependencies aren't rolled back when the + optional dependency is, and then are reported as extraneous thereafter. + +#### NEW FEATURES + +##### The multi-stage installer! + +* [#5919](https://github.com/npm/npm/issues/5919) + Previously the installer had a set of steps it executed for each package + and it would immediately start executing them as soon as it decided to + act on a package. + + But now it executes each of those steps at the same time for all + packages, waiting for all of one stage to complete before moving on. This + eliminates many race conditions and makes the code easier to reason + about. + +This fixes, for instance: + +* [#6926](https://github.com/npm/npm/issues/6926) + ([#5001](https://github.com/npm/npm/issues/5001), + [#6170](https://github.com/npm/npm/issues/6170)) + `install` and `postinstall` lifecycle scripts now only execute `after` + all the module with the script's dependencies are installed. + +##### Install: it looks different! + +You'll now get a tree much like the one produced by `npm ls` that +highlights in orange the packages that were installed. Similarly, any +removed packages will have their names prefixed by a `-`. + +Also, `npm outdated` used to include the name of the module in the +`Location` field: + +``` +Package Current Wanted Latest Location +deep-equal MISSING 1.0.0 1.0.0 deep-equal +glob 4.5.3 4.5.3 5.0.10 rimraf > glob +``` + +Now it shows the module that required it as the final point in the +`Location` field: + +``` +Package Current Wanted Latest Location +deep-equal MISSING 1.0.0 1.0.0 npm +glob 4.5.3 4.5.3 5.0.10 npm > rimraf +``` + +Previously the `Location` field was telling you where the module was on +disk. Now it tells you what requires the module. When more than one thing +requires the module you'll see it listed once for each thing requiring it. + +##### Install: it works different! + +* [#6928](https://github.com/npm/npm/issues/6928) + ([#2931](https://github.com/npm/npm/issues/2931) + [#2950](https://github.com/npm/npm/issues/2950)) + `npm install` when you have an `npm-shrinkwrap.json` will ensure you have + the modules specified in it are installed in exactly the shape specified + no matter what you had when you started. +* [#6913](https://github.com/npm/npm/issues/6913) + ([#1341](https://github.com/npm/npm/issues/1341) + [#3124](https://github.com/npm/npm/issues/3124) + [#4956](https://github.com/npm/npm/issues/4956) + [#6349](https://github.com/npm/npm/issues/6349) + [#5465](https://github.com/npm/npm/issues/5465)) + `npm install` when some of your dependencies are missing sub-dependencies + will result in those sub-dependencies being installed. That is, `npm + install` now knows how to fix broken installs, most of the time. +* [#5465](https://github.com/npm/npm/issues/5465) + If you directly `npm install` a module that's already a subdep of + something else and your new version is incompatible, it will now install + the previous version nested in the things that need it. +* [`a2b50cf`](https://github.com/npm/npm/commit/a2b50cf) + [#5693](https://github.com/npm/npm/issues/5693) + When installing a new module, if it's mentioned in your + `npm-shrinkwrap.json` or your `package.json` use the version specifier + from there if you didn't specify one yourself. + +##### Flat, flat, flat! + +Your dependencies will now be installed *maximally flat*. Insofar as is +possible, all of your dependencies, and their dependencies, and THEIR +dependencies will be installed in your project's `node_modules` folder with no +nesting. You'll only see modules nested underneath one another when two (or +more) modules have conflicting dependencies. + +* [#3697](https://github.com/npm/npm/issues/3697) + This will hopefully eliminate most cases where windows users ended up + with paths that were too long for Explorer and other standard tools to + deal with. +* [#6912](https://github.com/npm/npm/issues/6912) + ([#4761](https://github.com/npm/npm/issues/4761) + [#4037](https://github.com/npm/npm/issues/4037)) + This also means that your installs will be deduped from the start. +* [#5827](https://github.com/npm/npm/issues/5827) + This deduping even extends to git deps. +* [#6936](https://github.com/npm/npm/issues/6936) + ([#5698](https://github.com/npm/npm/issues/5698)) + Various commands are dedupe aware now. + +This has some implications for the behavior of other commands: + +* `npm uninstall` removes any dependencies of the module that you specified + that aren't required by any other module. Previously, it would only + remove those that happened to be installed under it, resulting in left + over cruft if you'd ever deduped. +* `npm ls` now shows you your dependency tree organized around what + requires what, rather than where those modules are on disk. +* [#6937](https://github.com/npm/npm/issues/6937) + `npm dedupe` now flattens the tree in addition to deduping. + +And bundling of dependencies when packing or publishing changes too: + +* [#2442](https://github.com/npm/npm/issues/2442) + bundledDependencies no longer requires that you specify deduped sub deps. + npm can now see that a dependency is required by something bundled and + automatically include it. To put that another way, bundledDependencies + should ONLY include things that you included in dependencies, + optionalDependencies or devDependencies. +* [#5437](https://github.com/npm/npm/issues/5437) + When bundling a dependency that's both a `devDependency` and the child of + a regular `dependency`, npm bundles the child dependency. + +As a demonstration of our confidence in our own work, npm's own +dependencies are now flattened, deduped, and bundled in the `npm@3` style. +This means that `npm@3` can't be packed or published by `npm@2`, which is +something to be aware of if you're hacking on npm. + +##### Shrinkwraps: they are a-changin'! + +First of all, they should be idempotent now +([#5779](https://github.com/npm/npm/issues/5779)). No more differences +because the first time you install (without `npm-shrinkwrap.json`) and the +second time (with `npm-shrinkwrap.json`). + +* [#6781](https://github.com/npm/npm/issues/6781) + Second, if you save your changes to `package.json` and you have + `npm-shrinkwrap.json`, then it will be updated as well. This applies to + all of the commands that update your tree: + * `npm install --save` + * `npm update --save` + * `npm dedupe --save` ([#6410](https://github.com/npm/npm/issues/6410)) + * `npm uninstall --save` +* [#4944](https://github.com/npm/npm/issues/4944) + ([#5161](https://github.com/npm/npm/issues/5161) + [#5448](https://github.com/npm/npm/issues/5448)) + Third, because `node_modules` folders are now deduped and flat, + shrinkwrap has to also be smart enough to handle this. + +And finally, enjoy this shrinkwrap bug fix: + +* [#3675](https://github.com/npm/npm/issues/3675) + When shrinkwrapping a dependency that's both a `devDependency` and the + child of a regular `dependency`, npm now correctly includes the child. + +##### The Age of Progress (Bars)! + +* [#6911](https://github.com/npm/npm/issues/6911) + ([#1257](https://github.com/npm/npm/issues/1257) + [#5340](https://github.com/npm/npm/issues/5340) + [#6420](https://github.com/npm/npm/issues/6420)) + The spinner is gone (yay? boo? will you miss it?), and in its place npm + has _progress bars_, so you actually have some sense of how long installs + will take. It's provided in Unicode and non-Unicode variants, and Unicode + support is automatically detected from your environment. + +#### TINY JEWELS + +The bottom is where we usually hide the less interesting bits of each +release, but each of these are small but incredibly useful bits of this +release, and very much worth checking out: + +* [`9ebe312`](https://github.com/npm/npm/commit/9ebe312) + Build system maintainers, rejoice: npm does a better job of cleaning up + after itself in your temporary folder. +* [#6942](https://github.com/npm/npm/issues/6942) + Check for permissions issues prior to actually trying to install + anything. +* Emit warnings at the end of the installation when possible, so that + they'll be on your screen when npm stops. +* [#3505](https://github.com/npm/npm/issues/3505) + `npm --dry-run`: You can now ask that npm only report what it _would have + done_ with the new `--dry-run` flag. This can be passed to any of the + commands that change your `node_modules` folder: `install`, `uninstall`, + `update` and `dedupe`. +* [`81b46fb`](https://github.com/npm/npm/commit/81b46fb) + npm now knows the correct URLs for `npm bugs` and `npm repo` for + repositories hosted on Bitbucket and GitLab, just like it does for GitHub + (and GitHub support now extends to projects hosted as gists as well as + traditional repositories). +* [`5be4008a`](https://github.com/npm/npm/commit/5be4008a09730cfa3891d9f145e4ec7f2accd144) + npm has been cleaned up to pass the [`standard`](http://npm.im/standard) + style checker. Forrest and Rebecca both feel this makes it easier to read + and understand the code, and should also make it easier for new + contributors to put merge-ready patches. + ([@othiym23](https://github.com/othiym23)) + +#### ZARRO BOOGS + +* [`6401643`](https://github.com/npm/npm/commit/6401643) + Make sure the global install directory exists before installing to it. + ([@thefourtheye](https://github.com/thefourtheye)) +* [#6158](https://github.com/npm/npm/issues/6158) + When we remove modules we do so inside-out running unbuild for each one. +* [`960a765`](https://github.com/npm/npm/commit/960a765) + The short usage information for each subcommand has been brought in sync + with the documentation. ([@smikes](https://github.com/smikes)) + ### v2.12.0 (2015-06-18): #### REMEMBER WHEN I SAID THAT THING ABOUT PERMISSIONS? diff --git a/deps/npm/LICENSE b/deps/npm/LICENSE index b6e3548d19ccc9..ab28d1e223fb8b 100644 --- a/deps/npm/LICENSE +++ b/deps/npm/LICENSE @@ -251,11 +251,11 @@ details. 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. -"npm Logo" created by Mathias Pettersson and Brian Hammond, -used with permission. +"npm Logo" contributed by Mathias Pettersson and Brian Hammond, +use is subject to https://www.npmjs.com/policies/trademark "Gubblebum Blocky" font -Copyright (c) by Tjarda Koster, http://jelloween.deviantart.com +Copyright (c) by Tjarda Koster, https://jelloween.deviantart.com included for use in the npm website and documentation, used with permission. diff --git a/deps/npm/Makefile b/deps/npm/Makefile index 34e40624b5aee6..abdac9ceb70a56 100644 --- a/deps/npm/Makefile +++ b/deps/npm/Makefile @@ -16,10 +16,6 @@ cli_mandocs = $(shell find doc/cli -name '*.md' \ |sed 's|doc/cli/|man/man1/|g' ) \ man/man1/npm-README.1 -api_mandocs = $(shell find doc/api -name '*.md' \ - |sed 's|.md|.3|g' \ - |sed 's|doc/api/|man/man3/|g' ) - files_mandocs = $(shell find doc/files -name '*.md' \ |sed 's|.md|.5|g' \ |sed 's|doc/files/|man/man5/|g' ) \ @@ -36,10 +32,6 @@ cli_htmldocs = $(shell find doc/cli -name '*.md' \ |sed 's|doc/cli/|html/doc/cli/|g' ) \ html/doc/README.html -api_htmldocs = $(shell find doc/api -name '*.md' \ - |sed 's|.md|.html|g' \ - |sed 's|doc/api/|html/doc/api/|g' ) - files_htmldocs = $(shell find doc/files -name '*.md' \ |sed 's|.md|.html|g' \ |sed 's|doc/files/|html/doc/files/|g' ) \ @@ -51,9 +43,9 @@ misc_htmldocs = $(shell find doc/misc -name '*.md' \ |sed 's|doc/misc/|html/doc/misc/|g' ) \ html/doc/index.html -mandocs = $(api_mandocs) $(cli_mandocs) $(files_mandocs) $(misc_mandocs) +mandocs = $(cli_mandocs) $(files_mandocs) $(misc_mandocs) -htmldocs = $(api_htmldocs) $(cli_htmldocs) $(files_htmldocs) $(misc_htmldocs) +htmldocs = $(cli_htmldocs) $(files_htmldocs) $(misc_htmldocs) all: doc @@ -93,7 +85,6 @@ doc-clean: .building_marked \ .building_marked-man \ html/doc \ - html/api \ man # use `npm install marked-man` for this to work. @@ -105,10 +96,6 @@ man/man1/%.1: doc/cli/%.md scripts/doc-build.sh package.json @[ -d man/man1 ] || mkdir -p man/man1 scripts/doc-build.sh $< $@ -man/man3/%.3: doc/api/%.md scripts/doc-build.sh package.json - @[ -d man/man3 ] || mkdir -p man/man3 - scripts/doc-build.sh $< $@ - man/man5/npm-json.5: man/man5/package.json.5 cp $< $@ @@ -138,12 +125,9 @@ html/doc/cli/%.html: doc/cli/%.md $(html_docdeps) @[ -d html/doc/cli ] || mkdir -p html/doc/cli scripts/doc-build.sh $< $@ -html/doc/api/%.html: doc/api/%.md $(html_docdeps) - @[ -d html/doc/api ] || mkdir -p html/doc/api - scripts/doc-build.sh $< $@ - html/doc/files/npm-json.html: html/doc/files/package.json.html cp $< $@ + html/doc/files/npm-global.html: html/doc/files/npm-folders.html cp $< $@ @@ -168,7 +152,7 @@ node_modules/.bin/marked-man: doc: man -man: $(cli_docs) $(api_docs) +man: $(cli_docs) test: doc node cli.js test diff --git a/deps/npm/README.md b/deps/npm/README.md index ceaefb8f6c3438..694d9cf0d643d0 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -208,7 +208,7 @@ 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. -### In plainer english +### In plainer English npm is the property of npm, Inc. diff --git a/deps/npm/bin/node-gyp-bin/node-gyp.cmd b/deps/npm/bin/node-gyp-bin/node-gyp.cmd index 83ea8f59247858..bb0a7f710666e2 100755 --- a/deps/npm/bin/node-gyp-bin/node-gyp.cmd +++ b/deps/npm/bin/node-gyp-bin/node-gyp.cmd @@ -1,5 +1,5 @@ -if not defined npm_config_node_gyp ( - node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %* -) else ( +if not defined npm_config_node_gyp ( + node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %* +) else ( node %npm_config_node_gyp% %* -) +) diff --git a/deps/npm/bin/npm-cli.js b/deps/npm/bin/npm-cli.js index ace40ca791c459..2346feba47d604 100755 --- a/deps/npm/bin/npm-cli.js +++ b/deps/npm/bin/npm-cli.js @@ -1,75 +1,76 @@ #!/usr/bin/env node ;(function () { // wrapper in case we're in module_context mode -// windows: running "npm blah" in this folder will invoke WSH, not node. -if (typeof WScript !== "undefined") { - WScript.echo("npm does not work when run\n" - +"with the Windows Scripting Host\n\n" - +"'cd' to a different directory,\n" - +"or type 'npm.cmd ',\n" - +"or type 'node npm '.") - WScript.quit(1) - return -} - - -process.title = "npm" - -var log = require("npmlog") -log.pause() // will be unpaused when config is loaded. -log.info("it worked if it ends with", "ok") - -var path = require("path") - , npm = require("../lib/npm.js") - , npmconf = require("../lib/config/core.js") - , errorHandler = require("../lib/utils/error-handler.js") - - , configDefs = npmconf.defs - , shorthands = configDefs.shorthands - , types = configDefs.types - , nopt = require("nopt") - -// if npm is called as "npmg" or "npm_g", then -// run in global mode. -if (path.basename(process.argv[1]).slice(-1) === "g") { - process.argv.splice(1, 1, "npm", "-g") -} - -log.verbose("cli", process.argv) - -var conf = nopt(types, shorthands) -npm.argv = conf.argv.remain -if (npm.deref(npm.argv[0])) npm.command = npm.argv.shift() -else conf.usage = true - - -if (conf.version) { - console.log(npm.version) - return -} - -if (conf.versions) { - npm.command = "version" - conf.usage = false - npm.argv = [] -} - -log.info("using", "npm@%s", npm.version) -log.info("using", "node@%s", process.version) - -process.on("uncaughtException", errorHandler) - -if (conf.usage && npm.command !== "help") { - npm.argv.unshift(npm.command) - npm.command = "help" -} - -// now actually fire up npm and run the command. -// this is how to use npm programmatically: -conf._exit = true -npm.load(conf, function (er) { - if (er) return errorHandler(er) - npm.commands[npm.command](npm.argv, errorHandler) -}) - + // windows: running "npm blah" in this folder will invoke WSH, not node. + /*global WScript*/ + if (typeof WScript !== 'undefined') { + WScript.echo( + 'npm does not work when run\n' + + 'with the Windows Scripting Host\n\n' + + "'cd' to a different directory,\n" + + "or type 'npm.cmd ',\n" + + "or type 'node npm '." + ) + WScript.quit(1) + return + } + + process.title = 'npm' + + var log = require('npmlog') + log.pause() // will be unpaused when config is loaded. + + log.info('it worked if it ends with', 'ok') + + var path = require('path') + var npm = require('../lib/npm.js') + var npmconf = require('../lib/config/core.js') + var errorHandler = require('../lib/utils/error-handler.js') + + var configDefs = npmconf.defs + var shorthands = configDefs.shorthands + var types = configDefs.types + var nopt = require('nopt') + + // if npm is called as "npmg" or "npm_g", then + // run in global mode. + if (path.basename(process.argv[1]).slice(-1) === 'g') { + process.argv.splice(1, 1, 'npm', '-g') + } + + log.verbose('cli', process.argv) + + var conf = nopt(types, shorthands) + npm.argv = conf.argv.remain + if (npm.deref(npm.argv[0])) npm.command = npm.argv.shift() + else conf.usage = true + + if (conf.version) { + console.log(npm.version) + return + } + + if (conf.versions) { + npm.command = 'version' + conf.usage = false + npm.argv = [] + } + + log.info('using', 'npm@%s', npm.version) + log.info('using', 'node@%s', process.version) + + process.on('uncaughtException', errorHandler) + + if (conf.usage && npm.command !== 'help') { + npm.argv.unshift(npm.command) + npm.command = 'help' + } + + // now actually fire up npm and run the command. + // this is how to use npm programmatically: + conf._exit = true + npm.load(conf, function (er) { + if (er) return errorHandler(er) + npm.commands[npm.command](npm.argv, errorHandler) + }) })() diff --git a/deps/npm/bin/read-package-json.js b/deps/npm/bin/read-package-json.js index 3e5a0c77f254b4..7e62a0bd7de552 100755 --- a/deps/npm/bin/read-package-json.js +++ b/deps/npm/bin/read-package-json.js @@ -1,22 +1,24 @@ var argv = process.argv if (argv.length < 3) { - console.error("Usage: read-package.json [ ...]") + console.error('Usage: read-package.json [ ...]') process.exit(1) } -var fs = require("fs") - , file = argv[2] - , readJson = require("read-package-json") +var file = argv[2] +var readJson = require('read-package-json') readJson(file, function (er, data) { if (er) throw er - if (argv.length === 3) console.log(data) - else argv.slice(3).forEach(function (field) { - field = field.split(".") - var val = data - field.forEach(function (f) { - val = val[f] + if (argv.length === 3) { + console.log(data) + } else { + argv.slice(3).forEach(function (field) { + field = field.split('.') + var val = data + field.forEach(function (f) { + val = val[f] + }) + console.log(val) }) - console.log(val) - }) + } }) diff --git a/deps/npm/cli.js b/deps/npm/cli.js index 0df931e35a4120..05c5e21fb1eb53 100755 --- a/deps/npm/cli.js +++ b/deps/npm/cli.js @@ -1,2 +1,2 @@ #!/usr/bin/env node -require("./bin/npm-cli.js") +require('./bin/npm-cli.js') diff --git a/deps/npm/doc/api/npm-bin.md b/deps/npm/doc/api/npm-bin.md deleted file mode 100644 index bd27af2fdca30e..00000000000000 --- a/deps/npm/doc/api/npm-bin.md +++ /dev/null @@ -1,13 +0,0 @@ -npm-bin(3) -- Display npm bin folder -==================================== - -## SYNOPSIS - - npm.commands.bin(args, cb) - -## DESCRIPTION - -Print the folder where npm will install executables. - -This function should not be used programmatically. Instead, just refer -to the `npm.bin` property. diff --git a/deps/npm/doc/api/npm-bugs.md b/deps/npm/doc/api/npm-bugs.md deleted file mode 100644 index cc4db8f9ecdb91..00000000000000 --- a/deps/npm/doc/api/npm-bugs.md +++ /dev/null @@ -1,19 +0,0 @@ -npm-bugs(3) -- Bugs for a package in a web browser maybe -======================================================== - -## SYNOPSIS - - npm.commands.bugs(package, callback) - -## DESCRIPTION - -This command tries to guess at the likely location of a package's -bug tracker URL, and then tries to open it using the `--browser` -config param. - -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. - -This command will launch a browser, so this command may not be the most -friendly for programmatic use. diff --git a/deps/npm/doc/api/npm-cache.md b/deps/npm/doc/api/npm-cache.md deleted file mode 100644 index e7079d8c1e9f5b..00000000000000 --- a/deps/npm/doc/api/npm-cache.md +++ /dev/null @@ -1,30 +0,0 @@ -npm-cache(3) -- manage the npm cache programmatically -===================================================== - -## SYNOPSIS - - 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) - -## DESCRIPTION - -This acts much the same ways as the npm-cache(1) command line -functionality. - -The callback is called with the package.json data of the thing that is -eventually added to or read from the cache. - -The top level `npm.commands.cache(...)` functionality is a public -interface, and like all commands on the `npm.commands` object, it will -match the command line behavior exactly. - -However, the cache folder structure and the cache helper functions are -considered **internal** API surface, and as such, may change in future -releases of npm, potentially without warning or significant version -incrementation. - -Use at your own risk. diff --git a/deps/npm/doc/api/npm-commands.md b/deps/npm/doc/api/npm-commands.md deleted file mode 100644 index 36dcfd8d6b6f52..00000000000000 --- a/deps/npm/doc/api/npm-commands.md +++ /dev/null @@ -1,22 +0,0 @@ -npm-commands(3) -- npm commands -=============================== - -## SYNOPSIS - - npm.commands[](args, callback) - -## DESCRIPTION - -npm comes with a full set of commands, and each of the commands takes a -similar set of arguments. - -In general, all commands on the command object take an **array** of positional -argument **strings**. The last argument to any function is a callback. Some -commands are special and take other optional arguments. - -All commands have their own man page. See `man npm-` for command-line -usage, or `man 3 npm-` for programmatic usage. - -## SEE ALSO - -* npm-index(7) diff --git a/deps/npm/doc/api/npm-config.md b/deps/npm/doc/api/npm-config.md deleted file mode 100644 index 7ae22742810841..00000000000000 --- a/deps/npm/doc/api/npm-config.md +++ /dev/null @@ -1,45 +0,0 @@ -npm-config(3) -- Manage the npm configuration files -=================================================== - -## SYNOPSIS - - npm.commands.config(args, callback) - var val = npm.config.get(key) - npm.config.set(key, val) - -## DESCRIPTION - -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: - -* `set` - - Sets a config parameter. The second element in `args` is interpreted as the - key, and the third element is interpreted as the value. - -* `get` - - Gets the value of a config parameter. The second element in `args` is the - key to get the value of. - -* `delete` (`rm` or `del`) - - Deletes a parameter from the config. The second element in `args` is the - key to delete. - -* `list` (`ls`) - - Show all configs that aren't secret. No parameters necessary. - -* `edit`: - - Opens the config file in the default editor. This command isn't very useful - programmatically, but it is made available. - -To programmatically access npm configuration settings, or set them for -the duration of a program, use the `npm.config.set` and `npm.config.get` -functions instead. - -## SEE ALSO - -* npm(3) diff --git a/deps/npm/doc/api/npm-deprecate.md b/deps/npm/doc/api/npm-deprecate.md deleted file mode 100644 index 200fb9c30ae019..00000000000000 --- a/deps/npm/doc/api/npm-deprecate.md +++ /dev/null @@ -1,34 +0,0 @@ -npm-deprecate(3) -- Deprecate a version of a package -==================================================== - -## SYNOPSIS - - npm.commands.deprecate(args, callback) - -## DESCRIPTION - -This command will update the npm registry entry for a package, providing -a deprecation warning to all who attempt to install it. - -The 'args' parameter must have exactly two elements: - -* `package[@version]` - - The `version` portion is optional, and may be either a range, or a - specific version, or a tag. - -* `message` - - The warning message that will be printed whenever a user attempts to - install the package. - -Note that you must be the package owner to deprecate something. See the -`owner` and `adduser` help topics. - -To un-deprecate a package, specify an empty string (`""`) for the `message` argument. - -## SEE ALSO - -* npm-publish(3) -* npm-unpublish(3) -* npm-registry(7) diff --git a/deps/npm/doc/api/npm-docs.md b/deps/npm/doc/api/npm-docs.md deleted file mode 100644 index 2c5fc5e6321b38..00000000000000 --- a/deps/npm/doc/api/npm-docs.md +++ /dev/null @@ -1,19 +0,0 @@ -npm-docs(3) -- Docs for a package in a web browser maybe -======================================================== - -## SYNOPSIS - - npm.commands.docs(package, callback) - -## DESCRIPTION - -This command tries to guess at the likely location of a package's -documentation URL, and then tries to open it using the `--browser` -config param. - -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. - -This command will launch a browser, so this command may not be the most -friendly for programmatic use. diff --git a/deps/npm/doc/api/npm-edit.md b/deps/npm/doc/api/npm-edit.md deleted file mode 100644 index b13fbb8578bee6..00000000000000 --- a/deps/npm/doc/api/npm-edit.md +++ /dev/null @@ -1,24 +0,0 @@ -npm-edit(3) -- Edit an installed package -======================================== - -## SYNOPSIS - - npm.commands.edit(package, callback) - -## DESCRIPTION - -Opens the package folder in the default editor (or whatever you've -configured as the npm `editor` config -- see `npm help config`.) - -After it has been edited, the package is rebuilt so as to pick up any -changes in compiled packages. - -For instance, you can do `npm install connect` to install connect -into your package, and then `npm.commands.edit(["connect"], callback)` -to make a few changes to your locally installed copy. - -The first parameter is a string array with a single element, the package -to open. The package can optionally have a version number attached. - -Since this command opens an editor in a new process, be careful about where -and how this is used. diff --git a/deps/npm/doc/api/npm-explore.md b/deps/npm/doc/api/npm-explore.md deleted file mode 100644 index a239f3df3142fd..00000000000000 --- a/deps/npm/doc/api/npm-explore.md +++ /dev/null @@ -1,18 +0,0 @@ -npm-explore(3) -- Browse an installed package -============================================= - -## SYNOPSIS - - npm.commands.explore(args, callback) - -## DESCRIPTION - -Spawn a subshell in the directory of the installed package specified. - -If a command is specified, then it is run in the subshell, which then -immediately terminates. - -Note that the package is *not* automatically rebuilt afterwards, so be -sure to use `npm rebuild ` if you make any changes. - -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/doc/api/npm-help-search.md b/deps/npm/doc/api/npm-help-search.md deleted file mode 100644 index 01b235ce72b4bd..00000000000000 --- a/deps/npm/doc/api/npm-help-search.md +++ /dev/null @@ -1,30 +0,0 @@ -npm-help-search(3) -- Search the help pages -=========================================== - -## SYNOPSIS - - npm.commands.helpSearch(args, [silent,] callback) - -## DESCRIPTION - -This command is rarely useful, but it exists in the rare case that it is. - -This command takes an array of search terms and returns the help pages that -match in order of best match. - -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: - -* hits: - A map of args to number of hits on that arg. For example, {"npm": 3} -* found: - Total number of unique args that matched. -* totalHits: - Total number of hits. -* lines: - An array of all matching lines (and some adjacent lines). -* file: - Name of the file that matched - -The silent parameter is not necessary not used, but it may in the future. diff --git a/deps/npm/doc/api/npm-init.md b/deps/npm/doc/api/npm-init.md deleted file mode 100644 index 9b75bf79116dd3..00000000000000 --- a/deps/npm/doc/api/npm-init.md +++ /dev/null @@ -1,29 +0,0 @@ -npm init(3) -- Interactively create a package.json file -======================================================= - -## SYNOPSIS - - npm.commands.init(args, callback) - -## DESCRIPTION - -This will ask you a bunch of questions, and then write a package.json for you. - -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. - -If you already have a package.json file, it'll read that first, and default to -the options in there. - -It is strictly additive, so it does not delete options from your package.json -without a really good reason to do so. - -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, -then go ahead and use this programmatically. - -## SEE ALSO - -package.json(5) diff --git a/deps/npm/doc/api/npm-install.md b/deps/npm/doc/api/npm-install.md deleted file mode 100644 index 12f665a76c92c7..00000000000000 --- a/deps/npm/doc/api/npm-install.md +++ /dev/null @@ -1,19 +0,0 @@ -npm-install(3) -- install a package programmatically -==================================================== - -## SYNOPSIS - - npm.commands.install([where,] packages, callback) - -## DESCRIPTION - -This acts much the same ways as installing on the command-line. - -The 'where' parameter is optional and only used internally, and it specifies -where the packages should be installed to. - -The 'packages' parameter is an array of strings. Each element in the array is -the name of a package to be installed. - -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/doc/api/npm-link.md b/deps/npm/doc/api/npm-link.md deleted file mode 100644 index fe875ec60f1c4c..00000000000000 --- a/deps/npm/doc/api/npm-link.md +++ /dev/null @@ -1,33 +0,0 @@ -npm-link(3) -- Symlink a package folder -======================================= - -## SYNOPSIS - - npm.commands.link(callback) - npm.commands.link(packages, callback) - -## DESCRIPTION - -Package linking is a two-step process. - -Without parameters, link will create a globally-installed -symbolic link from `prefix/package-name` to the current folder. - -With a parameters, link will create a symlink from the local `node_modules` -folder to the global symlink. - -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. - -For example: - - npm.commands.link(cb) # creates global link from the cwd - # (say redis package) - npm.commands.link('redis', cb) # link-install the package - -Now, any changes to the redis package will be reflected in -the package in the current working directory diff --git a/deps/npm/doc/api/npm-load.md b/deps/npm/doc/api/npm-load.md deleted file mode 100644 index de412aff5b87b5..00000000000000 --- a/deps/npm/doc/api/npm-load.md +++ /dev/null @@ -1,26 +0,0 @@ -npm-load(3) -- Load config settings -=================================== - -## SYNOPSIS - - npm.load(conf, cb) - -## DESCRIPTION - -npm.load() must be called before any other function call. Both parameters are -optional, but the second is recommended. - -The first parameter is an object containing command-line config params, and the -second parameter is a callback that will be called when npm is loaded and ready -to serve. - -The first parameter should follow a similar structure as the package.json -config object. - -For example, to emulate the --dev flag, pass an object that looks like this: - - { - "dev": true - } - -For a list of all the available command-line configs, see `npm help config` diff --git a/deps/npm/doc/api/npm-ls.md b/deps/npm/doc/api/npm-ls.md deleted file mode 100644 index 5de78f2104ae0c..00000000000000 --- a/deps/npm/doc/api/npm-ls.md +++ /dev/null @@ -1,56 +0,0 @@ -npm-ls(3) -- List installed packages -====================================== - -## SYNOPSIS - - npm.commands.ls(args, [silent,] callback) - -## DESCRIPTION - -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. - -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 `global` to list global packages. - -It will print out extraneous, missing, and invalid packages. - -If the silent parameter is set to true, nothing will be output to the screen, -but the data will still be returned. - -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. - -## CONFIGURATION - -### long - -* Default: false -* Type: Boolean - -Show extended information. - -### parseable - -* Default: false -* Type: Boolean - -Show parseable output instead of tree view. - -### global - -* Default: false -* Type: Boolean - -List packages in the global install prefix instead of in the current -project. - -Note, if parseable is set or long isn't set, then duplicates will be trimmed. -This means that if a submodule has the same dependency as a parent module, then the -dependency will only be output once. diff --git a/deps/npm/doc/api/npm-outdated.md b/deps/npm/doc/api/npm-outdated.md deleted file mode 100644 index 89f4cf6faa7fd7..00000000000000 --- a/deps/npm/doc/api/npm-outdated.md +++ /dev/null @@ -1,13 +0,0 @@ -npm-outdated(3) -- Check for outdated packages -============================================== - -## SYNOPSIS - - npm.commands.outdated([packages,] callback) - -## DESCRIPTION - -This command will check the registry to see if the specified packages are -currently outdated. - -If the 'packages' parameter is left out, npm will check all packages. diff --git a/deps/npm/doc/api/npm-owner.md b/deps/npm/doc/api/npm-owner.md deleted file mode 100644 index 71fcccff59163b..00000000000000 --- a/deps/npm/doc/api/npm-owner.md +++ /dev/null @@ -1,31 +0,0 @@ -npm-owner(3) -- Manage package owners -===================================== - -## SYNOPSIS - - npm.commands.owner(args, callback) - -## DESCRIPTION - -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): - -* 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. -* 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. -* rm (user, package): - Remove a user from the package owner list. This immediately revokes their - privileges. - -Note that there is only one level of access. Either you can modify a package, -or you can't. Future versions may contain more fine-grained access levels, but -that is not implemented at this time. - -## SEE ALSO - -* npm-publish(3) -* npm-registry(7) diff --git a/deps/npm/doc/api/npm-pack.md b/deps/npm/doc/api/npm-pack.md deleted file mode 100644 index cb339c0c42d6fe..00000000000000 --- a/deps/npm/doc/api/npm-pack.md +++ /dev/null @@ -1,19 +0,0 @@ -npm-pack(3) -- Create a tarball from a package -============================================== - -## SYNOPSIS - - npm.commands.pack([packages,] callback) - -## DESCRIPTION - -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 `-.tgz`, and then write the filenames out to -stdout. - -If the same package is specified multiple times, then the file will be -overwritten the second time. - -If no arguments are supplied, then npm packs the current package folder. diff --git a/deps/npm/doc/api/npm-ping.md b/deps/npm/doc/api/npm-ping.md deleted file mode 100644 index 4357fe2ba99994..00000000000000 --- a/deps/npm/doc/api/npm-ping.md +++ /dev/null @@ -1,14 +0,0 @@ -npm-ping(3) -- Ping npm registry -================================ - -## SYNOPSIS - - npm.registry.ping(registry, options, function (er, pong)) - -## DESCRIPTION - -Attempts to connect to the given registry, returning a `pong` -object with various metadata if it succeeds. - -This function is primarily useful for debugging connection issues -to npm registries. diff --git a/deps/npm/doc/api/npm-prefix.md b/deps/npm/doc/api/npm-prefix.md deleted file mode 100644 index 806dd4b6cbafd0..00000000000000 --- a/deps/npm/doc/api/npm-prefix.md +++ /dev/null @@ -1,15 +0,0 @@ -npm-prefix(3) -- Display prefix -=============================== - -## SYNOPSIS - - npm.commands.prefix(args, callback) - -## DESCRIPTION - -Print the prefix to standard out. - -'args' is never used and callback is never called with data. -'args' must be present or things will break. - -This function is not useful programmatically diff --git a/deps/npm/doc/api/npm-prune.md b/deps/npm/doc/api/npm-prune.md deleted file mode 100644 index 2a4f177485deb9..00000000000000 --- a/deps/npm/doc/api/npm-prune.md +++ /dev/null @@ -1,17 +0,0 @@ -npm-prune(3) -- Remove extraneous packages -========================================== - -## SYNOPSIS - - npm.commands.prune([packages,] callback) - -## DESCRIPTION - -This command removes "extraneous" packages. - -The first parameter is optional, and it specifies packages to be removed. - -No packages are specified, then all packages will be checked. - -Extraneous packages are packages that are not listed on the parent -package's dependencies list. diff --git a/deps/npm/doc/api/npm-publish.md b/deps/npm/doc/api/npm-publish.md deleted file mode 100644 index 6871dafb856d0e..00000000000000 --- a/deps/npm/doc/api/npm-publish.md +++ /dev/null @@ -1,30 +0,0 @@ -npm-publish(3) -- Publish a package -=================================== - -## SYNOPSIS - - npm.commands.publish([packages,] callback) - -## DESCRIPTION - -Publishes a package to the registry so that it can be installed by name. -Possible values in the 'packages' array are: - -* ``: - A folder containing a package.json file - -* ``: - A url or file path to a gzipped tar archive containing a single folder - with a package.json file inside. - -If the package array is empty, npm will try to publish something in the -current working directory. - -This command could fails if one of the packages specified already exists in -the registry. Overwrites when the "force" environment variable is set. - -## SEE ALSO - -* npm-registry(7) -* npm-adduser(1) -* npm-owner(3) diff --git a/deps/npm/doc/api/npm-rebuild.md b/deps/npm/doc/api/npm-rebuild.md deleted file mode 100644 index 8b8989806ae26f..00000000000000 --- a/deps/npm/doc/api/npm-rebuild.md +++ /dev/null @@ -1,16 +0,0 @@ -npm-rebuild(3) -- Rebuild a package -=================================== - -## SYNOPSIS - - npm.commands.rebuild([packages,] callback) - -## DESCRIPTION - -This command runs the `npm build` 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. - -## CONFIGURATION - -See `npm help build` diff --git a/deps/npm/doc/api/npm-repo.md b/deps/npm/doc/api/npm-repo.md deleted file mode 100644 index af3c52fab64a30..00000000000000 --- a/deps/npm/doc/api/npm-repo.md +++ /dev/null @@ -1,19 +0,0 @@ -npm-repo(3) -- Open package repository page in the browser -======================================================== - -## SYNOPSIS - - npm.commands.repo(package, callback) - -## DESCRIPTION - -This command tries to guess at the likely location of a package's -repository URL, and then tries to open it using the `--browser` -config param. - -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. - -This command will launch a browser, so this command may not be the most -friendly for programmatic use. diff --git a/deps/npm/doc/api/npm-restart.md b/deps/npm/doc/api/npm-restart.md deleted file mode 100644 index 606c41bf8505f4..00000000000000 --- a/deps/npm/doc/api/npm-restart.md +++ /dev/null @@ -1,41 +0,0 @@ -npm-restart(3) -- Restart a package -=================================== - -## SYNOPSIS - - npm.commands.restart(packages, callback) - -## DESCRIPTION - -This restarts a package (or multiple packages). - -This runs a package's "stop", "restart", and "start" scripts, and associated -pre- and post- scripts, in the order given below: - -1. prerestart -2. prestop -3. stop -4. poststop -5. restart -6. prestart -7. start -8. poststart -9. postrestart - -If no version is specified, then it restarts the "active" version. - -npm can restart multiple packages. Just specify multiple packages in -the `packages` parameter. - -## NOTE - -Note that the "restart" script is run **in addition to** the "stop" -and "start" scripts, not instead of them. - -This is the behavior as of `npm` major version 2. A change in this -behavior will be accompanied by an increase in major version number - -## SEE ALSO - -* npm-start(3) -* npm-stop(3) diff --git a/deps/npm/doc/api/npm-root.md b/deps/npm/doc/api/npm-root.md deleted file mode 100644 index 1c3ab56402c0f8..00000000000000 --- a/deps/npm/doc/api/npm-root.md +++ /dev/null @@ -1,15 +0,0 @@ -npm-root(3) -- Display npm root -=============================== - -## SYNOPSIS - - npm.commands.root(args, callback) - -## DESCRIPTION - -Print the effective `node_modules` folder to standard out. - -'args' is never used and callback is never called with data. -'args' must be present or things will break. - -This function is not useful programmatically. diff --git a/deps/npm/doc/api/npm-run-script.md b/deps/npm/doc/api/npm-run-script.md deleted file mode 100644 index 91ad95351bb5c0..00000000000000 --- a/deps/npm/doc/api/npm-run-script.md +++ /dev/null @@ -1,27 +0,0 @@ -npm-run-script(3) -- Run arbitrary package scripts -================================================== - -## SYNOPSIS - - npm.commands.run-script(args, callback) - -## DESCRIPTION - -This runs an arbitrary command from a package's "scripts" object. - -It is used by the test, start, restart, and stop commands, but can be -called directly, as well. - -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. - -## SEE ALSO - -* npm-scripts(7) -* npm-test(3) -* npm-start(3) -* npm-restart(3) -* npm-stop(3) diff --git a/deps/npm/doc/api/npm-search.md b/deps/npm/doc/api/npm-search.md deleted file mode 100644 index 30651d76a4227f..00000000000000 --- a/deps/npm/doc/api/npm-search.md +++ /dev/null @@ -1,35 +0,0 @@ -npm-search(3) -- Search for packages -==================================== - -## SYNOPSIS - - npm.commands.search(searchTerms, [silent,] [staleness,] callback) - -## DESCRIPTION - -Search the registry for packages matching the search terms. The available parameters are: - -* searchTerms: - Array of search terms. These terms are case-insensitive. -* silent: - If true, npm will not log anything to the console. -* staleness: - This is the threshold for stale packages. "Fresh" packages are not refreshed - from the registry. This value is measured in seconds. -* 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 - 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: - - * name - * description - * maintainers - * url - * keywords - -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 -like). diff --git a/deps/npm/doc/api/npm-shrinkwrap.md b/deps/npm/doc/api/npm-shrinkwrap.md deleted file mode 100644 index 6584d6a0da48f7..00000000000000 --- a/deps/npm/doc/api/npm-shrinkwrap.md +++ /dev/null @@ -1,20 +0,0 @@ -npm-shrinkwrap(3) -- programmatically generate package shrinkwrap file -==================================================== - -## SYNOPSIS - - npm.commands.shrinkwrap(args, [silent,] callback) - -## DESCRIPTION - -This acts much the same ways as shrinkwrapping on the command-line. - -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. - -If the 'silent' parameter is set to true, nothing will be output to the screen, -but the shrinkwrap file will still be written. - -Finally, 'callback' is a function that will be called when the shrinkwrap has -been saved. diff --git a/deps/npm/doc/api/npm-start.md b/deps/npm/doc/api/npm-start.md deleted file mode 100644 index deeea90d97649b..00000000000000 --- a/deps/npm/doc/api/npm-start.md +++ /dev/null @@ -1,13 +0,0 @@ -npm-start(3) -- Start a package -=============================== - -## SYNOPSIS - - npm.commands.start(packages, callback) - -## DESCRIPTION - -This runs a package's "start" script, if one was provided. - -npm can start multiple packages. Just specify multiple packages in the -`packages` parameter. diff --git a/deps/npm/doc/api/npm-stop.md b/deps/npm/doc/api/npm-stop.md deleted file mode 100644 index 0f8333d3513233..00000000000000 --- a/deps/npm/doc/api/npm-stop.md +++ /dev/null @@ -1,13 +0,0 @@ -npm-stop(3) -- Stop a package -============================= - -## SYNOPSIS - - npm.commands.stop(packages, callback) - -## DESCRIPTION - -This runs a package's "stop" script, if one was provided. - -npm can run stop on multiple packages. Just specify multiple packages -in the `packages` parameter. diff --git a/deps/npm/doc/api/npm-tag.md b/deps/npm/doc/api/npm-tag.md deleted file mode 100644 index 9cda0c407dec84..00000000000000 --- a/deps/npm/doc/api/npm-tag.md +++ /dev/null @@ -1,23 +0,0 @@ -npm-tag(3) -- Tag a published version -===================================== - -## SYNOPSIS - - npm.commands.tag(package@version, tag, callback) - -## DESCRIPTION - -Tags the specified version of the package with the specified tag, or the -`--tag` config if not specified. - -The 'package@version' is an array of strings, but only the first two elements are -currently used. - -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). - -The second element is the name of the tag to tag this version with. If this -parameter is missing or falsey (empty), the default from the config will be -used. For more information about how to set this config, check -`man 3 npm-config` for programmatic usage or `man npm-config` for cli usage. diff --git a/deps/npm/doc/api/npm-test.md b/deps/npm/doc/api/npm-test.md deleted file mode 100644 index bc48dcc35f9572..00000000000000 --- a/deps/npm/doc/api/npm-test.md +++ /dev/null @@ -1,16 +0,0 @@ -npm-test(3) -- Test a package -============================= - -## SYNOPSIS - - npm.commands.test(packages, callback) - -## 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 -true. - -npm can run tests on multiple packages. Just specify multiple packages -in the `packages` parameter. diff --git a/deps/npm/doc/api/npm-uninstall.md b/deps/npm/doc/api/npm-uninstall.md deleted file mode 100644 index 4505295b3b3d3a..00000000000000 --- a/deps/npm/doc/api/npm-uninstall.md +++ /dev/null @@ -1,16 +0,0 @@ -npm-uninstall(3) -- uninstall a package programmatically -======================================================== - -## SYNOPSIS - - npm.commands.uninstall(packages, callback) - -## DESCRIPTION - -This acts much the same ways as uninstalling on the command-line. - -The 'packages' parameter is an array of strings. Each element in the array is -the name of a package to be uninstalled. - -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/doc/api/npm-unpublish.md b/deps/npm/doc/api/npm-unpublish.md deleted file mode 100644 index 6cbc5c1f371ffe..00000000000000 --- a/deps/npm/doc/api/npm-unpublish.md +++ /dev/null @@ -1,20 +0,0 @@ -npm-unpublish(3) -- Remove a package from the registry -====================================================== - -## SYNOPSIS - - npm.commands.unpublish(package, callback) - -## DESCRIPTION - -This removes a package version from the registry, deleting its -entry and removing the tarball. - -The package parameter must be defined. - -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. - -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/doc/api/npm-update.md b/deps/npm/doc/api/npm-update.md deleted file mode 100644 index 52d7ec343c0cfd..00000000000000 --- a/deps/npm/doc/api/npm-update.md +++ /dev/null @@ -1,18 +0,0 @@ -npm-update(3) -- Update a package -================================= - -## SYNOPSIS - - npm.commands.update(packages, callback) - -# DESCRIPTION - -Updates a package, upgrading it to the latest version. It also installs any -missing packages. - -The `packages` argument is an array of packages to update. The `callback` -parameter will be called when done or when an error occurs. - -## SEE ALSO - -* npm-update(1) diff --git a/deps/npm/doc/api/npm-version.md b/deps/npm/doc/api/npm-version.md deleted file mode 100644 index bd40102c457bf8..00000000000000 --- a/deps/npm/doc/api/npm-version.md +++ /dev/null @@ -1,18 +0,0 @@ -npm-version(3) -- Bump a package version -======================================== - -## SYNOPSIS - - npm.commands.version(newversion, callback) - -## DESCRIPTION - -Run this in a package directory to bump the version and write the new -data back to the package.json file. - -If run in a git repo, it will also create a version commit and tag, and -fail if the repo is not clean. - -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/doc/api/npm-view.md b/deps/npm/doc/api/npm-view.md deleted file mode 100644 index 0c110f52ed1c59..00000000000000 --- a/deps/npm/doc/api/npm-view.md +++ /dev/null @@ -1,93 +0,0 @@ -npm-view(3) -- View registry info -================================= - -## SYNOPSIS - - npm.commands.view(args, [silent,] callback) - -## DESCRIPTION - -This command shows data about a package and prints it to the stream -referenced by the `outfd` config, which defaults to stdout. - -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. - -The callback will be passed all of the data returned by the query. - -For example, to get the package registry entry for the `connect` package, -you can do this: - - npm.commands.view(["connect"], callback) - -If no version is specified, "latest" is assumed. - -Field names can be specified after the package descriptor. -For example, to show the dependencies of the `ronn` package at version -0.3.5, you could do the following: - - npm.commands.view(["ronn@0.3.5", "dependencies"], callback) - -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: - - npm.commands.view(["npm", "repository.url"], callback) - -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: - - npm.commands.view(["express", "contributors.email"], callback) - -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: - - npm.commands.view(["express", "contributors[0].email"], callback) - -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: - - npm.commands.view(["express", "contributors.name", "contributors.email"], callback) - -"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 json` for more on this.) - - npm.commands.view(["npm", "contributors"], callback) - -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: - - npm.commands.view(["yui3@>0.5.4", "dependencies.jsdom"], callback) - -## OUTPUT - -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 version range matches multiple versions, than each printed value -will be prefixed with the version it applies to. - -If multiple fields are requested, than each of them are prefixed with -the field name. - -Console output can be disabled by setting the 'silent' parameter to true. - -## RETURN VALUE - -The data returned will be an object in this formation: - - { : - { : - , ... } - , ... } - -corresponding to the list of fields selected. diff --git a/deps/npm/doc/api/npm-whoami.md b/deps/npm/doc/api/npm-whoami.md deleted file mode 100644 index 598a1ab1a347e5..00000000000000 --- a/deps/npm/doc/api/npm-whoami.md +++ /dev/null @@ -1,15 +0,0 @@ -npm-whoami(3) -- Display npm username -===================================== - -## SYNOPSIS - - npm.commands.whoami(args, callback) - -## DESCRIPTION - -Print the `username` config to standard output. - -'args' is never used and callback is never called with data. -'args' must be present or things will break. - -This function is not useful programmatically diff --git a/deps/npm/doc/api/npm.md b/deps/npm/doc/api/npm.md deleted file mode 100644 index 611292ec94688d..00000000000000 --- a/deps/npm/doc/api/npm.md +++ /dev/null @@ -1,115 +0,0 @@ -npm(3) -- javascript package manager -==================================== - -## SYNOPSIS - - var npm = require("npm") - npm.load([configObject, ]function (er, npm) { - // 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) - }) - -## VERSION - -@VERSION@ - -## DESCRIPTION - -This is the API documentation for npm. -To find documentation of the command line -client, see `npm(1)`. - -Prior to using npm's commands, `npm.load()` must be called. If you provide -`configObject` as an object map 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-config(1)`, `npm-config(7)`, and `npmrc(5)` for more information. - -After that, each of the functions are accessible in the -commands object: `npm.commands.`. See `npm-index(7)` for a list of -all possible commands. - -All commands on the command object take an **array** of positional argument -**strings**. The last argument to any function is a callback. Some -commands take other optional arguments. - -Configs cannot currently be set on a per function basis, as each call to -npm.config.set will change the value for *all* npm commands in that process. - -To find API documentation for a specific command, run the `npm apihelp` -command. - -## METHODS AND PROPERTIES - -* `npm.load(configs, cb)` - - Load the configuration params, and call the `cb` function once the - globalconfig and userconfig files have been loaded as well, or on - nextTick if they've already been loaded. - -* `npm.config` - - An object for accessing npm configuration parameters. - - * `npm.config.get(key)` - * `npm.config.set(key, val)` - * `npm.config.del(key)` - -* `npm.dir` or `npm.root` - - The `node_modules` directory where npm will operate. - -* `npm.prefix` - - The prefix where npm is operating. (Most often the current working - directory.) - -* `npm.cache` - - The place where npm keeps JSON and tarballs it fetches from the - registry (or uploads to the registry). - -* `npm.tmp` - - npm's temporary working directory. - -* `npm.deref` - - Get the "real" name for a command that has either an alias or - abbreviation. - -## MAGIC - -For each of the methods in the `npm.commands` object, a method is added to the -npm object, which takes a set of positional string arguments rather than an -array and a callback. - -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. - -For example, this would work in a node repl: - - > npm = require("npm") - > npm.load() // wait a sec... - > npm.install("dnode", "express") - -Note that that *won't* work in a node program, since the `install` -method will get called before the configuration load is completed. - -## ABBREVS - -In order to support `npm ins foo` instead of `npm install foo`, the -`npm.commands` object has a set of abbreviations as well as the full -method names. Use the `npm.deref` method to find the real name. - -For example: - - var cmd = npm.deref("unp") // cmd === "unpublish" diff --git a/deps/npm/doc/cli/npm-bin.md b/deps/npm/doc/cli/npm-bin.md index 33863b45714b8f..9b76ec529e30a0 100644 --- a/deps/npm/doc/cli/npm-bin.md +++ b/deps/npm/doc/cli/npm-bin.md @@ -3,7 +3,7 @@ npm-bin(1) -- Display npm bin folder ## SYNOPSIS - npm bin + npm bin [-g|--global] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-bugs.md b/deps/npm/doc/cli/npm-bugs.md index 002d9f7556f31a..d2ad534fa3501a 100644 --- a/deps/npm/doc/cli/npm-bugs.md +++ b/deps/npm/doc/cli/npm-bugs.md @@ -3,8 +3,7 @@ npm-bugs(1) -- Bugs for a package in a web browser maybe ## SYNOPSIS - npm bugs - npm bugs (with no args in a package dir) + npm bugs [] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-build.md b/deps/npm/doc/cli/npm-build.md index 4d3467a160dd0c..019f225850dc04 100644 --- a/deps/npm/doc/cli/npm-build.md +++ b/deps/npm/doc/cli/npm-build.md @@ -3,7 +3,7 @@ npm-build(1) -- Build a package ## SYNOPSIS - npm build + npm build [] * ``: A folder containing a `package.json` file in its root. diff --git a/deps/npm/doc/cli/npm-completion.md b/deps/npm/doc/cli/npm-completion.md index bec0f60867cf82..6c7f3935629e7b 100644 --- a/deps/npm/doc/cli/npm-completion.md +++ b/deps/npm/doc/cli/npm-completion.md @@ -3,7 +3,7 @@ npm-completion(1) -- Tab Completion for npm ## SYNOPSIS - . <(npm completion) + source <(npm completion) ## DESCRIPTION @@ -12,7 +12,10 @@ Enables tab-completion in all npm commands. The synopsis above loads the completions into your current shell. Adding it to your ~/.bashrc or ~/.zshrc will make the completions available -everywhere. +everywhere: + + npm completion >> ~/.bashrc + npm completion >> ~/.zshrc You may of course also pipe the output of npm completion to a file such as `/usr/local/etc/bash_completion.d/npm` if you have a system diff --git a/deps/npm/doc/cli/npm-config.md b/deps/npm/doc/cli/npm-config.md index 1d978c9dea0b45..ec5c4eb14be8ab 100644 --- a/deps/npm/doc/cli/npm-config.md +++ b/deps/npm/doc/cli/npm-config.md @@ -3,14 +3,13 @@ npm-config(1) -- Manage the npm configuration files ## SYNOPSIS - npm config set [--global] + npm config set [-g|--global] npm config get npm config delete npm config list npm config edit - npm c [set|get|delete|list] npm get - npm set [--global] + npm set [-g|--global] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-dedupe.md b/deps/npm/doc/cli/npm-dedupe.md index d3be01050c7f5b..c963dfa8e9ee45 100644 --- a/deps/npm/doc/cli/npm-dedupe.md +++ b/deps/npm/doc/cli/npm-dedupe.md @@ -31,25 +31,20 @@ 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. +The deduplication algorithm walks the tree, moving each dependency as far +up in the tree as possible, even if duplicates are not found. This will +result in both a flat and deduplicated tree. + 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. -If no suitable version can be found, then a warning is printed, and -nothing is done. - -If any arguments are supplied, then they are filters, and only the -named packages will be touched. - -Note that this operation transforms the dependency tree, and may -result in packages getting updated versions, perhaps from the npm -registry. +Arguments are ignored. Dedupe always acts on the entire tree. -This feature is experimental, and may change in future versions. +Modules -The `--tag` 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. +Note that this operation transforms the dependency tree, but will never +result in new modules being installed. ## SEE ALSO diff --git a/deps/npm/doc/cli/npm-deprecate.md b/deps/npm/doc/cli/npm-deprecate.md index e62579349526e7..1be6f491be2053 100644 --- a/deps/npm/doc/cli/npm-deprecate.md +++ b/deps/npm/doc/cli/npm-deprecate.md @@ -3,7 +3,7 @@ npm-deprecate(1) -- Deprecate a version of a package ## SYNOPSIS - npm deprecate [@] + npm deprecate [@] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-docs.md b/deps/npm/doc/cli/npm-docs.md index 5db3d9f7e94f8c..f5064c55e2829a 100644 --- a/deps/npm/doc/cli/npm-docs.md +++ b/deps/npm/doc/cli/npm-docs.md @@ -4,9 +4,9 @@ npm-docs(1) -- Docs for a package in a web browser maybe ## SYNOPSIS npm docs [ [ ...]] - npm docs (with no args in a package dir) + npm docs . npm home [ [ ...]] - npm home (with no args in a package dir) + npm home . ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-edit.md b/deps/npm/doc/cli/npm-edit.md index 6a73317b819791..89ecfa877eeacd 100644 --- a/deps/npm/doc/cli/npm-edit.md +++ b/deps/npm/doc/cli/npm-edit.md @@ -3,7 +3,7 @@ npm-edit(1) -- Edit an installed package ## SYNOPSIS - npm edit [@] + npm edit [@] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-explore.md b/deps/npm/doc/cli/npm-explore.md index fded5340870776..b66e08bfb935ca 100644 --- a/deps/npm/doc/cli/npm-explore.md +++ b/deps/npm/doc/cli/npm-explore.md @@ -3,7 +3,7 @@ npm-explore(1) -- Browse an installed package ## SYNOPSIS - npm explore [ -- ] + npm explore [ -- ] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-help-search.md b/deps/npm/doc/cli/npm-help-search.md index 7bf7401ba0cb49..0a40f1c43b9167 100644 --- a/deps/npm/doc/cli/npm-help-search.md +++ b/deps/npm/doc/cli/npm-help-search.md @@ -3,7 +3,7 @@ npm-help-search(1) -- Search npm help documentation ## SYNOPSIS - npm help-search some search terms + npm help-search ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-help.md b/deps/npm/doc/cli/npm-help.md index 7991b1d38d2aaa..9fb96c9c2e6512 100644 --- a/deps/npm/doc/cli/npm-help.md +++ b/deps/npm/doc/cli/npm-help.md @@ -3,8 +3,7 @@ npm-help(1) -- Get help on npm ## SYNOPSIS - npm help - npm help some search terms + npm help [] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-install.md b/deps/npm/doc/cli/npm-install.md index be32f7b296ef01..75e9e13fd9398a 100644 --- a/deps/npm/doc/cli/npm-install.md +++ b/deps/npm/doc/cli/npm-install.md @@ -3,15 +3,17 @@ npm-install(1) -- Install a package ## SYNOPSIS - npm install (with no args in a package dir) + npm install (with no args, in package dir) + npm install [<@scope>/] + npm install [<@scope>/]@ + npm install [<@scope>/]@ + npm install [<@scope>/]@ 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) + + alias: npm i + common options: [-S|--save|-D|--save-dev|-O|--save-optional] [-E|--save-exact] [--dry-run] ## DESCRIPTION @@ -27,7 +29,7 @@ A `package` is: * d) a `@` that is published on the registry (see `npm-registry(7)`) with (c) * e) a `@` that points to (d) * f) a `` that has a "latest" tag satisfying (e) -* g) a `` that resolves to (b) +* g) a `` that resolves to (a) 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 @@ -71,7 +73,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 [<@scope>/] [-S|--save|-D|--save-dev|-O|--save-optional]`: Do a `@` install, where `` is the "tag" config. (See `npm-config(7)`.) @@ -86,19 +88,22 @@ after packing it up into a tarball (b). `npm install` takes 3 exclusive, optional flags which save or update the package version in your main package.json: - * `--save`: Package will appear in your `dependencies`. + * `-S, --save`: Package will appear in your `dependencies`. - * `--save-dev`: Package will appear in your `devDependencies`. + * `-D, --save-dev`: Package will appear in your `devDependencies`. - * `--save-optional`: Package will appear in your `optionalDependencies`. + * `-O, --save-optional`: Package will appear in your `optionalDependencies`. When using any of the above options to save dependencies to your package.json, there is an additional, optional flag: - * `--save-exact`: Saved dependencies will be configured with an + * `-E, --save-exact`: Saved dependencies will be configured with an exact version rather than using npm's default semver range operator. + Further, if you have an `npm-shrinkwrap.json` then it will be updated as + well. + `` 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)`. @@ -121,7 +126,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 [<@scope>/]@`: 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 @@ -132,7 +137,7 @@ after packing it up into a tarball (b). npm install sax@latest npm install @myorg/mypackage@latest -* `npm install [@/]@`: +* `npm install [<@scope>/]@`: Install the specified version of the package. This will fail if the version has not been published to the registry. @@ -142,7 +147,7 @@ after packing it up into a tarball (b). npm install sax@0.1.1 npm install @myorg/privatepackage@1.5.0 -* `npm install [@/]@`: +* `npm install [<@scope>/]@`: 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)`. @@ -157,10 +162,10 @@ after packing it up into a tarball (b). * `npm install `: - Install a package by cloning a git remote url. The format of the git - url is: + Installs the package from the hosted git provider, cloning it with + `git`. First it tries via the https (git with github) and if that fails, via ssh. - ://[[:]@][:][:/][#] + ://[[:]@][:][:][/][#] `` is one of `git`, `git+ssh`, `git+http`, or `git+https`. If no `` is specified, then `master` is @@ -202,7 +207,7 @@ after packing it up into a tarball (b). Install the package at `https://gist.github.com/gistID` by attempting to clone it using `git`. The GitHub username associated with the gist is - optional and will not be saved in `package.json` if `--save` is used. + optional and will not be saved in `package.json` if `-S` or `--save` is used. If you don't specify a *commit-ish* then `master` will be used. @@ -241,12 +246,15 @@ The `--tag` 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. -The `--force` argument will force npm to fetch remote resources even if a +The `--dry-run` argument will report in the usual way what the install would +have done without actually installing anything. + +The `-f` or `--force` argument will force npm to fetch remote resources even if a local copy exists on disk. npm install sax --force -The `--global` argument will cause npm to install the package globally +The `-g` or `--global` argument will cause npm to install the package globally rather than locally. See `npm-folders(5)`. The `--link` argument will cause npm to link global installs into the @@ -264,6 +272,9 @@ shrinkwrap file and use the package.json instead. The `--nodedir=/path/to/node/source` argument will allow npm to find the node source code so that npm can compile native modules. +The `--only={prod[uction]|dev[elopment]}` argument will cause either only +`devDependencies` or only non-`devDependencies` to be installed regardless of the `NODE_ENV`. + See `npm-config(7)`. Many of the configuration params have some effect on installation, since that's most of what npm does. @@ -271,26 +282,39 @@ effect on installation, since that's most of what npm does. To install a package, npm uses the following algorithm: - install(where, what, family, ancestors) - fetch what, unpack to /node_modules/ - for each dep in what.dependencies - resolve dep to precise version - for each dep@version in what.dependencies - not in /node_modules//node_modules/* - and not in - add precise version deps to - install(/node_modules/, dep, family) + load the existing node_modules tree from disk + clone the tree + fetch the package.json and assorted metadata and add it to the clone + walk the clone and add any missing dependencies + dependencies will be added as close to the top as is possible + without breaking any other modules + compare the original tree with the cloned tree and make a list of + actions to take to convert one to the other + execute all of the actions, deepest first + kinds of actions are install, update, remove and move For this `package{dep}` structure: `A{B,C}, B{C}, C{D}`, this algorithm produces: A +-- B - `-- C - `-- D + +-- C + +-- D 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. +already caused C to be installed at a higher level. D is still installed +at the top level because nothing conflicts with it. + +For `A{B,C}, B{C,D@1}, C{D@2}`, this algorithm produces: + + A + +-- B + +-- C + `-- D@2 + +-- D@1 + +Because B's D@1 will be installed in the top level, C now has to install D@2 +privately for itself. See npm-folders(5) for a more detailed description of the specific folder structures that npm creates. diff --git a/deps/npm/doc/cli/npm-link.md b/deps/npm/doc/cli/npm-link.md index b6d0c143ad4c15..344fcbf1a742bb 100644 --- a/deps/npm/doc/cli/npm-link.md +++ b/deps/npm/doc/cli/npm-link.md @@ -3,9 +3,10 @@ npm-link(1) -- Symlink a package folder ## SYNOPSIS - npm link (in package folder) - npm link [@/] - npm ln (with any of the previous argument usage) + npm link (in package dir) + npm link [<@scope>/][@] + + alias: npm ln ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-logout.md b/deps/npm/doc/cli/npm-logout.md index 867953c02449bc..411ea67e6ca10e 100644 --- a/deps/npm/doc/cli/npm-logout.md +++ b/deps/npm/doc/cli/npm-logout.md @@ -3,7 +3,7 @@ npm-logout(1) -- Log out of the registry ## SYNOPSIS - npm logout [--registry=url] [--scope=@orgname] + npm logout [--registry=] [--scope=<@scope>] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-ls.md b/deps/npm/doc/cli/npm-ls.md index 318cdd8fd64997..70835189aae582 100644 --- a/deps/npm/doc/cli/npm-ls.md +++ b/deps/npm/doc/cli/npm-ls.md @@ -3,10 +3,9 @@ npm-ls(1) -- List installed packages ## SYNOPSIS - npm list [[@/] ...] - npm ls [[@/] ...] - npm la [[@/] ...] - npm ll [[@/] ...] + npm ls [[<@scope>/] ...] + + aliases: list, la, ll ## DESCRIPTION @@ -28,6 +27,9 @@ 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. +The tree shown is the logical dependency tree, based on package +dependencies, not the physical layout of your node_modules folder. + When run as `ll` or `la`, it shows extended information by default. ## CONFIGURATION @@ -81,6 +83,14 @@ Display only the dependency tree for packages in `dependencies`. Display only the dependency tree for packages in `devDependencies`. +### only + +* Type: String + +When "dev" or "development", is an alias to `dev`. + +When "prod" or "production", is an alias to `production`.` + ## SEE ALSO * npm-config(1) diff --git a/deps/npm/doc/cli/npm-outdated.md b/deps/npm/doc/cli/npm-outdated.md index aa2a7d5dd16e02..bdc9b9b8ed7982 100644 --- a/deps/npm/doc/cli/npm-outdated.md +++ b/deps/npm/doc/cli/npm-outdated.md @@ -3,7 +3,7 @@ npm-outdated(1) -- Check for outdated packages ## SYNOPSIS - npm outdated [ [ ...]] + npm outdated [[<@scope>/] ...] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-owner.md b/deps/npm/doc/cli/npm-owner.md index b400f76378f531..1047a09bb8a053 100644 --- a/deps/npm/doc/cli/npm-owner.md +++ b/deps/npm/doc/cli/npm-owner.md @@ -3,9 +3,9 @@ npm-owner(1) -- Manage package owners ## SYNOPSIS - npm owner ls - npm owner add - npm owner rm + npm owner add [<@scope>/] + npm owner rm [<@scope>/] + npm owner ls [<@scope>/] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-pack.md b/deps/npm/doc/cli/npm-pack.md index 42bc1564be7157..f44f5e3620c2af 100644 --- a/deps/npm/doc/cli/npm-pack.md +++ b/deps/npm/doc/cli/npm-pack.md @@ -3,15 +3,15 @@ npm-pack(1) -- Create a tarball from a package ## SYNOPSIS - npm pack [ [ ...]] + npm pack [[<@scope>/]...] ## DESCRIPTION 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 `-.tgz`, and then write the filenames out to -stdout. +tarball url, name@tag, name@version, name, or scoped name), this +command will fetch it to the cache, and then copy the tarball to the +current working directory as `-.tgz`, and then write +the filenames out to stdout. If the same package is specified multiple times, then the file will be overwritten the second time. diff --git a/deps/npm/doc/cli/npm-prune.md b/deps/npm/doc/cli/npm-prune.md index 846a04240e598d..9089122117ab40 100644 --- a/deps/npm/doc/cli/npm-prune.md +++ b/deps/npm/doc/cli/npm-prune.md @@ -3,8 +3,7 @@ npm-prune(1) -- Remove extraneous packages ## SYNOPSIS - npm prune [ [ [/]...] [--production] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-publish.md b/deps/npm/doc/cli/npm-publish.md index 8c447d0df9c4d5..8e4da32cd5f505 100644 --- a/deps/npm/doc/cli/npm-publish.md +++ b/deps/npm/doc/cli/npm-publish.md @@ -4,8 +4,10 @@ npm-publish(1) -- Publish a package ## SYNOPSIS - npm publish [--tag ] [--access ] - npm publish [--tag ] [--access ] + npm publish [|] [--tag ] [--access ] + + Publishes '.' if no argument supplied + Sets tag 'latest' if no --tag specified ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-rebuild.md b/deps/npm/doc/cli/npm-rebuild.md index 7287208681fd08..437737d9f4b563 100644 --- a/deps/npm/doc/cli/npm-rebuild.md +++ b/deps/npm/doc/cli/npm-rebuild.md @@ -3,11 +3,9 @@ npm-rebuild(1) -- Rebuild a package ## SYNOPSIS - npm rebuild [ [ ...]] - npm rb [ [ ...]] + npm rebuild [[<@scope>/]...] -* ``: - The package to rebuild + alias: npm rb ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-repo.md b/deps/npm/doc/cli/npm-repo.md index 6bc6f3b3758f43..523e135e8cc31f 100644 --- a/deps/npm/doc/cli/npm-repo.md +++ b/deps/npm/doc/cli/npm-repo.md @@ -3,8 +3,7 @@ npm-repo(1) -- Open package repository page in the browser ## SYNOPSIS - npm repo - npm repo (with no args in a package dir) + npm repo [] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-rm.md b/deps/npm/doc/cli/npm-rm.md deleted file mode 100644 index 6691265fff9394..00000000000000 --- a/deps/npm/doc/cli/npm-rm.md +++ /dev/null @@ -1,23 +0,0 @@ -npm-rm(1) -- Remove a package -============================= - -## SYNOPSIS - - npm rm - npm r - npm uninstall - npm un - -## DESCRIPTION - -This uninstalls a package, completely removing everything npm installed -on its behalf. - -## SEE ALSO - -* npm-prune(1) -* npm-install(1) -* npm-folders(5) -* npm-config(1) -* npm-config(7) -* npmrc(5) diff --git a/deps/npm/doc/cli/npm-root.md b/deps/npm/doc/cli/npm-root.md index ca99e1206b2789..a1d5bf8629913b 100644 --- a/deps/npm/doc/cli/npm-root.md +++ b/deps/npm/doc/cli/npm-root.md @@ -3,7 +3,7 @@ npm-root(1) -- Display npm root ## SYNOPSIS - npm root + npm root [-g] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-run-script.md b/deps/npm/doc/cli/npm-run-script.md index 895e382f2faa18..1e956adcc0188e 100644 --- a/deps/npm/doc/cli/npm-run-script.md +++ b/deps/npm/doc/cli/npm-run-script.md @@ -3,8 +3,9 @@ npm-run-script(1) -- Run arbitrary package scripts ## SYNOPSIS - npm run-script [command] [-- ] - npm run [command] [-- ] + npm run-script [-- ...] + + alias: npm run ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-search.md b/deps/npm/doc/cli/npm-search.md index 4757ad3202941e..a14b9c353de24c 100644 --- a/deps/npm/doc/cli/npm-search.md +++ b/deps/npm/doc/cli/npm-search.md @@ -3,9 +3,9 @@ npm-search(1) -- Search for packages ## SYNOPSIS - npm search [--long] [search terms ...] - npm s [search terms ...] - npm se [search terms ...] + npm search [-l|--long] [search terms ...] + + aliases: s, se ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-shrinkwrap.md b/deps/npm/doc/cli/npm-shrinkwrap.md index ca9cb257b9d351..5156d339a74b16 100644 --- a/deps/npm/doc/cli/npm-shrinkwrap.md +++ b/deps/npm/doc/cli/npm-shrinkwrap.md @@ -82,29 +82,32 @@ This generates `npm-shrinkwrap.json`, which will look something like this: { "name": "A", - "version": "0.1.0", + "version": "1.1.0", "dependencies": { "B": { - "version": "0.0.1", + "version": "1.0.1", + "from": "B@^1.0.0", + "resolved": "https://registry.npmjs.org/B/-/B-1.0.1.tgz", "dependencies": { "C": { - "version": "0.0.1" + "version": "1.0.1", + "from": "org/C#v1.0.1", + "resolved": "git://github.com/org/C.git#5c380ae319fc4efe9e7f2d9c78b0faa588fd99b4" } } } } } -The shrinkwrap command has locked down the dependencies based on -what's currently installed in node_modules. When `npm install` -installs a package with an `npm-shrinkwrap.json` 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.0.1, regardless the -dependencies and versions listed in A's, B's, and C's `package.json` -files. +The shrinkwrap command has locked down the dependencies based on what's +currently installed in `node_modules`. The installation behavior is changed to: + +1. The module tree described by the shrinkwrap is reproduced. This means +reproducing the structure described in the file, using the specific files +referenced in "resolved" if available, falling back to normal package +resolution using "version" if one isn't. +2. The tree is walked and any missing dependencies are installed in the usual fashion. ### Using shrinkwrapped packages @@ -126,15 +129,14 @@ To add or update a dependency in a shrinkwrapped package: 1. Run `npm install` in the package root to install the current versions of all dependencies. -2. 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 `npm - install` with no arguments will merely reproduce the existing +2. Add or update dependencies. `npm install --save` each new or updated + package individually to update the `package.json` and the shrinkwrap. + Note that they must be explicitly named in order to be installed: running + `npm install` with no arguments will merely reproduce the existing shrinkwrap. 3. Validate that the package works as expected with the new dependencies. -4. Run `npm shrinkwrap`, commit the new `npm-shrinkwrap.json`, and - publish your package. +4. Commit the new `npm-shrinkwrap.json`, and publish your package. You can use npm-outdated(1) to view dependencies with newer versions available. diff --git a/deps/npm/doc/cli/npm-star.md b/deps/npm/doc/cli/npm-star.md index 5c076b3c3c1e7b..87d90b560c2027 100644 --- a/deps/npm/doc/cli/npm-star.md +++ b/deps/npm/doc/cli/npm-star.md @@ -3,8 +3,8 @@ npm-star(1) -- Mark your favorite packages ## SYNOPSIS - npm star [, ...] - npm unstar [, ...] + npm star [...] + npm unstar [...] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-stars.md b/deps/npm/doc/cli/npm-stars.md index 7c28f5b2a5e020..1e225be29f3eda 100644 --- a/deps/npm/doc/cli/npm-stars.md +++ b/deps/npm/doc/cli/npm-stars.md @@ -3,8 +3,7 @@ npm-stars(1) -- View packages marked as favorites ## SYNOPSIS - npm stars - npm stars [username] + npm stars [] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-tag.md b/deps/npm/doc/cli/npm-tag.md index d7118d4e581a23..357c0862f267e3 100644 --- a/deps/npm/doc/cli/npm-tag.md +++ b/deps/npm/doc/cli/npm-tag.md @@ -3,7 +3,8 @@ npm-tag(1) -- Tag a published version ## SYNOPSIS - npm tag @ [] + [DEPRECATED] npm tag @ [] + See `dist-tag` ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-team.md b/deps/npm/doc/cli/npm-team.md index 2ed9b367b56d30..08856ed3ec68cc 100644 --- a/deps/npm/doc/cli/npm-team.md +++ b/deps/npm/doc/cli/npm-team.md @@ -18,7 +18,7 @@ npm-team(1) -- Manage organization teams and team memberships Used to manage teams in organizations, and change team memberships. Does not handle permissions for packages. -Teams must always be fully qualified with the organization/scope they belond to +Teams must always be fully qualified with the organization/scope they belong to when operating on them, separated by a colon (`:`). That is, if you have a `developers` team on a `foo` organization, you must always refer to that team as `developers:foo` in these commands. @@ -52,4 +52,4 @@ use the `npm access` command to grant or revoke the appropriate permissions. ## SEE ALSO * npm-access(1) -* npm-registr(7) +* npm-registry(7) diff --git a/deps/npm/doc/cli/npm-uninstall.md b/deps/npm/doc/cli/npm-uninstall.md index bfa667c3e26eab..97d72d2c5c56ae 100644 --- a/deps/npm/doc/cli/npm-uninstall.md +++ b/deps/npm/doc/cli/npm-uninstall.md @@ -3,8 +3,9 @@ npm-rm(1) -- Remove a package ## SYNOPSIS - npm uninstall [@/] [--save|--save-dev|--save-optional] - npm rm (with any of the previous argument usage) + npm uninstall [<@scope>/][@]... [-S|--save|-D|--save-dev|-O|--save-optional] + + aliases: remove, rm, r, un, unlink ## DESCRIPTION @@ -21,11 +22,14 @@ it uninstalls the current package context as a global package. `npm uninstall` takes 3 exclusive, optional flags which save or update the package version in your main package.json: -* `--save`: Package will be removed from your `dependencies`. +* `-S, --save`: Package will be removed from your `dependencies`. + +* `-D, --save-dev`: Package will be removed from your `devDependencies`. -* `--save-dev`: Package will be removed from your `devDependencies`. +* `-O, --save-optional`: Package will be removed from your `optionalDependencies`. -* `--save-optional`: Package will be removed from your `optionalDependencies`. +Further, if you have an `npm-shrinkwrap.json` then it will be updated as +well. Scope is optional and follows the usual rules for `npm-scope(7)`. diff --git a/deps/npm/doc/cli/npm-unpublish.md b/deps/npm/doc/cli/npm-unpublish.md index 1d5fe928780378..0a5731ee1dbc24 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 [<@scope>/][@] ## WARNING diff --git a/deps/npm/doc/cli/npm-update.md b/deps/npm/doc/cli/npm-update.md index ce31c28910ff08..72719670dd0cb0 100644 --- a/deps/npm/doc/cli/npm-update.md +++ b/deps/npm/doc/cli/npm-update.md @@ -3,7 +3,7 @@ npm-update(1) -- Update a package ## SYNOPSIS - npm update [-g] [ [ ...]] + npm update [-g] [...] ## DESCRIPTION @@ -114,7 +114,8 @@ version that satisfies `^0.4.0` (`>= 0.4.0 <0.5.0`) When you want to update a package and save the new version as the minimum required dependency in `package.json`, you can use -`npm update --save`. For example if `package.json` contains +`npm update -S` or `npm update --save`. For example if +`package.json` contains: ``` dependencies: { diff --git a/deps/npm/doc/cli/npm-version.md b/deps/npm/doc/cli/npm-version.md index 0a00e78cd7ccb9..6bd550659d54e8 100644 --- a/deps/npm/doc/cli/npm-version.md +++ b/deps/npm/doc/cli/npm-version.md @@ -5,6 +5,10 @@ npm-version(1) -- Bump a package version npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease] + 'npm [-v | --version]' to print npm version + 'npm view version' to view a package's published version + 'npm ls' to inspect current package/dependency versions + ## DESCRIPTION Run this in a package directory to bump the version and write the new @@ -18,10 +22,10 @@ the existing version will be incremented by 1 in the specified field. If run in a git repo, it will also create a version commit and tag. This behavior is controlled by `git-tag-version` (see below), and can be disabled on the command line by running `npm --no-git-tag-version version`. -It will fail if the working directory is not clean, unless the `--force` -flag is set. +It will fail if the working directory is not clean, unless the `-f` or +`--force` flag is set. -If supplied with `--message` (shorthand: `-m`) config option, npm will +If supplied with `-m` or `--message` config option, npm will use it as a commit message when creating a version commit. If the `message` config contains `%s` then that will be replaced with the resulting version number. For example: diff --git a/deps/npm/doc/cli/npm-view.md b/deps/npm/doc/cli/npm-view.md index 683ed09f46f651..2215818a457d89 100644 --- a/deps/npm/doc/cli/npm-view.md +++ b/deps/npm/doc/cli/npm-view.md @@ -3,8 +3,9 @@ npm-view(1) -- View registry info ## SYNOPSIS - npm view [@/][@] [[.]...] - npm v [@/][@] [[.]...] + npm view [<@scope>/][@] [[.]...] + + aliases: info, show, v ## DESCRIPTION @@ -49,7 +50,7 @@ contributor in the list, you can do this: npm view express contributors[0].email Multiple fields may be specified, and will be printed one after another. -For exampls, to get all the contributor names and email addresses, you +For example, to get all the contributor names and email addresses, you can do this: npm view express contributors.name contributors.email diff --git a/deps/npm/doc/cli/npm-whoami.md b/deps/npm/doc/cli/npm-whoami.md index 3ff8837ff49d92..70b6a48f44671c 100644 --- a/deps/npm/doc/cli/npm-whoami.md +++ b/deps/npm/doc/cli/npm-whoami.md @@ -3,7 +3,7 @@ npm-whoami(1) -- Display npm username ## SYNOPSIS - npm whoami + npm whoami [--registry ] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm.md b/deps/npm/doc/cli/npm.md index 331a03577b20d0..8a05d0605a6b5c 100644 --- a/deps/npm/doc/cli/npm.md +++ b/deps/npm/doc/cli/npm.md @@ -61,7 +61,7 @@ In particular, npm has two modes of operation: defaults to the current working directory. Packages are installed to `./node_modules`, and bins are installed to `./node_modules/.bin`. -Local mode is the default. Use `--global` or `-g` on any command to +Local mode is the default. Use `-g` or `--global` on any command to operate in global mode instead. ## DEVELOPER USAGE diff --git a/deps/npm/doc/files/package.json.md b/deps/npm/doc/files/package.json.md index 91064b58b96159..d907945194a72d 100644 --- a/deps/npm/doc/files/package.json.md +++ b/deps/npm/doc/files/package.json.md @@ -468,8 +468,8 @@ included. For example: ## 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 saved using `npm install --save`, using any of -these forms: +package. Local paths can be saved using `npm install -S` or +`npm install --save`, using any of these forms: ../foo/bar ~/foo/bar @@ -626,17 +626,10 @@ field is advisory only. ## engineStrict -**NOTE: This feature is deprecated and will be removed in npm 3.0.0.** +**This feature was deprecated with npm 3.0.0** -If you are sure that your module will *definitely not* run properly on -versions of Node/npm other than those specified in the `engines` object, -then you can set `"engineStrict": true` in your package.json file. -This will override the user's `engine-strict` config setting. - -Please do not do this unless you are really very very sure. If your -engines object 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. +Prior to npm 3.0.0, this feature was used to treat this package as if the +user had set `engine-strict`. ## os diff --git a/deps/npm/doc/misc/npm-coding-style.md b/deps/npm/doc/misc/npm-coding-style.md index 7dd7ad556deba1..81dadf83473d2c 100644 --- a/deps/npm/doc/misc/npm-coding-style.md +++ b/deps/npm/doc/misc/npm-coding-style.md @@ -61,7 +61,7 @@ Don't use them except in four situations: * `for (;;)` loops. They're actually required. * null loops like: `while (something) ;` (But you'd better have a good reason for doing that.) -* `case "foo": doSomething(); break` +* `case 'foo': doSomething(); break` * In front of a leading `(` or `[` at the start of the line. This prevents the expression from being interpreted as a function call or property access, respectively. @@ -72,9 +72,9 @@ Some examples of good semicolon usage: ;[a, b, c].forEach(doSomething) for (var i = 0; i < 10; i ++) { switch (state) { - case "begin": start(); continue - case "end": finish(); break - default: throw new Error("unknown state") + case 'begin': start(); continue + case 'end': finish(); break + default: throw new Error('unknown state') } end() } @@ -89,18 +89,30 @@ 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: - var magicWords = [ "abracadabra" - , "gesundheit" - , "ventrilo" + var magicWords = [ 'abracadabra' + , 'gesundheit' + , 'ventrilo' ] - , spells = { "fireball" : function () { setOnFire() } - , "water" : function () { putOut() } + , spells = { 'fireball' : function () { setOnFire() } + , 'water' : function () { putOut() } } , a = 1 - , b = "abc" + , b = 'abc' , etc , somethingElse +## Quotes +Use single quotes for strings except to avoid escaping. + +Bad: + + var notOk = "Just double quotes" + +Good: + + var ok = 'String contains "double" quotes' + var alsoOk = "String contains 'single' quotes or apostrophe" + ## Whitespace Put a single space in front of ( for anything other than a function call. diff --git a/deps/npm/doc/misc/npm-config.md b/deps/npm/doc/misc/npm-config.md index 4b9d32ba3338cc..f88bf9f8a048dc 100644 --- a/deps/npm/doc/misc/npm-config.md +++ b/deps/npm/doc/misc/npm-config.md @@ -28,15 +28,15 @@ The four relevant files are: * per-project config file (/path/to/my/project/.npmrc) * per-user config file (~/.npmrc) -* global config file ($PREFIX/npmrc) +* global config file ($PREFIX/etc/npmrc) * npm builtin config file (/path/to/npm/npmrc) See npmrc(5) for more details. ### Default Configs -A set of configuration parameters that are internal to npm, and are -defaults if nothing else is specified. +Run `npm config ls -l` to see a set of configuration parameters that are +internal to npm, and are defaults if nothing else is specified. ## Shorthands and Other CLI Niceties @@ -124,6 +124,14 @@ you want your scoped package to be publicly viewable (and installable) set Force npm to always require authentication when accessing the registry, even for `GET` requests. +### also + +* Default: null +* Type: String + +When "dev" or "development" and running local `npm shrinkwrap`, +`npm outdated`, or `npm update`, is an alias for `--dev`. + ### bin-links * Default: `true` @@ -268,6 +276,17 @@ Install `dev-dependencies` along with packages. Note that `dev-dependencies` are also installed if the `npat` flag is set. +### dry-run + +* Default: false +* Type: Boolean + +Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, `install`, `update`, +`dedupe`, `uninstall`. This is NOT currently honored by network related +commands, eg `dist-tags`, `owner`, `publish`, etc. + ### editor * Default: `EDITOR` environment variable if set, or `"vi"` on Posix, @@ -561,6 +580,24 @@ Run tests on installation. A node module to `require()` when npm loads. Useful for programmatic usage. +### only + +* Default: null +* Type: String + +When "dev" or "development" and running local `npm install` without any +arguments, only devDependencies (and their dependencies) are installed. + +When "dev" or "development" and running local `npm ls`, `npm outdated`, or +`npm update`, is an alias for `--dev`. + +When "prod" or "production" and running local `npm install` without any +arguments, only non-devDependencies (and their dependencies) are +installed. + +When "prod" or "production" and running local `npm ls`, `npm outdated`, or +`npm update`, is an alias for `--production`. + ### optional * Default: true @@ -597,6 +634,16 @@ Set to true to run in "production" mode. local `npm install` without any arguments. 2. Set the NODE_ENV="production" for lifecycle scripts. +### progress + +* Default: true +* Type: Boolean + +When set to `true`, npm will display a progress bar during time intensive +operations, if `process.stderr` is a TTY. + +Set to `false` to suppress the progress bar. + ### proprietary-attribs * Default: true @@ -772,17 +819,6 @@ using `-s` to add a signature. Note that git requires you to have set up GPG keys in your git configs for this to work properly. -### spin - -* Default: true -* Type: Boolean or `"always"` - -When set to `true`, npm will display an ascii spinner while it is doing -things, if `process.stderr` is a TTY. - -Set to `false` to suppress the spinner, or set to `always` to output -the spinner even for non-TTY outputs. - ### strict-ssl * Default: true @@ -827,7 +863,7 @@ on success, but left behind on failure for forensic purposes. ### unicode -* Default: true +* Default: true on windows and mac/unix systems with a unicode locale * Type: Boolean When set to true, npm uses unicode characters in the tree output. When diff --git a/deps/npm/doc/misc/npm-faq.md b/deps/npm/doc/misc/npm-faq.md index 557ec1a9c6c27a..cc1c19e61a7458 100644 --- a/deps/npm/doc/misc/npm-faq.md +++ b/deps/npm/doc/misc/npm-faq.md @@ -7,18 +7,19 @@ npm-faq(7) -- Frequently Asked Questions npm config set viewer browser -to open these documents in your default web browser rather than `man`. +This command will set the npm docs to open in your default web browser rather than `man`. ## It didn't work. -That's not really a question. +Please provide a little more detail, search for the error via [Google](https://google.com) or [StackOverflow npm](http://stackoverflow.com/search?q=npm) to see if another developer has encountered a similar problem. ## Why didn't it work? I don't know yet. -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. +Try reading the error output first, ensure this is a true npm issue and not a package issue. If you are having an issue with a package dependency, please submit your error to that particular package maintainer. + +For any npm issues, try following the instructions, or even retracing your steps. If the issue continues to persist, submit a bug with the steps to reproduce, please include the operating system you are working on, along with the error you recieve. ## Where does npm put stuff? @@ -28,7 +29,7 @@ tl;dr: * Use the `npm root` command to see where modules go, and the `npm bin` command to see where executables go -* Global installs are different from local installs. If you install +* Global installs are different from local installs. If you install something with the `-g` flag, then its executables go in `npm bin -g` and its modules go in `npm root -g`. diff --git a/deps/npm/doc/misc/npm-index.md b/deps/npm/doc/misc/npm-index.md index 4efcb92af35698..1bf102f4e49ab0 100644 --- a/deps/npm/doc/misc/npm-index.md +++ b/deps/npm/doc/misc/npm-index.md @@ -141,10 +141,6 @@ Open package repository page in the browser Restart a package -### npm-rm(1) - -Remove a package - ### npm-root(1) Display npm root @@ -217,166 +213,6 @@ Display npm username Using npm in your Node programs -### npm(3) - -javascript package manager - -### npm-bin(3) - -Display npm bin folder - -### npm-bugs(3) - -Bugs for a package in a web browser maybe - -### npm-cache(3) - -manage the npm cache programmatically - -### 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 - -### npm-link(3) - -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-ping(3) - -Ping npm registry - -### npm-prefix(3) - -Display prefix - -### npm-prune(3) - -Remove extraneous packages - -### npm-publish(3) - -Publish a package - -### npm-rebuild(3) - -Rebuild a package - -### npm-repo(3) - -Open package repository page in the browser - -### npm-restart(3) - -Restart 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-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 File system structures npm uses diff --git a/deps/npm/doc/misc/npm-scripts.md b/deps/npm/doc/misc/npm-scripts.md index 12c7f23167d4d8..c7f8b20ce68eae 100644 --- a/deps/npm/doc/misc/npm-scripts.md +++ b/deps/npm/doc/misc/npm-scripts.md @@ -71,7 +71,7 @@ npm will default some script values based on package contents. * `"install": "node-gyp rebuild"`: - If there is a `bindings.gyp` file in the root of your package, npm will + If there is a `binding.gyp` file in the root of your package, npm will default the `install` command to compile using node-gyp. ## USER diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html index 3ff8701c178278..7d191393d4cc49 100644 --- a/deps/npm/html/doc/README.html +++ b/deps/npm/html/doc/README.html @@ -140,11 +140,11 @@

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.

-

In plainer english

+

In plainer English

npm is the property of npm, Inc.

If you publish something, it's yours, and you are solely accountable for it.

@@ -183,5 +183,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/api/npm-bin.html b/deps/npm/html/doc/api/npm-bin.html deleted file mode 100644 index f7dbcb1d6699e2..00000000000000 --- a/deps/npm/html/doc/api/npm-bin.html +++ /dev/null @@ -1,32 +0,0 @@ - - - npm-bin - - - - - - -
- -

npm-bin

Display npm bin folder

-

SYNOPSIS

-
npm.commands.bin(args, cb)
-

DESCRIPTION

-

Print the folder where npm will install executables.

-

This function should not be used programmatically. Instead, just refer -to the npm.bin property.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-bugs.html b/deps/npm/html/doc/api/npm-bugs.html deleted file mode 100644 index 787057361e1f7b..00000000000000 --- a/deps/npm/html/doc/api/npm-bugs.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-bugs - - - - - - -
- -

npm-bugs

Bugs for a package in a web browser maybe

-

SYNOPSIS

-
npm.commands.bugs(package, callback)
-

DESCRIPTION

-

This command tries to guess at the likely location of a package's -bug tracker URL, and then tries to open it using the --browser -config param.

-

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.

-

This command will launch a browser, so this command may not be the most -friendly for programmatic use.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-cache.html b/deps/npm/html/doc/api/npm-cache.html deleted file mode 100644 index 95640498f86008..00000000000000 --- a/deps/npm/html/doc/api/npm-cache.html +++ /dev/null @@ -1,46 +0,0 @@ - - - npm-cache - - - - - - -
- -

npm-cache

manage the npm cache programmatically

-

SYNOPSIS

-
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)
-

DESCRIPTION

-

This acts much the same ways as the npm-cache(1) command line -functionality.

-

The callback is called with the package.json data of the thing that is -eventually added to or read from the cache.

-

The top level npm.commands.cache(...) functionality is a public -interface, and like all commands on the npm.commands object, it will -match the command line behavior exactly.

-

However, the cache folder structure and the cache helper functions are -considered internal API surface, and as such, may change in future -releases of npm, potentially without warning or significant version -incrementation.

-

Use at your own risk.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-commands.html b/deps/npm/html/doc/api/npm-commands.html deleted file mode 100644 index 3b0dc843e25248..00000000000000 --- a/deps/npm/html/doc/api/npm-commands.html +++ /dev/null @@ -1,40 +0,0 @@ - - - npm-commands - - - - - - -
- -

npm-commands

npm commands

-

SYNOPSIS

-
npm.commands[<command>](args, callback)
-

DESCRIPTION

-

npm comes with a full set of commands, and each of the commands takes a -similar set of arguments.

-

In general, all commands on the command object take an array of positional -argument strings. The last argument to any function is a callback. Some -commands are special and take other optional arguments.

-

All commands have their own man page. See man npm-<command> for command-line -usage, or man 3 npm-<command> for programmatic usage.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-config.html b/deps/npm/html/doc/api/npm-config.html deleted file mode 100644 index e2f2519246c105..00000000000000 --- a/deps/npm/html/doc/api/npm-config.html +++ /dev/null @@ -1,61 +0,0 @@ - - - npm-config - - - - - - -
- -

npm-config

Manage the npm configuration files

-

SYNOPSIS

-
npm.commands.config(args, callback)
-var val = npm.config.get(key)
-npm.config.set(key, val)
-

DESCRIPTION

-

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:

-
    -
  • set

    -

    Sets a config parameter. The second element in args is interpreted as the - key, and the third element is interpreted as the value.

    -
  • -
  • get

    -

    Gets the value of a config parameter. The second element in args is the - key to get the value of.

    -
  • -
  • delete (rm or del)

    -

    Deletes a parameter from the config. The second element in args is the - key to delete.

    -
  • -
  • list (ls)

    -

    Show all configs that aren't secret. No parameters necessary.

    -
  • -
  • edit:

    -

    Opens the config file in the default editor. This command isn't very useful - programmatically, but it is made available.

    -
  • -
-

To programmatically access npm configuration settings, or set them for -the duration of a program, use the npm.config.set and npm.config.get -functions instead.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-deprecate.html b/deps/npm/html/doc/api/npm-deprecate.html deleted file mode 100644 index 5f35253d0ca4e7..00000000000000 --- a/deps/npm/html/doc/api/npm-deprecate.html +++ /dev/null @@ -1,51 +0,0 @@ - - - npm-deprecate - - - - - - -
- -

npm-deprecate

Deprecate a version of a package

-

SYNOPSIS

-
npm.commands.deprecate(args, callback)
-

DESCRIPTION

-

This command will update the npm registry entry for a package, providing -a deprecation warning to all who attempt to install it.

-

The 'args' parameter must have exactly two elements:

-
    -
  • package[@version]

    -

    The version portion is optional, and may be either a range, or a - specific version, or a tag.

    -
  • -
  • message

    -

    The warning message that will be printed whenever a user attempts to - install the package.

    -
  • -
-

Note that you must be the package owner to deprecate something. See the -owner and adduser help topics.

-

To un-deprecate a package, specify an empty string ("") for the message argument.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-docs.html b/deps/npm/html/doc/api/npm-docs.html deleted file mode 100644 index 908533f162dffb..00000000000000 --- a/deps/npm/html/doc/api/npm-docs.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-docs - - - - - - -
- -

npm-docs

Docs for a package in a web browser maybe

-

SYNOPSIS

-
npm.commands.docs(package, callback)
-

DESCRIPTION

-

This command tries to guess at the likely location of a package's -documentation URL, and then tries to open it using the --browser -config param.

-

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.

-

This command will launch a browser, so this command may not be the most -friendly for programmatic use.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-edit.html b/deps/npm/html/doc/api/npm-edit.html deleted file mode 100644 index 6acabac5542f00..00000000000000 --- a/deps/npm/html/doc/api/npm-edit.html +++ /dev/null @@ -1,40 +0,0 @@ - - - npm-edit - - - - - - -
- -

npm-edit

Edit an installed package

-

SYNOPSIS

-
npm.commands.edit(package, callback)
-

DESCRIPTION

-

Opens the package folder in the default editor (or whatever you've -configured as the npm editor config -- see npm help config.)

-

After it has been edited, the package is rebuilt so as to pick up any -changes in compiled packages.

-

For instance, you can do npm install connect to install connect -into your package, and then npm.commands.edit(["connect"], callback) -to make a few changes to your locally installed copy.

-

The first parameter is a string array with a single element, the package -to open. The package can optionally have a version number attached.

-

Since this command opens an editor in a new process, be careful about where -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 deleted file mode 100644 index 587ebfd0365c74..00000000000000 --- a/deps/npm/html/doc/api/npm-explore.html +++ /dev/null @@ -1,35 +0,0 @@ - - - npm-explore - - - - - - -
- -

npm-explore

Browse an installed package

-

SYNOPSIS

-
npm.commands.explore(args, callback)
-

DESCRIPTION

-

Spawn a subshell in the directory of the installed package specified.

-

If a command is specified, then it is run in the subshell, which then -immediately terminates.

-

Note that the package is not automatically rebuilt afterwards, so be -sure to use npm rebuild <pkg> if you make any changes.

-

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/html/doc/api/npm-help-search.html b/deps/npm/html/doc/api/npm-help-search.html deleted file mode 100644 index 0732f3f66f0cd2..00000000000000 --- a/deps/npm/html/doc/api/npm-help-search.html +++ /dev/null @@ -1,48 +0,0 @@ - - - npm-help-search - - - - - - -
- -

npm-help-search

Search the help pages

-

SYNOPSIS

-
npm.commands.helpSearch(args, [silent,] callback)
-

DESCRIPTION

-

This command is rarely useful, but it exists in the rare case that it is.

-

This command takes an array of search terms and returns the help pages that -match in order of best match.

-

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:

-
    -
  • hits: -A map of args to number of hits on that arg. For example, {"npm": 3}
  • -
  • found: -Total number of unique args that matched.
  • -
  • totalHits: -Total number of hits.
  • -
  • lines: -An array of all matching lines (and some adjacent lines).
  • -
  • file: -Name of the file that matched
  • -
-

The silent parameter is not necessary not used, but it may in the future.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-init.html b/deps/npm/html/doc/api/npm-init.html deleted file mode 100644 index 6beeaf6e2b71d3..00000000000000 --- a/deps/npm/html/doc/api/npm-init.html +++ /dev/null @@ -1,43 +0,0 @@ - - - npm-init - - - - - - -
- -

npm init

Interactively create a package.json file

-

SYNOPSIS

-
npm.commands.init(args, callback)
-

DESCRIPTION

-

This will ask you a bunch of questions, and then write a package.json for you.

-

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.

-

If you already have a package.json file, it'll read that first, and default to -the options in there.

-

It is strictly additive, so it does not delete options from your package.json -without a really good reason to do so.

-

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, -then go ahead and use this programmatically.

-

SEE ALSO

-

package.json(5)

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-install.html b/deps/npm/html/doc/api/npm-install.html deleted file mode 100644 index e697b8176f9b92..00000000000000 --- a/deps/npm/html/doc/api/npm-install.html +++ /dev/null @@ -1,36 +0,0 @@ - - - npm-install - - - - - - -
- -

npm-install

install a package programmatically

-

SYNOPSIS

-
npm.commands.install([where,] packages, callback)
-

DESCRIPTION

-

This acts much the same ways as installing on the command-line.

-

The 'where' parameter is optional and only used internally, and it specifies -where the packages should be installed to.

-

The 'packages' parameter is an array of strings. Each element in the array is -the name of a package to be installed.

-

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/html/doc/api/npm-link.html b/deps/npm/html/doc/api/npm-link.html deleted file mode 100644 index 4137329992f801..00000000000000 --- a/deps/npm/html/doc/api/npm-link.html +++ /dev/null @@ -1,46 +0,0 @@ - - - npm-link - - - - - - -
- -

npm-link

Symlink a package folder

-

SYNOPSIS

-
npm.commands.link(callback)
-npm.commands.link(packages, callback)
-

DESCRIPTION

-

Package linking is a two-step process.

-

Without parameters, link will create a globally-installed -symbolic link from prefix/package-name to the current folder.

-

With a parameters, link will create a symlink from the local node_modules -folder to the global symlink.

-

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.

-

For example:

-
npm.commands.link(cb)           # creates global link from the cwd
-                                # (say redis package)
-npm.commands.link('redis', cb)  # link-install the package
-

Now, any changes to the redis package will be reflected in -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 deleted file mode 100644 index 2af4720ac40b39..00000000000000 --- a/deps/npm/html/doc/api/npm-load.html +++ /dev/null @@ -1,41 +0,0 @@ - - - npm-load - - - - - - -
- -

npm-load

Load config settings

-

SYNOPSIS

-
npm.load(conf, cb)
-

DESCRIPTION

-

npm.load() must be called before any other function call. Both parameters are -optional, but the second is recommended.

-

The first parameter is an object containing command-line config params, and the -second parameter is a callback that will be called when npm is loaded and ready -to serve.

-

The first parameter should follow a similar structure as the package.json -config object.

-

For example, to emulate the --dev flag, pass an object that looks like this:

-
{
-  "dev": true
-}
-

For a list of all the available command-line configs, see npm help config

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-ls.html b/deps/npm/html/doc/api/npm-ls.html deleted file mode 100644 index b0d31e2515fc8b..00000000000000 --- a/deps/npm/html/doc/api/npm-ls.html +++ /dev/null @@ -1,67 +0,0 @@ - - - npm-ls - - - - - - -
- -

npm-ls

List installed packages

-

SYNOPSIS

-
npm.commands.ls(args, [silent,] callback)
-

DESCRIPTION

-

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.

-

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 global to list global packages.

-

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

-

If the silent parameter is set to true, nothing will be output to the screen, -but the data will still be returned.

-

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.

-

CONFIGURATION

-

long

-
    -
  • Default: false
  • -
  • Type: Boolean
  • -
-

Show extended information.

-

parseable

-
    -
  • Default: false
  • -
  • Type: Boolean
  • -
-

Show parseable output instead of tree view.

-

global

-
    -
  • Default: false
  • -
  • Type: Boolean
  • -
-

List packages in the global install prefix instead of in the current -project.

-

Note, if parseable is set or long isn't set, then duplicates will be trimmed. -This means that if a submodule has the same dependency as a parent module, then the -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 deleted file mode 100644 index 5c564a6eea8188..00000000000000 --- a/deps/npm/html/doc/api/npm-outdated.html +++ /dev/null @@ -1,32 +0,0 @@ - - - npm-outdated - - - - - - -
- -

npm-outdated

Check for outdated packages

-

SYNOPSIS

-
npm.commands.outdated([packages,] callback)
-

DESCRIPTION

-

This command will check the registry to see if the specified packages are -currently outdated.

-

If the 'packages' parameter is left out, npm will check all packages.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-owner.html b/deps/npm/html/doc/api/npm-owner.html deleted file mode 100644 index 32c0e6feac02f4..00000000000000 --- a/deps/npm/html/doc/api/npm-owner.html +++ /dev/null @@ -1,51 +0,0 @@ - - - npm-owner - - - - - - -
- -

npm-owner

Manage package owners

-

SYNOPSIS

-
npm.commands.owner(args, callback)
-

DESCRIPTION

-

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):

-
    -
  • 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.
  • -
  • 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.
  • -
  • rm (user, package): -Remove a user from the package owner list. This immediately revokes their -privileges.
  • -
-

Note that there is only one level of access. Either you can modify a package, -or you can't. Future versions may contain more fine-grained access levels, but -that is not implemented at this time.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-pack.html b/deps/npm/html/doc/api/npm-pack.html deleted file mode 100644 index da0a19993cbb30..00000000000000 --- a/deps/npm/html/doc/api/npm-pack.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-pack - - - - - - -
- -

npm-pack

Create a tarball from a package

-

SYNOPSIS

-
npm.commands.pack([packages,] callback)
-

DESCRIPTION

-

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 <name>-<version>.tgz, and then write the filenames out to -stdout.

-

If the same package is specified multiple times, then the file will be -overwritten the second time.

-

If no arguments are supplied, then npm packs the current package folder.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-ping.html b/deps/npm/html/doc/api/npm-ping.html deleted file mode 100644 index b768c73d4538c5..00000000000000 --- a/deps/npm/html/doc/api/npm-ping.html +++ /dev/null @@ -1,32 +0,0 @@ - - - npm-ping - - - - - - -
- -

npm-ping

Ping npm registry

-

SYNOPSIS

-
npm.registry.ping(registry, options, function (er, pong))
-

DESCRIPTION

-

Attempts to connect to the given registry, returning a pong -object with various metadata if it succeeds.

-

This function is primarily useful for debugging connection issues -to npm registries.

- -
- - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-prefix.html b/deps/npm/html/doc/api/npm-prefix.html deleted file mode 100644 index 6f9dcff7917a4e..00000000000000 --- a/deps/npm/html/doc/api/npm-prefix.html +++ /dev/null @@ -1,33 +0,0 @@ - - - npm-prefix - - - - - - -
- -

npm-prefix

Display prefix

-

SYNOPSIS

-
npm.commands.prefix(args, callback)
-

DESCRIPTION

-

Print the prefix to standard out.

-

'args' is never used and callback is never called with data. -'args' must be present or things will break.

-

This function is not useful programmatically

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-prune.html b/deps/npm/html/doc/api/npm-prune.html deleted file mode 100644 index 44f67558217df0..00000000000000 --- a/deps/npm/html/doc/api/npm-prune.html +++ /dev/null @@ -1,34 +0,0 @@ - - - npm-prune - - - - - - -
- -

npm-prune

Remove extraneous packages

-

SYNOPSIS

-
npm.commands.prune([packages,] callback)
-

DESCRIPTION

-

This command removes "extraneous" packages.

-

The first parameter is optional, and it specifies packages to be removed.

-

No packages are specified, then all packages will be checked.

-

Extraneous packages are packages that are not listed on the parent -package's dependencies list.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-publish.html b/deps/npm/html/doc/api/npm-publish.html deleted file mode 100644 index 9aec5e56509bb5..00000000000000 --- a/deps/npm/html/doc/api/npm-publish.html +++ /dev/null @@ -1,50 +0,0 @@ - - - npm-publish - - - - - - -
- -

npm-publish

Publish a package

-

SYNOPSIS

-
npm.commands.publish([packages,] callback)
-

DESCRIPTION

-

Publishes a package to the registry so that it can be installed by name. -Possible values in the 'packages' array are:

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

    -
  • -
  • <tarball>: -A url or file path to a gzipped tar archive containing a single folder -with a package.json file inside.

    -
  • -
-

If the package array is empty, npm will try to publish something in the -current working directory.

-

This command could fails if one of the packages specified already exists in -the registry. Overwrites when the "force" environment variable is set.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-rebuild.html b/deps/npm/html/doc/api/npm-rebuild.html deleted file mode 100644 index f65c948f25b689..00000000000000 --- a/deps/npm/html/doc/api/npm-rebuild.html +++ /dev/null @@ -1,34 +0,0 @@ - - - npm-rebuild - - - - - - -
- -

npm-rebuild

Rebuild a package

-

SYNOPSIS

-
npm.commands.rebuild([packages,] callback)
-

DESCRIPTION

-

This command runs the npm build 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.

-

CONFIGURATION

-

See npm help build

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-repo.html b/deps/npm/html/doc/api/npm-repo.html deleted file mode 100644 index c0f95fa2c6d181..00000000000000 --- a/deps/npm/html/doc/api/npm-repo.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-repo - - - - - - -
- -

npm-repo

Open package repository page in the browser

-

SYNOPSIS

-
npm.commands.repo(package, callback)
-

DESCRIPTION

-

This command tries to guess at the likely location of a package's -repository URL, and then tries to open it using the --browser -config param.

-

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.

-

This command will launch a browser, so this command may not be the most -friendly for programmatic use.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-restart.html b/deps/npm/html/doc/api/npm-restart.html deleted file mode 100644 index 7390b50d270187..00000000000000 --- a/deps/npm/html/doc/api/npm-restart.html +++ /dev/null @@ -1,56 +0,0 @@ - - - npm-restart - - - - - - -
- -

npm-restart

Restart a package

-

SYNOPSIS

-
npm.commands.restart(packages, callback)
-

DESCRIPTION

-

This restarts a package (or multiple packages).

-

This runs a package's "stop", "restart", and "start" scripts, and associated -pre- and post- scripts, in the order given below:

-
    -
  1. prerestart
  2. -
  3. prestop
  4. -
  5. stop
  6. -
  7. poststop
  8. -
  9. restart
  10. -
  11. prestart
  12. -
  13. start
  14. -
  15. poststart
  16. -
  17. postrestart
  18. -
-

If no version is specified, then it restarts the "active" version.

-

npm can restart multiple packages. Just specify multiple packages in -the packages parameter.

-

NOTE

-

Note that the "restart" script is run in addition to the "stop" -and "start" scripts, not instead of them.

-

This is the behavior as of npm major version 2. A change in this -behavior will be accompanied by an increase in major version number

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-root.html b/deps/npm/html/doc/api/npm-root.html deleted file mode 100644 index 706518ad20e9ba..00000000000000 --- a/deps/npm/html/doc/api/npm-root.html +++ /dev/null @@ -1,33 +0,0 @@ - - - npm-root - - - - - - -
- -

npm-root

Display npm root

-

SYNOPSIS

-
npm.commands.root(args, callback)
-

DESCRIPTION

-

Print the effective node_modules folder to standard out.

-

'args' is never used and callback is never called with data. -'args' must be present or things will break.

-

This function is not useful programmatically.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-run-script.html b/deps/npm/html/doc/api/npm-run-script.html deleted file mode 100644 index 196ea26143afa0..00000000000000 --- a/deps/npm/html/doc/api/npm-run-script.html +++ /dev/null @@ -1,45 +0,0 @@ - - - npm-run-script - - - - - - -
- -

npm-run-script

Run arbitrary package scripts

-

SYNOPSIS

-
npm.commands.run-script(args, callback)
-

DESCRIPTION

-

This runs an arbitrary command from a package's "scripts" object.

-

It is used by the test, start, restart, and stop commands, but can be -called directly, as well.

-

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.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-search.html b/deps/npm/html/doc/api/npm-search.html deleted file mode 100644 index 3c83b1a6c22bee..00000000000000 --- a/deps/npm/html/doc/api/npm-search.html +++ /dev/null @@ -1,57 +0,0 @@ - - - npm-search - - - - - - -
- -

npm-search

Search for packages

-

SYNOPSIS

-
npm.commands.search(searchTerms, [silent,] [staleness,] callback)
-

DESCRIPTION

-

Search the registry for packages matching the search terms. The available parameters are:

-
    -
  • searchTerms: -Array of search terms. These terms are case-insensitive.
  • -
  • silent: -If true, npm will not log anything to the console.
  • -
  • staleness: -This is the threshold for stale packages. "Fresh" packages are not refreshed -from the registry. This value is measured in seconds.
  • -
  • 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 -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:

    -
      -
    • name
    • -
    • description
    • -
    • maintainers
    • -
    • url
    • -
    • keywords
    • -
    -
  • -
-

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 -like).

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-shrinkwrap.html b/deps/npm/html/doc/api/npm-shrinkwrap.html deleted file mode 100644 index f9c37187ac2425..00000000000000 --- a/deps/npm/html/doc/api/npm-shrinkwrap.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-shrinkwrap - - - - - - -
- -

npm-shrinkwrap

programmatically generate package shrinkwrap file

-

SYNOPSIS

-
npm.commands.shrinkwrap(args, [silent,] callback)
-

DESCRIPTION

-

This acts much the same ways as shrinkwrapping on the command-line.

-

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.

-

If the 'silent' parameter is set to true, nothing will be output to the screen, -but the shrinkwrap file will still be written.

-

Finally, 'callback' is a function that will be called when the shrinkwrap has -been saved.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-start.html b/deps/npm/html/doc/api/npm-start.html deleted file mode 100644 index 2e02140363285e..00000000000000 --- a/deps/npm/html/doc/api/npm-start.html +++ /dev/null @@ -1,32 +0,0 @@ - - - npm-start - - - - - - -
- -

npm-start

Start a package

-

SYNOPSIS

-
npm.commands.start(packages, callback)
-

DESCRIPTION

-

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

-

npm can start multiple packages. Just specify multiple packages in the -packages parameter.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-stop.html b/deps/npm/html/doc/api/npm-stop.html deleted file mode 100644 index 7a83de6a08c001..00000000000000 --- a/deps/npm/html/doc/api/npm-stop.html +++ /dev/null @@ -1,32 +0,0 @@ - - - npm-stop - - - - - - -
- -

npm-stop

Stop a package

-

SYNOPSIS

-
npm.commands.stop(packages, callback)
-

DESCRIPTION

-

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

-

npm can run stop on multiple packages. Just specify multiple packages -in the packages parameter.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-tag.html b/deps/npm/html/doc/api/npm-tag.html deleted file mode 100644 index 6569e063275d6d..00000000000000 --- a/deps/npm/html/doc/api/npm-tag.html +++ /dev/null @@ -1,40 +0,0 @@ - - - npm-tag - - - - - - -
- -

npm-tag

Tag a published version

-

SYNOPSIS

-
npm.commands.tag(package@version, tag, callback)
-

DESCRIPTION

-

Tags the specified version of the package with the specified tag, or the ---tag config if not specified.

-

The 'package@version' is an array of strings, but only the first two elements are -currently used.

-

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).

-

The second element is the name of the tag to tag this version with. If this -parameter is missing or falsey (empty), the default from the config will be -used. For more information about how to set this config, check -man 3 npm-config for programmatic usage or man npm-config for cli usage.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-test.html b/deps/npm/html/doc/api/npm-test.html deleted file mode 100644 index c556185e38f3bb..00000000000000 --- a/deps/npm/html/doc/api/npm-test.html +++ /dev/null @@ -1,34 +0,0 @@ - - - npm-test - - - - - - -
- -

npm-test

Test a package

-

SYNOPSIS

-
  npm.commands.test(packages, callback)
-

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 -true.

-

npm can run tests on multiple packages. Just specify multiple packages -in the packages parameter.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-uninstall.html b/deps/npm/html/doc/api/npm-uninstall.html deleted file mode 100644 index 33c7016ee7fe7d..00000000000000 --- a/deps/npm/html/doc/api/npm-uninstall.html +++ /dev/null @@ -1,34 +0,0 @@ - - - npm-uninstall - - - - - - -
- -

npm-uninstall

uninstall a package programmatically

-

SYNOPSIS

-
npm.commands.uninstall(packages, callback)
-

DESCRIPTION

-

This acts much the same ways as uninstalling on the command-line.

-

The 'packages' parameter is an array of strings. Each element in the array is -the name of a package to be uninstalled.

-

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/html/doc/api/npm-unpublish.html b/deps/npm/html/doc/api/npm-unpublish.html deleted file mode 100644 index 03e4d93ee8ea17..00000000000000 --- a/deps/npm/html/doc/api/npm-unpublish.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-unpublish - - - - - - -
- -

npm-unpublish

Remove a package from the registry

-

SYNOPSIS

-
npm.commands.unpublish(package, callback)
-

DESCRIPTION

-

This removes a package version from the registry, deleting its -entry and removing the tarball.

-

The package parameter must be defined.

-

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.

-

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/html/doc/api/npm-update.html b/deps/npm/html/doc/api/npm-update.html deleted file mode 100644 index fc42422829be8b..00000000000000 --- a/deps/npm/html/doc/api/npm-update.html +++ /dev/null @@ -1,37 +0,0 @@ - - - npm-update - - - - - - -
- -

npm-update

Update a package

-

SYNOPSIS

-
npm.commands.update(packages, callback)
-

DESCRIPTION

-

Updates a package, upgrading it to the latest version. It also installs any -missing packages.

-

The packages argument is an array of packages to update. The callback -parameter will be called when done or when an error occurs.

-

SEE ALSO

- - -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-version.html b/deps/npm/html/doc/api/npm-version.html deleted file mode 100644 index d584335baed1fe..00000000000000 --- a/deps/npm/html/doc/api/npm-version.html +++ /dev/null @@ -1,36 +0,0 @@ - - - npm-version - - - - - - -
- -

npm-version

Bump a package version

-

SYNOPSIS

-
npm.commands.version(newversion, callback)
-

DESCRIPTION

-

Run this in a package directory to bump the version and write the new -data back to the package.json file.

-

If run in a git repo, it will also create a version commit and tag, and -fail if the repo is not clean.

-

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/html/doc/api/npm-view.html b/deps/npm/html/doc/api/npm-view.html deleted file mode 100644 index 110f222c02ad60..00000000000000 --- a/deps/npm/html/doc/api/npm-view.html +++ /dev/null @@ -1,85 +0,0 @@ - - - npm-view - - - - - - -
- -

npm-view

View registry info

-

SYNOPSIS

-
npm.commands.view(args, [silent,] callback)
-

DESCRIPTION

-

This command shows data about a package and prints it to the stream -referenced by the outfd config, which defaults to stdout.

-

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.

-

The callback will be passed all of the data returned by the query.

-

For example, to get the package registry entry for the connect package, -you can do this:

-
npm.commands.view(["connect"], callback)
-

If no version is specified, "latest" is assumed.

-

Field names can be specified after the package descriptor. -For example, to show the dependencies of the ronn package at version -0.3.5, you could do the following:

-
npm.commands.view(["ronn@0.3.5", "dependencies"], callback)
-

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:

-
npm.commands.view(["npm", "repository.url"], callback)
-

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:

-
npm.commands.view(["express", "contributors.email"], callback)
-

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:

-
npm.commands.view(["express", "contributors[0].email"], callback)
-

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:

-
npm.commands.view(["express", "contributors.name", "contributors.email"], callback)
-

"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 json for more on this.)

-
npm.commands.view(["npm", "contributors"], callback)
-

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:

-
npm.commands.view(["yui3@>0.5.4", "dependencies.jsdom"], callback)
-

OUTPUT

-

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 version range matches multiple versions, than each printed value -will be prefixed with the version it applies to.

-

If multiple fields are requested, than each of them are prefixed with -the field name.

-

Console output can be disabled by setting the 'silent' parameter to true.

-

RETURN VALUE

-

The data returned will be an object in this formation:

-
{ <version>:
-  { <field>: <value>
-  , ... }
-, ... }
-

corresponding to the list of fields selected.

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm-whoami.html b/deps/npm/html/doc/api/npm-whoami.html deleted file mode 100644 index 30cd99f8a9a52e..00000000000000 --- a/deps/npm/html/doc/api/npm-whoami.html +++ /dev/null @@ -1,33 +0,0 @@ - - - npm-whoami - - - - - - -
- -

npm-whoami

Display npm username

-

SYNOPSIS

-
npm.commands.whoami(args, callback)
-

DESCRIPTION

-

Print the username config to standard output.

-

'args' is never used and callback is never called with data. -'args' must be present or things will break.

-

This function is not useful programmatically

- -
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/api/npm.html b/deps/npm/html/doc/api/npm.html deleted file mode 100644 index b1e961cb88605f..00000000000000 --- a/deps/npm/html/doc/api/npm.html +++ /dev/null @@ -1,113 +0,0 @@ - - - npm - - - - - - -
- -

npm

javascript package manager

-

SYNOPSIS

-
var npm = require("npm")
-npm.load([configObject, ]function (er, npm) {
-  // 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)
-})
-

VERSION

-

2.14.7

-

DESCRIPTION

-

This is the API documentation for npm. -To find documentation of the command line -client, see npm(1).

-

Prior to using npm's commands, npm.load() must be called. If you provide -configObject as an object map 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-config(1), npm-config(7), and npmrc(5) for more information.

-

After that, each of the functions are accessible in the -commands object: npm.commands.<cmd>. See npm-index(7) for a list of -all possible commands.

-

All commands on the command object take an array of positional argument -strings. The last argument to any function is a callback. Some -commands take other optional arguments.

-

Configs cannot currently be set on a per function basis, as each call to -npm.config.set will change the value for all npm commands in that process.

-

To find API documentation for a specific command, run the npm apihelp -command.

-

METHODS AND PROPERTIES

-
    -
  • npm.load(configs, cb)

    -

    Load the configuration params, and call the cb function once the - globalconfig and userconfig files have been loaded as well, or on - nextTick if they've already been loaded.

    -
  • -
  • npm.config

    -

    An object for accessing npm configuration parameters.

    -
      -
    • npm.config.get(key)
    • -
    • npm.config.set(key, val)
    • -
    • npm.config.del(key)
    • -
    -
  • -
  • npm.dir or npm.root

    -

    The node_modules directory where npm will operate.

    -
  • -
  • npm.prefix

    -

    The prefix where npm is operating. (Most often the current working - directory.)

    -
  • -
  • npm.cache

    -

    The place where npm keeps JSON and tarballs it fetches from the - registry (or uploads to the registry).

    -
  • -
  • npm.tmp

    -

    npm's temporary working directory.

    -
  • -
  • npm.deref

    -

    Get the "real" name for a command that has either an alias or - abbreviation.

    -
  • -
-

MAGIC

-

For each of the methods in the npm.commands object, a method is added to the -npm object, which takes a set of positional string arguments rather than an -array and a callback.

-

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.

-

For example, this would work in a node repl:

-
> npm = require("npm")
-> npm.load()  // wait a sec...
-> npm.install("dnode", "express")
-

Note that that won't work in a node program, since the install -method will get called before the configuration load is completed.

-

ABBREVS

-

In order to support npm ins foo instead of npm install foo, the -npm.commands object has a set of abbreviations as well as the full -method names. Use the npm.deref method to find the real name.

-

For example:

-
var cmd = npm.deref("unp") // cmd === "unpublish"
-
-
- - - - - - - - - - - - diff --git a/deps/npm/html/doc/cli/npm-access.html b/deps/npm/html/doc/cli/npm-access.html index 761aea5e5250ab..001fe175cddc65 100644 --- a/deps/npm/html/doc/cli/npm-access.html +++ b/deps/npm/html/doc/cli/npm-access.html @@ -84,5 +84,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html index a331bfbbf543c4..d3d9c2e61844df 100644 --- a/deps/npm/html/doc/cli/npm-adduser.html +++ b/deps/npm/html/doc/cli/npm-adduser.html @@ -68,5 +68,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html index 12c598c62ffc5b..c7c39e06c215ff 100644 --- a/deps/npm/html/doc/cli/npm-bin.html +++ b/deps/npm/html/doc/cli/npm-bin.html @@ -11,7 +11,7 @@

npm-bin

Display npm bin folder

SYNOPSIS

-
npm bin
+
npm bin [-g|--global]
 

DESCRIPTION

Print the folder where npm will install executables.

SEE ALSO

@@ -35,5 +35,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html index fcd2b88da1c46f..862cd8ee642b42 100644 --- a/deps/npm/html/doc/cli/npm-bugs.html +++ b/deps/npm/html/doc/cli/npm-bugs.html @@ -11,8 +11,7 @@

npm-bugs

Bugs for a package in a web browser maybe

SYNOPSIS

-
npm bugs <pkgname>
-npm bugs (with no args in a package dir)
+
npm bugs [<pkgname>]
 

DESCRIPTION

This command tries to guess at the likely location of a package's bug tracker URL, and then tries to open it using the --browser @@ -54,5 +53,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html index 9bc91614328b52..b6303676288409 100644 --- a/deps/npm/html/doc/cli/npm-build.html +++ b/deps/npm/html/doc/cli/npm-build.html @@ -11,7 +11,7 @@

npm-build

Build a package

SYNOPSIS

-
npm build <package-folder>
+
npm build [<package-folder>]
 
  • <package-folder>: A folder containing a package.json file in its root.
  • @@ -40,5 +40,5 @@

    DESCRIPTION

           - + diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html index 81a65c16921498..8d2e9e4b39b30c 100644 --- a/deps/npm/html/doc/cli/npm-bundle.html +++ b/deps/npm/html/doc/cli/npm-bundle.html @@ -31,5 +31,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html index 85179374751b82..989c06bdced5f2 100644 --- a/deps/npm/html/doc/cli/npm-cache.html +++ b/deps/npm/html/doc/cli/npm-cache.html @@ -81,5 +81,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html index 15f71fb290f1bb..150957ba65b0cc 100644 --- a/deps/npm/html/doc/cli/npm-completion.html +++ b/deps/npm/html/doc/cli/npm-completion.html @@ -11,14 +11,16 @@

    npm-completion

    Tab Completion for npm

    SYNOPSIS

    -
    . <(npm completion)
    +
    source <(npm completion)
     

    DESCRIPTION

    Enables tab-completion in all npm commands.

    The synopsis above loads the completions into your current shell. Adding it to your ~/.bashrc or ~/.zshrc will make the completions available -everywhere.

    -

    You may of course also pipe the output of npm completion to a file +everywhere:

    +
    npm completion >> ~/.bashrc
    +npm completion >> ~/.zshrc
    +

    You may of course also pipe the output of npm completion to a file such as /usr/local/etc/bash_completion.d/npm if you have a system that will read that file for you.

    When COMP_CWORD, COMP_LINE, and COMP_POINT are defined in the @@ -42,5 +44,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html index d73762fe026dd0..b38e1dd29af891 100644 --- a/deps/npm/html/doc/cli/npm-config.html +++ b/deps/npm/html/doc/cli/npm-config.html @@ -11,14 +11,13 @@

    npm-config

    Manage the npm configuration files

    SYNOPSIS

    -
    npm config set <key> <value> [--global]
    +
    npm config set <key> <value> [-g|--global]
     npm config get <key>
     npm config delete <key>
     npm config list
     npm config edit
    -npm c [set|get|delete|list]
     npm get <key>
    -npm set <key> <value> [--global]
    +npm set <key> <value> [-g|--global]
     

    DESCRIPTION

    npm gets its config settings from the command line, environment variables, npmrc files, and in some cases, the package.json file.

    @@ -66,5 +65,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html index b8bab0074dd91f..1e161006951bd2 100644 --- a/deps/npm/html/doc/cli/npm-dedupe.html +++ b/deps/npm/html/doc/cli/npm-dedupe.html @@ -31,20 +31,16 @@

    SYNOPSIS

    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.

    +

    The deduplication algorithm walks the tree, moving each dependency as far +up in the tree as possible, even if duplicates are not found. This will +result in both a flat and deduplicated tree.

    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.

    -

    If no suitable version can be found, then a warning is printed, and -nothing is done.

    -

    If any arguments are supplied, then they are filters, and only the -named packages will be touched.

    -

    Note that this operation transforms the dependency tree, and may -result in packages getting updated versions, perhaps from the npm -registry.

    -

    This feature is experimental, and may change in future versions.

    -

    The --tag 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.

    +

    Arguments are ignored. Dedupe always acts on the entire tree.

    +

    Modules

    +

    Note that this operation transforms the dependency tree, but will never +result in new modules being installed.

    SEE ALSO

    • npm-ls(1)
    • @@ -63,5 +59,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html index 9549631b692012..22492af06e6aae 100644 --- a/deps/npm/html/doc/cli/npm-deprecate.html +++ b/deps/npm/html/doc/cli/npm-deprecate.html @@ -11,7 +11,7 @@

      npm-deprecate

      Deprecate a version of a package

      SYNOPSIS

      -
      npm deprecate <name>[@<version>] <message>
      +
      npm deprecate <pkg>[@<version>] <message>
       

      DESCRIPTION

      This command will update the npm registry entry for a package, providing a deprecation warning to all who attempt to install it.

      @@ -38,5 +38,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-dist-tag.html b/deps/npm/html/doc/cli/npm-dist-tag.html index 2a683e71065c43..49d06f74a3a727 100644 --- a/deps/npm/html/doc/cli/npm-dist-tag.html +++ b/deps/npm/html/doc/cli/npm-dist-tag.html @@ -77,5 +77,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html index 0e17c157fc6abc..763d17fef4c850 100644 --- a/deps/npm/html/doc/cli/npm-docs.html +++ b/deps/npm/html/doc/cli/npm-docs.html @@ -12,9 +12,9 @@

      npm-docs

      Docs for a package in a web browser maybe

      SYNOPSIS

      npm docs [<pkgname> [<pkgname> ...]]
      -npm docs (with no args in a package dir)
      +npm docs .
       npm home [<pkgname> [<pkgname> ...]]
      -npm home (with no args in a package dir)
      +npm home .
       

      DESCRIPTION

      This command tries to guess at the likely location of a package's documentation URL, and then tries to open it using the --browser @@ -56,5 +56,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html index 79c150019e1023..47581a3260dc7a 100644 --- a/deps/npm/html/doc/cli/npm-edit.html +++ b/deps/npm/html/doc/cli/npm-edit.html @@ -11,7 +11,7 @@

      npm-edit

      Edit an installed package

      SYNOPSIS

      -
      npm edit <name>[@<version>]
      +
      npm edit <pkg>[@<version>]
       

      DESCRIPTION

      Opens the package folder in the default editor (or whatever you've configured as the npm editor config -- see npm-config(7).)

      @@ -49,5 +49,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html index 29364ad4f3921c..d585315aa0fb00 100644 --- a/deps/npm/html/doc/cli/npm-explore.html +++ b/deps/npm/html/doc/cli/npm-explore.html @@ -11,7 +11,7 @@

      npm-explore

      Browse an installed package

      SYNOPSIS

      -
      npm explore <name> [ -- <cmd>]
      +
      npm explore <pkg> [ -- <cmd>]
       

      DESCRIPTION

      Spawn a subshell in the directory of the installed package specified.

      If a command is specified, then it is run in the subshell, which then @@ -49,5 +49,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html index 2ff4a11ac69943..3d1205c0c3c9fa 100644 --- a/deps/npm/html/doc/cli/npm-help-search.html +++ b/deps/npm/html/doc/cli/npm-help-search.html @@ -11,7 +11,7 @@

      npm-help-search

      Search npm help documentation

      SYNOPSIS

      -
      npm help-search some search terms
      +
      npm help-search <text>
       

      DESCRIPTION

      This command will search the npm markdown documentation files for the terms provided, and then list the results, sorted by relevance.

      @@ -46,5 +46,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html index 13b670b596e7c4..f7cbfd7c22f217 100644 --- a/deps/npm/html/doc/cli/npm-help.html +++ b/deps/npm/html/doc/cli/npm-help.html @@ -11,8 +11,7 @@

      npm-help

      Get help on npm

      SYNOPSIS

      -
      npm help <topic>
      -npm help some search terms
      +
      npm help <term> [<terms..>]
       

      DESCRIPTION

      If supplied a topic, then show the appropriate documentation page.

      If the topic does not exist, or if multiple terms are provided, then run @@ -52,5 +51,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html index d9c3d05247d764..b23c3b9e5b51cd 100644 --- a/deps/npm/html/doc/cli/npm-init.html +++ b/deps/npm/html/doc/cli/npm-init.html @@ -48,5 +48,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html index ab3e03f9ba6ffd..52ffa24fb4f9bc 100644 --- a/deps/npm/html/doc/cli/npm-install.html +++ b/deps/npm/html/doc/cli/npm-install.html @@ -11,15 +11,17 @@

      npm-install

      Install a package

      SYNOPSIS

      -
      npm install (with no args in a package dir)
      +
      npm install (with no args, in package dir)
      +npm install [<@scope>/]<name>
      +npm install [<@scope>/]<name>@<tag>
      +npm install [<@scope>/]<name>@<version>
      +npm install [<@scope>/]<name>@<version range>
       npm install <tarball file>
       npm install <tarball url>
       npm install <folder>
      -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)
      +
      +alias: npm i
      +common options: [-S|--save|-D|--save-dev|-O|--save-optional] [-E|--save-exact] [--dry-run]
       

      DESCRIPTION

      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 @@ -32,7 +34,7 @@

      SYNOPSIS

    • d) a <name>@<version> that is published on the registry (see npm-registry(7)) with (c)
    • e) a <name>@<tag> that points to (d)
    • f) a <name> that has a "latest" tag satisfying (e)
    • -
    • g) a <git remote url> that resolves to (b)
    • +
    • g) a <git remote url> that resolves to (a)

    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 @@ -65,7 +67,7 @@

    SYNOPSIS

    Example:

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

    +
  • npm install [<@scope>/]<name> [-S|--save|-D|--save-dev|-O|--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 @@ -75,17 +77,19 @@

    SYNOPSIS

  • npm install takes 3 exclusive, optional flags which save or update the package version in your main package.json:

      -
    • --save: Package will appear in your dependencies.

      +
    • -S, --save: Package will appear in your dependencies.

    • -
    • --save-dev: Package will appear in your devDependencies.

      +
    • -D, --save-dev: Package will appear in your devDependencies.

    • -
    • --save-optional: Package will appear in your optionalDependencies.

      +
    • -O, --save-optional: Package will appear in your optionalDependencies.

      When using any of the above options to save dependencies to your package.json, there is an additional, optional flag:

    • -
    • --save-exact: Saved dependencies will be configured with an +

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

      +

      Further, if you have an npm-shrinkwrap.json then it will be updated as +well.

      <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).

      @@ -107,7 +111,7 @@

      SYNOPSIS

      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 [@<scope>/]<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.

    @@ -115,14 +119,14 @@

    SYNOPSIS

        npm install sax@latest
         npm install @myorg/mypackage@latest
     
  • -
  • npm install [@<scope>/]<name>@<version>:

    +
  • 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 [@<scope>/]<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 @@ -132,9 +136,9 @@

    SYNOPSIS

    npm install @myorg/privatepackage@">=0.1.0 <0.2.0"
  • npm install <git remote url>:

    -

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

    -
        <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:/]<path>[#<commit-ish>]
    +

    Installs the package from the hosted git provider, cloning it with + git. First it tries via the https (git with github) and if that fails, via ssh.

    +
        <protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>[#<commit-ish>]
     

    <protocol> is one of git, git+ssh, git+http, or git+https. If no <commit-ish> is specified, then master is used.

    @@ -169,7 +173,7 @@

    SYNOPSIS

  • npm install gist:[<githubname>/]<gistID>[#<commit-ish>]:

    Install the package at https://gist.github.com/gistID by attempting to clone it using git. The GitHub username associated with the gist is - optional and will not be saved in package.json if --save is used.

    + optional and will not be saved in package.json if -S or --save is used.

    If you don't specify a commit-ish then master will be used.

    Example:

        npm install gist:101a11beef
    @@ -195,10 +199,12 @@ 

    SYNOPSIS

    The --tag 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.

    -

    The --force argument will force npm to fetch remote resources even if a +

    The --dry-run argument will report in the usual way what the install would +have done without actually installing anything.

    +

    The -f or --force argument will force npm to fetch remote resources even if a local copy exists on disk.

    npm install sax --force
    -

    The --global argument will cause npm to install the package globally +

  • The -g or --global argument will cause npm to install the package globally rather than locally. See npm-folders(5).

    The --link argument will cause npm to link global installs into the local space in some cases.

    @@ -210,27 +216,39 @@

    SYNOPSIS

    shrinkwrap file and use the package.json instead.

    The --nodedir=/path/to/node/source argument will allow npm to find the node source code so that npm can compile native modules.

    +

    The --only={prod[uction]|dev[elopment]} argument will cause either only +devDependencies or only non-devDependencies to be installed regardless of the NODE_ENV.

    See npm-config(7). Many of the configuration params have some effect on installation, since that's most of what npm does.

    ALGORITHM

    To install a package, npm uses the following algorithm:

    -
    install(where, what, family, ancestors)
    -fetch what, unpack to <where>/node_modules/<what>
    -for each dep in what.dependencies
    -  resolve dep to precise version
    -for each dep@version in what.dependencies
    -    not in <where>/node_modules/<what>/node_modules/*
    -    and not in <family>
    -  add precise version deps to <family>
    -  install(<where>/node_modules/<what>, dep, family)
    +
    load the existing node_modules tree from disk
    +clone the tree
    +fetch the package.json and assorted metadata and add it to the clone
    +walk the clone and add any missing dependencies
    +  dependencies will be added as close to the top as is possible
    +  without breaking any other modules
    +compare the original tree with the cloned tree and make a list of
    +actions to take to convert one to the other
    +execute all of the actions, deepest first
    +  kinds of actions are install, update, remove and move
     

    For this package{dep} structure: A{B,C}, B{C}, C{D}, this algorithm produces:

    A
     +-- B
    -`-- C
    -    `-- D
    ++-- C
    ++-- D
     

    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.

    +already caused C to be installed at a higher level. D is still installed +at the top level because nothing conflicts with it.

    +

    For A{B,C}, B{C,D@1}, C{D@2}, this algorithm produces:

    +
    A
    ++-- B
    ++-- C
    +   `-- D@2
    ++-- D@1
    +

    Because B's D@1 will be installed in the top level, C now has to install D@2 +privately for itself.

    See npm-folders(5) for a more detailed description of the specific folder structures that npm creates.

    Limitations of npm's Install Algorithm

    @@ -277,5 +295,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html index 322d02d46918af..16505c433148a7 100644 --- a/deps/npm/html/doc/cli/npm-link.html +++ b/deps/npm/html/doc/cli/npm-link.html @@ -11,9 +11,10 @@

    npm-link

    Symlink a package folder

    SYNOPSIS

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

    DESCRIPTION

    Package linking is a two-step process.

    First, npm link in a package folder will create a globally-installed @@ -72,5 +73,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/cli/npm-logout.html b/deps/npm/html/doc/cli/npm-logout.html index 16b97daae388bd..27f70f529e7295 100644 --- a/deps/npm/html/doc/cli/npm-logout.html +++ b/deps/npm/html/doc/cli/npm-logout.html @@ -11,7 +11,7 @@

    npm-logout

    Log out of the registry

    SYNOPSIS

    -
    npm logout [--registry=url] [--scope=@orgname]
    +
    npm logout [--registry=<url>] [--scope=<@scope>]
     

    DESCRIPTION

    When logged into a registry that supports token-based authentication, tell the server to end this token's session. This will invalidate the token everywhere @@ -55,5 +55,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html index f36d7952cf10cb..2fec3f055aa48e 100644 --- a/deps/npm/html/doc/cli/npm-ls.html +++ b/deps/npm/html/doc/cli/npm-ls.html @@ -11,10 +11,9 @@

    npm-ls

    List installed packages

    SYNOPSIS

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

    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,13 +21,15 @@

    SYNOPSIS

    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@2.14.7 /path/to/npm
    +
    npm@3.3.12 /path/to/npm
     └─┬ init-package-json@0.0.4
       └── promzard@0.1.5
     

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

    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.

    +

    The tree shown is the logical dependency tree, based on package +dependencies, not the physical layout of your node_modules folder.

    When run as ll or la, it shows extended information by default.

    CONFIGURATION

    json

    @@ -73,6 +74,12 @@

    dev

  • Default: false
  • Display only the dependency tree for packages in devDependencies.

    +

    only

    +
      +
    • Type: String
    • +
    +

    When "dev" or "development", is an alias to dev.

    +

    When "prod" or "production", is an alias to production.`

    SEE ALSO

    • npm-config(1)
    • @@ -97,5 +104,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html index 29728e96ae7784..69513a8d7bc156 100644 --- a/deps/npm/html/doc/cli/npm-outdated.html +++ b/deps/npm/html/doc/cli/npm-outdated.html @@ -11,7 +11,7 @@

      npm-outdated

      Check for outdated packages

      SYNOPSIS

      -
      npm outdated [<name> [<name> ...]]
      +
      npm outdated [[<@scope>/]<pkg> ...]
       

      DESCRIPTION

      This command will check the registry to see if any (or, specific) installed packages are currently outdated.

      @@ -67,5 +67,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html index 603043dc6e19e3..99c485c7d9ee41 100644 --- a/deps/npm/html/doc/cli/npm-owner.html +++ b/deps/npm/html/doc/cli/npm-owner.html @@ -11,9 +11,9 @@

      npm-owner

      Manage package owners

      SYNOPSIS

      -
      npm owner ls <package name>
      -npm owner add <user> <package name>
      -npm owner rm <user> <package name>
      +
      npm owner add <user> [<@scope>/]<pkg>
      +npm owner rm <user> [<@scope>/]<pkg>
      +npm owner ls [<@scope>/]<pkg>
       

      DESCRIPTION

      Manage ownership of published packages.

        @@ -49,5 +49,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html index 77bf5578bbe6a6..b35b2c40f885f9 100644 --- a/deps/npm/html/doc/cli/npm-pack.html +++ b/deps/npm/html/doc/cli/npm-pack.html @@ -11,13 +11,13 @@

        npm-pack

        Create a tarball from a package

        SYNOPSIS

        -
        npm pack [<pkg> [<pkg> ...]]
        +
        npm pack [[<@scope>/]<pkg>...]
         

        DESCRIPTION

        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 <name>-<version>.tgz, and then write the filenames out to -stdout.

        +tarball url, name@tag, name@version, name, or scoped name), this +command will fetch it to the cache, and then copy the tarball to the +current working directory as <name>-<version>.tgz, and then write +the filenames out to stdout.

        If the same package is specified multiple times, then the file will be overwritten the second time.

        If no arguments are supplied, then npm packs the current package folder.

        @@ -41,5 +41,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-ping.html b/deps/npm/html/doc/cli/npm-ping.html index e10095ec5a50ae..c5a8fb663be649 100644 --- a/deps/npm/html/doc/cli/npm-ping.html +++ b/deps/npm/html/doc/cli/npm-ping.html @@ -32,4 +32,4 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html index 96d63d75070f5e..9111d20c76f9d6 100644 --- a/deps/npm/html/doc/cli/npm-prefix.html +++ b/deps/npm/html/doc/cli/npm-prefix.html @@ -38,5 +38,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html index d90b0fb25a57b9..43010bc3c2435f 100644 --- a/deps/npm/html/doc/cli/npm-prune.html +++ b/deps/npm/html/doc/cli/npm-prune.html @@ -11,8 +11,7 @@

        npm-prune

        Remove extraneous packages

        SYNOPSIS

        -
        npm prune [<name> [<name ...]]
        -npm prune [<name> [<name ...]] [--production]
        +
        npm prune [[<@scope>/]<pkg>...] [--production]
         

        DESCRIPTION

        This command removes "extraneous" packages. If a package name is provided, then only packages matching one of the supplied names are @@ -41,5 +40,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html index b6372b26446a7a..c2d8b0815aa0f0 100644 --- a/deps/npm/html/doc/cli/npm-publish.html +++ b/deps/npm/html/doc/cli/npm-publish.html @@ -11,8 +11,10 @@

        npm-publish

        Publish a package

        SYNOPSIS

        -
        npm publish <tarball> [--tag <tag>] [--access <public|restricted>]
        -npm publish <folder> [--tag <tag>] [--access <public|restricted>]
        +
        npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>]
        +
        +Publishes '.' if no argument supplied
        +Sets tag 'latest' if no --tag specified
         

        DESCRIPTION

        Publishes a package to the registry so that it can be installed by name. See npm-developers(7) for details on what's included in the published package, as @@ -66,5 +68,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html index 4fb2d48108246b..9fdabf57478891 100644 --- a/deps/npm/html/doc/cli/npm-rebuild.html +++ b/deps/npm/html/doc/cli/npm-rebuild.html @@ -11,13 +11,10 @@

        npm-rebuild

        Rebuild a package

        SYNOPSIS

        -
        npm rebuild [<name> [<name> ...]]
        -npm rb [<name> [<name> ...]]
        -
          -
        • <name>: -The package to rebuild
        • -
        -

        DESCRIPTION

        +
        npm rebuild [[<@scope>/<name>]...]
        +
        +alias: npm rb
        +

        DESCRIPTION

        This command runs the npm build 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.

        @@ -38,5 +35,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html index d66da6ab92f39f..bf94fde6a53b61 100644 --- a/deps/npm/html/doc/cli/npm-repo.html +++ b/deps/npm/html/doc/cli/npm-repo.html @@ -11,8 +11,7 @@

        npm-repo

        Open package repository page in the browser

        SYNOPSIS

        -
        npm repo <pkgname>
        -npm repo (with no args in a package dir)
        +
        npm repo [<pkg>]
         

        DESCRIPTION

        This command tries to guess at the likely location of a package's repository URL, and then tries to open it using the --browser @@ -42,5 +41,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html index 7d9fe7b9641efe..eb7bf47c5af736 100644 --- a/deps/npm/html/doc/cli/npm-restart.html +++ b/deps/npm/html/doc/cli/npm-restart.html @@ -53,5 +53,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-rm.html b/deps/npm/html/doc/cli/npm-rm.html deleted file mode 100644 index 1714fe27df61f0..00000000000000 --- a/deps/npm/html/doc/cli/npm-rm.html +++ /dev/null @@ -1,43 +0,0 @@ - - - npm-rm - - - - - - -
        - -

        npm-rm

        Remove a package

        -

        SYNOPSIS

        -
        npm rm <name>
        -npm r <name>
        -npm uninstall <name>
        -npm un <name>
        -

        DESCRIPTION

        -

        This uninstalls a package, completely removing everything npm installed -on its behalf.

        -

        SEE ALSO

        - - -
        - - - - - - - - - - - - diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html index e29dacdbea6204..eaf93c0ac61c01 100644 --- a/deps/npm/html/doc/cli/npm-root.html +++ b/deps/npm/html/doc/cli/npm-root.html @@ -11,7 +11,7 @@

        npm-root

        Display npm root

        SYNOPSIS

        -
        npm root
        +
        npm root [-g]
         

        DESCRIPTION

        Print the effective node_modules folder to standard out.

        SEE ALSO

        @@ -35,5 +35,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html index 47f437d6257a15..487c086adc7258 100644 --- a/deps/npm/html/doc/cli/npm-run-script.html +++ b/deps/npm/html/doc/cli/npm-run-script.html @@ -11,8 +11,9 @@

        npm-run-script

        Run arbitrary package scripts

        SYNOPSIS

        -
        npm run-script [command] [-- <args>]
        -npm run [command] [-- <args>]
        +
        npm run-script <command> [-- <args>...]
        +
        +alias: npm run
         

        DESCRIPTION

        This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts. run[-script] is @@ -57,5 +58,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html index 049a5faa187897..6c31f1b60c19f1 100644 --- a/deps/npm/html/doc/cli/npm-search.html +++ b/deps/npm/html/doc/cli/npm-search.html @@ -11,9 +11,9 @@

        npm-search

        Search for packages

        SYNOPSIS

        -
        npm search [--long] [search terms ...]
        -npm s [search terms ...]
        -npm se [search terms ...]
        +
        npm search [-l|--long] [search terms ...]
        +
        +aliases: s, se
         

        DESCRIPTION

        Search the registry for packages matching the search terms.

        If a term starts with /, then it's interpreted as a regular expression. @@ -49,5 +49,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html index 3d11d8e0e4d817..ab72eb0d71a5bb 100644 --- a/deps/npm/html/doc/cli/npm-shrinkwrap.html +++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html @@ -72,27 +72,33 @@

        SYNOPSIS

        This generates npm-shrinkwrap.json, which will look something like this:

        {
           "name": "A",
        -  "version": "0.1.0",
        +  "version": "1.1.0",
           "dependencies": {
             "B": {
        -      "version": "0.0.1",
        +      "version": "1.0.1",
        +      "from": "B@^1.0.0",
        +      "resolved": "https://registry.npmjs.org/B/-/B-1.0.1.tgz",
               "dependencies": {
                 "C": {
        -          "version": "0.0.1"
        +          "version": "1.0.1",
        +          "from": "org/C#v1.0.1",
        +          "resolved": "git://github.com/org/C.git#5c380ae319fc4efe9e7f2d9c78b0faa588fd99b4"
                 }
               }
             }
           }
         }
        -

        The shrinkwrap command has locked down the dependencies based on -what's currently installed in node_modules. When npm install -installs a package with an npm-shrinkwrap.json 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.0.1, regardless the -dependencies and versions listed in A's, B's, and C's package.json -files.

        +

        The shrinkwrap command has locked down the dependencies based on what's +currently installed in node_modules. The installation behavior is changed to:

        +
          +
        1. The module tree described by the shrinkwrap is reproduced. This means +reproducing the structure described in the file, using the specific files +referenced in "resolved" if available, falling back to normal package +resolution using "version" if one isn't.

          +
        2. +
        3. The tree is walked and any missing dependencies are installed in the usual fashion.

          +
        4. +

        Using shrinkwrapped packages

        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 @@ -110,15 +116,14 @@

        Building shrinkwrapped packages

        1. Run npm install in the package root to install the current versions of all dependencies.
        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 npm -install with no arguments will merely reproduce the existing +
        4. Add or update dependencies. npm install --save each new or updated +package individually to update the package.json and the shrinkwrap. +Note that they must be explicitly named in order to be installed: running +npm install with no arguments will merely reproduce the existing shrinkwrap.
        5. Validate that the package works as expected with the new dependencies.
        6. -
        7. Run npm shrinkwrap, commit the new npm-shrinkwrap.json, and -publish your package.
        8. +
        9. Commit the new npm-shrinkwrap.json, and publish your package.

        You can use npm-outdated(1) to view dependencies with newer versions available.

        @@ -164,5 +169,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html index 6a33768b779697..be7f542964a700 100644 --- a/deps/npm/html/doc/cli/npm-star.html +++ b/deps/npm/html/doc/cli/npm-star.html @@ -11,8 +11,8 @@

        npm-star

        Mark your favorite packages

        SYNOPSIS

        -
        npm star <pkgname> [<pkg>, ...]
        -npm unstar <pkgname> [<pkg>, ...]
        +
        npm star [<pkg>...]
        +npm unstar [<pkg>...]
         

        DESCRIPTION

        "Starring" a package means that you have some interest in it. It's a vaguely positive way to show that you care.

        @@ -36,5 +36,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html index 89b23b0a8872c2..eac253ff8ecdc6 100644 --- a/deps/npm/html/doc/cli/npm-stars.html +++ b/deps/npm/html/doc/cli/npm-stars.html @@ -11,8 +11,7 @@

        npm-stars

        View packages marked as favorites

        SYNOPSIS

        -
        npm stars
        -npm stars [username]
        +
        npm stars [<user>]
         

        DESCRIPTION

        If you have starred a lot of neat things and want to find them again quickly this command lets you do just that.

        @@ -37,5 +36,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html index 718160b63eb421..410364f5fa14f3 100644 --- a/deps/npm/html/doc/cli/npm-start.html +++ b/deps/npm/html/doc/cli/npm-start.html @@ -34,5 +34,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html index 2047d8e85417b2..2c99d6646559f0 100644 --- a/deps/npm/html/doc/cli/npm-stop.html +++ b/deps/npm/html/doc/cli/npm-stop.html @@ -34,5 +34,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html index af7b2f746f6e9c..1bbecd6c694bd9 100644 --- a/deps/npm/html/doc/cli/npm-tag.html +++ b/deps/npm/html/doc/cli/npm-tag.html @@ -11,7 +11,8 @@

        npm-tag

        Tag a published version

        SYNOPSIS

        -
        npm tag <name>@<version> [<tag>]
        +
        [DEPRECATED] npm tag <name>@<version> [<tag>]
        +See `dist-tag`
         

        DESCRIPTION

        THIS COMMAND IS DEPRECATED. See npm-dist-tag(1) for details.

        Tags the specified version of the package with the specified tag, or the @@ -62,5 +63,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-team.html b/deps/npm/html/doc/cli/npm-team.html index cc23b76d82e007..dab0a0e1d129bb 100644 --- a/deps/npm/html/doc/cli/npm-team.html +++ b/deps/npm/html/doc/cli/npm-team.html @@ -23,7 +23,7 @@

        SYNOPSIS

        DESCRIPTION

        Used to manage teams in organizations, and change team memberships. Does not handle permissions for packages.

        -

        Teams must always be fully qualified with the organization/scope they belond to +

        Teams must always be fully qualified with the organization/scope they belong to when operating on them, separated by a colon (:). That is, if you have a developers team on a foo organization, you must always refer to that team as developers:foo in these commands.

        @@ -53,7 +53,7 @@

        DETAILS

        SEE ALSO

        @@ -67,4 +67,4 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html index bcd729a7487a56..206de736c581dd 100644 --- a/deps/npm/html/doc/cli/npm-test.html +++ b/deps/npm/html/doc/cli/npm-test.html @@ -37,5 +37,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html index 8763c40adb2922..93fe4810f2a821 100644 --- a/deps/npm/html/doc/cli/npm-uninstall.html +++ b/deps/npm/html/doc/cli/npm-uninstall.html @@ -11,8 +11,9 @@

        npm-rm

        Remove a package

        SYNOPSIS

        -
        npm uninstall [@<scope>/]<package> [--save|--save-dev|--save-optional]
        -npm rm (with any of the previous argument usage)
        +
        npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|-D|--save-dev|-O|--save-optional]
        +
        +aliases: remove, rm, r, un, unlink
         

        DESCRIPTION

        This uninstalls a package, completely removing everything npm installed on its behalf.

        @@ -23,13 +24,15 @@

        SYNOPSIS

        npm uninstall takes 3 exclusive, optional flags which save or update the package version in your main package.json:

          -
        • --save: Package will be removed from your dependencies.

          +
        • -S, --save: Package will be removed from your dependencies.

        • -
        • --save-dev: Package will be removed from your devDependencies.

          +
        • -D, --save-dev: Package will be removed from your devDependencies.

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

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

        +

        Further, if you have an npm-shrinkwrap.json then it will be updated as +well.

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

        Examples:

        npm uninstall sax --save
        @@ -57,5 +60,5 @@ 

        SYNOPSIS

               - + diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html index 667802cd4ccc65..da50613ed6c6be 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 [@<scope>/]<name>[@<version>]
        +
        npm unpublish [<@scope>/]<pkg>[@<version>]
         

        WARNING

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

        @@ -47,5 +47,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html index e08a2c115044b6..fe4e3c178f2184 100644 --- a/deps/npm/html/doc/cli/npm-update.html +++ b/deps/npm/html/doc/cli/npm-update.html @@ -11,7 +11,7 @@

        npm-update

        Update a package

        SYNOPSIS

        -
        npm update [-g] [<name> [<name> ...]]
        +
        npm update [-g] [<pkg>...]
         

        DESCRIPTION

        This command will update all the packages listed to the latest version (specified by the tag config), respecting semver.

        @@ -81,7 +81,8 @@

        Caret Dependencies below 1.0.0

        Recording Updates with --save

        When you want to update a package and save the new version as the minimum required dependency in package.json, you can use -npm update --save. For example if package.json contains

        +npm update -S or npm update --save. For example if +package.json contains:

        dependencies: {
           dep1: "^1.1.1"
         }
        @@ -119,5 +120,5 @@ 

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html index 34bb9c956bb89a..bc3cf3b5d64297 100644 --- a/deps/npm/html/doc/cli/npm-version.html +++ b/deps/npm/html/doc/cli/npm-version.html @@ -12,6 +12,10 @@

        npm-version

        Bump a package version

        SYNOPSIS

        npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]
        +
        +'npm [-v | --version]' to print npm version
        +'npm view <pkg> version' to view a package's published version
        +'npm ls' to inspect current package/dependency versions
         

        DESCRIPTION

        Run this in a package directory to bump the version and write the new data back to package.json and, if present, npm-shrinkwrap.json.

        @@ -22,9 +26,9 @@

        SYNOPSIS

        If run in a git repo, it will also create a version commit and tag. This behavior is controlled by git-tag-version (see below), and can be disabled on the command line by running npm --no-git-tag-version version. -It will fail if the working directory is not clean, unless the --force -flag is set.

        -

        If supplied with --message (shorthand: -m) config option, npm will +It will fail if the working directory is not clean, unless the -f or +--force flag is set.

        +

        If supplied with -m or --message config option, npm will use it as a commit message when creating a version commit. If the message config contains %s then that will be replaced with the resulting version number. For example:

        @@ -50,7 +54,7 @@

        SYNOPSIS

      • Run the preversion script. These scripts have access to the old version in package.json. A typical use would be running your full test suite before deploying. Any files you want added to the commit should be explicitly added using git add.
      • -
      • Bump version in package.json as requested (patch, minor, major, etc).
      • +
      • Bump version in package.json as requested (patch, minor, major, etc).
      • Run the version script. These scripts have access to the new version in package.json (so they can incorporate it into file headers in generated files for example). Again, scripts should explicitly add generated files to the commit using git add.
      • @@ -95,5 +99,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html index 930a299af6e1ea..965b3504e26229 100644 --- a/deps/npm/html/doc/cli/npm-view.html +++ b/deps/npm/html/doc/cli/npm-view.html @@ -11,8 +11,9 @@

        npm-view

        View registry info

        SYNOPSIS

        -
        npm view [@<scope>/]<name>[@<version>] [<field>[.<subfield>]...]
        -npm v [@<scope>/]<name>[@<version>] [<field>[.<subfield>]...]
        +
        npm view [<@scope>/]<name>[@<version>] [<field>[.<subfield>]...]
        +
        +aliases: info, show, v
         

        DESCRIPTION

        This command shows data about a package and prints it to the stream referenced by the outfd config, which defaults to stdout.

        @@ -41,7 +42,7 @@

        SYNOPSIS

        contributor in the list, you can do this:

        npm view express contributors[0].email
         

        Multiple fields may be specified, and will be printed one after another. -For exampls, to get all the contributor names and email addresses, you +For example, to get all the contributor names and email addresses, you can do this:

        npm view express contributors.name contributors.email
         

        "Person" fields are shown as a string if they would be shown as an @@ -82,5 +83,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html index 1f25215aeb5a46..1b954c864b7b19 100644 --- a/deps/npm/html/doc/cli/npm-whoami.html +++ b/deps/npm/html/doc/cli/npm-whoami.html @@ -11,7 +11,7 @@

        npm-whoami

        Display npm username

        SYNOPSIS

        -
        npm whoami
        +
        npm whoami [--registry <registry>]
         

        DESCRIPTION

        Print the username config to standard output.

        SEE ALSO

        @@ -33,5 +33,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html index 9fd4df9b2d30c4..b43ccda47f7d7b 100644 --- a/deps/npm/html/doc/cli/npm.html +++ b/deps/npm/html/doc/cli/npm.html @@ -13,7 +13,7 @@

        npm

        javascript package manager

        SYNOPSIS

        npm <command> [args]
         

        VERSION

        -

        2.14.7

        +

        3.3.12

        DESCRIPTION

        npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency @@ -51,7 +51,7 @@

        DIRECTORIES

        defaults to the current working directory. Packages are installed to ./node_modules, and bins are installed to ./node_modules/.bin.
      -

      Local mode is the default. Use --global or -g on any command to +

      Local mode is the default. Use -g or --global on any command to operate in global mode instead.

      DEVELOPER USAGE

      If you're using npm to develop and publish your code, check out the @@ -110,7 +110,7 @@

      CONTRIBUTIONS

      the issues list or ask on the mailing list.

      BUGS

      When you find issues, please report them:

      @@ -118,7 +118,7 @@

      BUGS

    • web: http://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.

    @@ -128,7 +128,7 @@

    AUTHOR

    Isaac Z. Schlueter :: isaacs :: @izs :: -i@izs.me

    +i@izs.me

    SEE ALSO

    • npm-help(1)
    • @@ -154,5 +154,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html index 71ac40170d7b67..a4e67332769d4a 100644 --- a/deps/npm/html/doc/files/npm-folders.html +++ b/deps/npm/html/doc/files/npm-folders.html @@ -184,5 +184,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html index 71ac40170d7b67..a4e67332769d4a 100644 --- a/deps/npm/html/doc/files/npm-global.html +++ b/deps/npm/html/doc/files/npm-global.html @@ -184,5 +184,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html index 9fecd63fa7865d..92d14ba6c56be1 100644 --- a/deps/npm/html/doc/files/npm-json.html +++ b/deps/npm/html/doc/files/npm-json.html @@ -354,8 +354,8 @@

      GitHub URLs

      }

    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 saved using npm install --save, using any of -these forms:

    +package. Local paths can be saved using npm install -S or +npm install --save, using any of these forms:

    ../foo/bar
     ~/foo/bar
     ./foo/bar
    @@ -473,15 +473,9 @@ 

    engines

    Note that, unless the user has set the engine-strict config flag, this field is advisory only.

    engineStrict

    -

    NOTE: This feature is deprecated and will be removed in npm 3.0.0.

    -

    If you are sure that your module will definitely not run properly on -versions of Node/npm other than those specified in the engines object, -then you can set "engineStrict": true in your package.json file. -This will override the user's engine-strict config setting.

    -

    Please do not do this unless you are really very very sure. If your -engines object 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.

    +

    This feature was deprecated with npm 3.0.0

    +

    Prior to npm 3.0.0, this feature was used to treat this package as if the +user had set engine-strict.

    os

    You can specify which operating systems your module will run on:

    @@ -565,5 +559,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html index 01a596ff22fc8e..dc50a18c8174d7 100644 --- a/deps/npm/html/doc/files/npmrc.html +++ b/deps/npm/html/doc/files/npmrc.html @@ -83,5 +83,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html index 9fecd63fa7865d..92d14ba6c56be1 100644 --- a/deps/npm/html/doc/files/package.json.html +++ b/deps/npm/html/doc/files/package.json.html @@ -354,8 +354,8 @@

    GitHub URLs

    }

    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 saved using npm install --save, using any of -these forms:

    +package. Local paths can be saved using npm install -S or +npm install --save, using any of these forms:

    ../foo/bar
     ~/foo/bar
     ./foo/bar
    @@ -473,15 +473,9 @@ 

    engines

    Note that, unless the user has set the engine-strict config flag, this field is advisory only.

    engineStrict

    -

    NOTE: This feature is deprecated and will be removed in npm 3.0.0.

    -

    If you are sure that your module will definitely not run properly on -versions of Node/npm other than those specified in the engines object, -then you can set "engineStrict": true in your package.json file. -This will override the user's engine-strict config setting.

    -

    Please do not do this unless you are really very very sure. If your -engines object 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.

    +

    This feature was deprecated with npm 3.0.0

    +

    Prior to npm 3.0.0, this feature was used to treat this package as if the +user had set engine-strict.

    os

    You can specify which operating systems your module will run on:

    @@ -565,5 +559,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html index 7cc68acd4a8cb0..36fcbe74c35f98 100644 --- a/deps/npm/html/doc/index.html +++ b/deps/npm/html/doc/index.html @@ -80,8 +80,6 @@

    npm-repo(1)

    Open package repository page in the browser

    npm-restart(1)

    Restart a package

    -

    npm-rm(1)

    -

    Remove a package

    npm-root(1)

    Display npm root

    npm-run-script(1)

    @@ -118,86 +116,6 @@

    npm-whoami(1)

    Display npm username

    API Documentation

    Using npm in your Node programs

    -

    npm(3)

    -

    javascript package manager

    -

    npm-bin(3)

    -

    Display npm bin folder

    -

    npm-bugs(3)

    -

    Bugs for a package in a web browser maybe

    -

    npm-cache(3)

    -

    manage the npm cache programmatically

    -

    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-ping(3)

    -

    Ping npm registry

    -

    npm-prefix(3)

    -

    Display prefix

    -

    npm-prune(3)

    -

    Remove extraneous packages

    -

    npm-publish(3)

    -

    Publish a package

    -

    npm-rebuild(3)

    -

    Rebuild a package

    -

    npm-repo(3)

    -

    Open package repository page in the browser

    -

    npm-restart(3)

    -

    Restart 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-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

    File system structures npm uses

    npm-folders(5)

    @@ -244,5 +162,5 @@

    semver(7)

           - + diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html index ac3c95c105c933..757272863d748e 100644 --- a/deps/npm/html/doc/misc/npm-coding-style.html +++ b/deps/npm/html/doc/misc/npm-coding-style.html @@ -49,7 +49,7 @@

    Curly braces

  • for (;;) loops. They're actually required.
  • null loops like: while (something) ; (But you'd better have a good reason for doing that.)
  • -
  • case "foo": doSomething(); break
  • +
  • case 'foo': doSomething(); break
  • In front of a leading ( or [ at the start of the line. This prevents the expression from being interpreted as a function call or property access, respectively.
  • @@ -59,9 +59,9 @@

    Curly braces

    ;[a, b, c].forEach(doSomething) for (var i = 0; i < 10; i ++) { switch (state) { - case "begin": start(); continue - case "end": finish(); break - default: throw new Error("unknown state") + case 'begin': start(); continue + case 'end': finish(); break + default: throw new Error('unknown state') } end() } @@ -72,17 +72,24 @@

    Comma First

    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:

    -
    var magicWords = [ "abracadabra"
    -                 , "gesundheit"
    -                 , "ventrilo"
    +
    var magicWords = [ 'abracadabra'
    +                 , 'gesundheit'
    +                 , 'ventrilo'
                      ]
    -  , spells = { "fireball" : function () { setOnFire() }
    -             , "water" : function () { putOut() }
    +  , spells = { 'fireball' : function () { setOnFire() }
    +             , 'water' : function () { putOut() }
                  }
       , a = 1
    -  , b = "abc"
    +  , b = 'abc'
       , etc
       , somethingElse
    +

    Quotes

    +

    Use single quotes for strings except to avoid escaping.

    +

    Bad:

    +
    var notOk = "Just double quotes"
    +

    Good:

    +
    var ok = 'String contains "double" quotes'
    +var alsoOk = "String contains 'single' quotes or apostrophe"
     

    Whitespace

    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.

    @@ -147,5 +154,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html index 0fd36894c9d06f..74b3c7bfc65c59 100644 --- a/deps/npm/html/doc/misc/npm-config.html +++ b/deps/npm/html/doc/misc/npm-config.html @@ -30,13 +30,13 @@

    npmrc Files

    • per-project config file (/path/to/my/project/.npmrc)
    • per-user config file (~/.npmrc)
    • -
    • global config file ($PREFIX/npmrc)
    • +
    • global config file ($PREFIX/etc/npmrc)
    • npm builtin config file (/path/to/npm/npmrc)

    See npmrc(5) for more details.

    Default Configs

    -

    A set of configuration parameters that are internal to npm, and are -defaults if nothing else is specified.

    +

    Run npm config ls -l to see a set of configuration parameters that are +internal to npm, and are defaults if nothing else is specified.

    Shorthands and Other CLI Niceties

    The following shorthands are parsed on the command-line:

      @@ -107,6 +107,13 @@

      always-auth

    Force npm to always require authentication when accessing the registry, even for GET requests.

    +

    also

    +
      +
    • Default: null
    • +
    • Type: String
    • +
    +

    When "dev" or "development" and running local npm shrinkwrap, +npm outdated, or npm update, is an alias for --dev.

    • Default: true
    • @@ -226,6 +233,16 @@

      dev

      Install dev-dependencies along with packages.

      Note that dev-dependencies are also installed if the npat flag is set.

      +

      dry-run

      +
        +
      • Default: false
      • +
      • Type: Boolean
      • +
      +

      Indicates that you don't want npm to make any changes and that it should +only report what it would have done. This can be passed into any of the +commands that modify your local installation, eg, install, update, +dedupe, uninstall. This is NOT currently honored by network related +commands, eg dist-tags, owner, publish, etc.

      editor

      • Default: EDITOR environment variable if set, or "vi" on Posix, @@ -483,6 +500,20 @@

        onload-script

      A node module to require() when npm loads. Useful for programmatic usage.

      +

      only

      +
        +
      • Default: null
      • +
      • Type: String
      • +
      +

      When "dev" or "development" and running local npm install without any +arguments, only devDependencies (and their dependencies) are installed.

      +

      When "dev" or "development" and running local npm ls, npm outdated, or +npm update, is an alias for --dev.

      +

      When "prod" or "production" and running local npm install without any +arguments, only non-devDependencies (and their dependencies) are +installed.

      +

      When "prod" or "production" and running local npm ls, npm outdated, or +npm update, is an alias for --production.

      optional

      • Default: true
      • @@ -516,6 +547,14 @@

        production

        local npm install without any arguments.
      • Set the NODE_ENV="production" for lifecycle scripts.
      • +

        progress

        +
          +
        • Default: true
        • +
        • Type: Boolean
        • +
        +

        When set to true, npm will display a progress bar during time intensive +operations, if process.stderr is a TTY.

        +

        Set to false to suppress the progress bar.

        proprietary-attribs

        • Default: true
        • @@ -663,15 +702,6 @@

          sign-git-tag

          using -s to add a signature.

          Note that git requires you to have set up GPG keys in your git configs for this to work properly.

          -

          spin

          -
            -
          • Default: true
          • -
          • Type: Boolean or "always"
          • -
          -

          When set to true, npm will display an ascii spinner while it is doing -things, if process.stderr is a TTY.

          -

          Set to false to suppress the spinner, or set to always to output -the spinner even for non-TTY outputs.

          strict-ssl

          • Default: true
          • @@ -709,7 +739,7 @@

            tmp

            on success, but left behind on failure for forensic purposes.

            unicode

              -
            • Default: true
            • +
            • Default: true on windows and mac/unix systems with a unicode locale
            • Type: Boolean

            When set to true, npm uses unicode characters in the tree output. When @@ -799,5 +829,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html index 03d1a8eda0d1c0..3da7d9162186b1 100644 --- a/deps/npm/html/doc/misc/npm-developers.html +++ b/deps/npm/html/doc/misc/npm-developers.html @@ -195,5 +195,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html index cf739f6b1c5e80..0962b39b5a998c 100644 --- a/deps/npm/html/doc/misc/npm-disputes.html +++ b/deps/npm/html/doc/misc/npm-disputes.html @@ -13,7 +13,7 @@

            npm-disputes

            Handling Module

            SYNOPSIS

            1. Get the author email with npm owner ls <pkgname>
            2. -
            3. Email the author, CC support@npmjs.com
            4. +
            5. Email the author, CC support@npmjs.com
            6. After a few weeks, if there's no resolution, we'll sort it out.

            Don't squat on package names. Publish code or move out of the way.

            @@ -51,12 +51,12 @@

            DESCRIPTION

            owner (Bob).
          • Joe emails Bob, explaining the situation as respectfully as possible, and what he would like to do with the module name. He -adds the npm support staff support@npmjs.com 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 npm owner add joe foo to add Joe as an owner of the foo package.
          • 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 -support@npmjs.com and we'll sort it out. ("Reasonable" is +support@npmjs.com and we'll sort it out. ("Reasonable" is usually at least 4 weeks, but extra time is allowed around common holidays.)
          • @@ -112,5 +112,5 @@

            SEE ALSO

                   - + diff --git a/deps/npm/html/doc/misc/npm-faq.html b/deps/npm/html/doc/misc/npm-faq.html index eb017f3001274c..fa0cc22eff9ce8 100644 --- a/deps/npm/html/doc/misc/npm-faq.html +++ b/deps/npm/html/doc/misc/npm-faq.html @@ -13,20 +13,20 @@

            npm-faq

            Frequently Asked Question

            Where can I find these docs in HTML?

            https://docs.npmjs.com/, or run:

            npm config set viewer browser
            -

            to open these documents in your default web browser rather than man.

            +

    This command will set the npm docs to open in your default web browser rather than man.

    It didn't work.

    -

    That's not really a question.

    +

    Please provide a little more detail, search for the error via Google or StackOverflow npm to see if another developer has encountered a similar problem.

    Why didn't it work?

    I don't know yet.

    -

    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.

    +

    Try reading the error output first, ensure this is a true npm issue and not a package issue. If you are having an issue with a package dependency, please submit your error to that particular package maintainer.

    +

    For any npm issues, try following the instructions, or even retracing your steps. If the issue continues to persist, submit a bug with the steps to reproduce, please include the operating system you are working on, along with the error you recieve.

    Where does npm put stuff?

    See npm-folders(5)

    tl;dr:

    • Use the npm root command to see where modules go, and the npm bin command to see where executables go
    • -
    • Global installs are different from local installs. If you install +
    • Global installs are different from local installs. If you install something with the -g flag, then its executables go in npm bin -g and its modules go in npm root -g.
    @@ -237,7 +237,7 @@

    I get ECONNREFUSED a lot. What'

    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.

    -

    If the registry IS down, let us know by emailing support@npmjs.com +

    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.

    @@ -308,5 +308,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html index 2f7381b625bca0..ae0950efd7ebcf 100644 --- a/deps/npm/html/doc/misc/npm-index.html +++ b/deps/npm/html/doc/misc/npm-index.html @@ -80,8 +80,6 @@

    npm-repo(1)

    Open package repository page in the browser

    npm-restart(1)

    Restart a package

    -

    npm-rm(1)

    -

    Remove a package

    npm-root(1)

    Display npm root

    npm-run-script(1)

    @@ -118,86 +116,6 @@

    npm-whoami(1)

    Display npm username

    API Documentation

    Using npm in your Node programs

    -

    npm(3)

    -

    javascript package manager

    -

    npm-bin(3)

    -

    Display npm bin folder

    -

    npm-bugs(3)

    -

    Bugs for a package in a web browser maybe

    -

    npm-cache(3)

    -

    manage the npm cache programmatically

    -

    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-ping(3)

    -

    Ping npm registry

    -

    npm-prefix(3)

    -

    Display prefix

    -

    npm-prune(3)

    -

    Remove extraneous packages

    -

    npm-publish(3)

    -

    Publish a package

    -

    npm-rebuild(3)

    -

    Rebuild a package

    -

    npm-repo(3)

    -

    Open package repository page in the browser

    -

    npm-restart(3)

    -

    Restart 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-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

    File system structures npm uses

    npm-folders(5)

    @@ -244,5 +162,4 @@

    semver(7)

           - - + diff --git a/deps/npm/html/doc/misc/npm-orgs.html b/deps/npm/html/doc/misc/npm-orgs.html index 8c6e768c25c3aa..a42a4863f8141a 100644 --- a/deps/npm/html/doc/misc/npm-orgs.html +++ b/deps/npm/html/doc/misc/npm-orgs.html @@ -86,4 +86,4 @@

    Team Admins create teams

           - + diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html index a622e530491129..9068310aef2015 100644 --- a/deps/npm/html/doc/misc/npm-registry.html +++ b/deps/npm/html/doc/misc/npm-registry.html @@ -70,5 +70,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-scope.html b/deps/npm/html/doc/misc/npm-scope.html index a2ac6463331b57..2aac1b177dd8cc 100644 --- a/deps/npm/html/doc/misc/npm-scope.html +++ b/deps/npm/html/doc/misc/npm-scope.html @@ -91,5 +91,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html index 580535d2c5101b..ed50c1caf8a9d7 100644 --- a/deps/npm/html/doc/misc/npm-scripts.html +++ b/deps/npm/html/doc/misc/npm-scripts.html @@ -74,7 +74,7 @@

    DEFAULT VALUES

    will default the start command to node server.js.

  • "install": "node-gyp rebuild":

    -

    If there is a bindings.gyp file in the root of your package, npm will +

    If there is a binding.gyp file in the root of your package, npm will default the install command to compile using node-gyp.

  • @@ -207,5 +207,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html index dc23b860d8d63f..90e345a4a2990f 100644 --- a/deps/npm/html/doc/misc/removing-npm.html +++ b/deps/npm/html/doc/misc/removing-npm.html @@ -57,5 +57,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html index de275ef6e922e6..c73b0534f6816d 100644 --- a/deps/npm/html/doc/misc/semver.html +++ b/deps/npm/html/doc/misc/semver.html @@ -282,5 +282,5 @@

    Ranges

           - + diff --git a/deps/npm/html/static/toc.js b/deps/npm/html/static/toc.js index 2cfebd0aa968b7..7551e47efdf48e 100644 --- a/deps/npm/html/static/toc.js +++ b/deps/npm/html/static/toc.js @@ -1,29 +1,29 @@ ;(function () { -var wrapper = document.getElementById("wrapper") -var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0) - .filter(function (el) { - return el.parentNode === wrapper - && el.tagName.match(/H[1-6]/) - && el.id - }) -var l = 2 - , toc = document.createElement("ul") -toc.innerHTML = els.map(function (el) { - var i = el.tagName.charAt(1) - , out = "" - while (i > l) { - out += "
      " - l ++ - } - while (i < l) { - out += "
    " - l -- - } - out += "
  • " + - ( el.innerText || el.text || el.innerHTML) - + "" - return out -}).join("\n") -toc.id = "toc" -document.body.appendChild(toc) -})(); + var wrapper = document.getElementById('wrapper') + var els = Array.prototype.slice.call(wrapper.getElementsByTagName('*'), 0) + .filter(function (el) { + return el.parentNode === wrapper && + el.tagName.match(/H[1-6]/) && + el.id + }) + var l = 2 + var toc = document.createElement('ul') + toc.innerHTML = els.map(function (el) { + var i = el.tagName.charAt(1) + var out = '' + while (i > l) { + out += '
      ' + l++ + } + while (i < l) { + out += '
    ' + l-- + } + out += '
  • ' + + (el.innerText || el.text || el.innerHTML) + + '' + return out + }).join('\n') + toc.id = 'toc' + document.body.appendChild(toc) +})() diff --git a/deps/npm/lib/access.js b/deps/npm/lib/access.js index 790a760cb72201..25a482a20e3cdb 100644 --- a/deps/npm/lib/access.js +++ b/deps/npm/lib/access.js @@ -35,6 +35,7 @@ access.completion = function (opts, cb) { } else { return cb(null, []) } + break case 'public': case 'restricted': case 'ls-packages': diff --git a/deps/npm/lib/adduser.js b/deps/npm/lib/adduser.js index 367f3ba0d92754..630a2c5e6f1797 100644 --- a/deps/npm/lib/adduser.js +++ b/deps/npm/lib/adduser.js @@ -1,30 +1,32 @@ - module.exports = adduser -var log = require("npmlog") - , npm = require("./npm.js") - , read = require("read") - , userValidate = require("npm-user-validate") - , crypto +var log = require('npmlog') +var npm = require('./npm.js') +var read = require('read') +var userValidate = require('npm-user-validate') +var crypto try { - crypto = require("crypto") + crypto = require('crypto') } catch (ex) {} -adduser.usage = "npm adduser\nThen enter stuff at the prompts" +adduser.usage = 'npm adduser [--registry=url] [--scope=@orgname] [--always-auth]' function adduser (args, cb) { - npm.spinner.stop() - if (!crypto) return cb(new Error( - "You must compile node with ssl support to use the adduser feature")) - - 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] + if (!crypto) { + return cb(new Error( + 'You must compile node with ssl support to use the adduser feature' + )) + } + + var creds = npm.config.getCredentialsByURI(npm.config.get('registry')) + var c = { + u: creds.username || '', + p: creds.password || '', + e: creds.email || '' + } + var u = {} + var fns = [readUsername, readPassword, readEmail, save] loop() function loop (er) { @@ -37,9 +39,9 @@ function adduser (args, cb) { function readUsername (c, u, cb) { var v = userValidate.username - read({prompt: "Username: ", default: c.u || ""}, function (er, un) { + read({prompt: 'Username: ', default: c.u || ''}, function (er, un) { if (er) { - return cb(er.message === "cancelled" ? er.message : er) + return cb(er.message === 'cancelled' ? er.message : er) } // make sure it's valid. we have to do this here, because @@ -68,17 +70,17 @@ function readPassword (c, u, cb) { var prompt if (c.p && !c.changed) { - prompt = "Password: (or leave unchanged) " + prompt = 'Password: (or leave unchanged) ' } else { - prompt = "Password: " + prompt = 'Password: ' } read({prompt: prompt, silent: true}, function (er, pw) { if (er) { - return cb(er.message === "cancelled" ? er.message : er) + return cb(er.message === 'cancelled' ? er.message : er) } - if (!c.changed && pw === "") { + if (!c.changed && pw === '') { // when the username was not changed, // empty response means "use the old value" pw = c.p @@ -102,10 +104,10 @@ function readPassword (c, u, cb) { function readEmail (c, u, cb) { var v = userValidate.email - var r = { prompt: "Email: (this IS public) ", default: c.e || "" } + var r = { prompt: 'Email: (this IS public) ', default: c.e || '' } read(r, function (er, em) { if (er) { - return cb(er.message === "cancelled" ? er.message : er) + return cb(er.message === 'cancelled' ? er.message : er) } if (!em) { @@ -124,52 +126,48 @@ function readEmail (c, u, cb) { } function save (c, u, cb) { - npm.spinner.start() - // save existing configs, but yank off for this PUT - var uri = npm.config.get("registry") - var scope = npm.config.get("scope") + 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 + if (scope.charAt(0) !== '@') scope = '@' + scope - var scopedRegistry = npm.config.get(scope + ":registry") - var cliRegistry = npm.config.get("registry", "cli") + var scopedRegistry = npm.config.get(scope + ':registry') + var cliRegistry = npm.config.get('registry', 'cli') if (scopedRegistry && !cliRegistry) uri = scopedRegistry } var params = { - auth : { - username : u.u, - password : u.p, - email : u.e + auth: { + username: u.u, + password: u.p, + email: u.e } } npm.registry.adduser(uri, params, function (er, doc) { - npm.spinner.stop() if (er) return cb(er) // don't want this polluting the configuration - npm.config.del("_token", "user") + npm.config.del('_token', 'user') - if (scope) npm.config.set(scope + ":registry", uri, "user") + if (scope) npm.config.set(scope + ':registry', uri, 'user') if (doc && doc.token) { npm.config.setCredentialsByURI(uri, { - token : doc.token + token: doc.token }) - } - else { + } else { npm.config.setCredentialsByURI(uri, { - username : u.u, - password : u.p, - email : u.e, - alwaysAuth : npm.config.get("always-auth") + username: u.u, + password: u.p, + email: u.e, + alwaysAuth: npm.config.get('always-auth') }) } - log.info("adduser", "Authorized user %s", u.u) - npm.config.save("user", cb) + log.info('adduser', 'Authorized user %s', u.u) + npm.config.save('user', cb) }) } diff --git a/deps/npm/lib/bin.js b/deps/npm/lib/bin.js index 5465112d8891e8..2e02617d35a790 100644 --- a/deps/npm/lib/bin.js +++ b/deps/npm/lib/bin.js @@ -1,19 +1,22 @@ module.exports = bin -var npm = require("./npm.js") -var osenv = require("osenv") +var npm = require('./npm.js') +var osenv = require('osenv') -bin.usage = "npm bin\nnpm bin -g\n(just prints the bin folder)" +bin.usage = 'npm bin [--global]' function bin (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } var b = npm.bin - , PATH = osenv.path() + var PATH = osenv.path() if (!silent) console.log(b) process.nextTick(cb.bind(this, null, b)) - if (npm.config.get("global") && PATH.indexOf(b) === -1) { - npm.config.get("logstream").write("(not in PATH env variable)\n") + if (npm.config.get('global') && PATH.indexOf(b) === -1) { + npm.config.get('logstream').write('(not in PATH env variable)\n') } } diff --git a/deps/npm/lib/bugs.js b/deps/npm/lib/bugs.js index 306d9bb4bfc9fe..d42e68faa5cde5 100644 --- a/deps/npm/lib/bugs.js +++ b/deps/npm/lib/bugs.js @@ -1,16 +1,11 @@ - module.exports = bugs -bugs.usage = "npm bugs " +bugs.usage = 'npm bugs []' -var npm = require("./npm.js") - , log = require("npmlog") - , opener = require("opener") - , path = require("path") - , readJson = require("read-package-json") - , npa = require("npm-package-arg") - , fs = require("fs") - , mapToRegistry = require("./utils/map-to-registry.js") +var npm = require('./npm.js') +var log = require('npmlog') +var opener = require('opener') +var fetchPackageMetadata = require('./fetch-package-metadata.js') bugs.completion = function (opts, cb) { // FIXME: there used to be registry completion here, but it stopped making @@ -19,51 +14,15 @@ bugs.completion = function (opts, cb) { } function bugs (args, cb) { - var n = args.length && npa(args[0]).name || "." - fs.stat(n, function (er, s) { - if (er) { - if (er.code === "ENOENT") return callRegistry(n, cb) - return cb(er) - } - if (!s.isDirectory()) return callRegistry(n, cb) - readJson(path.resolve(n, "package.json"), function(er, d) { - if (er) return cb(er) - getUrlAndOpen(d, cb) - }) - }) -} - -function getUrlAndOpen (d, cb) { - var repo = d.repository || d.repositories - , url - if (d.bugs) { - url = (typeof d.bugs === "string") ? d.bugs : d.bugs.url - } - else if (repo) { - if (Array.isArray(repo)) repo = repo.shift() - if (repo.hasOwnProperty("url")) repo = repo.url - log.verbose("bugs", "repository", repo) - if (repo && repo.match(/^(https?:\/\/|git(:\/\/|@))github.com/)) { - url = repo.replace(/^git(@|:\/\/)/, "https://") - .replace(/^https?:\/\/github.com:/, "https://github.com/") - .replace(/\.git$/, "")+"/issues" - } - } - if (!url) { - url = "https://www.npmjs.org/package/" + d.name - } - log.silly("bugs", "url", url) - opener(url, { command: npm.config.get("browser") }, cb) -} - -function callRegistry (name, cb) { - mapToRegistry(name, npm.config, function (er, uri, auth) { + var n = args.length ? args[0] : '.' + fetchPackageMetadata(n, '.', function (er, d) { if (er) return cb(er) - npm.registry.get(uri + "/latest", { auth : auth }, function (er, d) { - if (er) return cb(er) - - getUrlAndOpen(d, cb) - }) + var url = d.bugs && ((typeof d.bugs === 'string') ? d.bugs : d.bugs.url) + if (!url) { + url = 'https://www.npmjs.org/package/' + d.name + } + log.silly('bugs', 'url', url) + opener(url, { command: npm.config.get('browser') }, cb) }) } diff --git a/deps/npm/lib/build.js b/deps/npm/lib/build.js index 1f2d2efceb4618..e9da59a23dc5a3 100644 --- a/deps/npm/lib/build.js +++ b/deps/npm/lib/build.js @@ -7,100 +7,112 @@ // This runs AFTER install or link are completed. -var npm = require("./npm.js") - , log = require("npmlog") - , chain = require("slide").chain - , fs = require("graceful-fs") - , path = require("path") - , lifecycle = require("./utils/lifecycle.js") - , readJson = require("read-package-json") - , link = require("./utils/link.js") - , linkIfExists = link.ifExists - , cmdShim = require("cmd-shim") - , cmdShimIfExists = cmdShim.ifExists - , asyncMap = require("slide").asyncMap - , ini = require("ini") - , writeFile = require("write-file-atomic") +var npm = require('./npm.js') +var log = require('npmlog') +var chain = require('slide').chain +var fs = require('graceful-fs') +var path = require('path') +var lifecycle = require('./utils/lifecycle.js') +var readJson = require('read-package-json') +var link = require('./utils/link.js') +var linkIfExists = link.ifExists +var cmdShim = require('cmd-shim') +var cmdShimIfExists = cmdShim.ifExists +var asyncMap = require('slide').asyncMap +var ini = require('ini') +var writeFile = require('write-file-atomic') +var packageId = require('./utils/package-id.js') module.exports = build -build.usage = "npm build \n(this is plumbing)" +build.usage = 'npm build []' build._didBuild = {} build._noLC = {} function build (args, global, didPre, didRB, cb) { - if (typeof cb !== "function") cb = didRB, didRB = false - if (typeof cb !== "function") cb = didPre, didPre = false - if (typeof cb !== "function") { - cb = global, global = npm.config.get("global") + if (typeof cb !== 'function') { + cb = didRB + didRB = false } + if (typeof cb !== 'function') { + cb = didPre + didPre = false + } + if (typeof cb !== 'function') { + cb = global + global = npm.config.get('global') + } + // it'd be nice to asyncMap these, but actually, doing them // in parallel generally munges up the output from node-waf var builder = build_(global, didPre, didRB) - chain(args.map(function (arg) { return function (cb) { - builder(arg, cb) - }}), cb) + chain(args.map(function (arg) { + return function (cb) { + builder(arg, cb) + } + }), cb) } -function build_ (global, didPre, didRB) { return function (folder, cb) { - folder = path.resolve(folder) - if (build._didBuild[folder]) log.info("build", "already built", folder) - build._didBuild[folder] = true - log.info("build", folder) - readJson(path.resolve(folder, "package.json"), function (er, pkg) { - if (er) return cb(er) - chain - ( [ !didPre && [lifecycle, pkg, "preinstall", folder] - , [linkStuff, pkg, folder, global, didRB] - , [writeBuiltinConf, pkg, folder] - , didPre !== build._noLC && [lifecycle, pkg, "install", folder] - , didPre !== build._noLC && [lifecycle, pkg, "postinstall", folder] - , didPre !== build._noLC - && npm.config.get("npat") - && [lifecycle, pkg, "test", folder] ] - , cb ) - }) -}} +function build_ (global, didPre, didRB) { + return function (folder, cb) { + folder = path.resolve(folder) + if (build._didBuild[folder]) log.info('build', 'already built', folder) + build._didBuild[folder] = true + log.info('build', folder) + readJson(path.resolve(folder, 'package.json'), function (er, pkg) { + if (er) return cb(er) + chain([ + !didPre && [lifecycle, pkg, 'preinstall', folder], + [linkStuff, pkg, folder, global, didRB], + [writeBuiltinConf, pkg, folder], + didPre !== build._noLC && [lifecycle, pkg, 'install', folder], + didPre !== build._noLC && [lifecycle, pkg, 'postinstall', folder], + didPre !== build._noLC && npm.config.get('npat') && [lifecycle, pkg, 'test', folder] + ], + cb) + }) + } +} -function writeBuiltinConf (pkg, folder, cb) { +var writeBuiltinConf = build.writeBuiltinConf = function (pkg, folder, cb) { // the builtin config is "sticky". Any time npm installs // itself globally, it puts its builtin config file there var parent = path.dirname(folder) var dir = npm.globalDir - if (pkg.name !== "npm" || - !npm.config.get("global") || + if (pkg.name !== 'npm' || + !npm.config.get('global') || !npm.config.usingBuiltin || dir !== parent) { return cb() } var data = ini.stringify(npm.config.sources.builtin.data) - writeFile(path.resolve(folder, "npmrc"), data, cb) + writeFile(path.resolve(folder, 'npmrc'), data, cb) } -function linkStuff (pkg, folder, global, didRB, cb) { +var linkStuff = build.linkStuff = function (pkg, folder, global, didRB, cb) { // allow to opt out of linking binaries. - if (npm.config.get("bin-links") === false) return cb() + if (npm.config.get('bin-links') === false) return 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 = pkg.name[0] === '@' ? path.dirname(path.dirname(folder)) : path.dirname(folder) + var parent = pkg.name && pkg.name[0] === '@' ? path.dirname(path.dirname(folder)) : path.dirname(folder) var gnm = global && npm.globalDir var gtop = parent === gnm - log.info('linkStuff', pkg._id) - log.silly('linkStuff', pkg._id, 'has', parent, 'as its parent node_modules') - if (global) log.silly('linkStuff', pkg._id, 'is part of a global install') - if (gnm) log.silly('linkStuff', pkg._id, 'is installed into a global node_modules') - if (gtop) log.silly('linkStuff', pkg._id, 'is installed into the top-level global node_modules') + log.info('linkStuff', packageId(pkg)) + log.silly('linkStuff', packageId(pkg), 'has', parent, 'as its parent node_modules') + if (global) log.silly('linkStuff', packageId(pkg), 'is part of a global install') + if (gnm) log.silly('linkStuff', packageId(pkg), 'is installed into a global node_modules') + if (gtop) log.silly('linkStuff', packageId(pkg), 'is installed into the top-level global node_modules') shouldWarn(pkg, folder, global, function () { asyncMap( [linkBins, linkMans, !didRB && rebuildBundles], function (fn, cb) { if (!fn) return cb() - log.verbose(fn.name, pkg._id) + log.verbose(fn.name, packageId(pkg)) fn(pkg, folder, parent, gtop, cb) }, cb @@ -108,27 +120,25 @@ function linkStuff (pkg, folder, global, didRB, cb) { }) } -function shouldWarn(pkg, folder, global, cb) { +function shouldWarn (pkg, folder, global, cb) { var parent = path.dirname(folder) - , top = parent === npm.dir - , cwd = npm.localPrefix + var top = parent === npm.dir + var cwd = npm.localPrefix - readJson(path.resolve(cwd, "package.json"), function(er, topPkg) { + readJson(path.resolve(cwd, 'package.json'), function (er, topPkg) { if (er) return cb(er) var linkedPkg = path.basename(cwd) - , currentPkg = path.basename(folder) + var currentPkg = path.basename(folder) // current searched package is the linked package on first call if (linkedPkg !== currentPkg) { - // don't generate a warning if it's listed in dependencies if (Object.keys(topPkg.dependencies || {}) .concat(Object.keys(topPkg.devDependencies || {})) .indexOf(currentPkg) === -1) { - if (top && pkg.preferGlobal && !global) { - log.warn("prefer global", pkg._id + " should be installed with -g") + log.warn('prefer global', packageId(pkg) + ' should be installed with -g') } } } @@ -138,76 +148,81 @@ function shouldWarn(pkg, folder, global, cb) { } function rebuildBundles (pkg, folder, parent, gtop, cb) { - if (!npm.config.get("rebuild-bundle")) return cb() + if (!npm.config.get('rebuild-bundle')) return cb() var deps = Object.keys(pkg.dependencies || {}) .concat(Object.keys(pkg.devDependencies || {})) - , bundles = pkg.bundleDependencies || pkg.bundledDependencies || [] + var bundles = pkg.bundleDependencies || pkg.bundledDependencies || [] - fs.readdir(path.resolve(folder, "node_modules"), function (er, files) { + fs.readdir(path.resolve(folder, 'node_modules'), function (er, files) { // error means no bundles if (er) return cb() - log.verbose("rebuildBundles", files) + log.verbose('rebuildBundles', files) // don't asyncMap these, because otherwise build script output // gets interleaved and is impossible to read chain(files.filter(function (file) { // rebuild if: // not a .folder, like .bin or .hooks - return !file.match(/^[\._-]/) + return !file.match(/^[\._-]/) && // not some old 0.x style bundle - && file.indexOf("@") === -1 + file.indexOf('@') === -1 && // either not a dep, or explicitly bundled - && (deps.indexOf(file) === -1 || bundles.indexOf(file) !== -1) + (deps.indexOf(file) === -1 || bundles.indexOf(file) !== -1) }).map(function (file) { - file = path.resolve(folder, "node_modules", file) + file = path.resolve(folder, 'node_modules', file) return function (cb) { if (build._didBuild[file]) return cb() - log.verbose("rebuild bundle", file) + log.verbose('rebuild bundle', file) // if file is not a package dir, then don't do it. - fs.lstat(path.resolve(file, "package.json"), function (er) { + fs.lstat(path.resolve(file, 'package.json'), function (er) { if (er) return cb() build_(false)(file, cb) }) - }}), cb) + } + }), cb) }) } function linkBins (pkg, folder, parent, gtop, cb) { - if (!pkg.bin || !gtop && path.basename(parent) !== "node_modules") { + if (!pkg.bin || !gtop && path.basename(parent) !== 'node_modules') { return cb() } var binRoot = gtop ? npm.globalBin - : path.resolve(parent, ".bin") - log.verbose("link bins", [pkg.bin, binRoot, gtop]) + : path.resolve(parent, '.bin') + log.verbose('link bins', [pkg.bin, binRoot, gtop]) asyncMap(Object.keys(pkg.bin), function (b, cb) { - linkBin( path.resolve(folder, pkg.bin[b]) - , path.resolve(binRoot, b) - , gtop && folder - , function (er) { - if (er) return cb(er) - // bins should always be executable. - // XXX skip chmod on windows? - var src = path.resolve(folder, pkg.bin[b]) - fs.chmod(src, npm.modes.exec, function (er) { - if (er && er.code === "ENOENT" && npm.config.get("ignore-scripts")) { - return cb() - } - if (er || !gtop) return cb(er) - var dest = path.resolve(binRoot, b) - , out = npm.config.get("parseable") - ? dest + "::" + src + ":BINFILE" - : dest + " -> " + src - console.log(out) - cb() - }) - }) + linkBin( + path.resolve(folder, pkg.bin[b]), + path.resolve(binRoot, b), + gtop && folder, + function (er) { + if (er) return cb(er) + // bins should always be executable. + // XXX skip chmod on windows? + var src = path.resolve(folder, pkg.bin[b]) + fs.chmod(src, npm.modes.exec, function (er) { + if (er && er.code === 'ENOENT' && npm.config.get('ignore-scripts')) { + return cb() + } + if (er || !gtop) return cb(er) + var dest = path.resolve(binRoot, b) + var out = npm.config.get('parseable') + ? dest + '::' + src + ':BINFILE' + : dest + ' -> ' + src + log.clearProgress() + console.log(out) + log.showProgress() + cb() + }) + } + ) }, cb) } function linkBin (from, to, gently, cb) { - if (process.platform !== "win32") { + if (process.platform !== 'win32') { return linkIfExists(from, to, gently, cb) } else { return cmdShimIfExists(from, to, cb) @@ -215,10 +230,10 @@ function linkBin (from, to, gently, cb) { } function linkMans (pkg, folder, parent, gtop, cb) { - if (!pkg.man || !gtop || process.platform === "win32") return cb() + if (!pkg.man || !gtop || process.platform === 'win32') return cb() - var manRoot = path.resolve(npm.config.get("prefix"), "share", "man") - log.verbose("linkMans", "man files are", pkg.man, "in", manRoot) + var manRoot = path.resolve(npm.config.get('prefix'), 'share', 'man') + log.verbose('linkMans', 'man files are', pkg.man, 'in', manRoot) // make sure that the mans are unique. // otherwise, if there are dupes, it'll fail with EEXIST @@ -231,14 +246,14 @@ function linkMans (pkg, folder, parent, gtop, cb) { }) asyncMap(pkg.man, function (man, cb) { - if (typeof man !== "string") return cb() - log.silly("linkMans", "preparing to link", man) + if (typeof man !== 'string') return cb() + log.silly('linkMans', 'preparing to link', man) var parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) if (!parseMan) { return cb(new Error( - man+" is not a valid name for a man file. " + - "Man files must end with a number, " + - "and optionally a .gz suffix if they are compressed." + man + ' is not a valid name for a man file. ' + + 'Man files must end with a number, ' + + 'and optionally a .gz suffix if they are compressed.' )) } @@ -246,7 +261,7 @@ function linkMans (pkg, folder, parent, gtop, cb) { var sxn = parseMan[2] var bn = path.basename(stem) var manSrc = path.resolve(folder, man) - var manDest = path.join(manRoot, "man" + sxn, bn) + var manDest = path.join(manRoot, 'man' + sxn, bn) linkIfExists(manSrc, manDest, gtop && folder, cb) }, cb) diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js index 2e11be32f862fa..eb5a1e413771dc 100644 --- a/deps/npm/lib/cache.js +++ b/deps/npm/lib/cache.js @@ -60,54 +60,53 @@ cache.unpack = unpack cache.clean = clean cache.read = read -var npm = require("./npm.js") - , fs = require("graceful-fs") - , writeFileAtomic = require("write-file-atomic") - , assert = require("assert") - , rm = require("./utils/gently-rm.js") - , readJson = require("read-package-json") - , log = require("npmlog") - , path = require("path") - , asyncMap = require("slide").asyncMap - , tar = require("./utils/tar.js") - , fileCompletion = require("./utils/completion/file-completion.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") - , inflight = require("inflight") - , realizePackageSpecifier = require("realize-package-specifier") - , npa = require("npm-package-arg") - , getStat = require("./cache/get-stat.js") - , cachedPackageRoot = require("./cache/cached-package-root.js") - , mapToRegistry = require("./utils/map-to-registry.js") - -cache.usage = "npm cache add " - + "\nnpm cache add " - + "\nnpm cache add " - + "\nnpm cache add " - + "\nnpm cache add @" - + "\nnpm cache ls []" - + "\nnpm cache clean [[@]]" +var npm = require('./npm.js') +var fs = require('graceful-fs') +var writeFileAtomic = require('write-file-atomic') +var assert = require('assert') +var rm = require('./utils/gently-rm.js') +var readJson = require('read-package-json') +var log = require('npmlog') +var path = require('path') +var asyncMap = require('slide').asyncMap +var tar = require('./utils/tar.js') +var fileCompletion = require('./utils/completion/file-completion.js') +var deprCheck = require('./utils/depr-check.js') +var addNamed = require('./cache/add-named.js') +var addLocal = require('./cache/add-local.js') +var addRemoteTarball = require('./cache/add-remote-tarball.js') +var addRemoteGit = require('./cache/add-remote-git.js') +var inflight = require('inflight') +var realizePackageSpecifier = require('realize-package-specifier') +var npa = require('npm-package-arg') +var getStat = require('./cache/get-stat.js') +var cachedPackageRoot = require('./cache/cached-package-root.js') +var mapToRegistry = require('./utils/map-to-registry.js') + +cache.usage = 'npm cache add ' + + '\nnpm cache add ' + + '\nnpm cache add ' + + '\nnpm cache add ' + + '\nnpm cache add @' + + '\nnpm cache ls []' + + '\nnpm cache clean [[@]]' cache.completion = function (opts, cb) { - var argv = opts.conf.argv.remain if (argv.length === 2) { - return cb(null, ["add", "ls", "clean"]) + return cb(null, ['add', 'ls', 'clean']) } switch (argv[2]) { - case "clean": - case "ls": + case 'clean': + case 'ls': // cache and ls are easy, because the completion is // what ls_ returns anyway. // just get the partial words, minus the last path part - var p = path.dirname(opts.partialWords.slice(3).join("/")) - if (p === ".") p = "" + var p = path.dirname(opts.partialWords.slice(3).join('/')) + if (p === '.') p = '' return ls_(p, 2, cb) - case "add": + case 'add': // Same semantics as install and publish. return npm.commands.install.completion(opts, cb) } @@ -116,10 +115,10 @@ cache.completion = function (opts, cb) { function cache (args, cb) { var cmd = args.shift() 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, npm.prefix, cb) - default: return cb("Usage: "+cache.usage) + 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, npm.prefix, cb) + default: return cb('Usage: ' + cache.usage) } } @@ -127,30 +126,30 @@ function cache (args, cb) { // just do a readJson and return. // if they're not, then fetch them from the registry. function read (name, ver, forceBypass, cb) { - assert(typeof name === "string", "must include name of module to install") - assert(typeof cb === "function", "must include callback") + assert(typeof name === 'string', 'must include name of module to install') + assert(typeof cb === 'function', 'must include callback') if (forceBypass === undefined || forceBypass === null) forceBypass = true - var root = cachedPackageRoot({name : name, version : ver}) + var root = cachedPackageRoot({name: name, version: ver}) function c (er, data) { - if (er) log.verbose("cache", "addNamed error for", name+"@"+ver, er) + if (er) log.verbose('cache', 'addNamed error for', name + '@' + ver, er) if (data) deprCheck(data) return cb(er, data) } - if (forceBypass && npm.config.get("force")) { - log.verbose("using force", "skipping cache") + if (forceBypass && npm.config.get('force')) { + log.verbose('using force', 'skipping cache') return addNamed(name, ver, null, c) } - readJson(path.join(root, "package", "package.json"), function (er, data) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + readJson(path.join(root, 'package', 'package.json'), function (er, data) { + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) if (data) { - if (!data.name) return cb(new Error("No name provided")) - if (!data.version) return cb(new Error("No version provided")) + if (!data.name) return cb(new Error('No name provided')) + if (!data.version) return cb(new Error('No version provided')) } if (er) return addNamed(name, ver, null, c) @@ -159,33 +158,33 @@ function read (name, ver, forceBypass, cb) { } function normalize (args) { - var normalized = "" + 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 (a.rawSpec) normalized = [normalized, a.rawSpec].join('/') + if (args.length > 1) normalized = [normalized].concat(args.slice(1)).join('/') } - if (normalized.substr(-1) === "/") { + if (normalized.substr(-1) === '/') { normalized = normalized.substr(0, normalized.length - 1) } normalized = path.normalize(normalized) - log.silly("ls", "normalized", normalized) + log.silly('ls', 'normalized', normalized) return normalized } // npm cache ls [] function ls (args, cb) { - var prefix = npm.config.get("cache") + var prefix = npm.config.get('cache') if (prefix.indexOf(process.env.HOME) === 0) { - prefix = "~" + prefix.substr(process.env.HOME.length) + prefix = '~' + prefix.substr(process.env.HOME.length) } - ls_(normalize(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()) + }).join('\n').trim()) cb(er, files) }) } @@ -197,7 +196,7 @@ function ls_ (req, depth, cb) { // npm cache clean [] function clean (args, cb) { - assert(typeof cb === "function", "must include callback") + assert(typeof cb === 'function', 'must include callback') if (!args) args = [] @@ -205,15 +204,17 @@ function clean (args, cb) { if (f === npm.cache) { fs.readdir(npm.cache, function (er, files) { if (er) return cb() - asyncMap( files.filter(function (f) { - return npm.config.get("force") || f !== "-" - }).map(function (f) { - return path.join(npm.cache, f) - }) - , rm, cb ) + asyncMap( + files.filter(function (f) { + return npm.config.get('force') || f !== '-' + }).map(function (f) { + return path.join(npm.cache, f) + }), + rm, + cb + ) }) - } - else { + } else { rm(f, cb) } } @@ -223,8 +224,8 @@ function clean (args, cb) { // npm cache add // npm cache add 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") + assert(typeof pkg === 'string', 'must include name of package to install') + assert(typeof cb === 'function', 'must include callback') if (scrub) { return clean([], function (er) { @@ -235,67 +236,63 @@ cache.add = function (pkg, ver, where, scrub, cb) { return add([pkg, ver], where, cb) } - var adding = 0 function add (args, where, cb) { // this is hot code. almost everything passes through here. // the args can be any of: - // ["url"] - // ["pkg", "version"] - // ["pkg@version"] - // ["pkg", "url"] + // ['url'] + // ['pkg', 'version'] + // ['pkg@version'] + // ['pkg', 'url'] // This is tricky, because urls can contain @ // Also, in some cases we get [name, null] rather // that just a single argument. - var usage = "Usage:\n" - + " npm cache add \n" - + " npm cache add @\n" - + " npm cache add \n" - + " npm cache add \n" - , spec + var usage = 'Usage:\n' + + ' npm cache add \n' + + ' npm cache add @\n' + + ' npm cache add \n' + + ' npm cache add \n' + var spec - log.silly("cache add", "args", args) + log.silly('cache add', 'args', args) if (args[1] === undefined) args[1] = null // at this point the args length must ==2 if (args[1] !== null) { - spec = args[0]+"@"+args[1] + spec = args[0] + '@' + args[1] } else if (args.length === 2) { spec = args[0] } - log.verbose("cache add", "spec", spec) + log.verbose('cache add', 'spec', spec) if (!spec) return cb(usage) - if (adding <= 0) { - npm.spinner.start() - } adding++ cb = afterAdd(cb) realizePackageSpecifier(spec, where, function (err, p) { if (err) return cb(err) - log.silly("cache add", "parsed spec", p) + log.silly('cache add', 'parsed spec', p) switch (p.type) { - case "local": - case "directory": + case 'local': + case 'directory': addLocal(p, null, cb) break - case "remote": + case 'remote': // get auth, if possible mapToRegistry(spec, npm.config, function (err, uri, auth) { if (err) return cb(err) - addRemoteTarball(p.spec, {name : p.name}, null, auth, cb) + addRemoteTarball(p.spec, { name: p.name }, null, auth, cb) }) break - case "git": - case "hosted": + case 'git': + case 'hosted': addRemoteGit(p.rawSpec, cb) break default: @@ -307,47 +304,62 @@ function add (args, where, cb) { } function unpack (pkg, ver, unpackTarget, dMode, fMode, uid, gid, cb) { - if (typeof cb !== "function") cb = gid, gid = null - if (typeof cb !== "function") cb = uid, uid = null - if (typeof cb !== "function") cb = fMode, fMode = null - if (typeof cb !== "function") cb = dMode, dMode = null + if (typeof cb !== 'function') { + cb = gid + gid = null + } + if (typeof cb !== 'function') { + cb = uid + uid = null + } + if (typeof cb !== 'function') { + cb = fMode + fMode = null + } + if (typeof cb !== 'function') { + cb = dMode + dMode = null + } read(pkg, ver, false, function (er) { if (er) { - log.error("unpack", "Could not read data for %s", pkg + "@" + ver) + log.error('unpack', 'Could not read data for %s', pkg + '@' + ver) return cb(er) } npm.commands.unbuild([unpackTarget], true, function (er) { if (er) return cb(er) - tar.unpack( path.join(cachedPackageRoot({name : pkg, version : ver}), "package.tgz") - , unpackTarget - , dMode, fMode - , uid, gid - , cb ) + tar.unpack( + path.join(cachedPackageRoot({ name: pkg, version: ver }), 'package.tgz'), + unpackTarget, + dMode, fMode, + uid, gid, + cb + ) }) }) } -function afterAdd (cb) { return function (er, data) { - adding-- - if (adding <= 0) npm.spinner.stop() +function afterAdd (cb) { + return function (er, data) { + adding-- - if (er || !data || !data.name || !data.version) return cb(er, data) - log.silly("cache", "afterAdd", data.name+"@"+data.version) + if (er || !data || !data.name || !data.version) return cb(er, data) + log.silly('cache', 'afterAdd', data.name + '@' + data.version) - // Save the resolved, shasum, etc. into the data so that the next - // time we load from this cached data, we have all the same info. - var pj = path.join(cachedPackageRoot(data), "package", "package.json") + // Save the resolved, shasum, etc. into the data so that the next + // time we load from this cached data, we have all the same info. + var pj = path.join(cachedPackageRoot(data), 'package', 'package.json') - var done = inflight(pj, cb) - if (!done) return log.verbose("afterAdd", pj, "already in flight; not writing") - log.verbose("afterAdd", pj, "not in flight; writing") + var done = inflight(pj, cb) + if (!done) return log.verbose('afterAdd', pj, 'already in flight; not writing') + log.verbose('afterAdd', pj, 'not in flight; writing') - getStat(function (er, cs) { - if (er) return done(er) - writeFileAtomic(pj, JSON.stringify(data), {chown : cs}, function (er) { - if (!er) log.verbose("afterAdd", pj, "written") - return done(er, data) + getStat(function (er, cs) { + if (er) return done(er) + writeFileAtomic(pj, JSON.stringify(data), { chown: cs }, function (er) { + if (!er) log.verbose('afterAdd', pj, 'written') + return done(er, data) + }) }) - }) -}} + } +} diff --git a/deps/npm/lib/cache/add-local-tarball.js b/deps/npm/lib/cache/add-local-tarball.js index e84b66dd8dd51f..7d747ea80444c5 100644 --- a/deps/npm/lib/cache/add-local-tarball.js +++ b/deps/npm/lib/cache/add-local-tarball.js @@ -1,26 +1,28 @@ -var mkdir = require("mkdirp") - , assert = require("assert") - , fs = require("graceful-fs") - , writeFileAtomic = require("write-file-atomic") - , path = require("path") - , sha = require("sha") - , npm = require("../npm.js") - , log = require("npmlog") - , tar = require("../utils/tar.js") - , pathIsInside = require("path-is-inside") - , getCacheStat = require("./get-stat.js") - , cachedPackageRoot = require("./cached-package-root.js") - , chownr = require("chownr") - , inflight = require("inflight") - , once = require("once") - , writeStream = require("fs-write-stream-atomic") - , randomBytes = require("crypto").pseudoRandomBytes // only need uniqueness +var mkdir = require('mkdirp') +var assert = require('assert') +var fs = require('graceful-fs') +var writeFileAtomic = require('write-file-atomic') +var path = require('path') +var sha = require('sha') +var npm = require('../npm.js') +var log = require('npmlog') +var tar = require('../utils/tar.js') +var pathIsInside = require('path-is-inside') +var getCacheStat = require('./get-stat.js') +var cachedPackageRoot = require('./cached-package-root.js') +var chownr = require('chownr') +var inflight = require('inflight') +var once = require('once') +var writeStream = require('fs-write-stream-atomic') +var tempFilename = require('../utils/temp-filename.js') +var rimraf = require('rimraf') +var packageId = require('../utils/package-id.js') module.exports = addLocalTarball function addLocalTarball (p, pkgData, shasum, cb) { - assert(typeof p === "string", "must have path") - assert(typeof cb === "function", "must have callback") + assert(typeof p === 'string', 'must have path') + assert(typeof cb === 'function', 'must have callback') if (!pkgData) pkgData = {} @@ -28,16 +30,16 @@ function addLocalTarball (p, pkgData, shasum, cb) { if (!shasum) { return sha.get(p, function (er, shasum) { if (er) return cb(er) - log.silly("addLocalTarball", "shasum (computed)", shasum) + log.silly('addLocalTarball', 'shasum (computed)', shasum) addLocalTarball(p, pkgData, shasum, cb) }) } if (pathIsInside(p, npm.cache)) { - if (path.basename(p) !== "package.tgz") { - return cb(new Error("Not a valid cache tarball name: "+p)) + if (path.basename(p) !== 'package.tgz') { + return cb(new Error('Not a valid cache tarball name: ' + p)) } - log.verbose("addLocalTarball", "adding from inside cache", p) + log.verbose('addLocalTarball', 'adding from inside cache', p) return addPlacedTarball(p, pkgData, shasum, cb) } @@ -51,8 +53,8 @@ function addLocalTarball (p, pkgData, shasum, cb) { } function addPlacedTarball (p, pkgData, shasum, cb) { - assert(pkgData, "should have package data by now") - assert(typeof cb === "function", "cb function required") + assert(pkgData, 'should have package data by now') + assert(typeof cb === 'function', 'cb function required') getCacheStat(function (er, cs) { if (er) return cb(er) @@ -61,7 +63,7 @@ function addPlacedTarball (p, pkgData, shasum, cb) { } function addPlacedTarball_ (p, pkgData, uid, gid, resolvedSum, cb) { - var folder = path.join(cachedPackageRoot(pkgData), "package") + var folder = path.join(cachedPackageRoot(pkgData), 'package') // First, make sure we have the shasum, if we don't already. if (!resolvedSum) { @@ -74,7 +76,7 @@ function addPlacedTarball_ (p, pkgData, uid, gid, resolvedSum, cb) { mkdir(folder, function (er) { if (er) return cb(er) - var pj = path.join(folder, "package.json") + var pj = path.join(folder, 'package.json') var json = JSON.stringify(pkgData, null, 2) writeFileAtomic(pj, json, function (er) { cb(er, pkgData) @@ -83,19 +85,19 @@ function addPlacedTarball_ (p, pkgData, uid, gid, resolvedSum, cb) { } function addTmpTarball (tgz, pkgData, shasum, cb) { - assert(typeof cb === "function", "must have callback function") - assert(shasum, "must have shasum by now") + assert(typeof cb === 'function', 'must have callback function') + assert(shasum, 'must have shasum by now') - cb = inflight("addTmpTarball:" + tgz, cb) - if (!cb) return log.verbose("addTmpTarball", tgz, "already in flight; not adding") - log.verbose("addTmpTarball", tgz, "not in flight; adding") + cb = inflight('addTmpTarball:' + tgz, cb) + if (!cb) return log.verbose('addTmpTarball', tgz, 'already in flight; not adding') + log.verbose('addTmpTarball', tgz, 'not in flight; adding') // we already have the package info, so just move into place if (pkgData && pkgData.name && pkgData.version) { log.verbose( - "addTmpTarball", - "already have metadata; skipping unpack for", - pkgData.name + "@" + pkgData.version + 'addTmpTarball', + 'already have metadata; skipping unpack for', + packageId(pkgData) ) return addTmpTarball_(tgz, pkgData, shasum, cb) } @@ -107,34 +109,29 @@ function addTmpTarball (tgz, pkgData, shasum, cb) { // NOTE: we might not have any clue what we think it is, for example if the // user just did `npm install ./foo.tgz` - // generate a unique filename - randomBytes(6, function (er, random) { + var target = tempFilename('unpack') + getCacheStat(function (er, cs) { if (er) return cb(er) - var target = path.join(npm.tmp, "unpack-" + random.toString("hex")) - getCacheStat(function (er, cs) { - if (er) return cb(er) - - log.verbose("addTmpTarball", "validating metadata from", tgz) - tar.unpack(tgz, target, null, null, cs.uid, cs.gid, function (er, data) { - if (er) return cb(er) - + log.verbose('addTmpTarball', 'validating metadata from', tgz) + tar.unpack(tgz, target, null, null, cs.uid, cs.gid, function (unpackEr, data) { + // cleanup the extracted package and move on with the metadata + rimraf(target, function () { + if (unpackEr) return cb(unpackEr) // check that this is what we expected. if (!data.name) { - return cb(new Error("No name provided")) - } - else if (pkgData.name && data.name !== pkgData.name) { - return cb(new Error("Invalid Package: expected " + pkgData.name + - " but found " + data.name)) + return cb(new Error('No name provided')) + } else if (pkgData.name && data.name !== pkgData.name) { + return cb(new Error('Invalid Package: expected ' + pkgData.name + + ' but found ' + data.name)) } if (!data.version) { - return cb(new Error("No version provided")) - } - else if (pkgData.version && data.version !== pkgData.version) { - return cb(new Error("Invalid Package: expected " + - pkgData.name + "@" + pkgData.version + - " but found " + data.name + "@" + data.version)) + return cb(new Error('No version provided')) + } else if (pkgData.version && data.version !== pkgData.version) { + return cb(new Error('Invalid Package: expected ' + + packageId(pkgData) + + ' but found ' + packageId(data))) } addTmpTarball_(tgz, data, shasum, cb) @@ -144,19 +141,18 @@ function addTmpTarball (tgz, pkgData, shasum, cb) { } function addTmpTarball_ (tgz, data, shasum, cb) { - assert(typeof cb === "function", "must have callback function") + assert(typeof cb === 'function', 'must have callback function') cb = once(cb) - assert(data.name, "should have package name by now") - assert(data.version, "should have package version by now") + assert(data.name, 'should have package name by now') + assert(data.version, 'should have package version by now') var root = cachedPackageRoot(data) - var pkg = path.resolve(root, "package") - var target = path.resolve(root, "package.tgz") + var pkg = path.resolve(root, 'package') + var target = path.resolve(root, 'package.tgz') getCacheStat(function (er, cs) { if (er) return cb(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. @@ -168,12 +164,11 @@ function addTmpTarball_ (tgz, data, shasum, cb) { var read = fs.createReadStream(tgz) var write = writeStream(target, { mode: npm.modes.file }) var fin = cs.uid && cs.gid ? chown : done - read.on("error", cb).pipe(write).on("error", cb).on("close", fin) + read.on('error', cb).pipe(write).on('error', cb).on('close', fin) }) - }) - function done() { + function done () { data._shasum = data._shasum || shasum cb(null, data) } diff --git a/deps/npm/lib/cache/add-local.js b/deps/npm/lib/cache/add-local.js index e7d286e4fb5d40..075ca5fc61d8de 100644 --- a/deps/npm/lib/cache/add-local.js +++ b/deps/npm/lib/cache/add-local.js @@ -1,44 +1,45 @@ -var assert = require("assert") - , path = require("path") - , mkdir = require("mkdirp") - , chownr = require("chownr") - , pathIsInside = require("path-is-inside") - , readJson = require("read-package-json") - , log = require("npmlog") - , npm = require("../npm.js") - , tar = require("../utils/tar.js") - , deprCheck = require("../utils/depr-check.js") - , getCacheStat = require("./get-stat.js") - , cachedPackageRoot = require("./cached-package-root.js") - , addLocalTarball = require("./add-local-tarball.js") - , sha = require("sha") - , inflight = require("inflight") +var assert = require('assert') +var path = require('path') +var mkdir = require('mkdirp') +var chownr = require('chownr') +var pathIsInside = require('path-is-inside') +var readJson = require('read-package-json') +var log = require('npmlog') +var npm = require('../npm.js') +var tar = require('../utils/tar.js') +var deprCheck = require('../utils/depr-check.js') +var getCacheStat = require('./get-stat.js') +var cachedPackageRoot = require('./cached-package-root.js') +var addLocalTarball = require('./add-local-tarball.js') +var sha = require('sha') +var inflight = require('inflight') +var lifecycle = require('../utils/lifecycle.js') +var iferr = require('iferr') module.exports = addLocal function addLocal (p, pkgData, cb_) { - assert(typeof p === "object", "must have spec info") - assert(typeof cb === "function", "must have callback") + assert(typeof p === 'object', 'must have spec info') + assert(typeof cb === 'function', 'must have callback') pkgData = pkgData || {} function cb (er, data) { if (er) { - log.error("addLocal", "Could not install %s", p.spec) + log.error('addLocal', 'Could not install %s', p.spec) return cb_(er) } - if (data && !data._fromGithub) { - data._from = path.relative(npm.prefix, p.spec) || "." + if (data && !data._fromHosted) { + data._from = path.relative(npm.prefix, p.spec) || '.' var resolved = path.relative(npm.prefix, p.spec) - if (resolved) data._resolved = "file:"+resolved + if (resolved) data._resolved = 'file:' + resolved } return cb_(er, data) } - if (p.type === "directory") { + if (p.type === 'directory') { addLocalDirectory(p.spec, pkgData, null, cb) - } - else { + } else { addLocalTarball(p.spec, pkgData, null, cb) } } @@ -46,33 +47,34 @@ function addLocal (p, pkgData, cb_) { // At this point, if shasum is set, it's something that we've already // read and checked. Just stashing it in the data at this point. function addLocalDirectory (p, pkgData, shasum, cb) { - assert(pkgData, "must pass package data") - assert(typeof cb === "function", "must have callback") + assert(pkgData, 'must pass package data') + assert(typeof cb === 'function', 'must have callback') // if it's a folder, then read the package.json, // tar it to the proper place, and add the cache tar - if (pathIsInside(p, npm.cache)) return cb(new Error( - "Adding a cache directory to the cache will make the world implode.")) + if (pathIsInside(p, npm.cache)) { + return cb(new Error( + 'Adding a cache directory to the cache will make the world implode.' + )) + } - readJson(path.join(p, "package.json"), false, function (er, data) { + readJson(path.join(p, 'package.json'), false, function (er, data) { if (er) return cb(er) if (!data.name) { - return cb(new Error("No name provided in package.json")) - } - else if (pkgData.name && pkgData.name !== data.name) { + return cb(new Error('No name provided in package.json')) + } else if (pkgData.name && pkgData.name !== data.name) { return cb(new Error( - "Invalid package: expected " + pkgData.name + " but found " + data.name + 'Invalid package: expected ' + pkgData.name + ' but found ' + data.name )) } if (!data.version) { - return cb(new Error("No version provided in package.json")) - } - else if (pkgData.version && pkgData.version !== data.version) { + return cb(new Error('No version provided in package.json')) + } else if (pkgData.version && pkgData.version !== data.version) { return cb(new Error( - "Invalid package: expected " + pkgData.name + "@" + pkgData.version + - " but found " + data.name + "@" + data.version + 'Invalid package: expected ' + pkgData.name + '@' + pkgData.version + + ' but found ' + data.name + '@' + data.version )) } @@ -80,27 +82,34 @@ function addLocalDirectory (p, pkgData, shasum, cb) { // pack to {cache}/name/ver/package.tgz var root = cachedPackageRoot(data) - var tgz = path.resolve(root, "package.tgz") - var pj = path.resolve(root, "package/package.json") + var tgz = path.resolve(root, 'package.tgz') + var pj = path.resolve(root, 'package/package.json') var wrapped = inflight(tgz, next) - if (!wrapped) return log.verbose("addLocalDirectory", tgz, "already in flight; waiting") - log.verbose("addLocalDirectory", tgz, "not in flight; packing") + if (!wrapped) return log.verbose('addLocalDirectory', tgz, 'already in flight; waiting') + log.verbose('addLocalDirectory', tgz, 'not in flight; packing') getCacheStat(function (er, cs) { mkdir(path.dirname(pj), function (er, made) { if (er) return cb(er) - var fancy = !pathIsInside(p, npm.tmp) - tar.pack(tgz, p, data, fancy, function (er) { - if (er) { - log.error("addLocalDirectory", "Could not pack", p, "to", tgz) - return cb(er) - } - - if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) wrapped() - - chownr(made || tgz, cs.uid, cs.gid, wrapped) - }) + var doPrePublish = !pathIsInside(p, npm.tmp) + if (doPrePublish) { + lifecycle(data, 'prepublish', p, iferr(cb, thenPack)) + } else { + thenPack() + } + function thenPack () { + tar.pack(tgz, p, data, function (er) { + if (er) { + log.error('addLocalDirectory', 'Could not pack', p, 'to', tgz) + return cb(er) + } + + if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) wrapped() + + chownr(made || tgz, cs.uid, cs.gid, wrapped) + }) + } }) }) diff --git a/deps/npm/lib/cache/add-named.js b/deps/npm/lib/cache/add-named.js index acc67bf9d26d4f..f0e5e2c33a8f31 100644 --- a/deps/npm/lib/cache/add-named.js +++ b/deps/npm/lib/cache/add-named.js @@ -1,23 +1,24 @@ -var path = require("path") - , assert = require("assert") - , fs = require("graceful-fs") - , http = require("http") - , log = require("npmlog") - , semver = require("semver") - , readJson = require("read-package-json") - , url = require("url") - , npm = require("../npm.js") - , deprCheck = require("../utils/depr-check.js") - , inflight = require("inflight") - , addRemoteTarball = require("./add-remote-tarball.js") - , cachedPackageRoot = require("./cached-package-root.js") - , mapToRegistry = require("../utils/map-to-registry.js") - +var path = require('path') +var assert = require('assert') +var fs = require('graceful-fs') +var http = require('http') +var log = require('npmlog') +var semver = require('semver') +var readJson = require('read-package-json') +var url = require('url') +var npm = require('../npm.js') +var deprCheck = require('../utils/depr-check.js') +var inflight = require('inflight') +var addRemoteTarball = require('./add-remote-tarball.js') +var cachedPackageRoot = require('./cached-package-root.js') +var mapToRegistry = require('../utils/map-to-registry.js') +var pulseTillDone = require('../utils/pulse-till-done.js') +var packageId = require('../utils/package-id.js') module.exports = addNamed function getOnceFromRegistry (name, from, next, done) { - function fixName(err, data, json, resp) { + function fixName (err, data, json, resp) { // this is only necessary until npm/npm-registry-client#80 is fixed if (err && err.pkgid && err.pkgid !== name) { err.message = err.message.replace( @@ -32,24 +33,24 @@ function getOnceFromRegistry (name, from, next, done) { mapToRegistry(name, npm.config, function (er, uri, auth) { if (er) return done(er) - var key = "registry:" + uri + var key = 'registry:' + uri next = inflight(key, next) - if (!next) return log.verbose(from, key, "already in flight; waiting") - else log.verbose(from, key, "not in flight; fetching") + if (!next) return log.verbose(from, key, 'already in flight; waiting') + else log.verbose(from, key, 'not in flight; fetching') - npm.registry.get(uri, { auth : auth }, fixName) + npm.registry.get(uri, { auth: auth }, pulseTillDone('fetchRegistry', fixName)) }) } function addNamed (name, version, data, cb_) { - assert(typeof name === "string", "must have module name") - assert(typeof cb_ === "function", "must have callback") + assert(typeof name === 'string', 'must have module name') + assert(typeof cb_ === 'function', 'must have callback') - var key = name + "@" + version - log.silly("addNamed", key) + var key = name + '@' + version + log.silly('addNamed', key) function cb (er, data) { - if (data && !data._fromGithub) data._from = key + if (data && !data._fromHosted) data._from = key cb_(er, data) } @@ -66,29 +67,29 @@ function addNamed (name, version, data, cb_) { } function addNameTag (name, tag, data, cb) { - log.info("addNameTag", [name, tag]) + log.info('addNameTag', [name, tag]) var explicit = true if (!tag) { explicit = false - tag = npm.config.get("tag") + tag = npm.config.get('tag') } - getOnceFromRegistry(name, "addNameTag", next, cb) + getOnceFromRegistry(name, 'addNameTag', next, cb) function next (er, data, json, resp) { if (!er) er = errorResponse(name, resp) if (er) return cb(er) - log.silly("addNameTag", "next cb for", name, "with tag", tag) + log.silly('addNameTag', 'next cb for', name, 'with tag', tag) engineFilter(data) - if (data["dist-tags"] && data["dist-tags"][tag] - && data.versions[data["dist-tags"][tag]]) { - var ver = data["dist-tags"][tag] + if (data['dist-tags'] && data['dist-tags'][tag] && + data.versions[data['dist-tags'][tag]]) { + var ver = data['dist-tags'][tag] return addNamed(name, ver, data.versions[ver], cb) } if (!explicit && Object.keys(data.versions).length) { - return addNamed(name, "*", data, cb) + return addNamed(name, '*', data, cb) } er = installTargetsError(tag, data) @@ -98,17 +99,17 @@ function addNameTag (name, tag, data, cb) { function engineFilter (data) { var npmv = npm.version - , nodev = npm.config.get("node-version") - , strict = npm.config.get("engine-strict") + var nodev = npm.config.get('node-version') + var strict = npm.config.get('engine-strict') - if (!nodev || npm.config.get("force")) return data + if (!nodev || npm.config.get('force')) return data Object.keys(data.versions || {}).forEach(function (v) { var eng = data.versions[v].engines if (!eng) return - if (!strict && !data.versions[v].engineStrict) return - if (eng.node && !semver.satisfies(nodev, eng.node, true) - || eng.npm && !semver.satisfies(npmv, eng.npm, true)) { + if (!strict) return + if (eng.node && !semver.satisfies(nodev, eng.node, true) || + eng.npm && !semver.satisfies(npmv, eng.npm, true)) { delete data.versions[v] } }) @@ -116,7 +117,7 @@ function engineFilter (data) { function addNameVersion (name, v, data, cb) { var ver = semver.valid(v, true) - if (!ver) return cb(new Error("Invalid version: "+v)) + if (!ver) return cb(new Error('Invalid version: ' + v)) var response @@ -125,7 +126,7 @@ function addNameVersion (name, v, data, cb) { return next() } - getOnceFromRegistry(name, "addNameVersion", setData, cb) + getOnceFromRegistry(name, 'addNameVersion', setData, cb) function setData (er, d, json, resp) { if (!er) { @@ -134,7 +135,7 @@ function addNameVersion (name, v, data, cb) { 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) @@ -147,27 +148,30 @@ function addNameVersion (name, v, data, cb) { deprCheck(data) var dist = data.dist - if (!dist) return cb(new Error("No dist in "+data._id+" package")) + if (!dist) return cb(new Error('No dist in ' + packageId(data) + ' package')) - if (!dist.tarball) return cb(new Error( - "No dist.tarball in " + data._id + " package")) + if (!dist.tarball) { + return cb(new Error( + 'No dist.tarball in ' + packageId(data) + ' package' + )) + } - if ((response && response.statusCode !== 304) || npm.config.get("force")) { + if ((response && response.statusCode !== 304) || npm.config.get('force')) { return fetchit() } // we got cached data, so let's see if we have a tarball. - var pkgroot = cachedPackageRoot({name : name, version : ver}) - var pkgtgz = path.join(pkgroot, "package.tgz") - var pkgjson = path.join(pkgroot, "package", "package.json") + var pkgroot = cachedPackageRoot({ name: name, version: ver }) + var pkgtgz = path.join(pkgroot, 'package.tgz') + var pkgjson = path.join(pkgroot, 'package', 'package.json') fs.stat(pkgtgz, function (er) { if (!er) { readJson(pkgjson, function (er, data) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) if (data) { - if (!data.name) return cb(new Error("No name provided")) - if (!data.version) return cb(new Error("No version provided")) + if (!data.name) return cb(new Error('No name provided')) + if (!data.version) return cb(new Error('No version provided')) // check the SHA of the package we have, to ensure it wasn't installed // from somewhere other than the registry (eg, a fork) @@ -205,8 +209,8 @@ function addNameVersion (name, v, data, cb) { // 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)) + if (!dist.shasum && !npm.config.get('force')) { + return cb(new Error('package lacks shasum: ' + packageId(data))) } addRemoteTarball(tb, data, dist.shasum, auth, cb) @@ -217,15 +221,17 @@ function addNameVersion (name, v, data, cb) { function addNameRange (name, range, data, cb) { range = semver.validRange(range, true) - if (range === null) return cb(new Error( - "Invalid version range: " + range - )) + if (range === null) { + return cb(new Error( + 'Invalid version range: ' + range + )) + } - log.silly("addNameRange", {name:name, range:range, hasData:!!data}) + log.silly('addNameRange', { name: name, range: range, hasData: !!data }) if (data) return next() - getOnceFromRegistry(name, "addNameRange", setData, cb) + getOnceFromRegistry(name, 'addNameRange', setData, cb) function setData (er, d, json, resp) { if (!er) { @@ -237,18 +243,20 @@ function addNameRange (name, range, data, cb) { } function next () { - log.silly( "addNameRange", "number 2" - , {name:name, range:range, hasData:!!data}) + log.silly( + 'addNameRange', + 'number 2', { name: name, range: range, hasData: !!data } + ) engineFilter(data) - log.silly("addNameRange", "versions" + log.silly('addNameRange', 'versions' , [data.name, Object.keys(data.versions || {})]) // if the tagged version satisfies, then use that. - var tagged = data["dist-tags"][npm.config.get("tag")] - if (tagged - && data.versions[tagged] - && semver.satisfies(tagged, range, true)) { + var tagged = data['dist-tags'][npm.config.get('tag')] + if (tagged && + data.versions[tagged] && + semver.satisfies(tagged, range, true)) { return addNamed(name, tagged, data.versions[tagged], cb) } @@ -256,8 +264,8 @@ function addNameRange (name, range, data, cb) { var versions = Object.keys(data.versions || {}) var ms = semver.maxSatisfying(versions, range, true) if (!ms) { - if (range === "*" && versions.length) { - return addNameTag(name, "latest", data, cb) + if (range === '*' && versions.length) { + return addNameTag(name, 'latest', data, cb) } else { return cb(installTargetsError(range, data)) } @@ -270,20 +278,19 @@ function addNameRange (name, range, data, cb) { } function installTargetsError (requested, data) { - var targets = Object.keys(data["dist-tags"]).filter(function (f) { + var targets = Object.keys(data['dist-tags']).filter(function (f) { return (data.versions || {}).hasOwnProperty(f) }).concat(Object.keys(data.versions || {})) - requested = data.name + (requested ? "@'" + requested + "'" : "") + requested = data.name + (requested ? "@'" + requested + "'" : '') targets = targets.length - ? "Valid install targets:\n" + JSON.stringify(targets) + "\n" - : "No valid targets found.\n" - + "Perhaps not compatible with your version of node?" + ? 'Valid install targets:\n' + targets.join(', ') + '\n' + : 'No valid targets found.\n' + + 'Perhaps not compatible with your version of node?' - var er = new Error( "No compatible version found: " - + requested + "\n" + targets) - er.code = "ETARGET" + var er = new Error('No compatible version found: ' + requested + '\n' + targets) + er.code = 'ETARGET' return er } @@ -292,7 +299,7 @@ function errorResponse (name, response) { if (response.statusCode >= 400) { er = new Error(http.STATUS_CODES[response.statusCode]) er.statusCode = response.statusCode - er.code = "E" + er.statusCode + er.code = 'E' + er.statusCode er.pkgid = name } return er diff --git a/deps/npm/lib/cache/add-remote-git.js b/deps/npm/lib/cache/add-remote-git.js index d3ecccdce9af81..09096f9badae95 100644 --- a/deps/npm/lib/cache/add-remote-git.js +++ b/deps/npm/lib/cache/add-remote-git.js @@ -1,5 +1,4 @@ var assert = require('assert') -var crypto = require('crypto') var fs = require('graceful-fs') var path = require('path') var url = require('url') @@ -13,12 +12,14 @@ var mkdir = require('mkdirp') var normalizeGitUrl = require('normalize-git-url') var npa = require('npm-package-arg') var realizePackageSpecifier = require('realize-package-specifier') +var uniqueFilename = require('unique-filename') var addLocal = require('./add-local.js') var correctMkdir = require('../utils/correct-mkdir.js') var git = require('../utils/git.js') var npm = require('../npm.js') var rm = require('../utils/gently-rm.js') +var tempFilename = require('../utils/temp-filename.js') var remotes = path.resolve(npm.config.get('cache'), '_git-remotes') var templates = path.join(remotes, '_templates') @@ -47,7 +48,7 @@ function addRemoteGit (uri, _cb) { if (parsed) { // normalize GitHub syntax to org/repo (for now) var from - if (parsed.type === 'github' && parsed.default === 'shortcut') { + if (parsed.type === 'github' && parsed.getDefaultRepresentation() === 'shortcut') { from = parsed.path() } else { from = parsed.toString() @@ -56,7 +57,7 @@ function addRemoteGit (uri, _cb) { log.verbose('addRemoteGit', from, 'is a repository hosted by', parsed.type) // prefer explicit URLs to pushing everything through shortcuts - if (parsed.default !== 'shortcut') { + if (parsed.getDefaultRepresentation() !== 'shortcut') { return tryClone(from, parsed.toString(), false, cb) } @@ -75,7 +76,7 @@ function addRemoteGit (uri, _cb) { function tryGitProto (from, hostedInfo, cb) { var gitURL = hostedInfo.git() - if (!gitURL) return trySSH(from, hostedInfo, cb) + if (!gitURL) return tryHTTPS(from, hostedInfo, cb) log.silly('tryGitProto', 'attempting to clone', gitURL) tryClone(from, gitURL, true, function (er) { @@ -115,9 +116,9 @@ function tryClone (from, combinedURL, silent, cb) { var treeish = normalized.branch // ensure that similarly-named remotes don't collide - var repoID = cloneURL.replace(/[^a-zA-Z0-9]+/g, '-') + '-' + - crypto.createHash('sha1').update(combinedURL).digest('hex').slice(0, 8) - var cachedRemote = path.join(remotes, repoID) + var cachedRemote = uniqueFilename(remotes, combinedURL.replace(/[^a-zA-Z0-9]+/g, '-'), cloneURL) + var repoID = path.relative(remotes, cachedRemote) + cachedRemote = path.join(remotes, repoID) cb = inflight(repoID, cb) if (!cb) { @@ -297,11 +298,7 @@ function resolveHead (from, cloneURL, treeish, cachedRemote, cb) { log.verbose('resolveHead', from, 'resolved Git URL:', resolvedURL) // generate a unique filename - var tmpdir = path.join( - npm.tmp, - 'git-cache-' + crypto.pseudoRandomBytes(6).toString('hex'), - resolvedTreeish - ) + var tmpdir = path.join(tempFilename('git-cache'), resolvedTreeish) log.silly('resolveHead', 'Git working directory:', tmpdir) mkdir(tmpdir, function (er) { diff --git a/deps/npm/lib/cache/add-remote-tarball.js b/deps/npm/lib/cache/add-remote-tarball.js index 66d22009663307..aaa768acbd07b9 100644 --- a/deps/npm/lib/cache/add-remote-tarball.js +++ b/deps/npm/lib/cache/add-remote-tarball.js @@ -1,20 +1,22 @@ -var mkdir = require("mkdirp") - , assert = require("assert") - , log = require("npmlog") - , path = require("path") - , sha = require("sha") - , retry = require("retry") - , createWriteStream = require("fs-write-stream-atomic") - , npm = require("../npm.js") - , inflight = require("inflight") - , addLocalTarball = require("./add-local-tarball.js") - , cacheFile = require("npm-cache-filename") +var mkdir = require('mkdirp') +var assert = require('assert') +var log = require('npmlog') +var path = require('path') +var sha = require('sha') +var retry = require('retry') +var createWriteStream = require('fs-write-stream-atomic') +var npm = require('../npm.js') +var inflight = require('inflight') +var addLocalTarball = require('./add-local-tarball.js') +var cacheFile = require('npm-cache-filename') +var rimraf = require('rimraf') +var pulseTillDone = require('../utils/pulse-till-done.js') module.exports = addRemoteTarball function addRemoteTarball (u, pkgData, shasum, auth, cb_) { - assert(typeof u === "string", "must have module URL") - assert(typeof cb_ === "function", "must have callback") + assert(typeof u === 'string', 'must have module URL') + assert(typeof cb_ === 'function', 'must have callback') function cb (er, data) { if (data) { @@ -26,8 +28,8 @@ function addRemoteTarball (u, pkgData, shasum, auth, cb_) { } cb_ = inflight(u, cb_) - if (!cb_) return log.verbose("addRemoteTarball", u, "already in flight; waiting") - log.verbose("addRemoteTarball", u, "not in flight; adding") + if (!cb_) return log.verbose('addRemoteTarball', u, 'already in flight; waiting') + log.verbose('addRemoteTarball', u, 'not in flight; adding') // XXX Fetch direct to cache location, store tarballs under // ${cache}/registry.npmjs.org/pkg/-/pkg-1.2.3.tgz @@ -35,10 +37,16 @@ function addRemoteTarball (u, pkgData, shasum, auth, cb_) { function next (er, resp, shasum) { if (er) return cb(er) - addLocalTarball(tmp, pkgData, shasum, cb) + addLocalTarball(tmp, pkgData, shasum, cleanup) + } + function cleanup (er, data) { + if (er) return cb(er) + rimraf(tmp, function () { + cb(er, data) + }) } - log.verbose("addRemoteTarball", [u, shasum]) + log.verbose('addRemoteTarball', [u, shasum]) mkdir(path.dirname(tmp), function (er) { if (er) return cb(er) addRemoteTarball_(u, tmp, shasum, auth, next) @@ -49,21 +57,24 @@ function addRemoteTarball_ (u, tmp, shasum, auth, cb) { // Tuned to spread 3 attempts over about a minute. // See formula at . var operation = retry.operation({ - retries: npm.config.get("fetch-retries") - , factor: npm.config.get("fetch-retry-factor") - , minTimeout: npm.config.get("fetch-retry-mintimeout") - , maxTimeout: npm.config.get("fetch-retry-maxtimeout") + retries: npm.config.get('fetch-retries'), + factor: npm.config.get('fetch-retry-factor'), + minTimeout: npm.config.get('fetch-retry-mintimeout'), + maxTimeout: npm.config.get('fetch-retry-maxtimeout') }) operation.attempt(function (currentAttempt) { - log.info("retry", "fetch attempt " + currentAttempt - + " at " + (new Date()).toLocaleTimeString()) + log.info( + 'retry', + 'fetch attempt', currentAttempt, + 'at', (new Date()).toLocaleTimeString() + ) fetchAndShaCheck(u, tmp, shasum, auth, function (er, response, shasum) { // Only retry on 408, 5xx or no `response`. var sc = response && response.statusCode var statusRetry = !sc || (sc === 408 || sc >= 500) if (er && statusRetry && operation.retry(er)) { - log.warn("retry", "will retry, error on last attempt: " + er) + log.warn('retry', 'will retry, error on last attempt: ' + er) return } cb(er, response, shasum) @@ -72,34 +83,35 @@ function addRemoteTarball_ (u, tmp, shasum, auth, cb) { } function fetchAndShaCheck (u, tmp, shasum, auth, cb) { - npm.registry.fetch(u, { auth : auth }, function (er, response) { + cb = pulseTillDone('fetchTarball', cb) + npm.registry.fetch(u, { auth: auth }, function (er, response) { if (er) { - log.error("fetch failed", u) + log.error('fetch failed', u) return cb(er, response) } - var tarball = createWriteStream(tmp, { mode : npm.modes.file }) - tarball.on("error", function (er) { + var tarball = createWriteStream(tmp, { mode: npm.modes.file }) + tarball.on('error', function (er) { cb(er) tarball.destroy() }) - tarball.on("finish", function () { + 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) + log.silly('fetchAndShaCheck', 'shasum', shasum) cb(er, response, shasum) }) } // validate that the url we just downloaded matches the expected shasum. - log.silly("fetchAndShaCheck", "shasum", 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 + er.message = er.message + '\n' + 'From: ' + u } return cb(er, response, shasum) }) diff --git a/deps/npm/lib/cache/cached-package-root.js b/deps/npm/lib/cache/cached-package-root.js index 7163314a8ede62..b47fac6c9e2ea0 100644 --- a/deps/npm/lib/cache/cached-package-root.js +++ b/deps/npm/lib/cache/cached-package-root.js @@ -1,14 +1,14 @@ -var assert = require("assert") -var resolve = require("path").resolve +var assert = require('assert') +var resolve = require('path').resolve -var npm = require("../npm.js") +var npm = require('../npm.js') module.exports = getCacheRoot function getCacheRoot (data) { - assert(data, "must pass package metadata") - assert(data.name, "package metadata must include name") - assert(data.version, "package metadata must include version") + assert(data, 'must pass package metadata') + assert(data.name, 'package metadata must include name') + assert(data.version, 'package metadata must include version') return resolve(npm.cache, data.name, data.version) } diff --git a/deps/npm/lib/cache/caching-client.js b/deps/npm/lib/cache/caching-client.js index ec8eb8e16ce083..f70271127cae2a 100644 --- a/deps/npm/lib/cache/caching-client.js +++ b/deps/npm/lib/cache/caching-client.js @@ -1,40 +1,41 @@ module.exports = CachingRegistryClient -var path = require("path") - , fs = require("graceful-fs") - , url = require("url") - , assert = require("assert") - , inherits = require("util").inherits - -var RegistryClient = require("npm-registry-client") - , npm = require("../npm.js") - , log = require("npmlog") - , getCacheStat = require("./get-stat.js") - , cacheFile = require("npm-cache-filename") - , mkdirp = require("mkdirp") - , rimraf = require("rimraf") - , chownr = require("chownr") - , writeFile = require("write-file-atomic") +var path = require('path') +var fs = require('graceful-fs') +var url = require('url') +var assert = require('assert') +var inherits = require('util').inherits + +var RegistryClient = require('npm-registry-client') +var npm = require('../npm.js') +var log = require('npmlog') +var getCacheStat = require('./get-stat.js') +var cacheFile = require('npm-cache-filename') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var chownr = require('chownr') +var writeFile = require('write-file-atomic') +var parseJSON = require('../utils/parse-json') function CachingRegistryClient (config) { RegistryClient.call(this, adaptConfig(config)) - this._mapToCache = cacheFile(config.get("cache")) + this._mapToCache = cacheFile(config.get('cache')) // swizzle in our custom cache invalidation logic this._request = this.request - this.request = this._invalidatingRequest - this.get = get + this.request = this._invalidatingRequest + this.get = get } inherits(CachingRegistryClient, RegistryClient) CachingRegistryClient.prototype._invalidatingRequest = function (uri, params, cb) { var client = this - this._request.call(this, uri, params, function () { + this._request(uri, params, function () { var args = arguments var method = params.method - if (method !== "HEAD" && method !== "GET") { + if (method !== 'HEAD' && method !== 'GET') { var invalidated = client._mapToCache(uri) // invalidate cache // @@ -43,7 +44,7 @@ CachingRegistryClient.prototype._invalidatingRequest = function (uri, params, cb // thinking that it didn't work when it did. // Note that failure is an acceptable option here, since the only // result will be a stale cache for some helper commands. - log.verbose("request", "invalidating", invalidated, "on", method) + log.verbose('request', 'invalidating', invalidated, 'on', method) return rimraf(invalidated, function () { cb.apply(undefined, args) }) @@ -54,23 +55,23 @@ CachingRegistryClient.prototype._invalidatingRequest = function (uri, params, cb } function get (uri, params, cb) { - assert(typeof uri === "string", "must pass registry URI to get") - assert(params && typeof params === "object", "must pass params to get") - assert(typeof cb === "function", "must pass callback to get") + assert(typeof uri === 'string', 'must pass registry URI to get') + assert(params && typeof params === 'object', 'must pass params to get') + assert(typeof cb === 'function', 'must pass callback to get') var parsed = url.parse(uri) assert( - parsed.protocol === "http:" || parsed.protocol === "https:", - "must have a URL that starts with http: or https:" + parsed.protocol === 'http:' || parsed.protocol === 'https:', + 'must have a URL that starts with http: or https:' ) - var cacheBase = cacheFile(npm.config.get("cache"))(uri) - var cachePath = path.join(cacheBase, ".cache.json") + var cacheBase = cacheFile(npm.config.get('cache'))(uri) + var cachePath = path.join(cacheBase, '.cache.json') // If the GET is part of a write operation (PUT or DELETE), then // skip past the cache entirely, but still save the results. if (uri.match(/\?write=true$/)) { - log.verbose("get", "GET as part of write; not caching result") + log.verbose('get', 'GET as part of write; not caching result') return get_.call(this, uri, cachePath, params, cb) } @@ -78,20 +79,14 @@ function get (uri, params, cb) { fs.stat(cachePath, function (er, stat) { if (!er) { fs.readFile(cachePath, function (er, data) { - try { - data = JSON.parse(data) - } - catch (ex) { - data = null - } + data = parseJSON.noExceptions(data) params.stat = stat params.data = data get_.call(client, uri, cachePath, params, cb) }) - } - else { + } else { get_.call(client, uri, cachePath, params, cb) } }) @@ -99,16 +94,16 @@ function get (uri, params, cb) { function get_ (uri, cachePath, params, cb) { var staleOk = params.staleOk === undefined ? false : params.staleOk - , timeout = params.timeout === undefined ? -1 : params.timeout - , data = params.data - , stat = params.stat - , etag - , lastModified - - timeout = Math.min(timeout, npm.config.get("cache-max") || 0) - timeout = Math.max(timeout, npm.config.get("cache-min") || -Infinity) + var timeout = params.timeout === undefined ? -1 : params.timeout + var data = params.data + var stat = params.stat + var etag + var lastModified + + timeout = Math.min(timeout, npm.config.get('cache-max') || 0) + timeout = Math.max(timeout, npm.config.get('cache-min') || -Infinity) if (process.env.COMP_CWORD !== undefined && - process.env.COMP_LINE !== undefined && + process.env.COMP_LINE !== undefined && process.env.COMP_POINT !== undefined) { timeout = Math.max(timeout, 60000) } @@ -118,19 +113,19 @@ function get_ (uri, cachePath, params, cb) { if (data._lastModified) lastModified = data._lastModified if (stat && timeout && timeout > 0) { - if ((Date.now() - stat.mtime.getTime())/1000 < timeout) { - log.verbose("get", uri, "not expired, no request") + if ((Date.now() - stat.mtime.getTime()) / 1000 < timeout) { + log.verbose('get', uri, 'not expired, no request') delete data._etag delete data._lastModified - return cb(null, data, JSON.stringify(data), { statusCode : 304 }) + return cb(null, data, JSON.stringify(data), { statusCode: 304 }) } if (staleOk) { - log.verbose("get", uri, "staleOk, background update") + log.verbose('get', uri, 'staleOk, background update') delete data._etag delete data._lastModified process.nextTick( - cb.bind(null, null, data, JSON.stringify(data), { statusCode : 304 } ) + cb.bind(null, null, data, JSON.stringify(data), { statusCode: 304 }) ) cb = function () {} } @@ -138,10 +133,10 @@ function get_ (uri, cachePath, params, cb) { } var options = { - etag : etag, - lastModified : lastModified, - follow : params.follow, - auth : params.auth + etag: etag, + lastModified: lastModified, + follow: params.follow, + auth: params.auth } this.request(uri, options, function (er, remoteData, raw, response) { // if we get an error talking to the registry, but we have it @@ -152,15 +147,15 @@ function get_ (uri, cachePath, params, cb) { } if (response) { - log.silly("get", "cb", [response.statusCode, response.headers]) + log.silly('get', 'cb', [response.statusCode, response.headers]) if (response.statusCode === 304 && (etag || lastModified)) { remoteData = data - log.verbose(etag ? "etag" : "lastModified", uri+" from cache") + log.verbose(etag ? 'etag' : 'lastModified', uri + ' from cache') } } data = remoteData - if (!data) er = er || new Error("failed to fetch from registry: " + uri) + if (!data) er = er || new Error('failed to fetch from registry: ' + uri) if (er) return cb(er, data, raw, response) @@ -174,7 +169,7 @@ function get_ (uri, cachePath, params, cb) { } function saveToCache (cachePath, data, saved) { - log.verbose("get", "saving", data.name, "to", cachePath) + log.verbose('get', 'saving', data.name, 'to', cachePath) getCacheStat(function (er, st) { mkdirp(path.dirname(cachePath), function (er, made) { if (er) return saved() @@ -192,26 +187,26 @@ function get_ (uri, cachePath, params, cb) { function adaptConfig (config) { return { - proxy : { - http : config.get("proxy"), - https : config.get("https-proxy"), - localAddress : config.get("local-address") + proxy: { + http: config.get('proxy'), + https: config.get('https-proxy'), + localAddress: config.get('local-address') }, - ssl : { - certificate : config.get("cert"), - key : config.get("key"), - ca : config.get("ca"), - strict : config.get("strict-ssl") + ssl: { + certificate: config.get('cert'), + key: config.get('key'), + ca: config.get('ca'), + strict: config.get('strict-ssl') }, - retry : { - retries : config.get("fetch-retries"), - factor : config.get("fetch-retry-factor"), - minTimeout : config.get("fetch-retry-mintimeout"), - maxTimeout : config.get("fetch-retry-maxtimeout") + retry: { + retries: config.get('fetch-retries'), + factor: config.get('fetch-retry-factor'), + minTimeout: config.get('fetch-retry-mintimeout'), + maxTimeout: config.get('fetch-retry-maxtimeout') }, - userAgent : config.get("user-agent"), - log : log, - defaultTag : config.get("tag"), - couchToken : config.get("_token") + userAgent: config.get('user-agent'), + log: log, + defaultTag: config.get('tag'), + couchToken: config.get('_token') } } diff --git a/deps/npm/lib/cache/update-index.js b/deps/npm/lib/cache/update-index.js index ab1ede120b2d88..a872b034908de5 100644 --- a/deps/npm/lib/cache/update-index.js +++ b/deps/npm/lib/cache/update-index.js @@ -10,6 +10,8 @@ var log = require('npmlog') var cacheFile = require('npm-cache-filename') var getCacheStat = require('./get-stat.js') var mapToRegistry = require('../utils/map-to-registry.js') +var pulseTillDone = require('../utils/pulse-till-done.js') +var parseJSON = require('../utils/parse-json.js') /* /-/all is special. * It uses timestamp-based caching and partial updates, @@ -46,9 +48,8 @@ function updateIndex (staleness, cb) { chownr(made || cachePath, st.uid, st.gid, function (er) { if (er) return cb(er) - try { - data = JSON.parse(data) - } catch (ex) { + data = parseJSON.noExceptions(data) + if (!data) { fs.writeFile(cachePath, '{}', function (er) { if (er) return cb(new Error('Broken cache.')) @@ -80,7 +81,7 @@ function updateIndex (staleness, cb) { function updateIndex_ (all, params, data, cachePath, cb) { log.silly('update-index', 'fetching', all) - npm.registry.request(all, params, function (er, updates, _, res) { + npm.registry.request(all, params, pulseTillDone('updateIndex', function (er, updates, _, res) { if (er) return cb(er, data) var headers = res.headers @@ -100,5 +101,5 @@ function updateIndex_ (all, params, data, cachePath, cb) { }) }) }) - }) + })) } diff --git a/deps/npm/lib/completion.js b/deps/npm/lib/completion.js index 1d26ffcf8ac92d..4aa3ae13a7cf28 100644 --- a/deps/npm/lib/completion.js +++ b/deps/npm/lib/completion.js @@ -1,119 +1,113 @@ module.exports = completion -completion.usage = "npm completion >> ~/.bashrc\n" - + "npm completion >> ~/.zshrc\n" - + "source <(npm completion)" - -var npm = require("./npm.js") - , npmconf = require("./config/core.js") - , configDefs = npmconf.defs - , configTypes = configDefs.types - , shorthands = configDefs.shorthands - , nopt = require("nopt") - , configNames = Object.keys(configTypes).filter(function (e) { - return e.charAt(0) !== "_" - }) - , shorthandNames = Object.keys(shorthands) - , allConfs = configNames.concat(shorthandNames) - , once = require("once") - +completion.usage = 'source <(npm completion)' + +var npm = require('./npm.js') +var npmconf = require('./config/core.js') +var configDefs = npmconf.defs +var configTypes = configDefs.types +var shorthands = configDefs.shorthands +var nopt = require('nopt') +var configNames = Object.keys(configTypes) + .filter(function (e) { return e.charAt(0) !== '_' }) +var shorthandNames = Object.keys(shorthands) +var allConfs = configNames.concat(shorthandNames) +var once = require('once') completion.completion = function (opts, cb) { if (opts.w > 3) return cb() - var fs = require("graceful-fs") - , path = require("path") - , bashExists = null - , zshExists = null - fs.stat(path.resolve(process.env.HOME, ".bashrc"), function (er) { + var fs = require('graceful-fs') + var path = require('path') + var bashExists = null + var zshExists = null + fs.stat(path.resolve(process.env.HOME, '.bashrc'), function (er) { bashExists = !er next() }) - fs.stat(path.resolve(process.env.HOME, ".zshrc"), function (er) { + fs.stat(path.resolve(process.env.HOME, '.zshrc'), function (er) { zshExists = !er next() }) function next () { if (zshExists === null || bashExists === null) return var out = [] - if (zshExists) out.push("~/.zshrc") - if (bashExists) out.push("~/.bashrc") - if (opts.w === 2) out = out.map(function (m) { - return [">>", m] - }) + if (zshExists) out.push('~/.zshrc') + if (bashExists) out.push('~/.bashrc') + if (opts.w === 2) { + out = out.map(function (m) { + return ['>>', m] + }) + } cb(null, out) } } function completion (args, cb) { - if (process.platform === "win32") { - var e = new Error("npm completion not supported on windows") - e.code = "ENOTSUP" - e.errno = require("constants").ENOTSUP + if (process.platform === 'win32') { + var e = new Error('npm completion not supported on windows') + e.code = 'ENOTSUP' + e.errno = require('constants').ENOTSUP return cb(e) } // if the COMP_* isn't in the env, then just dump the script. - if (process.env.COMP_CWORD === undefined - ||process.env.COMP_LINE === undefined - ||process.env.COMP_POINT === undefined - ) return dumpScript(cb) + if (process.env.COMP_CWORD === undefined || + process.env.COMP_LINE === undefined || + process.env.COMP_POINT === undefined) { + return dumpScript(cb) + } console.error(process.env.COMP_CWORD) console.error(process.env.COMP_LINE) console.error(process.env.COMP_POINT) - //console.log("abracadabrasauce\nabracad cat monger") - //if (Math.random() * 3 < 1) console.log("man\\ bear\\ pig") - //else if (Math.random() * 3 < 1) - // console.log("porkchop\\ sandwiches\nporkman") - //else console.log("encephylophagy") - // get the partial line and partial word, // if the point isn't at the end. // ie, tabbing at: npm foo b|ar var w = +process.env.COMP_CWORD - , words = args.map(unescape) - , word = words[w] - , line = process.env.COMP_LINE - , point = +process.env.COMP_POINT - , partialLine = line.substr(0, point) - , partialWords = words.slice(0, w) + var words = args.map(unescape) + var word = words[w] + var line = process.env.COMP_LINE + var point = +process.env.COMP_POINT + var partialLine = line.substr(0, point) + var partialWords = words.slice(0, w) // figure out where in that last word the point is. var partialWord = args[w] - , i = partialWord.length - while (partialWord.substr(0, i) !== partialLine.substr(-1*i) && i > 0) { - i -- + var i = partialWord.length + while (partialWord.substr(0, i) !== partialLine.substr(-1 * i) && i > 0) { + i-- } partialWord = unescape(partialWord.substr(0, i)) partialWords.push(partialWord) - var opts = { words : words - , w : w - , word : word - , line : line - , lineLength : line.length - , point : point - , partialLine : partialLine - , partialWords : partialWords - , partialWord : partialWord - , raw: args - } + var opts = { + words: words, + w: w, + word: word, + line: line, + lineLength: line.length, + point: point, + partialLine: partialLine, + partialWords: partialWords, + partialWord: partialWord, + raw: args + } cb = wrapCb(cb, opts) console.error(opts) - if (partialWords.slice(0, -1).indexOf("--") === -1) { - if (word.charAt(0) === "-") return configCompl(opts, cb) - if (words[w - 1] - && words[w - 1].charAt(0) === "-" - && !isFlag(words[w - 1])) { + if (partialWords.slice(0, -1).indexOf('--') === -1) { + if (word.charAt(0) === '-') return configCompl(opts, cb) + if (words[w - 1] && + words[w - 1].charAt(0) === '-' && + !isFlag(words[w - 1])) { // awaiting a value for a non-bool config. // don't even try to do this for now - console.error("configValueCompl") + console.error('configValueCompl') return configValueCompl(opts, cb) } } @@ -145,20 +139,20 @@ function completion (args, cb) { } function dumpScript (cb) { - var fs = require("graceful-fs") - , path = require("path") - , p = path.resolve(__dirname, "utils/completion.sh") + var fs = require('graceful-fs') + var path = require('path') + var p = path.resolve(__dirname, 'utils/completion.sh') // The Darwin patch below results in callbacks first for the write and then // for the error handler, so make sure we only call our callback once. cb = once(cb) - fs.readFile(p, "utf8", function (er, d) { + fs.readFile(p, 'utf8', function (er, d) { if (er) return cb(er) - d = d.replace(/^\#\!.*?\n/, "") + d = d.replace(/^\#\!.*?\n/, '') process.stdout.write(d, function () { cb() }) - process.stdout.on("error", function (er) { + process.stdout.on('error', function (er) { // Darwin is a real dick sometimes. // // This is necessary because the "source" or "." program in @@ -169,67 +163,72 @@ function dumpScript (cb) { // Really, one should not be tossing away EPIPE errors, or any // errors, so casually. But, without this, `. <(npm completion)` // can never ever work on OS X. - if (er.errno === "EPIPE") er = null + if (er.errno === 'EPIPE') er = null cb(er) }) - }) } function unescape (w) { - if (w.charAt(0) === "\"") return w.replace(/^"|"$/g, "") - else return w.replace(/\\ /g, " ") + if (w.charAt(0) === '\'') return w.replace(/^'|'$/g, '') + else return w.replace(/\\ /g, ' ') } function escape (w) { if (!w.match(/\s+/)) return w - return "\"" + w + "\"" + return '\'' + w + '\'' } // The command should respond with an array. Loop over that, // wrapping quotes around any that have spaces, and writing // them to stdout. Use console.log, not the outfd config. // If any of the items are arrays, then join them with a space. -// Ie, returning ["a", "b c", ["d", "e"]] would allow it to expand -// to: "a", "b c", or "d" "e" -function wrapCb (cb, opts) { return function (er, compls) { - if (!Array.isArray(compls)) compls = compls ? [compls] : [] - compls = compls.map(function (c) { - if (Array.isArray(c)) c = c.map(escape).join(" ") - else c = escape(c) - return c - }) - if (opts.partialWord) compls = compls.filter(function (c) { - return c.indexOf(opts.partialWord) === 0 - }) - console.error([er && er.stack, compls, opts.partialWord]) - if (er || compls.length === 0) return cb(er) +// Ie, returning ['a', 'b c', ['d', 'e']] would allow it to expand +// to: 'a', 'b c', or 'd' 'e' +function wrapCb (cb, opts) { + return function (er, compls) { + if (!Array.isArray(compls)) compls = compls ? [compls] : [] + compls = compls.map(function (c) { + if (Array.isArray(c)) c = c.map(escape).join(' ') + else c = escape(c) + return c + }) - console.log(compls.join("\n")) - cb() -}} + if (opts.partialWord) { + compls = compls.filter(function (c) { + return c.indexOf(opts.partialWord) === 0 + }) + } + + console.error([er && er.stack, compls, opts.partialWord]) + if (er || compls.length === 0) return cb(er) + + console.log(compls.join('\n')) + cb() + } +} // the current word has a dash. Return the config names, // with the same number of dashes as the current word has. function configCompl (opts, cb) { var word = opts.word - , split = word.match(/^(-+)((?:no-)*)(.*)$/) - , dashes = split[1] - , no = split[2] - , flags = configNames.filter(isFlag) + var split = word.match(/^(-+)((?:no-)*)(.*)$/) + var dashes = split[1] + var no = split[2] + var flags = configNames.filter(isFlag) console.error(flags) return cb(null, allConfs.map(function (c) { return dashes + c }).concat(flags.map(function (f) { - return dashes + (no || "no-") + f + return dashes + (no || 'no-') + f }))) } // expand with the valid values of various config values. // not yet implemented. function configValueCompl (opts, cb) { - console.error("configValue", opts) + console.error('configValue', opts) return cb(null, []) } @@ -237,8 +236,8 @@ function configValueCompl (opts, cb) { function isFlag (word) { // shorthands never take args. var split = word.match(/^(-*)((?:no-)+)?(.*)$/) - , no = split[2] - , conf = split[3] + var no = split[2] + var conf = split[3] return no || configTypes[conf] === Boolean || shorthands[conf] } diff --git a/deps/npm/lib/config.js b/deps/npm/lib/config.js index c79cdc5b8b254f..8570537d0da95b 100644 --- a/deps/npm/lib/config.js +++ b/deps/npm/lib/config.js @@ -1,46 +1,47 @@ module.exports = config -config.usage = "npm config set " - + "\nnpm config get []" - + "\nnpm config delete " - + "\nnpm config list" - + "\nnpm config edit" - + "\nnpm set " - + "\nnpm get []" +config.usage = 'npm config set ' + + '\nnpm config get []' + + '\nnpm config delete ' + + '\nnpm config list' + + '\nnpm config edit' + + '\nnpm set ' + + '\nnpm get []' -var log = require("npmlog") - , npm = require("./npm.js") - , npmconf = require("./config/core.js") - , fs = require("graceful-fs") - , writeFileAtomic = require("write-file-atomic") - , types = npmconf.defs.types - , ini = require("ini") - , editor = require("editor") - , os = require("os") - , umask = require("./utils/umask") +var log = require('npmlog') +var npm = require('./npm.js') +var npmconf = require('./config/core.js') +var fs = require('graceful-fs') +var writeFileAtomic = require('write-file-atomic') +var types = npmconf.defs.types +var ini = require('ini') +var editor = require('editor') +var os = require('os') +var umask = require('./utils/umask') config.completion = function (opts, cb) { var argv = opts.conf.argv.remain - if (argv[1] !== "config") argv.unshift("config") + if (argv[1] !== 'config') argv.unshift('config') if (argv.length === 2) { - var cmds = ["get", "set", "delete", "ls", "rm", "edit"] - if (opts.partialWord !== "l") cmds.push("list") + var cmds = ['get', 'set', 'delete', 'ls', 'rm', 'edit'] + if (opts.partialWord !== 'l') cmds.push('list') return cb(null, cmds) } var action = argv[2] switch (action) { - case "set": + case 'set': // todo: complete with valid values, if possible. if (argv.length > 3) return cb(null, []) // fallthrough - case "get": - case "delete": - case "rm": + /*eslint no-fallthrough:0*/ + case 'get': + case 'delete': + case 'rm': return cb(null, Object.keys(types)) - case "edit": - case "list": case "ls": + case 'edit': + case 'list': case 'ls': return cb(null, []) default: return cb(null, []) } @@ -52,87 +53,87 @@ config.completion = function (opts, cb) { function config (args, cb) { var action = args.shift() switch (action) { - case "set": return set(args[0], args[1], cb) - case "get": return get(args[0], cb) - case "delete": case "rm": case "del": return del(args[0], cb) - case "list": case "ls": return list(cb) - case "edit": return edit(cb) + case 'set': return set(args[0], args[1], cb) + case 'get': return get(args[0], cb) + case 'delete': case 'rm': case 'del': return del(args[0], cb) + case 'list': case 'ls': return list(cb) + case 'edit': return edit(cb) default: return unknown(action, cb) } } function edit (cb) { - var e = npm.config.get("editor") - , which = npm.config.get("global") ? "global" : "user" - , f = npm.config.get(which + "config") - if (!e) return cb(new Error("No EDITOR config or environ set.")) + var e = npm.config.get('editor') + var which = npm.config.get('global') ? 'global' : 'user' + var f = npm.config.get(which + 'config') + if (!e) return cb(new Error('No EDITOR config or environ set.')) npm.config.save(which, function (er) { if (er) return cb(er) - fs.readFile(f, "utf8", function (er, data) { - if (er) data = "" - data = [ ";;;;" - , "; npm "+(npm.config.get("global") ? - "globalconfig" : "userconfig")+" file" - , "; this is a simple ini-formatted file" - , "; lines that start with semi-colons are comments." - , "; read `npm help config` for help on the various options" - , ";;;;" - , "" - , data - ].concat( [ ";;;;" - , "; all options with default values" - , ";;;;" - ] - ) - .concat(Object.keys(npmconf.defaults).reduce(function (arr, key) { - var obj = {} - obj[key] = npmconf.defaults[key] - if (key === "logstream") return arr - return arr.concat( - ini.stringify(obj) - .replace(/\n$/m, "") - .replace(/^/g, "; ") - .replace(/\n/g, "\n; ") - .split("\n")) - }, [])) - .concat([""]) - .join(os.EOL) - writeFileAtomic - ( f - , data - , function (er) { - if (er) return cb(er) - editor(f, { editor: e }, cb) - } - ) + fs.readFile(f, 'utf8', function (er, data) { + if (er) data = '' + data = [ + ';;;;', + '; npm ' + (npm.config.get('global') + ? 'globalconfig' : 'userconfig') + ' file', + '; this is a simple ini-formatted file', + '; lines that start with semi-colons are comments.', + '; read `npm help config` for help on the various options', + ';;;;', + '', + data + ].concat([ + ';;;;', + '; all options with default values', + ';;;;' + ]).concat(Object.keys(npmconf.defaults).reduce(function (arr, key) { + var obj = {} + obj[key] = npmconf.defaults[key] + if (key === 'logstream') return arr + return arr.concat( + ini.stringify(obj) + .replace(/\n$/m, '') + .replace(/^/g, '; ') + .replace(/\n/g, '\n; ') + .split('\n')) + }, [])) + .concat(['']) + .join(os.EOL) + writeFileAtomic( + f, + data, + function (er) { + if (er) return cb(er) + editor(f, { editor: e }, cb) + } + ) }) }) } function del (key, cb) { - if (!key) return cb(new Error("no key provided")) - var where = npm.config.get("global") ? "global" : "user" + if (!key) return cb(new Error('no key provided')) + var where = npm.config.get('global') ? 'global' : 'user' npm.config.del(key, where) npm.config.save(where, cb) } function set (key, val, cb) { if (key === undefined) { - return unknown("", cb) + return unknown('', cb) } if (val === undefined) { - if (key.indexOf("=") !== -1) { - var k = key.split("=") + if (key.indexOf('=') !== -1) { + var k = key.split('=') key = k.shift() - val = k.join("=") + val = k.join('=') } else { - val = "" + val = '' } } key = key.trim() val = val.trim() - log.info("config", "set %j %j", key, val) - var where = npm.config.get("global") ? "global" : "user" + log.info('config', 'set %j %j', key, val) + var where = npm.config.get('global') ? 'global' : 'user' if (key.match(/umask/)) val = umask.fromString(val) npm.config.set(key, val, where) npm.config.save(where, cb) @@ -140,8 +141,8 @@ function set (key, val, cb) { function get (key, cb) { if (!key) return list(cb) - if (!public(key)) { - return cb(new Error("---sekretz---")) + if (!publicVar(key)) { + return cb(new Error('---sekretz---')) } var val = npm.config.get(key) if (key.match(/umask/)) val = umask.toString(val) @@ -153,133 +154,129 @@ function sort (a, b) { return a > b ? 1 : -1 } -function public (k) { - return !(k.charAt(0) === "_" || - k.indexOf(":_") !== -1 || +function publicVar (k) { + return !(k.charAt(0) === '_' || + k.indexOf(':_') !== -1 || types[k] !== types[k]) } function getKeys (data) { - return Object.keys(data).filter(public).sort(sort) + return Object.keys(data).filter(publicVar).sort(sort) } function list (cb) { - var msg = "" - , long = npm.config.get("long") + var msg = '' + var long = npm.config.get('long') var cli = npm.config.sources.cli.data - , cliKeys = getKeys(cli) + var cliKeys = getKeys(cli) if (cliKeys.length) { - msg += "; cli configs\n" + msg += '; cli configs\n' cliKeys.forEach(function (k) { - if (cli[k] && typeof cli[k] === "object") return - if (k === "argv") return - msg += k + " = " + JSON.stringify(cli[k]) + "\n" + if (cli[k] && typeof cli[k] === 'object') return + if (k === 'argv') return + msg += k + ' = ' + JSON.stringify(cli[k]) + '\n' }) - msg += "\n" + msg += '\n' } // env configs var env = npm.config.sources.env.data - , envKeys = getKeys(env) + var envKeys = getKeys(env) if (envKeys.length) { - msg += "; environment configs\n" + msg += '; environment configs\n' envKeys.forEach(function (k) { if (env[k] !== npm.config.get(k)) { if (!long) return - msg += "; " + k + " = " + JSON.stringify(env[k]) - + " (overridden)\n" - } else msg += k + " = " + JSON.stringify(env[k]) + "\n" + msg += '; ' + k + ' = ' + + JSON.stringify(env[k]) + ' (overridden)\n' + } else msg += k + ' = ' + JSON.stringify(env[k]) + '\n' }) - msg += "\n" + msg += '\n' } // user config file var uconf = npm.config.sources.user.data - , uconfKeys = getKeys(uconf) + var uconfKeys = getKeys(uconf) if (uconfKeys.length) { - msg += "; userconfig " + npm.config.get("userconfig") + "\n" + msg += '; userconfig ' + npm.config.get('userconfig') + '\n' uconfKeys.forEach(function (k) { - var val = (k.charAt(0) === "_") - ? "---sekretz---" + var val = (k.charAt(0) === '_') + ? '---sekretz---' : JSON.stringify(uconf[k]) if (uconf[k] !== npm.config.get(k)) { if (!long) return - msg += "; " + k + " = " + val - + " (overridden)\n" - } else msg += k + " = " + val + "\n" + msg += '; ' + k + ' = ' + val + ' (overridden)\n' + } else msg += k + ' = ' + val + '\n' }) - msg += "\n" + msg += '\n' } // global config file var gconf = npm.config.sources.global.data - , gconfKeys = getKeys(gconf) + var gconfKeys = getKeys(gconf) if (gconfKeys.length) { - msg += "; globalconfig " + npm.config.get("globalconfig") + "\n" + msg += '; globalconfig ' + npm.config.get('globalconfig') + '\n' gconfKeys.forEach(function (k) { - var val = (k.charAt(0) === "_") - ? "---sekretz---" + var val = (k.charAt(0) === '_') + ? '---sekretz---' : JSON.stringify(gconf[k]) if (gconf[k] !== npm.config.get(k)) { if (!long) return - msg += "; " + k + " = " + val - + " (overridden)\n" - } else msg += k + " = " + val + "\n" + msg += '; ' + k + ' = ' + val + ' (overridden)\n' + } else msg += k + ' = ' + val + '\n' }) - msg += "\n" + msg += '\n' } // builtin config file var builtin = npm.config.sources.builtin || {} if (builtin && builtin.data) { var bconf = builtin.data - , bpath = builtin.path - , bconfKeys = getKeys(bconf) + var bpath = builtin.path + var bconfKeys = getKeys(bconf) if (bconfKeys.length) { - msg += "; builtin config " + bpath + "\n" + msg += '; builtin config ' + bpath + '\n' bconfKeys.forEach(function (k) { - var val = (k.charAt(0) === "_") - ? "---sekretz---" + var val = (k.charAt(0) === '_') + ? '---sekretz---' : JSON.stringify(bconf[k]) if (bconf[k] !== npm.config.get(k)) { if (!long) return - msg += "; " + k + " = " + val - + " (overridden)\n" - } else msg += k + " = " + val + "\n" + msg += '; ' + k + ' = ' + val + ' (overridden)\n' + } else msg += k + ' = ' + val + '\n' }) - msg += "\n" + msg += '\n' } } // only show defaults if --long if (!long) { - msg += "; node bin location = " + process.execPath + "\n" - + "; cwd = " + process.cwd() + "\n" - + "; HOME = " + process.env.HOME + "\n" - + "; 'npm config ls -l' to show all defaults.\n" + msg += '; node bin location = ' + process.execPath + '\n' + + '; cwd = ' + process.cwd() + '\n' + + '; HOME = ' + process.env.HOME + '\n' + + '; "npm config ls -l" to show all defaults.\n' console.log(msg) return cb() } var defaults = npmconf.defaults - , defKeys = getKeys(defaults) - msg += "; default values\n" + var defKeys = getKeys(defaults) + msg += '; default values\n' defKeys.forEach(function (k) { - if (defaults[k] && typeof defaults[k] === "object") return + if (defaults[k] && typeof defaults[k] === 'object') return var val = JSON.stringify(defaults[k]) if (defaults[k] !== npm.config.get(k)) { - msg += "; " + k + " = " + val - + " (overridden)\n" - } else msg += k + " = " + val + "\n" + msg += '; ' + k + ' = ' + val + ' (overridden)\n' + } else msg += k + ' = ' + val + '\n' }) - msg += "\n" + msg += '\n' console.log(msg) return cb() } function unknown (action, cb) { - cb("Usage:\n" + config.usage) + cb('Usage:\n' + config.usage) } diff --git a/deps/npm/lib/config/clear-credentials-by-uri.js b/deps/npm/lib/config/clear-credentials-by-uri.js index 88131f7adb5b91..13c356605f0210 100644 --- a/deps/npm/lib/config/clear-credentials-by-uri.js +++ b/deps/npm/lib/config/clear-credentials-by-uri.js @@ -1,16 +1,16 @@ -var assert = require("assert") +var assert = require('assert') -var toNerfDart = require("./nerf-dart.js") +var toNerfDart = require('./nerf-dart.js') module.exports = clearCredentialsByURI function clearCredentialsByURI (uri) { - assert(uri && typeof uri === "string", "registry URL is required") + assert(uri && typeof uri === 'string', 'registry URL is required') var nerfed = toNerfDart(uri) - this.del(nerfed + ":_authToken", "user") - this.del(nerfed + ":_password", "user") - this.del(nerfed + ":username", "user") - this.del(nerfed + ":email", "user") + this.del(nerfed + ':_authToken', 'user') + this.del(nerfed + ':_password', 'user') + this.del(nerfed + ':username', 'user') + this.del(nerfed + ':email', 'user') } diff --git a/deps/npm/lib/config/core.js b/deps/npm/lib/config/core.js index f11a98dfb88c62..d1306eb4c85d01 100644 --- a/deps/npm/lib/config/core.js +++ b/deps/npm/lib/config/core.js @@ -1,16 +1,15 @@ - -var CC = require("config-chain").ConfigChain -var inherits = require("inherits") -var configDefs = require("./defaults.js") +var CC = require('config-chain').ConfigChain +var inherits = require('inherits') +var configDefs = require('./defaults.js') var types = configDefs.types -var once = require("once") -var fs = require("fs") -var path = require("path") -var nopt = require("nopt") -var ini = require("ini") +var once = require('once') +var fs = require('fs') +var path = require('path') +var nopt = require('nopt') +var ini = require('ini') var Umask = configDefs.Umask -var mkdirp = require("mkdirp") -var umask = require("../utils/umask") +var mkdirp = require('mkdirp') +var umask = require('../utils/umask') exports.load = load exports.Conf = Conf @@ -19,11 +18,11 @@ exports.rootConf = null exports.usingBuiltin = false exports.defs = configDefs -Object.defineProperty(exports, "defaults", { get: function () { +Object.defineProperty(exports, 'defaults', { get: function () { return configDefs.defaults }, enumerable: true }) -Object.defineProperty(exports, "types", { get: function () { +Object.defineProperty(exports, 'types', { get: function () { return configDefs.types }, enumerable: true }) @@ -34,20 +33,19 @@ var myUid = process.env.SUDO_UID !== undefined var myGid = process.env.SUDO_GID !== undefined ? process.env.SUDO_GID : (process.getgid && process.getgid()) - var loading = false var loadCbs = [] function load () { var cli, builtin, cb - for (var i = 0; i < arguments.length; i++) + for (var i = 0; i < arguments.length; i++) { switch (typeof arguments[i]) { - case "string": builtin = arguments[i]; break - case "object": cli = arguments[i]; break - case "function": cb = arguments[i]; break + case 'string': builtin = arguments[i]; break + case 'object': cli = arguments[i]; break + case 'function': cb = arguments[i]; break } + } - if (!cb) - cb = function () {} + if (!cb) cb = function () {} if (exports.loaded) { var ret = exports.loaded @@ -59,17 +57,17 @@ function load () { } // either a fresh object, or a clone of the passed in obj - if (!cli) + if (!cli) { cli = {} - else + } else { cli = Object.keys(cli).reduce(function (c, k) { c[k] = cli[k] return c }, {}) + } loadCbs.push(cb) - if (loading) - return + if (loading) return loading = true @@ -87,28 +85,28 @@ function load () { // check for a builtin if provided. exports.usingBuiltin = !!builtin var rc = exports.rootConf = new Conf() - if (builtin) - rc.addFile(builtin, "builtin") - else - rc.add({}, "builtin") + if (builtin) { + rc.addFile(builtin, 'builtin') + } else { + rc.add({}, 'builtin') + } - rc.on("load", function () { + rc.on('load', function () { load_(builtin, rc, cli, cb) }) - rc.on("error", cb) + rc.on('error', cb) } -function load_(builtin, rc, cli, cb) { +function load_ (builtin, rc, cli, cb) { var defaults = configDefs.defaults var conf = new Conf(rc) conf.usingBuiltin = !!builtin - conf.add(cli, "cli") + conf.add(cli, 'cli') conf.addEnv() - conf.loadPrefix(function(er) { - if (er) - return cb(er) + conf.loadPrefix(function (er) { + if (er) return cb(er) // If you're doing `npm --userconfig=~/foo.npmrc` then you'd expect // that ~/.npmrc won't override the stuff in ~/foo.npmrc (or, indeed @@ -126,24 +124,24 @@ function load_(builtin, rc, cli, cb) { // the default or resolved userconfig value. npm will log a "verbose" // message about this when it happens, but it is a rare enough edge case // that we don't have to be super concerned about it. - var projectConf = path.resolve(conf.localPrefix, ".npmrc") - var defaultUserConfig = rc.get("userconfig") - var resolvedUserConfig = conf.get("userconfig") - if (!conf.get("global") && + var projectConf = path.resolve(conf.localPrefix, '.npmrc') + var defaultUserConfig = rc.get('userconfig') + var resolvedUserConfig = conf.get('userconfig') + if (!conf.get('global') && projectConf !== defaultUserConfig && projectConf !== resolvedUserConfig) { - conf.addFile(projectConf, "project") - conf.once("load", afterPrefix) + conf.addFile(projectConf, 'project') + conf.once('load', afterPrefix) } else { - conf.add({}, "project") + conf.add({}, 'project') afterPrefix() } }) - function afterPrefix() { - conf.addFile(conf.get("userconfig"), "user") - conf.once("error", cb) - conf.once("load", afterUser) + function afterPrefix () { + conf.addFile(conf.get('userconfig'), 'user') + conf.once('error', cb) + conf.once('load', afterUser) } function afterUser () { @@ -152,11 +150,11 @@ function load_(builtin, rc, cli, cb) { // Eg, `npm config get globalconfig --prefix ~/local` should // return `~/local/etc/npmrc` // annoying humans and their expectations! - if (conf.get("prefix")) { - var etc = path.resolve(conf.get("prefix"), "etc") - mkdirp(etc, function (err) { - defaults.globalconfig = path.resolve(etc, "npmrc") - defaults.globalignorefile = path.resolve(etc, "npmignore") + if (conf.get('prefix')) { + var etc = path.resolve(conf.get('prefix'), 'etc') + mkdirp(etc, function () { + defaults.globalconfig = path.resolve(etc, 'npmrc') + defaults.globalignorefile = path.resolve(etc, 'npmignore') afterUserContinuation() }) } else { @@ -164,25 +162,24 @@ function load_(builtin, rc, cli, cb) { } } - function afterUserContinuation() { - conf.addFile(conf.get("globalconfig"), "global") + function afterUserContinuation () { + conf.addFile(conf.get('globalconfig'), 'global') // move the builtin into the conf stack now. conf.root = defaults - conf.add(rc.shift(), "builtin") - conf.once("load", function () { + conf.add(rc.shift(), 'builtin') + conf.once('load', function () { conf.loadExtras(afterExtras) }) } - function afterExtras(er) { - if (er) - return cb(er) + function afterExtras (er) { + if (er) return cb(er) // warn about invalid bits. validate(conf) - var cafile = conf.get("cafile") + var cafile = conf.get('cafile') if (cafile) { return conf.loadCAFile(cafile, finalize) @@ -191,7 +188,7 @@ function load_(builtin, rc, cli, cb) { finalize() } - function finalize(er) { + function finalize (er) { if (er) { return cb(er) } @@ -208,36 +205,35 @@ function load_(builtin, rc, cli, cb) { // 4. Can inherit from another Conf object, using it as the base. inherits(Conf, CC) function Conf (base) { - if (!(this instanceof Conf)) - return new Conf(base) + if (!(this instanceof Conf)) return new Conf(base) CC.apply(this) - if (base) - if (base instanceof Conf) + if (base) { + if (base instanceof Conf) { this.root = base.list[0] || base.root - else + } else { this.root = base - else + } + } else { this.root = configDefs.defaults + } } -Conf.prototype.loadPrefix = require("./load-prefix.js") -Conf.prototype.loadCAFile = require("./load-cafile.js") -Conf.prototype.loadUid = require("./load-uid.js") -Conf.prototype.setUser = require("./set-user.js") -Conf.prototype.findPrefix = require("./find-prefix.js") -Conf.prototype.getCredentialsByURI = require("./get-credentials-by-uri.js") -Conf.prototype.setCredentialsByURI = require("./set-credentials-by-uri.js") -Conf.prototype.clearCredentialsByURI = require("./clear-credentials-by-uri.js") - -Conf.prototype.loadExtras = function(cb) { - this.setUser(function(er) { - if (er) - return cb(er) - this.loadUid(function(er) { - if (er) - return cb(er) +Conf.prototype.loadPrefix = require('./load-prefix.js') +Conf.prototype.loadCAFile = require('./load-cafile.js') +Conf.prototype.loadUid = require('./load-uid.js') +Conf.prototype.setUser = require('./set-user.js') +Conf.prototype.findPrefix = require('./find-prefix.js') +Conf.prototype.getCredentialsByURI = require('./get-credentials-by-uri.js') +Conf.prototype.setCredentialsByURI = require('./set-credentials-by-uri.js') +Conf.prototype.clearCredentialsByURI = require('./clear-credentials-by-uri.js') + +Conf.prototype.loadExtras = function (cb) { + this.setUser(function (er) { + if (er) return cb(er) + this.loadUid(function (er) { + if (er) return cb(er) // Without prefix, nothing will ever work mkdirp(this.prefix, cb) }.bind(this)) @@ -247,17 +243,17 @@ Conf.prototype.loadExtras = function(cb) { 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 + if (where !== 'builtin') er = new Error('bad save target: ' + where) if (cb) { process.nextTick(cb.bind(null, er)) return this } - return this.emit("error", er) + return this.emit('error', er) } if (target.source) { - var pref = target.prefix || "" + var pref = target.prefix || '' Object.keys(target.data).forEach(function (k) { target.source[pref + k] = target.data[k] }) @@ -267,11 +263,29 @@ Conf.prototype.save = function (where, cb) { var data = ini.stringify(target.data) + var then = function then (er) { + if (er) return done(er) + + fs.chmod(target.path, mode, done) + } + + var done = function done (er) { + if (er) { + if (cb) return cb(er) + else return this.emit('error', er) + } + this._saving -- + if (this._saving === 0) { + if (cb) cb() + this.emit('save') + } + } + 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 () { // ignore the possible error (e.g. the file doesn't exist) @@ -279,57 +293,39 @@ Conf.prototype.save = function (where, cb) { }) } else { mkdirp(path.dirname(target.path), function (er) { - if (er) - return then(er) - fs.writeFile(target.path, data, "utf8", function (er) { - if (er) - return then(er) - if (where === "user" && myUid && myGid) + if (er) return then(er) + fs.writeFile(target.path, data, 'utf8', function (er) { + if (er) return then(er) + if (where === 'user' && myUid && myGid) { fs.chown(target.path, +myUid, +myGid, then) - else + } else { then() + } }) }) } - function then (er) { - if (er) - return done(er) - fs.chmod(target.path, mode, done) - } - - function done (er) { - if (er) { - if (cb) return cb(er) - else return this.emit("error", er) - } - this._saving -- - if (this._saving === 0) { - if (cb) cb() - this.emit("save") - } - } - return this } Conf.prototype.addFile = function (file, name) { name = name || file - var marker = {__source__:name} - this.sources[name] = { path: file, type: "ini" } + var marker = { __source__: name } + this.sources[name] = { path: file, type: 'ini' } this.push(marker) this._await() - fs.readFile(file, "utf8", function (er, data) { - if (er) // just ignore missing files. - return this.add({}, marker) - this.addString(data, file, "ini", marker) + fs.readFile(file, 'utf8', function (er, data) { + // just ignore missing files. + if (er) return this.add({}, marker) + + this.addString(data, file, 'ini', marker) }.bind(this)) return this } // always ini files. Conf.prototype.parse = function (content, file) { - return CC.prototype.parse.call(this, content, file, "ini") + return CC.prototype.parse.call(this, content, file, 'ini') } Conf.prototype.add = function (data, marker) { @@ -337,9 +333,8 @@ Conf.prototype.add = function (data, marker) { Object.keys(data).forEach(function (k) { data[k] = parseField(data[k], k) }) - } - catch (e) { - this.emit("error", e) + } catch (e) { + this.emit('error', e) return this } return CC.prototype.add.call(this, data, marker) @@ -351,82 +346,77 @@ Conf.prototype.addEnv = function (env) { Object.keys(env) .filter(function (k) { return k.match(/^npm_config_/i) }) .forEach(function (k) { - if (!env[k]) - return + if (!env[k]) return // leave first char untouched, even if - // it is a "_" - convert all other to "-" + // it is a '_' - convert all other to '-' var p = k.toLowerCase() - .replace(/^npm_config_/, "") - .replace(/(?!^)_/g, "-") + .replace(/^npm_config_/, '') + .replace(/(?!^)_/g, '-') conf[p] = env[k] }) - return CC.prototype.addEnv.call(this, "", conf, "env") + return CC.prototype.addEnv.call(this, '', conf, 'env') } function parseField (f, k) { - if (typeof f !== "string" && !(f instanceof String)) - return f + if (typeof f !== 'string' && !(f instanceof String)) return f // type can be an array or single thing. var typeList = [].concat(types[k]) - var isPath = -1 !== typeList.indexOf(path) - var isBool = -1 !== typeList.indexOf(Boolean) - var isString = -1 !== typeList.indexOf(String) - var isUmask = -1 !== typeList.indexOf(Umask) - var isNumber = -1 !== typeList.indexOf(Number) + var isPath = typeList.indexOf(path) !== -1 + var isBool = typeList.indexOf(Boolean) !== -1 + var isString = typeList.indexOf(String) !== -1 + var isUmask = typeList.indexOf(Umask) !== -1 + var isNumber = typeList.indexOf(Number) !== -1 - f = (""+f).trim() + f = ('' + f).trim() if (f.match(/^".*"$/)) { try { f = JSON.parse(f) - } - catch (e) { - throw new Error("Failed parsing JSON config key " + k + ": " + f) + } catch (e) { + throw new Error('Failed parsing JSON config key ' + k + ': ' + f) } } - if (isBool && !isString && f === "") - return true + if (isBool && !isString && f === '') return true switch (f) { - case "true": return true - case "false": return false - case "null": return null - case "undefined": return undefined + case 'true': return true + case 'false': return false + case 'null': return null + case 'undefined': return undefined } f = envReplace(f) if (isPath) { - var homePattern = process.platform === "win32" ? /^~(\/|\\)/ : /^~\// + var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\// if (f.match(homePattern) && process.env.HOME) { f = path.resolve(process.env.HOME, f.substr(2)) } f = path.resolve(f) } - if (isUmask) - f = umask.fromString(f) + if (isUmask) f = umask.fromString(f) - if (isNumber && !isNaN(f)) - f = +f + if (isNumber && !isNaN(f)) f = +f return f } function envReplace (f) { - if (typeof f !== "string" || !f) return f + if (typeof f !== 'string' || !f) return f // replace any ${ENV} values with the appropriate environ. var envExpr = /(\\*)\$\{([^}]+)\}/g return f.replace(envExpr, function (orig, esc, name) { esc = esc.length && esc.length % 2 - if (esc) - return orig - if (undefined === process.env[name]) - throw new Error("Failed to replace env in config: "+orig) + if (esc) return orig + if (undefined === process.env[name]) { + throw new Error('Failed to replace env in config: ' + orig) + } + return process.env[name] }) } diff --git a/deps/npm/lib/config/defaults.js b/deps/npm/lib/config/defaults.js index a90d4c22b0a87e..ff56cb8e4e7bda 100644 --- a/deps/npm/lib/config/defaults.js +++ b/deps/npm/lib/config/defaults.js @@ -1,23 +1,23 @@ // defaults, types, and shorthands. - -var path = require("path") - , url = require("url") - , Stream = require("stream").Stream - , semver = require("semver") - , stableFamily = semver.parse(process.version) - , nopt = require("nopt") - , os = require("os") - , osenv = require("osenv") - , umask = require("../utils/umask") +var path = require('path') +var url = require('url') +var Stream = require('stream').Stream +var semver = require('semver') +var stableFamily = semver.parse(process.version) +var nopt = require('nopt') +var os = require('os') +var osenv = require('osenv') +var umask = require('../utils/umask') +var hasUnicode = require('has-unicode') var log try { - log = require("npmlog") + log = require('npmlog') } catch (er) { - var util = require("util") + 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))) } } } @@ -42,7 +42,7 @@ nopt.typeDefs.Stream = { type: Stream, validate: validateStream } nopt.typeDefs.Umask = { type: Umask, validate: validateUmask } nopt.invalidHandler = function (k, val, type) { - log.warn("invalid config", k + "=" + JSON.stringify(val)) + log.warn('invalid config', k + '=' + JSON.stringify(val)) if (Array.isArray(type)) { if (type.indexOf(url) !== -1) type = url @@ -51,25 +51,25 @@ nopt.invalidHandler = function (k, val, type) { switch (type) { case Umask: - log.warn("invalid config", "Must be umask, octal number in range 0000..0777") + log.warn('invalid config', 'Must be umask, octal number in range 0000..0777') break case url: - log.warn("invalid config", "Must be a full url with 'http://'") + log.warn('invalid config', "Must be a full url with 'http://'") break case path: - log.warn("invalid config", "Must be a valid filesystem path") + log.warn('invalid config', 'Must be a valid filesystem path') break case Number: - log.warn("invalid config", "Must be a numeric value") + log.warn('invalid config', 'Must be a numeric value') break case Stream: - log.warn("invalid config", "Must be an instance of the Stream class") + log.warn('invalid config', 'Must be an instance of the Stream class') break } } if (!stableFamily || (+stableFamily.minor % 2)) stableFamily = null -else stableFamily = stableFamily.major + "." + stableFamily.minor +else stableFamily = stableFamily.major + '.' + stableFamily.minor var defaults @@ -79,20 +79,19 @@ var home = osenv.home() var uidOrPid = process.getuid ? process.getuid() : process.pid if (home) process.env.HOME = home -else home = path.resolve(temp, "npm-" + uidOrPid) +else home = path.resolve(temp, 'npm-' + uidOrPid) -var cacheExtra = process.platform === "win32" ? "npm-cache" : ".npm" -var cacheRoot = process.platform === "win32" && process.env.APPDATA || home +var cacheExtra = process.platform === 'win32' ? 'npm-cache' : '.npm' +var cacheRoot = process.platform === 'win32' && process.env.APPDATA || home var cache = path.resolve(cacheRoot, cacheExtra) - var globalPrefix -Object.defineProperty(exports, "defaults", {get: function () { +Object.defineProperty(exports, 'defaults', {get: function () { if (defaults) return defaults if (process.env.PREFIX) { globalPrefix = process.env.PREFIX - } else if (process.platform === "win32") { + } else if (process.platform === 'win32') { // c:\node\node.exe --> prefix=c:\node\ globalPrefix = path.dirname(process.execPath) } else { @@ -106,214 +105,222 @@ Object.defineProperty(exports, "defaults", {get: function () { } defaults = { - access : null - , "always-auth" : false - - , "bin-links" : true - , browser : null - - , ca: null - , cafile: null - - , cache : cache - - , "cache-lock-stale": 60000 - , "cache-lock-retries": 10 - , "cache-lock-wait": 10000 - - , "cache-max": Infinity - , "cache-min": 10 - - , cert: null - - , color : true - , depth: Infinity - , description : true - , dev : false - , editor : osenv.editor() - , "engine-strict": false - , force : false - - , "fetch-retries": 2 - , "fetch-retry-factor": 10 - , "fetch-retry-mintimeout": 10000 - , "fetch-retry-maxtimeout": 60000 - - , git: "git" - , "git-tag-version": true - - , global : false - , globalconfig : path.resolve(globalPrefix, "etc", "npmrc") - , group : process.platform === "win32" ? 0 - : process.env.SUDO_GID || (process.getgid && process.getgid()) - , heading: "npm" - , "if-present": false - , "ignore-scripts": false - , "init-module": path.resolve(home, ".npm-init.js") - , "init-author-name" : "" - , "init-author-email" : "" - , "init-author-url" : "" - , "init-version": "1.0.0" - , "init-license": "ISC" - , json: false - , key: null - , link: false - , "local-address" : undefined - , loglevel : "warn" - , logstream : process.stderr - , long : false - , message : "%s" - , "node-version" : process.version - , npat : false - , "onload-script" : false - , optional: true - , parseable : false - , prefix : globalPrefix - , production: process.env.NODE_ENV === "production" - , "proprietary-attribs": true - , proxy : null - , "https-proxy" : null - , "user-agent" : "npm/{npm-version} " - + "node/{node-version} " - + "{platform} " - + "{arch}" - , "rebuild-bundle" : true - , registry : "https://registry.npmjs.org/" - , rollback : true - , save : false - , "save-bundle": false - , "save-dev" : false - , "save-exact" : false - , "save-optional" : false - , "save-prefix": "^" - , scope : "" - , searchopts: "" - , searchexclude: null - , searchsort: "name" - , shell : osenv.shell() - , shrinkwrap: true - , "sign-git-tag": false - , spin: true - , "strict-ssl": true - , tag : "latest" - , "tag-version-prefix" : "v" - , tmp : temp - , unicode : true - , "unsafe-perm" : process.platform === "win32" - || process.platform === "cygwin" - || !( process.getuid && process.setuid - && process.getgid && process.setgid ) - || process.getuid() !== 0 - , usage : false - , user : process.platform === "win32" ? 0 : "nobody" - , userconfig : path.resolve(home, ".npmrc") - , umask: process.umask ? process.umask() : umask.fromString("022") - , version : false - , versions : false - , viewer: process.platform === "win32" ? "browser" : "man" - - , _exit : true + access: null, + 'always-auth': false, + also: null, + + 'bin-links': true, + browser: null, + + ca: null, + cafile: null, + + cache: cache, + + 'cache-lock-stale': 60000, + 'cache-lock-retries': 10, + 'cache-lock-wait': 10000, + + 'cache-max': Infinity, + 'cache-min': 10, + + cert: null, + + color: true, + depth: Infinity, + description: true, + dev: false, + 'dry-run': false, + editor: osenv.editor(), + 'engine-strict': false, + force: false, + + 'fetch-retries': 2, + 'fetch-retry-factor': 10, + 'fetch-retry-mintimeout': 10000, + 'fetch-retry-maxtimeout': 60000, + + git: 'git', + 'git-tag-version': true, + + global: false, + globalconfig: path.resolve(globalPrefix, 'etc', 'npmrc'), + group: process.platform === 'win32' ? 0 + : process.env.SUDO_GID || (process.getgid && process.getgid()), + heading: 'npm', + 'if-present': false, + 'ignore-scripts': false, + 'init-module': path.resolve(home, '.npm-init.js'), + 'init-author-name': '', + 'init-author-email': '', + 'init-author-url': '', + 'init-version': '1.0.0', + 'init-license': 'ISC', + json: false, + key: null, + link: false, + 'local-address': undefined, + loglevel: 'warn', + logstream: process.stderr, + long: false, + message: '%s', + 'node-version': process.version, + npat: false, + 'onload-script': false, + only: null, + optional: true, + parseable: false, + prefix: globalPrefix, + production: process.env.NODE_ENV === 'production', + 'progress': !process.env.TRAVIS && !process.env.CI, + 'proprietary-attribs': true, + proxy: null, + 'https-proxy': null, + 'user-agent': 'npm/{npm-version} ' + + 'node/{node-version} ' + + '{platform} ' + + '{arch}', + 'rebuild-bundle': true, + registry: 'https://registry.npmjs.org/', + rollback: true, + save: false, + 'save-bundle': false, + 'save-dev': false, + 'save-exact': false, + 'save-optional': false, + 'save-prefix': '^', + scope: '', + searchopts: '', + searchexclude: null, + searchsort: 'name', + shell: osenv.shell(), + shrinkwrap: true, + 'sign-git-tag': false, + 'strict-ssl': true, + tag: 'latest', + 'tag-version-prefix': 'v', + tmp: temp, + unicode: hasUnicode(), + 'unsafe-perm': process.platform === 'win32' || + process.platform === 'cygwin' || + !(process.getuid && process.setuid && + process.getgid && process.setgid) || + process.getuid() !== 0, + usage: false, + user: process.platform === 'win32' ? 0 : 'nobody', + userconfig: path.resolve(home, '.npmrc'), + umask: process.umask ? process.umask() : umask.fromString('022'), + version: false, + versions: false, + viewer: process.platform === 'win32' ? 'browser' : 'man', + + _exit: true } return defaults }}) -exports.types = - { access : [null, "restricted", "public"] - , "always-auth" : Boolean - , "bin-links": Boolean - , browser : [null, String] - , ca: [null, String, Array] - , cafile : path - , cache : path - , "cache-lock-stale": Number - , "cache-lock-retries": Number - , "cache-lock-wait": Number - , "cache-max": Number - , "cache-min": Number - , cert: [null, String] - , color : ["always", Boolean] - , depth : Number - , description : Boolean - , dev : Boolean - , editor : String - , "engine-strict": Boolean - , force : Boolean - , "fetch-retries": Number - , "fetch-retry-factor": Number - , "fetch-retry-mintimeout": Number - , "fetch-retry-maxtimeout": Number - , git: String - , "git-tag-version": Boolean - , global : Boolean - , globalconfig : path - , group : [Number, String] - , "https-proxy" : [null, url] - , "user-agent" : String - , "heading": String - , "if-present": Boolean - , "ignore-scripts": Boolean - , "init-module": path - , "init-author-name" : String - , "init-author-email" : String - , "init-author-url" : ["", url] - , "init-license": String - , "init-version": semver - , json: Boolean - , key: [null, String] - , link: Boolean +exports.types = { + access: [null, 'restricted', 'public'], + 'always-auth': Boolean, + also: [null, 'dev', 'development'], + 'bin-links': Boolean, + browser: [null, String], + ca: [null, String, Array], + cafile: path, + cache: path, + 'cache-lock-stale': Number, + 'cache-lock-retries': Number, + 'cache-lock-wait': Number, + 'cache-max': Number, + 'cache-min': Number, + cert: [null, String], + color: ['always', Boolean], + depth: Number, + description: Boolean, + dev: Boolean, + 'dry-run': Boolean, + editor: String, + 'engine-strict': Boolean, + force: Boolean, + 'fetch-retries': Number, + 'fetch-retry-factor': Number, + 'fetch-retry-mintimeout': Number, + 'fetch-retry-maxtimeout': Number, + git: String, + 'git-tag-version': Boolean, + global: Boolean, + globalconfig: path, + group: [Number, String], + 'https-proxy': [null, url], + 'user-agent': String, + 'heading': String, + 'if-present': Boolean, + 'ignore-scripts': Boolean, + 'init-module': path, + 'init-author-name': String, + '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", "error", "warn", "http", "info", "verbose", "silly"] - , logstream : Stream - , long : Boolean - , message: String - , "node-version" : [null, semver] - , npat : Boolean - , "onload-script" : [null, String] - , optional: Boolean - , parseable : Boolean - , prefix: path - , production: Boolean - , "proprietary-attribs": Boolean - , proxy : [null, false, url] // allow proxy to be disabled explicitly - , "rebuild-bundle" : Boolean - , registry : [null, url] - , rollback : Boolean - , save : Boolean - , "save-bundle": Boolean - , "save-dev" : Boolean - , "save-exact" : Boolean - , "save-optional" : Boolean - , "save-prefix": String - , scope : String - , searchopts : String - , searchexclude: [null, String] - , searchsort: [ "name", "-name" - , "description", "-description" - , "author", "-author" - , "date", "-date" - , "keywords", "-keywords" ] - , shell : String - , shrinkwrap: Boolean - , "sign-git-tag": Boolean - , spin: ["always", Boolean] - , "strict-ssl": Boolean - , tag : String - , tmp : path - , unicode : Boolean - , "unsafe-perm" : Boolean - , usage : Boolean - , user : [Number, String] - , userconfig : path - , umask: Umask - , version : Boolean - , "tag-version-prefix" : String - , versions : Boolean - , viewer: String - , _exit : Boolean - } + 'local-address': getLocalAddresses(), + loglevel: ['silent', 'error', 'warn', 'http', 'info', 'verbose', 'silly'], + logstream: Stream, + long: Boolean, + message: String, + 'node-version': [null, semver], + npat: Boolean, + 'onload-script': [null, String], + only: [null, 'dev', 'development', 'prod', 'production'], + optional: Boolean, + parseable: Boolean, + prefix: path, + production: Boolean, + progress: Boolean, + 'proprietary-attribs': Boolean, + proxy: [null, false, url], // allow proxy to be disabled explicitly + 'rebuild-bundle': Boolean, + registry: [null, url], + rollback: Boolean, + save: Boolean, + 'save-bundle': Boolean, + 'save-dev': Boolean, + 'save-exact': Boolean, + 'save-optional': Boolean, + 'save-prefix': String, + scope: String, + searchopts: String, + searchexclude: [null, String], + searchsort: [ + 'name', '-name', + 'description', '-description', + 'author', '-author', + 'date', '-date', + 'keywords', '-keywords' + ], + shell: String, + shrinkwrap: Boolean, + 'sign-git-tag': Boolean, + 'strict-ssl': Boolean, + tag: String, + tmp: path, + unicode: Boolean, + 'unsafe-perm': Boolean, + usage: Boolean, + user: [Number, String], + userconfig: path, + umask: Umask, + version: Boolean, + 'tag-version-prefix': String, + versions: Boolean, + viewer: String, + _exit: Boolean +} function getLocalAddresses () { var interfaces @@ -338,41 +345,41 @@ function getLocalAddresses () { }, []).concat(undefined) } -exports.shorthands = - { s : ["--loglevel", "silent"] - , d : ["--loglevel", "info"] - , dd : ["--loglevel", "verbose"] - , ddd : ["--loglevel", "silly"] - , noreg : ["--no-registry"] - , N : ["--no-registry"] - , reg : ["--registry"] - , "no-reg" : ["--no-registry"] - , silent : ["--loglevel", "silent"] - , verbose : ["--loglevel", "verbose"] - , quiet: ["--loglevel", "warn"] - , q: ["--loglevel", "warn"] - , h : ["--usage"] - , H : ["--usage"] - , "?" : ["--usage"] - , help : ["--usage"] - , v : ["--version"] - , f : ["--force"] - , gangster : ["--force"] - , gangsta : ["--force"] - , desc : ["--description"] - , "no-desc" : ["--no-description"] - , "local" : ["--no-global"] - , l : ["--long"] - , m : ["--message"] - , p : ["--parseable"] - , porcelain : ["--parseable"] - , g : ["--global"] - , S : ["--save"] - , D : ["--save-dev"] - , E : ["--save-exact"] - , O : ["--save-optional"] - , y : ["--yes"] - , n : ["--no-yes"] - , B : ["--save-bundle"] - , C : ["--prefix"] - } +exports.shorthands = { + s: ['--loglevel', 'silent'], + d: ['--loglevel', 'info'], + dd: ['--loglevel', 'verbose'], + ddd: ['--loglevel', 'silly'], + noreg: ['--no-registry'], + N: ['--no-registry'], + reg: ['--registry'], + 'no-reg': ['--no-registry'], + silent: ['--loglevel', 'silent'], + verbose: ['--loglevel', 'verbose'], + quiet: ['--loglevel', 'warn'], + q: ['--loglevel', 'warn'], + h: ['--usage'], + H: ['--usage'], + '?': ['--usage'], + help: ['--usage'], + v: ['--version'], + f: ['--force'], + gangster: ['--force'], + gangsta: ['--force'], + desc: ['--description'], + 'no-desc': ['--no-description'], + 'local': ['--no-global'], + l: ['--long'], + m: ['--message'], + p: ['--parseable'], + porcelain: ['--parseable'], + g: ['--global'], + S: ['--save'], + D: ['--save-dev'], + E: ['--save-exact'], + O: ['--save-optional'], + y: ['--yes'], + n: ['--no-yes'], + B: ['--save-bundle'], + C: ['--prefix'] +} diff --git a/deps/npm/lib/config/find-prefix.js b/deps/npm/lib/config/find-prefix.js index bb00cd6b10c2fe..58f5cc8040b4d6 100644 --- a/deps/npm/lib/config/find-prefix.js +++ b/deps/npm/lib/config/find-prefix.js @@ -2,8 +2,8 @@ module.exports = findPrefix -var fs = require("fs") -var path = require("path") +var fs = require('fs') +var path = require('path') function findPrefix (p, cb_) { function cb (er, p) { @@ -17,7 +17,7 @@ function findPrefix (p, cb_) { // walk up until we hopefully find one. // if none anywhere, then use cwd. var walkedUp = false - while (path.basename(p) === "node_modules") { + while (path.basename(p) === 'node_modules') { p = path.dirname(p) walkedUp = true } @@ -27,8 +27,8 @@ function findPrefix (p, cb_) { } function findPrefix_ (p, original, cb) { - if (p === "/" - || (process.platform === "win32" && p.match(/^[a-zA-Z]:(\\|\/)?$/))) { + if (p === '/' || + (process.platform === 'win32' && p.match(/^[a-zA-Z]:(\\|\/)?$/))) { return cb(null, original) } fs.readdir(p, function (er, files) { @@ -36,15 +36,15 @@ function findPrefix_ (p, original, cb) { // unless the prefix was simply a non // existent directory. if (er && p === original) { - if (er.code === "ENOENT") return cb(null, original); + if (er.code === 'ENOENT') return cb(null, original) return cb(er) } // walked up too high or something. if (er) return cb(null, original) - if (files.indexOf("node_modules") !== -1 - || files.indexOf("package.json") !== -1) { + if (files.indexOf('node_modules') !== -1 || + files.indexOf('package.json') !== -1) { return cb(null, p) } diff --git a/deps/npm/lib/config/get-credentials-by-uri.js b/deps/npm/lib/config/get-credentials-by-uri.js index 26a7f4317c6a3a..a073a594a5b681 100644 --- a/deps/npm/lib/config/get-credentials-by-uri.js +++ b/deps/npm/lib/config/get-credentials-by-uri.js @@ -1,27 +1,27 @@ -var assert = require("assert") +var assert = require('assert') -var toNerfDart = require("./nerf-dart.js") +var toNerfDart = require('./nerf-dart.js') module.exports = getCredentialsByURI function getCredentialsByURI (uri) { - assert(uri && typeof uri === "string", "registry URL is required") + assert(uri && typeof uri === 'string', 'registry URL is required') var nerfed = toNerfDart(uri) - var defnerf = toNerfDart(this.get("registry")) + var defnerf = toNerfDart(this.get('registry')) // hidden class micro-optimization var c = { - scope : nerfed, - token : undefined, - password : undefined, - username : undefined, - email : undefined, - auth : undefined, - alwaysAuth : undefined + scope: nerfed, + token: undefined, + password: undefined, + username: undefined, + email: undefined, + auth: undefined, + alwaysAuth: undefined } - if (this.get(nerfed + ":_authToken")) { - c.token = this.get(nerfed + ":_authToken") + if (this.get(nerfed + ':_authToken')) { + c.token = this.get(nerfed + ':_authToken') // the bearer token is enough, don't confuse things return c } @@ -30,43 +30,43 @@ function getCredentialsByURI (uri) { // 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") + 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(":") + authDef = new Buffer(authDef, 'base64').toString() + authDef = authDef.split(':') userDef = authDef.shift() - passDef = authDef.join(":") + passDef = authDef.join(':') } - if (this.get(nerfed + ":_password")) { - c.password = new Buffer(this.get(nerfed + ":_password"), "base64").toString("utf8") + 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") + 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 (this.get(nerfed + ':email')) { + c.email = this.get(nerfed + ':email') + } else if (this.get('email')) { + c.email = this.get('email') } - if (this.get(nerfed + ":always-auth") !== undefined) { - var val = this.get(nerfed + ":always-auth") - c.alwaysAuth = val === "false" ? false : !!val - } else if (this.get("always-auth") !== undefined) { - c.alwaysAuth = this.get("always-auth") + if (this.get(nerfed + ':always-auth') !== undefined) { + var val = this.get(nerfed + ':always-auth') + c.alwaysAuth = val === 'false' ? false : !!val + } else if (this.get('always-auth') !== undefined) { + c.alwaysAuth = this.get('always-auth') } if (c.username && c.password) { - c.auth = new Buffer(c.username + ":" + c.password).toString("base64") + c.auth = new Buffer(c.username + ':' + c.password).toString('base64') } return c diff --git a/deps/npm/lib/config/load-cafile.js b/deps/npm/lib/config/load-cafile.js index cc63615ff55532..de8f61625a6b17 100644 --- a/deps/npm/lib/config/load-cafile.js +++ b/deps/npm/lib/config/load-cafile.js @@ -1,34 +1,32 @@ module.exports = loadCAFile -var fs = require("fs") +var fs = require('fs') -function loadCAFile(cafilePath, cb) { - if (!cafilePath) - return process.nextTick(cb) +function loadCAFile (cafilePath, cb) { + if (!cafilePath) return process.nextTick(cb) - fs.readFile(cafilePath, "utf8", afterCARead.bind(this)) - - function afterCARead(er, cadata) { + fs.readFile(cafilePath, 'utf8', afterCARead.bind(this)) + function afterCARead (er, cadata) { if (er) { // previous cafile no longer exists, so just continue on gracefully if (er.code === 'ENOENT') return cb() return cb(er) } - var delim = "-----END CERTIFICATE-----" + var delim = '-----END CERTIFICATE-----' var output output = cadata .split(delim) - .filter(function(xs) { + .filter(function (xs) { return !!xs.trim() }) - .map(function(xs) { + .map(function (xs) { return xs.trimLeft() + delim }) - this.set("ca", output) + this.set('ca', output) cb(null) } } diff --git a/deps/npm/lib/config/load-prefix.js b/deps/npm/lib/config/load-prefix.js index 39d076fb7d4434..bb5d9f3be56bf1 100644 --- a/deps/npm/lib/config/load-prefix.js +++ b/deps/npm/lib/config/load-prefix.js @@ -1,43 +1,45 @@ module.exports = loadPrefix -var findPrefix = require("./find-prefix.js") -var path = require("path") +var findPrefix = require('./find-prefix.js') +var path = require('path') function loadPrefix (cb) { var cli = this.list[0] - Object.defineProperty(this, "prefix", - { set : function (prefix) { - var g = this.get("global") - this[g ? "globalPrefix" : "localPrefix"] = prefix - }.bind(this) - , get : function () { - var g = this.get("global") + Object.defineProperty(this, 'prefix', + { + set: function (prefix) { + var g = this.get('global') + this[g ? 'globalPrefix' : 'localPrefix'] = prefix + }.bind(this), + get: function () { + var g = this.get('global') return g ? this.globalPrefix : this.localPrefix - }.bind(this) - , enumerable : true + }.bind(this), + enumerable: true }) - Object.defineProperty(this, "globalPrefix", - { set : function (prefix) { - this.set("prefix", prefix) - }.bind(this) - , get : function () { - return path.resolve(this.get("prefix")) - }.bind(this) - , enumerable : true + Object.defineProperty(this, 'globalPrefix', + { + set: function (prefix) { + this.set('prefix', prefix) + }.bind(this), + get: function () { + return path.resolve(this.get('prefix')) + }.bind(this), + enumerable: true }) var p - Object.defineProperty(this, "localPrefix", - { set : function (prefix) { p = prefix }, - get : function () { return p } - , enumerable: true }) + Object.defineProperty(this, 'localPrefix', + { set: function (prefix) { p = prefix }, + get: function () { return p }, + enumerable: true }) // try to guess at a good node_modules location. // If we are *explicitly* given a prefix on the cli, then // always use that. otherwise, infer local prefix from cwd. - if (Object.prototype.hasOwnProperty.call(cli, "prefix")) { + if (Object.prototype.hasOwnProperty.call(cli, 'prefix')) { p = path.resolve(cli.prefix) process.nextTick(cb) } else { diff --git a/deps/npm/lib/config/load-uid.js b/deps/npm/lib/config/load-uid.js index 3ca79877353519..859eac7494bc7e 100644 --- a/deps/npm/lib/config/load-uid.js +++ b/deps/npm/lib/config/load-uid.js @@ -1,14 +1,14 @@ module.exports = loadUid -var getUid = require("uid-number") +var getUid = require('uid-number') // Call in the context of a npmconf object function loadUid (cb) { // if we're not in unsafe-perm mode, then figure out who // to run stuff as. Do this first, to support `npm update npm -g` - if (!this.get("unsafe-perm")) { - getUid(this.get("user"), this.get("group"), cb) + if (!this.get('unsafe-perm')) { + getUid(this.get('user'), this.get('group'), cb) } else { process.nextTick(cb) } diff --git a/deps/npm/lib/config/nerf-dart.js b/deps/npm/lib/config/nerf-dart.js index 07c817500f6fbe..8d2bdd26edf9ba 100644 --- a/deps/npm/lib/config/nerf-dart.js +++ b/deps/npm/lib/config/nerf-dart.js @@ -1,4 +1,4 @@ -var url = require("url") +var url = require('url') module.exports = toNerfDart @@ -11,7 +11,7 @@ module.exports = toNerfDart * * @returns {String} A nerfed URL. */ -function toNerfDart(uri) { +function toNerfDart (uri) { var parsed = url.parse(uri) delete parsed.protocol delete parsed.auth @@ -19,5 +19,5 @@ function toNerfDart(uri) { delete parsed.search delete parsed.hash - return url.resolve(url.format(parsed), ".") + return url.resolve(url.format(parsed), '.') } diff --git a/deps/npm/lib/config/set-credentials-by-uri.js b/deps/npm/lib/config/set-credentials-by-uri.js index 31eab4479ede21..74211380d86b6f 100644 --- a/deps/npm/lib/config/set-credentials-by-uri.js +++ b/deps/npm/lib/config/set-credentials-by-uri.js @@ -1,42 +1,39 @@ -var assert = require("assert") +var assert = require('assert') -var toNerfDart = require("./nerf-dart.js") +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") + 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") - this.del(nerfed + ":always-auth", "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") + this.set(nerfed + ':_authToken', c.token, 'user') + this.del(nerfed + ':_password', 'user') + this.del(nerfed + ':username', 'user') + this.del(nerfed + ':email', 'user') + this.del(nerfed + ':always-auth', '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') if (c.alwaysAuth !== undefined) { - this.set(nerfed + ":always-auth", c.alwaysAuth, "user") + this.set(nerfed + ':always-auth', c.alwaysAuth, 'user') + } else { + this.del(nerfed + ':always-auth', 'user') } - else { - this.del(nerfed + ":always-auth", "user") - } - } - else { - throw new Error("No credentials to set.") + } else { + throw new Error('No credentials to set.') } } diff --git a/deps/npm/lib/config/set-user.js b/deps/npm/lib/config/set-user.js index 4c207a6792a6f4..14cc21d2ebd998 100644 --- a/deps/npm/lib/config/set-user.js +++ b/deps/npm/lib/config/set-user.js @@ -1,9 +1,9 @@ module.exports = setUser -var assert = require("assert") -var path = require("path") -var fs = require("fs") -var mkdirp = require("mkdirp") +var assert = require('assert') +var path = require('path') +var fs = require('fs') +var mkdirp = require('mkdirp') function setUser (cb) { var defaultConf = this.root @@ -12,13 +12,13 @@ function setUser (cb) { // If global, leave it as-is. // If not global, then set the user to the owner of the prefix folder. // Just set the default, so it can be overridden. - if (this.get("global")) return cb() + if (this.get('global')) return cb() if (process.env.SUDO_UID) { defaultConf.user = +(process.env.SUDO_UID) return cb() } - var prefix = path.resolve(this.get("prefix")) + var prefix = path.resolve(this.get('prefix')) mkdirp(prefix, function (er) { if (er) return cb(er) fs.stat(prefix, function (er, st) { diff --git a/deps/npm/lib/dedupe.js b/deps/npm/lib/dedupe.js index c63705e18d6ea9..2cb85990ce5ff1 100644 --- a/deps/npm/lib/dedupe.js +++ b/deps/npm/lib/dedupe.js @@ -1,375 +1,163 @@ -// traverse the node_modules/package.json tree -// looking for duplicates. If any duplicates are found, -// then move them up to the highest level necessary -// in order to make them no longer duplicated. -// -// This is kind of ugly, and really highlights the need for -// much better "put pkg X at folder Y" abstraction. Oh well, -// whatever. Perfect enemy of the good, and all that. - -var fs = require("fs") -var asyncMap = require("slide").asyncMap -var path = require("path") -var readJson = require("read-package-json") -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") +var util = require('util') +var path = require('path') +var validate = require('aproba') +var without = require('lodash.without') +var asyncMap = require('slide').asyncMap +var chain = require('slide').chain +var npa = require('npm-package-arg') +var log = require('npmlog') +var npm = require('./npm.js') +var Installer = require('./install.js').Installer +var findRequirement = require('./install/deps.js').findRequirement +var earliestInstallable = require('./install/deps.js').earliestInstallable +var checkPermissions = require('./install/check-permissions.js') +var decomposeActions = require('./install/decompose-actions.js') +var loadExtraneous = require('./install/deps.js').loadExtraneous +var filterInvalidActions = require('./install/filter-invalid-actions.js') +var recalculateMetadata = require('./install/deps.js').recalculateMetadata +var sortActions = require('./install/diff-trees.js').sortActions +var moduleName = require('./utils/module-name.js') +var packageId = require('./utils/package-id.js') +var childPath = require('./utils/child-path.js') module.exports = dedupe +module.exports.Deduper = Deduper -dedupe.usage = "npm dedupe [pkg pkg...]" +dedupe.usage = 'npm dedupe [package names...]' -function dedupe (args, silent, cb) { - if (typeof silent === "function") cb = silent, silent = false +function dedupe (args, cb) { + validate('AF', arguments) + // the /path/to/node_modules/.. + var where = path.resolve(npm.dir, '..') var dryrun = false if (npm.command.match(/^find/)) dryrun = true - return dedupe_(npm.prefix, args, {}, dryrun, silent, cb) -} - -function dedupe_ (dir, filter, unavoidable, dryrun, silent, cb) { - readInstalled(path.resolve(dir), {}, null, function (er, data, counter) { - if (er) { - return cb(er) - } - - if (!data) { - return cb() - } - - // find out which things are dupes - var dupes = Object.keys(counter || {}).filter(function (k) { - if (filter.length && -1 === filter.indexOf(k)) return false - return counter[k] > 1 && !unavoidable[k] - }).reduce(function (s, k) { - s[k] = [] - return s - }, {}) - - // any that are unavoidable need to remain as they are. don't even - // try to touch them or figure it out. Maybe some day, we can do - // something a bit more clever here, but for now, just skip over it, - // and all its children. - ;(function U (obj) { - if (unavoidable[obj.name]) { - obj.unavoidable = true - } - if (obj.parent && obj.parent.unavoidable) { - obj.unavoidable = true - } - 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) { - if (dupes[obj.name] && !obj.unavoidable) { - dupes[obj.name].push(obj) - obj.duplicate = true - } - obj.dependents = whoDepends(obj) - Object.keys(obj.children).forEach(function (k) { - C(obj.children[k]) - }) - })(data) - - if (dryrun) { - var k = Object.keys(dupes) - if (!k.length) return cb() - return npm.commands.ls(k, silent, cb) - } - - var summary = Object.keys(dupes).map(function (n) { - return [n, dupes[n].filter(function (d) { - return d && d.parent && !d.parent.duplicate && !d.unavoidable - }).map(function M (d) { - return [d.path, d.version, d.dependents.map(function (k) { - return [k.path, k.version, k.dependencies[d.name] || ""] - })] - })] - }).map(function (item) { - var set = item[1] - - var ranges = set.map(function (i) { - return i[2].map(function (d) { - return d[2] - }) - }).reduce(function (l, r) { - return l.concat(r) - }, []).map(function (v, i, set) { - if (set.indexOf(v) !== i) return false - return v - }).filter(function (v) { - return v !== false - }) - - var locs = set.map(function (i) { - return i[0] - }) - - var versions = set.map(function (i) { - return i[1] - }).filter(function (v, i, set) { - return set.indexOf(v) === i - }) - - var has = set.map(function (i) { - return [i[0], i[1]] - }).reduce(function (set, kv) { - set[kv[0]] = kv[1] - return set - }, {}) + if (npm.config.get('dry-run')) dryrun = true - var loc = locs.length ? locs.reduce(function (a, b) { - // a=/path/to/node_modules/foo/node_modules/bar - // b=/path/to/node_modules/elk/node_modules/bar - // ==/path/to/node_modules/bar - var nmReg = new RegExp("\\" + path.sep + "node_modules\\" + path.sep) - a = a.split(nmReg) - b = b.split(nmReg) - var name = a.pop() - b.pop() - // find the longest chain that both A and B share. - // then push the name back on it, and join by /node_modules/ - for (var i = 0, al = a.length, bl = b.length; i < al && i < bl && a[i] === b[i]; i++); - return a.slice(0, i).concat(name).join(path.sep + "node_modules" + path.sep) - }) : undefined - - return [item[0], { item: item - , ranges: ranges - , locs: locs - , loc: loc - , has: has - , versions: versions - }] - }).filter(function (i) { - return i[1].loc - }) - - findVersions(npm, summary, function (er, set) { - if (er) return cb(er) - if (!set.length) return cb() - installAndRetest(set, filter, dir, unavoidable, silent, cb) - }) - }) + new Deduper(where, dryrun).run(cb) } -function installAndRetest (set, filter, dir, unavoidable, silent, cb) { - //return cb(null, set) - var remove = [] - - asyncMap(set, function (item, cb) { - // [name, has, loc, locMatch, regMatch, others] - var name = item[0] - var has = item[1] - var where = item[2] - var locMatch = item[3] - var regMatch = item[4] - var others = item[5] - - // nothing to be done here. oh well. just a conflict. - if (!locMatch && !regMatch) { - log.warn("unavoidable conflict", item[0], item[1]) - log.warn("unavoidable conflict", "Not de-duplicating") - unavoidable[item[0]] = true - return cb() - } - - // nothing to do except to clean up the extraneous deps - if (locMatch && has[where] === locMatch) { - remove.push.apply(remove, others) - return cb() - } - - if (regMatch) { - var what = name + "@" + regMatch - // where is /path/to/node_modules/foo/node_modules/bar - // for package "bar", but we need it to be just - // /path/to/node_modules/foo - var nmReg = new RegExp("\\" + path.sep + "node_modules\\" + path.sep) - where = where.split(nmReg) - where.pop() - where = where.join(path.sep + "node_modules" + path.sep) - remove.push.apply(remove, others) - - return npm.commands.install(where, what, cb) - } - - // hrm? - return cb(new Error("danger zone\n" + name + " " + - regMatch + " " + locMatch)) - - }, function (er) { - if (er) return cb(er) - asyncMap(remove, rm, function (er) { - if (er) return cb(er) - remove.forEach(function (r) { - log.info("rm", r) - }) - dedupe_(dir, filter, unavoidable, false, silent, cb) - }) - }) +function Deduper (where, dryrun) { + validate('SB', arguments) + Installer.call(this, where, dryrun, []) + this.noPackageJsonOk = true + this.topLevelLifecycles = false } - -function findVersions (npm, summary, cb) { - // now, for each item in the summary, try to find the maximum version - // that will satisfy all the ranges. next step is to install it at - // the specified location. - asyncMap(summary, function (item, cb) { - var name = item[0] - var data = item[1] - var loc = data.loc - var locs = data.locs.filter(function (l) { - return l !== loc +util.inherits(Deduper, Installer) + +Deduper.prototype.normalizeTree = function (log, cb) { + validate('OF', arguments) + log.silly('dedupe', 'normalizeTree') + // If we're looking globally only look at the one package we're operating on + if (npm.config.get('global')) { + var args = this.args + this.currentTree.children = this.currentTree.children.filter(function (child) { + return args.filter(function (arg) { return arg === moduleName(child) }).length }) + } + Installer.prototype.normalizeTree.call(this, log, cb) +} - // not actually a dupe, or perhaps all the other copies were - // children of a dupe, so this'll maybe be picked up later. - if (locs.length === 0) { - return cb(null, []) - } - - // { : } - var has = data.has - - // the versions that we already have. - // if one of these is ok, then prefer to use that. - // otherwise, try fetching from the registry. - var versions = data.versions - - var ranges = data.ranges - mapToRegistry(name, npm.config, function (er, uri, auth) { - if (er) return cb(er) - - npm.registry.get(uri, { auth : auth }, next) - }) +Deduper.prototype.loadIdealTree = function (cb) { + validate('F', arguments) + log.silly('install', 'loadIdealTree') - function next (er, data) { - var regVersions = er ? [] : Object.keys(data.versions) - var locMatch = bestMatch(versions, ranges) - var tag = npm.config.get("tag") - var distTag = data["dist-tags"] && data["dist-tags"][tag] + var self = this + chain([ + [this.newTracker(this.progress.loadIdealTree, 'cloneCurrentTree')], + [this, this.cloneCurrentTreeToIdealTree], + [this, this.finishTracker, 'cloneCurrentTree'], - var regMatch - if (distTag && data.versions[distTag] && matches(distTag, ranges)) { - regMatch = distTag - } else { - regMatch = bestMatch(regVersions, ranges) - } + [this.newTracker(this.progress.loadIdealTree, 'loadAllDepsIntoIdealTree', 10)], + [ function (next) { + loadExtraneous(self.idealTree, self.progress.loadAllDepsIntoIdealTree, next) + } ], + [this, this.finishTracker, 'loadAllDepsIntoIdealTree'], - cb(null, [[name, has, loc, locMatch, regMatch, locs]]) - } - }, cb) + [this, function (next) { recalculateMetadata(this.idealTree, log, next) }] + ], cb) } -function matches (version, ranges) { - return !ranges.some(function (r) { - return !semver.satisfies(version, r, true) - }) +Deduper.prototype.generateActionsToTake = function (cb) { + validate('F', arguments) + log.silly('dedupe', 'generateActionsToTake') + chain([ + [this.newTracker(log, 'hoist', 1)], + [hoistChildren, this.idealTree, this.differences], + [this, this.finishTracker, 'hoist'], + [this.newTracker(log, 'sort-actions', 1)], + [this, function (next) { + this.differences = sortActions(this.differences) + next() + }], + [this, this.finishTracker, 'sort-actions'], + [filterInvalidActions, this.where, this.differences], + [checkPermissions, this.differences], + [decomposeActions, this.differences, this.todo] + ], cb) } -function bestMatch (versions, ranges) { - return versions.filter(function (v) { - return matches(v, ranges) - }).sort(semver.compareLoose).pop() +function move (node, hoistTo, diff) { + node.parent.children = without(node.parent.children, node) + hoistTo.children.push(node) + node.fromPath = node.path + node.path = childPath(hoistTo.path, node) + node.parent = hoistTo + if (!diff.filter(function (action) { return action[0] === 'move' && action[1] === node }).length) { + diff.push(['move', node]) + } } - -function readInstalled (dir, counter, parent, cb) { - var pkg, children, realpath - - fs.realpath(dir, function (er, rp) { - realpath = rp - next() +function moveRemainingChildren (node, diff) { + node.children.forEach(function (child) { + move(child, node, diff) + moveRemainingChildren(child, diff) }) +} - readJson(path.resolve(dir, "package.json"), function (er, data) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - if (er) return cb() // not a package, probably. - counter[data.name] = counter[data.name] || 0 - counter[data.name]++ - pkg = - { _id: data._id - , name: data.name - , version: data.version - , dependencies: data.dependencies || {} - , optionalDependencies: data.optionalDependencies || {} - , devDependencies: data.devDependencies || {} - , bundledDependencies: data.bundledDependencies || [] - , path: dir - , realPath: dir - , children: {} - , parent: parent - , family: Object.create(parent ? parent.family : null) - , unavoidable: false - , duplicate: false - } - if (parent) { - parent.children[data.name] = pkg - parent.family[data.name] = pkg - } - next() - }) - - fs.readdir(path.resolve(dir, "node_modules"), function (er, c) { - children = children || [] // error is ok, just means no children. - // check if there are scoped packages. - asyncMap(c || [], function (child, cb) { - if (child.indexOf('@') === 0) { - fs.readdir(path.resolve(dir, "node_modules", child), function (er, scopedChildren) { - // error is ok, just means no children. - (scopedChildren || []).forEach(function (sc) { - children.push(path.join(child, sc)) - }) - cb() - }) - } else { - children.push(child) - cb() - } - }, function (er) { - if (er) return cb(er) - children = children.filter(function (p) { - return !p.match(/^[\._-]/) - }) - next(); - }); - }) - - function next () { - if (!children || !pkg || !realpath) return - - // ignore devDependencies. Just leave them where they are. - children = children.filter(function (c) { - return !pkg.devDependencies.hasOwnProperty(c) - }) +function remove (child, diff, done) { + remove_(child, diff, {}, done) +} - pkg.realPath = realpath - if (pkg.realPath !== pkg.path) children = [] - var d = path.resolve(dir, "node_modules") - asyncMap(children, function (child, cb) { - readInstalled(path.resolve(d, child), counter, pkg, cb) - }, function (er) { - cb(er, pkg, counter) - }) - } +function remove_ (child, diff, seen, done) { + if (seen[child.path]) return done() + seen[child.path] = true + diff.push(['remove', child]) + child.parent.children = without(child.parent.children, child) + asyncMap(child.children, function (child, next) { + remove_(child, diff, seen, next) + }, done) } -function whoDepends (pkg) { - var start = pkg.parent || pkg - return whoDepends_(pkg, [], start) +function hoistChildren (tree, diff, next) { + hoistChildren_(tree, diff, {}, next) } -function whoDepends_ (pkg, who, test) { - if (test !== pkg && - test.dependencies[pkg.name] && - test.family[pkg.name] === pkg) { - who.push(test) - } - Object.keys(test.children).forEach(function (n) { - whoDepends_(pkg, who, test.children[n]) - }) - return who +function hoistChildren_ (tree, diff, seen, next) { + validate('OAOF', arguments) + if (seen[tree.path]) return next() + seen[tree.path] = true + asyncMap(tree.children, function (child, done) { + if (!tree.parent) return hoistChildren_(child, diff, seen, done) + var better = findRequirement(tree.parent, moduleName(child), child.package._requested || npa(packageId(child))) + if (better) { + return chain([ + [remove, child, diff], + [recalculateMetadata, tree, log] + ], done) + } + var hoistTo = earliestInstallable(tree, tree.parent, child.package) + if (hoistTo) { + move(child, hoistTo, diff) + chain([ + [recalculateMetadata, hoistTo, log], + [hoistChildren_, child, diff, seen], + [ function (next) { + moveRemainingChildren(child, diff) + next() + } ] + ], done) + } else { + done() + } + }, next) } diff --git a/deps/npm/lib/deprecate.js b/deps/npm/lib/deprecate.js index c90ad9027231c0..ffc29c9c8b92e1 100644 --- a/deps/npm/lib/deprecate.js +++ b/deps/npm/lib/deprecate.js @@ -1,25 +1,25 @@ -var npm = require("./npm.js") - , mapToRegistry = require("./utils/map-to-registry.js") - , npa = require("npm-package-arg") +var npm = require('./npm.js') +var mapToRegistry = require('./utils/map-to-registry.js') +var npa = require('npm-package-arg') module.exports = deprecate -deprecate.usage = "npm deprecate [@] " +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. if (opts.conf.argv.remain.length > 2) return cb() // get the list of packages by user - var path = "/-/by-user/" + var path = '/-/by-user/' mapToRegistry(path, npm.config, function (er, uri, c) { if (er) return cb(er) if (!(c && c.username)) return cb() var params = { - timeout : 60000, - auth : c + timeout: 60000, + auth: c } npm.registry.get(uri + c.username, params, function (er, list) { if (er) return cb() @@ -31,8 +31,8 @@ deprecate.completion = function (opts, cb) { function deprecate (args, cb) { var pkg = args[0] - , msg = args[1] - if (msg === undefined) return cb("Usage: " + deprecate.usage) + var msg = args[1] + if (msg === undefined) return cb('Usage: ' + deprecate.usage) // fetch the data and make sure it exists. var p = npa(pkg) @@ -41,9 +41,9 @@ function deprecate (args, cb) { if (er) return cb(er) var params = { - version : p.spec, - message : msg, - auth : auth + version: p.spec, + message: msg, + auth: auth } npm.registry.deprecate(uri, params, cb) }) diff --git a/deps/npm/lib/dist-tag.js b/deps/npm/lib/dist-tag.js index 48b40202f9a142..d0bae9ab4409c6 100644 --- a/deps/npm/lib/dist-tag.js +++ b/deps/npm/lib/dist-tag.js @@ -1,21 +1,21 @@ module.exports = distTag -var log = require("npmlog") -var npa = require("npm-package-arg") -var semver = require("semver") +var log = require('npmlog') +var npa = require('npm-package-arg') +var semver = require('semver') -var npm = require("./npm.js") -var mapToRegistry = require("./utils/map-to-registry.js") -var readLocalPkg = require("./utils/read-local-package.js") +var npm = require('./npm.js') +var mapToRegistry = require('./utils/map-to-registry.js') +var readLocalPkg = require('./utils/read-local-package.js') -distTag.usage = "npm dist-tag add @ []" - + "\nnpm dist-tag rm " - + "\nnpm dist-tag ls []" +distTag.usage = 'npm dist-tag add @ []' + + '\nnpm dist-tag rm ' + + '\nnpm dist-tag ls []' distTag.completion = function (opts, cb) { var argv = opts.conf.argv.remain if (argv.length === 2) { - return cb(null, ["add", "rm", "ls"]) + return cb(null, ['add', 'rm', 'ls']) } switch (argv[2]) { @@ -27,29 +27,29 @@ distTag.completion = function (opts, cb) { function distTag (args, cb) { var cmd = args.shift() switch (cmd) { - case "add": case "a": case "set": case "s": + case 'add': case 'a': case 'set': case 's': return add(args[0], args[1], cb) - case "rm": case "r": case "del": case "d": case "remove": + case 'rm': case 'r': case 'del': case 'd': case 'remove': return remove(args[1], args[0], cb) - case "ls": case "l": case "sl": case "list": + case 'ls': case 'l': case 'sl': case 'list': return list(args[0], cb) default: - return cb("Usage:\n"+distTag.usage) + return cb('Usage:\n' + distTag.usage) } } function add (spec, tag, cb) { - var thing = npa(spec || "") + var thing = npa(spec || '') var pkg = thing.name var version = thing.rawSpec - var t = (tag || npm.config.get("tag")).trim() + var t = (tag || npm.config.get('tag')).trim() - log.verbose("dist-tag add", t, "to", pkg+"@"+version) + log.verbose('dist-tag add', t, 'to', pkg + '@' + version) - if (!pkg || !version || !t) return cb("Usage:\n"+distTag.usage) + if (!pkg || !version || !t) return cb('Usage:\n' + distTag.usage) if (semver.validRange(t)) { - var er = new Error("Tag name must not be a valid SemVer range: " + t) + var er = new Error('Tag name must not be a valid SemVer range: ' + t) return cb(er) } @@ -57,23 +57,23 @@ function add (spec, tag, cb) { if (er) return cb(er) if (tags[t] === version) { - log.warn("dist-tag add", t, "is already set to version", version) + log.warn('dist-tag add', t, 'is already set to version', version) return cb() } tags[t] = version mapToRegistry(pkg, npm.config, function (er, uri, auth, base) { var params = { - package : pkg, - distTag : t, - version : version, - auth : auth + 'package': pkg, + distTag: t, + version: version, + auth: auth } npm.registry.distTags.add(base, params, function (er) { if (er) return cb(er) - console.log("+"+t+": "+pkg+"@"+version) + console.log('+' + t + ': ' + pkg + '@' + version) cb() }) }) @@ -81,14 +81,14 @@ function add (spec, tag, cb) { } function remove (tag, pkg, cb) { - log.verbose("dist-tag del", tag, "from", pkg) + log.verbose('dist-tag del', tag, 'from', pkg) fetchTags(pkg, function (er, tags) { if (er) return cb(er) if (!tags[tag]) { - log.info("dist-tag del", tag, "is not a dist-tag on", pkg) - return cb(new Error(tag+" is not a dist-tag on "+pkg)) + log.info('dist-tag del', tag, 'is not a dist-tag on', pkg) + return cb(new Error(tag + ' is not a dist-tag on ' + pkg)) } var version = tags[tag] @@ -96,15 +96,15 @@ function remove (tag, pkg, cb) { mapToRegistry(pkg, npm.config, function (er, uri, auth, base) { var params = { - package : pkg, - distTag : tag, - auth : auth + 'package': pkg, + distTag: tag, + auth: auth } npm.registry.distTags.rm(base, params, function (er) { if (er) return cb(er) - console.log("-"+tag+": "+pkg+"@"+version) + console.log('-' + tag + ': ' + pkg + '@' + version) cb() }) }) @@ -112,20 +112,22 @@ function remove (tag, pkg, cb) { } function list (pkg, cb) { - if (!pkg) return readLocalPkg(function (er, pkg) { - if (er) return cb(er) - if (!pkg) return cb(distTag.usage) - list(pkg, cb) - }) + if (!pkg) { + return readLocalPkg(function (er, pkg) { + if (er) return cb(er) + if (!pkg) return cb(distTag.usage) + list(pkg, cb) + }) + } fetchTags(pkg, function (er, tags) { if (er) { - log.error("dist-tag ls", "Couldn't get dist-tag data for", pkg) + log.error('dist-tag ls', "Couldn't get dist-tag data for", pkg) return cb(er) } var msg = Object.keys(tags).map(function (k) { - return k+": "+tags[k] - }).sort().join("\n") + return k + ': ' + tags[k] + }).sort().join('\n') console.log(msg) cb(er, tags) }) @@ -136,13 +138,13 @@ function fetchTags (pkg, cb) { if (er) return cb(er) var params = { - package : pkg, - auth : auth + 'package': pkg, + auth: auth } npm.registry.distTags.fetch(base, params, function (er, tags) { if (er) return cb(er) if (!tags || !Object.keys(tags).length) { - return cb(new Error("No dist-tags found for " + pkg)) + return cb(new Error('No dist-tags found for ' + pkg)) } cb(null, tags) diff --git a/deps/npm/lib/docs.js b/deps/npm/lib/docs.js index 0de2349ddc952c..ea4bd561077e86 100644 --- a/deps/npm/lib/docs.js +++ b/deps/npm/lib/docs.js @@ -1,14 +1,12 @@ module.exports = docs -docs.usage = "npm docs " -docs.usage += "\n" -docs.usage += "npm docs ." +docs.usage = 'npm docs ' + + '\nnpm docs .' -var npm = require("./npm.js") - , opener = require("opener") - , path = require("path") - , log = require("npmlog") - , mapToRegistry = require("./utils/map-to-registry.js") +var npm = require('./npm.js') +var opener = require('opener') +var log = require('npmlog') +var fetchPackageMetadata = require('./fetch-package-metadata.js') docs.completion = function (opts, cb) { // FIXME: there used to be registry completion here, but it stopped making @@ -16,16 +14,12 @@ docs.completion = function (opts, cb) { cb() } -function url (json) { - return json.homepage ? json.homepage : "https://npmjs.org/package/" + json.name -} - function docs (args, cb) { - args = args || [] + if (!args || !args.length) args = ['.'] var pending = args.length - if (!pending) return getDoc(".", cb) - args.forEach(function(proj) { - getDoc(proj, function(err) { + log.silly('docs', args) + args.forEach(function (proj) { + getDoc(proj, function (err) { if (err) { return cb(err) } @@ -35,37 +29,11 @@ function docs (args, cb) { } function getDoc (project, cb) { - project = project || "." - var package = path.resolve(npm.localPrefix, "package.json") - - if (project === "." || project === "./") { - var json - try { - json = require(package) - if (!json.name) throw new Error('package.json does not have a valid "name" property') - project = json.name - } catch (e) { - log.error(e.message) - return cb(docs.usage) - } - - return opener(url(json), { command: npm.config.get("browser") }, cb) - } - - mapToRegistry(project, npm.config, function (er, uri, auth) { + log.silly('getDoc', project) + fetchPackageMetadata(project, '.', function (er, d) { if (er) return cb(er) - - npm.registry.get(uri + "/latest", { timeout : 3600, auth : auth }, next) + var url = d.homepage + if (!url) url = 'https://www.npmjs.org/package/' + d.name + return opener(url, {command: npm.config.get('browser')}, cb) }) - - function next (er, json) { - var github = "https://github.com/" + project + "#readme" - - if (er) { - if (project.split("/").length !== 2) return cb(er) - return opener(github, { command: npm.config.get("browser") }, cb) - } - - return opener(url(json), { command: npm.config.get("browser") }, cb) - } } diff --git a/deps/npm/lib/edit.js b/deps/npm/lib/edit.js index ddf501d54e56be..155db6fd97828c 100644 --- a/deps/npm/lib/edit.js +++ b/deps/npm/lib/edit.js @@ -1,25 +1,28 @@ -// npm edit [@] +// npm edit // open the package folder in the $EDITOR module.exports = edit -edit.usage = "npm edit " +edit.usage = 'npm edit [@]' -edit.completion = require("./utils/completion/installed-shallow.js") +edit.completion = require('./utils/completion/installed-shallow.js') -var npm = require("./npm.js") - , path = require("path") - , fs = require("graceful-fs") - , editor = require("editor") +var npm = require('./npm.js') +var path = require('path') +var fs = require('graceful-fs') +var editor = require('editor') function edit (args, cb) { var p = args[0] if (args.length !== 1 || !p) return cb(edit.usage) - var e = npm.config.get("editor") - if (!e) return cb(new Error( - "No editor set. Set the 'editor' config, or $EDITOR environ.")) - p = p.split("/") - .join("/node_modules/") - .replace(/(\/node_modules)+/, "/node_modules") + var e = npm.config.get('editor') + if (!e) { + return cb(new Error( + "No editor set. Set the 'editor' config, or $EDITOR environ." + )) + } + p = p.split('/') + .join('/node_modules/') + .replace(/(\/node_modules)+/, '/node_modules') var f = path.resolve(npm.dir, p) fs.lstat(f, function (er) { if (er) return cb(er) diff --git a/deps/npm/lib/explore.js b/deps/npm/lib/explore.js index 96475a0691f987..105ff84cc81301 100644 --- a/deps/npm/lib/explore.js +++ b/deps/npm/lib/explore.js @@ -2,33 +2,39 @@ // open a subshell to the package folder. module.exports = explore -explore.usage = "npm explore [ -- ]" -explore.completion = require("./utils/completion/installed-shallow.js") +explore.usage = 'npm explore [ -- ]' +explore.completion = require('./utils/completion/installed-shallow.js') -var npm = require("./npm.js") - , spawn = require("./utils/spawn") - , path = require("path") - , fs = require("graceful-fs") +var npm = require('./npm.js') +var spawn = require('./utils/spawn') +var path = require('path') +var fs = require('graceful-fs') function explore (args, cb) { if (args.length < 1 || !args[0]) return cb(explore.usage) var p = args.shift() - args = args.join(" ").trim() - if (args) args = ["-c", args] + args = args.join(' ').trim() + if (args) args = ['-c', args] else args = [] var cwd = path.resolve(npm.dir, p) - var sh = npm.config.get("shell") + var sh = npm.config.get('shell') fs.stat(cwd, function (er, s) { - if (er || !s.isDirectory()) return cb(new Error( - "It doesn't look like "+p+" is installed.")) - if (!args.length) console.log( - "\nExploring "+cwd+"\n"+ - "Type 'exit' or ^D when finished\n") + if (er || !s.isDirectory()) { + return cb(new Error( + "It doesn't look like " + p + ' is installed.' + )) + } - npm.spinner.stop() - var shell = spawn(sh, args, { cwd: cwd, stdio: "inherit" }) - shell.on("close", function (er) { + if (!args.length) { + console.log( + '\nExploring ' + cwd + '\n' + + "Type 'exit' or ^D when finished\n" + ) + } + + var shell = spawn(sh, args, { cwd: cwd, stdio: 'inherit' }) + shell.on('close', function (er) { // only fail if non-interactive. if (!args.length) return cb() cb(er) diff --git a/deps/npm/lib/faq.js b/deps/npm/lib/faq.js index 912db0072f21e1..c9d88d3012e564 100644 --- a/deps/npm/lib/faq.js +++ b/deps/npm/lib/faq.js @@ -1,8 +1,7 @@ - module.exports = faq -faq.usage = "npm faq" +faq.usage = 'npm faq' -var npm = require("./npm.js") +var npm = require('./npm.js') -function faq (args, cb) { npm.commands.help(["faq"], cb) } +function faq (args, cb) { npm.commands.help(['faq'], cb) } diff --git a/deps/npm/lib/fetch-package-metadata.js b/deps/npm/lib/fetch-package-metadata.js new file mode 100644 index 00000000000000..9e62cacd914166 --- /dev/null +++ b/deps/npm/lib/fetch-package-metadata.js @@ -0,0 +1,341 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var zlib = require('zlib') + +var log = require('npmlog') +var realizePackageSpecifier = require('realize-package-specifier') +var tar = require('tar') +var once = require('once') +var semver = require('semver') +var readPackageTree = require('read-package-tree') +var readPackageJson = require('read-package-json') +var iferr = require('iferr') +var rimraf = require('rimraf') +var clone = require('lodash.clonedeep') +var validate = require('aproba') +var unpipe = require('unpipe') +var normalizePackageData = require('normalize-package-data') + +var npm = require('./npm.js') +var mapToRegistry = require('./utils/map-to-registry.js') +var cache = require('./cache.js') +var cachedPackageRoot = require('./cache/cached-package-root.js') +var tempFilename = require('./utils/temp-filename.js') +var getCacheStat = require('./cache/get-stat.js') +var unpack = require('./utils/tar.js').unpack +var pulseTillDone = require('./utils/pulse-till-done.js') +var parseJSON = require('./utils/parse-json.js') + +function andLogAndFinish (spec, tracker, done) { + validate('SF', [spec, done]) + return function (er, pkg) { + if (er) { + log.silly('fetchPackageMetaData', 'error for ' + spec, er) + if (tracker) tracker.finish() + } + return done(er, pkg) + } +} + +module.exports = function fetchPackageMetadata (spec, where, tracker, done) { + if (!done) { + done = tracker || where + tracker = null + if (done === where) where = null + } + if (typeof spec === 'object') { + var dep = spec + spec = dep.raw + } + var logAndFinish = andLogAndFinish(spec, tracker, done) + if (!dep) { + log.silly('fetchPackageMetaData', spec) + return realizePackageSpecifier(spec, where, iferr(logAndFinish, function (dep) { + fetchPackageMetadata(dep, where, tracker, done) + })) + } + if (dep.type === 'version' || dep.type === 'range' || dep.type === 'tag') { + fetchNamedPackageData(dep, addRequestedAndFinish) + } else if (dep.type === 'directory') { + fetchDirectoryPackageData(dep, where, addRequestedAndFinish) + } else { + fetchOtherPackageData(spec, dep, where, addRequestedAndFinish) + } + function addRequestedAndFinish (er, pkg) { + if (pkg) { + pkg._requested = dep + pkg._spec = spec + pkg._where = where + if (!pkg._args) pkg._args = [] + pkg._args.push([pkg._spec, pkg._where]) + // non-npm registries can and will return unnormalized data, plus + // even the npm registry may have package data normalized with older + // normalization rules. This ensures we get package data in a consistent, + // stable format. + try { + normalizePackageData(pkg) + } catch (ex) { + // don't care + } + } + logAndFinish(er, pkg) + } +} + +function fetchOtherPackageData (spec, dep, where, next) { + validate('SOSF', arguments) + log.silly('fetchOtherPackageData', spec) + cache.add(spec, null, where, false, iferr(next, function (pkg) { + var result = clone(pkg) + result._inCache = true + next(null, result) + })) +} + +function fetchDirectoryPackageData (dep, where, next) { + validate('OSF', arguments) + log.silly('fetchDirectoryPackageData', dep.name || dep.rawSpec) + readPackageJson(path.join(dep.spec, 'package.json'), false, next) +} + +var regCache = {} + +function fetchNamedPackageData (dep, next) { + validate('OF', arguments) + log.silly('fetchNamedPackageData', dep.name || dep.rawSpec) + mapToRegistry(dep.name || dep.rawSpec, npm.config, iferr(next, function (url, auth) { + if (regCache[url]) { + pickVersionFromRegistryDocument(clone(regCache[url])) + } else { + npm.registry.get(url, {auth: auth}, pulseTillDone('fetchMetadata', iferr(next, pickVersionFromRegistryDocument))) + } + function returnAndAddMetadata (pkg) { + delete pkg._from + delete pkg._resolved + delete pkg._shasum + next(null, pkg) + } + function pickVersionFromRegistryDocument (pkg) { + if (!regCache[url]) regCache[url] = pkg + var versions = Object.keys(pkg.versions).sort(semver.rcompare) + + if (dep.type === 'tag') { + var tagVersion = pkg['dist-tags'][dep.spec] + if (pkg.versions[tagVersion]) return returnAndAddMetadata(pkg.versions[tagVersion]) + } else { + var latestVersion = pkg['dist-tags'][npm.config.get('tag')] || versions[0] + + // Find the the most recent version less than or equal + // to latestVersion that satisfies our spec + for (var ii = 0; ii < versions.length; ++ii) { + if (semver.gt(versions[ii], latestVersion)) continue + if (semver.satisfies(versions[ii], dep.spec)) { + return returnAndAddMetadata(pkg.versions[versions[ii]]) + } + } + + // Failing that, try finding the most recent version that matches + // our spec + for (var jj = 0; jj < versions.length; ++jj) { + if (semver.satisfies(versions[jj], dep.spec)) { + return returnAndAddMetadata(pkg.versions[versions[jj]]) + } + } + + // Failing THAT, if the range was '*' uses latestVersion + if (dep.spec === '*') { + return returnAndAddMetadata(pkg.versions[latestVersion]) + } + } + + // And failing that, we error out + var targets = versions.length + ? 'Valid install targets:\n' + versions.join(', ') + '\n' + : 'No valid targets found.' + var er = new Error('No compatible version found: ' + + dep.raw + '\n' + targets) + return next(er) + } + })) +} + +function retryWithCached (pkg, asserter, next) { + if (!pkg._inCache) { + cache.add(pkg._spec, null, pkg._where, false, iferr(next, function (newpkg) { + Object.keys(newpkg).forEach(function (key) { + if (key[0] !== '_') return + pkg[key] = newpkg[key] + }) + pkg._inCache = true + return asserter(pkg, next) + })) + } + return !pkg._inCache +} + +module.exports.addShrinkwrap = function addShrinkwrap (pkg, next) { + validate('OF', arguments) + if (pkg._shrinkwrap !== undefined) return next(null, pkg) + if (retryWithCached(pkg, addShrinkwrap, next)) return + pkg._shrinkwrap = null + // FIXME: cache the shrinkwrap directly + var pkgname = pkg.name + var ver = pkg.version + var tarball = path.join(cachedPackageRoot({name: pkgname, version: ver}), 'package.tgz') + untarStream(tarball, function (er, untar) { + if (er) { + if (er.code === 'ENOTTARBALL') { + pkg._shrinkwrap = null + return next() + } else { + return next(er) + } + } + if (er) return next(er) + var foundShrinkwrap = false + untar.on('entry', function (entry) { + if (!/^(?:[^\/]+[\/])npm-shrinkwrap.json$/.test(entry.path)) return + log.silly('addShrinkwrap', 'Found shrinkwrap in ' + pkgname + ' ' + entry.path) + foundShrinkwrap = true + var shrinkwrap = '' + entry.on('data', function (chunk) { + shrinkwrap += chunk + }) + entry.on('end', function () { + untar.close() + log.silly('addShrinkwrap', 'Completed reading shrinkwrap in ' + pkgname) + try { + pkg._shrinkwrap = parseJSON(shrinkwrap) + } catch (ex) { + var er = new Error('Error parsing ' + pkgname + '@' + ver + "'s npm-shrinkwrap.json: " + ex.message) + er.type = 'ESHRINKWRAP' + return next(er) + } + next(null, pkg) + }) + entry.resume() + }) + untar.on('end', function () { + if (!foundShrinkwrap) { + pkg._shrinkwrap = null + next(null, pkg) + } + }) + }) +} + +module.exports.addBundled = function addBundled (pkg, next) { + validate('OF', arguments) + if (pkg._bundled !== undefined) return next(null, pkg) + if (!pkg.bundleDependencies) return next(null, pkg) + if (retryWithCached(pkg, addBundled, next)) return + pkg._bundled = null + var pkgname = pkg.name + var ver = pkg.version + var tarball = path.join(cachedPackageRoot({name: pkgname, version: ver}), 'package.tgz') + var target = tempFilename('unpack') + getCacheStat(iferr(next, function (cs) { + log.verbose('addBundled', 'extract', tarball) + unpack(tarball, target, null, null, cs.uid, cs.gid, iferr(next, function () { + log.silly('addBundled', 'read tarball') + readPackageTree(target, function (er, tree) { + log.silly('cleanup', 'remove extracted module') + rimraf(target, function () { + if (tree) { + pkg._bundled = tree.children + } + next(null, pkg) + }) + }) + })) + })) +} + +// FIXME: hasGzipHeader / hasTarHeader / untarStream duplicate a lot +// of code from lib/utils/tar.js– these should be brought together. + +function hasGzipHeader (c) { + return c[0] === 0x1F && c[1] === 0x8B && c[2] === 0x08 +} + +function hasTarHeader (c) { + return c[257] === 0x75 && // tar archives have 7573746172 at position + c[258] === 0x73 && // 257 and 003030 or 202000 at position 262 + c[259] === 0x74 && + c[260] === 0x61 && + c[261] === 0x72 && + + ((c[262] === 0x00 && + c[263] === 0x30 && + c[264] === 0x30) || + + (c[262] === 0x20 && + c[263] === 0x20 && + c[264] === 0x00)) +} + +function untarStream (tarball, cb) { + validate('SF', arguments) + cb = once(cb) + + var stream + var file = stream = fs.createReadStream(tarball) + var tounpipe = [file] + file.on('error', function (er) { + er = new Error('Error extracting ' + tarball + ' archive: ' + er.message) + er.code = 'EREADFILE' + cb(er) + }) + file.on('data', function OD (c) { + if (hasGzipHeader(c)) { + doGunzip() + } else if (hasTarHeader(c)) { + doUntar() + } else { + if (file.close) file.close() + if (file.destroy) file.destroy() + var er = new Error('Non-gzip/tarball ' + tarball) + er.code = 'ENOTTARBALL' + return cb(er) + } + file.removeListener('data', OD) + file.emit('data', c) + cb(null, stream) + }) + + function doGunzip () { + var gunzip = stream.pipe(zlib.createGunzip()) + gunzip.on('error', function (er) { + er = new Error('Error extracting ' + tarball + ' archive: ' + er.message) + er.code = 'EGUNZIP' + cb(er) + }) + tounpipe.push(gunzip) + stream = gunzip + doUntar() + } + + function doUntar () { + var untar = stream.pipe(tar.Parse()) + untar.on('error', function (er) { + er = new Error('Error extracting ' + tarball + ' archive: ' + er.message) + er.code = 'EUNTAR' + cb(er) + }) + tounpipe.push(untar) + stream = untar + addClose() + } + + function addClose () { + stream.close = function () { + tounpipe.forEach(function (stream) { + unpipe(stream) + }) + + if (file.close) file.close() + if (file.destroy) file.destroy() + } + } +} diff --git a/deps/npm/lib/fetch-package-metadata.md b/deps/npm/lib/fetch-package-metadata.md new file mode 100644 index 00000000000000..6a7d4fc595de24 --- /dev/null +++ b/deps/npm/lib/fetch-package-metadata.md @@ -0,0 +1,37 @@ +fetch-package-metadata +---------------------- + + var fetchPackageMetadata = require("npm/lib/fetch-package-metadata") + fetchPackageMetadata(spec, contextdir, callback) + +This will get package metadata (and if possible, ONLY package metadata) for +a specifer as passed to `npm install` et al, eg `npm@next` or `npm@^2.0.3` + +## fetchPackageMetadata(*spec*, *contextdir*, *tracker*, *callback*) + +* *spec* **string** | **object** -- The package specifier, can be anything npm can + understand (see [realize-package-specifier]), or it can be the result from + realize-package-specifier or npm-package-arg (for non-local deps). + +* *contextdir* **string** -- The directory from which relative paths to + local packages should be resolved. + +* *tracker* **object** -- **(optional)** An are-we-there-yet tracker group as + provided by `npm.log.newGroup()`. + +* *callback* **function (er, package)** -- Called when the package information + has been loaded. `package` is the object for of the `package.json` + matching the requested spec. In the case of named packages, it comes from + the registry and thus may not exactly match what's found in the associated + tarball. + +[realize-package-specifier]: (https://github.com/npm/realize-package-specifier) + +In the case of tarballs and git repos, it will use the cache to download +them in order to get the package metadata. For named packages, only the +metadata is downloaded (eg http://registry.npmjs.org/package). For local +directories, the package.json is read directly. For local tarballs, the +tarball is streamed in memory and just the package.json is extracted from +it. (Due to the nature of tars, having the package.json early in the file +will result in it being loaded faster– the extractor short-circuits the +uncompress/untar streams as best as it can.) diff --git a/deps/npm/lib/get.js b/deps/npm/lib/get.js index aa058002ec19a8..8dc805ec560c31 100644 --- a/deps/npm/lib/get.js +++ b/deps/npm/lib/get.js @@ -1,12 +1,12 @@ module.exports = get -get.usage = "npm get (See `npm config`)" +get.usage = 'npm get (See `npm config`)' -var npm = require("./npm.js") +var npm = require('./npm.js') get.completion = npm.commands.config.completion function get (args, cb) { - npm.commands.config(["get"].concat(args), cb) + npm.commands.config(['get'].concat(args), cb) } diff --git a/deps/npm/lib/help-search.js b/deps/npm/lib/help-search.js index d8553453bc54df..8a138feebed420 100644 --- a/deps/npm/lib/help-search.js +++ b/deps/npm/lib/help-search.js @@ -1,29 +1,29 @@ module.exports = helpSearch -var fs = require("graceful-fs") - , path = require("path") - , asyncMap = require("slide").asyncMap - , npm = require("./npm.js") - , glob = require("glob") - , color = require("ansicolors") +var fs = require('graceful-fs') +var path = require('path') +var asyncMap = require('slide').asyncMap +var npm = require('./npm.js') +var glob = require('glob') +var color = require('ansicolors') -helpSearch.usage = "npm help-search " +helpSearch.usage = 'npm help-search ' function helpSearch (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } if (!args.length) return cb(helpSearch.usage) - var docPath = path.resolve(__dirname, "..", "doc") - return glob(docPath + "/*/*.md", function (er, files) { - if (er) - return cb(er) + var docPath = path.resolve(__dirname, '..', 'doc') + return glob(docPath + '/*/*.md', function (er, files) { + if (er) return cb(er) readFiles(files, function (er, data) { - if (er) - return cb(er) + if (er) return cb(er) searchFiles(args, data, function (er, results) { - if (er) - return cb(er) + if (er) return cb(er) formatResults(args, results, cb) }) }) @@ -52,8 +52,7 @@ function searchFiles (args, files, cb) { for (var a = 0, l = args.length; a < l && !match; a++) { match = data.toLowerCase().indexOf(args[a].toLowerCase()) !== -1 } - if (!match) - return + if (!match) return var lines = data.split(/\n+/) @@ -61,14 +60,14 @@ function searchFiles (args, files, cb) { // if the next line has a search term, then skip all 3 // otherwise, set the line to null. then remove the nulls. l = lines.length - for (var i = 0; i < l; i ++) { + for (var i = 0; i < l; i++) { var line = lines[i] - , nextLine = lines[i + 1] - , ll + var nextLine = lines[i + 1] + var ll match = false if (nextLine) { - for (a = 0, ll = args.length; a < ll && !match; a ++) { + for (a = 0, ll = args.length; a < ll && !match; a++) { match = nextLine.toLowerCase() .indexOf(args[a].toLowerCase()) !== -1 } @@ -80,12 +79,12 @@ function searchFiles (args, files, cb) { } match = false - for (a = 0, ll = args.length; a < ll && !match; a ++) { + for (a = 0, ll = args.length; a < ll && !match; a++) { match = line.toLowerCase().indexOf(args[a].toLowerCase()) !== -1 } if (match) { // skip over the next line - i ++ + i++ continue } @@ -94,7 +93,7 @@ function searchFiles (args, files, cb) { // now squish any string of nulls into a single null lines = lines.reduce(function (l, r) { - if (!(r === null && l[l.length-1] === null)) l.push(r) + if (!(r === null && l[l.length - 1] === null)) l.push(r) return l }, []) @@ -103,10 +102,10 @@ function searchFiles (args, files, cb) { // now see how many args were found at all. var found = {} - , totalHits = 0 + var totalHits = 0 lines.forEach(function (line) { args.forEach(function (arg) { - var hit = (line || "").toLowerCase() + var hit = (line || '').toLowerCase() .split(arg.toLowerCase()).length - 1 if (hit > 0) { found[arg] = (found[arg] || 0) + hit @@ -115,27 +114,28 @@ function searchFiles (args, files, cb) { }) }) - var cmd = "npm help " - if (path.basename(path.dirname(file)) === "api") { - cmd = "npm apihelp " + var cmd = 'npm help ' + if (path.basename(path.dirname(file)) === 'api') { + cmd = 'npm apihelp ' } - cmd += path.basename(file, ".md").replace(/^npm-/, "") - results.push({ file: file - , cmd: cmd - , lines: lines - , found: Object.keys(found) - , hits: found - , totalHits: totalHits - }) + cmd += path.basename(file, '.md').replace(/^npm-/, '') + results.push({ + file: file, + cmd: cmd, + lines: lines, + found: Object.keys(found), + hits: found, + totalHits: totalHits + }) }) // if only one result, then just show that help section. if (results.length === 1) { - return npm.commands.help([results[0].file.replace(/\.md$/, "")], cb) + return npm.commands.help([results[0].file.replace(/\.md$/, '')], cb) } if (results.length === 0) { - console.log("No results for " + args.map(JSON.stringify).join(" ")) + console.log('No results for ' + args.map(JSON.stringify).join(' ')) return cb() } @@ -161,48 +161,49 @@ function formatResults (args, results, cb) { var out = results.map(function (res) { var out = res.cmd - , r = Object.keys(res.hits).map(function (k) { - return k + ":" + res.hits[k] - }).sort(function (a, b) { - return a > b ? 1 : -1 - }).join(" ") + var r = Object.keys(res.hits) + .map(function (k) { + return k + ':' + res.hits[k] + }).sort(function (a, b) { + return a > b ? 1 : -1 + }).join(' ') out += ((new Array(Math.max(1, cols - out.length - r.length))) - .join(" ")) + r + .join(' ')) + r - if (!npm.config.get("long")) return out + if (!npm.config.get('long')) return out - out = "\n\n" + out - + "\n" + (new Array(cols)).join("—") + "\n" - + res.lines.map(function (line, i) { - if (line === null || i > 3) return "" - for (var out = line, a = 0, l = args.length; a < l; a ++) { - var finder = out.toLowerCase().split(args[a].toLowerCase()) - , newOut = "" - , p = 0 + out = '\n\n' + out + '\n' + + (new Array(cols)).join('—') + '\n' + + res.lines.map(function (line, i) { + if (line === null || i > 3) return '' + for (var out = line, a = 0, l = args.length; a < l; a++) { + var finder = out.toLowerCase().split(args[a].toLowerCase()) + var newOut = '' + var p = 0 - finder.forEach(function (f) { - newOut += out.substr(p, f.length) + finder.forEach(function (f) { + newOut += out.substr(p, f.length) - var hilit = out.substr(p + f.length, args[a].length) - if (npm.color) hilit = color.bgBlack(color.red(hilit)) - newOut += hilit + var hilit = out.substr(p + f.length, args[a].length) + if (npm.color) hilit = color.bgBlack(color.red(hilit)) + newOut += hilit - p += f.length + args[a].length - }) - } + p += f.length + args[a].length + }) + } - return newOut - }).join("\n").trim() + return newOut + }).join('\n').trim() return out - }).join("\n") - - if (results.length && !npm.config.get("long")) { - out = "Top hits for "+(args.map(JSON.stringify).join(" ")) - + "\n" + (new Array(cols)).join("—") + "\n" - + out - + "\n" + (new Array(cols)).join("—") + "\n" - + "(run with -l or --long to see more context)" + }).join('\n') + + if (results.length && !npm.config.get('long')) { + out = 'Top hits for ' + (args.map(JSON.stringify).join(' ')) + '\n' + + (new Array(cols)).join('—') + '\n' + + out + '\n' + + (new Array(cols)).join('—') + '\n' + + '(run with -l or --long to see more context)' } console.log(out.trim()) diff --git a/deps/npm/lib/help.js b/deps/npm/lib/help.js index 942d27b41e17b8..a954ae814b7550 100644 --- a/deps/npm/lib/help.js +++ b/deps/npm/lib/help.js @@ -6,16 +6,15 @@ help.completion = function (opts, cb) { getSections(cb) } -var path = require("path") - , spawn = require("./utils/spawn") - , npm = require("./npm.js") - , log = require("npmlog") - , opener = require("opener") - , glob = require("glob") +var path = require('path') +var spawn = require('./utils/spawn') +var npm = require('./npm.js') +var log = require('npmlog') +var opener = require('opener') +var glob = require('glob') function help (args, cb) { - npm.spinner.stop() - var argv = npm.config.get("argv").cooked + var argv = npm.config.get('argv').cooked var argnum = 0 if (args.length === 2 && ~~args[0]) { @@ -24,54 +23,53 @@ function help (args, cb) { // npm help foo bar baz: search topics if (args.length > 1 && args[0]) { - return npm.commands["help-search"](args, argnum, cb) + return npm.commands['help-search'](args, argnum, cb) } var section = npm.deref(args[0]) || args[0] // npm help : show basic usage if (!section) { - var valid = argv[0] === "help" ? 0 : 1 + var valid = argv[0] === 'help' ? 0 : 1 return npmUsage(valid, cb) } - // npm -h: show command usage - if ( npm.config.get("usage") - && npm.commands[section] - && npm.commands[section].usage - ) { - npm.config.set("loglevel", "silent") - log.level = "silent" + if (npm.config.get('usage') && + npm.commands[section] && + npm.commands[section].usage) { + npm.config.set('loglevel', 'silent') + log.level = 'silent' console.log(npm.commands[section].usage) return cb() } // npm apihelp
    : Prefer section 3 over section 1 - var apihelp = argv.length && -1 !== argv[0].indexOf("api") + var apihelp = argv.length && argv[0].indexOf('api') !== -1 var pref = apihelp ? [3, 1, 5, 7] : [1, 3, 5, 7] - if (argnum) + if (argnum) { pref = [ argnum ].concat(pref.filter(function (n) { return n !== argnum })) + } // npm help
    : Try to find the path - var manroot = path.resolve(__dirname, "..", "man") + var manroot = path.resolve(__dirname, '..', 'man') // legacy - if (section === "global") section = "folders" - else if (section === "json") section = "package.json" + if (section === 'global') section = 'folders' + else if (section === 'json') section = 'package.json' // find either /section.n or /npm-section.n // The glob is used in the glob. The regexp is used much // further down. Globs and regexps are different - var compextglob = ".+(gz|bz2|lzma|[FYzZ]|xz)" - var compextre = "\\.(gz|bz2|lzma|[FYzZ]|xz)$" - var f = "+(npm-" + section + "|" + section + ").[0-9]?(" + compextglob + ")" - return glob(manroot + "/*/" + f, function (er, mans) { + var compextglob = '.+(gz|bz2|lzma|[FYzZ]|xz)' + var compextre = '\\.(gz|bz2|lzma|[FYzZ]|xz)$' + var f = '+(npm-' + section + '|' + section + ').[0-9]?(' + compextglob + ')' + return glob(manroot + '/*/' + f, function (er, mans) { if (er) return cb(er) - if (!mans.length) return npm.commands["help-search"](args, cb) + if (!mans.length) return npm.commands['help-search'](args, cb) mans = mans.map(function (man) { var ext = path.extname(man) @@ -103,83 +101,83 @@ function pickMan (mans, pref_) { function viewMan (man, cb) { var nre = /([0-9]+)$/ var num = man.match(nre)[1] - var section = path.basename(man, "." + num) + var section = path.basename(man, '.' + num) // at this point, we know that the specified man page exists - var manpath = path.join(__dirname, "..", "man") - , env = {} + var manpath = path.join(__dirname, '..', 'man') + var env = {} Object.keys(process.env).forEach(function (i) { env[i] = process.env[i] }) env.MANPATH = manpath - var viewer = npm.config.get("viewer") + var viewer = npm.config.get('viewer') var conf switch (viewer) { - case "woman": - var a = ["-e", "(woman-find-file \"" + man + "\")"] - conf = { env: env, stdio: "inherit" } - var woman = spawn("emacsclient", a, conf) - woman.on("close", cb) + case 'woman': + var a = ['-e', '(woman-find-file \'' + man + '\')'] + conf = { env: env, stdio: 'inherit' } + var woman = spawn('emacsclient', a, conf) + woman.on('close', cb) break - case "browser": - opener(htmlMan(man), { command: npm.config.get("browser") }, cb) + case 'browser': + opener(htmlMan(man), { command: npm.config.get('browser') }, cb) break default: - conf = { env: env, stdio: "inherit" } - var manProcess = spawn("man", [num, section], conf) - manProcess.on("close", cb) + conf = { env: env, stdio: 'inherit' } + var manProcess = spawn('man', [num, section], conf) + manProcess.on('close', cb) break } } function htmlMan (man) { var sect = +man.match(/([0-9]+)$/)[1] - var f = path.basename(man).replace(/([0-9]+)$/, "html") + var f = path.basename(man).replace(/([0-9]+)$/, 'html') switch (sect) { case 1: - sect = "cli" + sect = 'cli' break case 3: - sect = "api" + sect = 'api' break case 5: - sect = "files" + sect = 'files' break case 7: - sect = "misc" + sect = 'misc' break default: - throw new Error("invalid man section: " + sect) + throw new Error('invalid man section: ' + sect) } - return path.resolve(__dirname, "..", "html", "doc", sect, f) + return path.resolve(__dirname, '..', 'html', 'doc', sect, f) } function npmUsage (valid, cb) { - npm.config.set("loglevel", "silent") - log.level = "silent" - console.log( - [ "\nUsage: npm " - , "" - , "where is one of:" - , npm.config.get("long") ? usages() - : " " + wrap(Object.keys(npm.commands)) - , "" - , "npm -h quick help on " - , "npm -l display full usage info" - , "npm faq commonly asked questions" - , "npm help search for help on " - , "npm help npm involved overview" - , "" - , "Specify configs in the ini-formatted file:" - , " " + npm.config.get("userconfig") - , "or on the command line via: npm --key value" - , "Config info can be viewed via: npm help config" - , "" - , "npm@" + npm.version + " " + path.dirname(__dirname) - ].join("\n")) + npm.config.set('loglevel', 'silent') + log.level = 'silent' + console.log([ + '\nUsage: npm ', + '', + 'where is one of:', + npm.config.get('long') ? usages() + : ' ' + wrap(Object.keys(npm.commands)), + '', + 'npm -h quick help on ', + 'npm -l display full usage info', + 'npm faq commonly asked questions', + 'npm help search for help on ', + 'npm help npm involved overview', + '', + 'Specify configs in the ini-formatted file:', + ' ' + npm.config.get('userconfig'), + 'or on the command line via: npm --key value', + 'Config info can be viewed via: npm help config', + '', + 'npm@' + npm.version + ' ' + path.dirname(__dirname) + ].join('\n')) cb(valid) } @@ -189,50 +187,50 @@ function usages () { return Object.keys(npm.commands).filter(function (c) { return c === npm.deref(c) }).reduce(function (set, c) { - set.push([c, npm.commands[c].usage || ""]) + set.push([c, npm.commands[c].usage || '']) maxLen = Math.max(maxLen, c.length) return set }, []).map(function (item) { var c = item[0] - , usage = item[1] - return "\n " + c + (new Array(maxLen - c.length + 2).join(" ")) - + (usage.split("\n") - .join("\n" + (new Array(maxLen + 6).join(" ")))) - }).join("\n") + var usage = item[1] + return '\n ' + + c + (new Array(maxLen - c.length + 2).join(' ')) + + (usage.split('\n').join('\n' + (new Array(maxLen + 6).join(' ')))) + }).join('\n') } - function wrap (arr) { - var out = [""] - , l = 0 - , line + var out = [''] + var l = 0 + var line line = process.stdout.columns - if (!line) + if (!line) { line = 60 - else + } else { line = Math.min(60, Math.max(line - 16, 24)) + } - arr.sort(function (a,b) { return a --save` afterwards to install a package and" - ,"save it as a dependency in the package.json file." - ,"" - ,"Press ^C at any time to quit." - ].join("\n")) + console.log([ + 'This utility will walk you through creating a package.json file.', + 'It only covers the most common items, and tries to guess sensible defaults.', + '', + 'See `npm help json` for definitive documentation on these fields', + 'and exactly what they do.', + '', + 'Use `npm install --save` afterwards to install a package and', + 'save it as a dependency in the package.json file.', + '', + 'Press ^C at any time to quit.' + ].join('\n')) } initJson(dir, initFile, npm.config, function (er, data) { log.resume() - log.silly("package data", data) - if (er && er.message === "canceled") { - log.warn("init", "canceled") + log.silly('package data', data) + if (er && er.message === 'canceled') { + log.warn('init', 'canceled') return cb(null, data) } - log.info("init", "written successfully") + log.info('init', 'written successfully') cb(er, data) }) } diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 9cc6a46fc0ca06..773ed5405e9bf1 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -1,3 +1,4 @@ +'use strict' // npm install // // See doc/install.md for more description @@ -12,23 +13,23 @@ // added, and then that's passed to the next generation of installation. module.exports = install - -install.usage = "npm install" - + "\nnpm install " - + "\nnpm install @" - + "\nnpm install @" - + "\nnpm install @" - + "\nnpm install " - + "\nnpm install " - + "\nnpm install " - + "\nnpm install " - + "\nnpm install /" - + "\n\nCan specify one or more: npm install ./foo.tgz bar@stable /some/folder" - + "\nIf no argument is supplied and ./npm-shrinkwrap.json is " - + "\npresent, installs dependencies specified in the shrinkwrap." - + "\nOtherwise, installs dependencies from ./package.json." +module.exports.Installer = Installer + +install.usage = '\nnpm install (with no args, in package dir)' + + '\nnpm install [<@scope>/]' + + '\nnpm install [<@scope>/]@' + + '\nnpm install [<@scope>/]@' + + '\nnpm install [<@scope>/]@' + + '\nnpm install ' + + '\nnpm install ' + + '\nnpm install ' + + '\nnpm install ' + + '\nnpm install /' + + '\n\nalias: npm i' + + '\ncommon options: [--save|--save-dev|--save-optional] [--save-exact]' install.completion = function (opts, cb) { + validate('OF', arguments) // install can complete to a folder with a package.json, or any package. // if it has a slash, then it's gotta be a folder // if it starts with https?://, then just give up, because it's a url @@ -42,12 +43,12 @@ install.completion = function (opts, cb) { // is a folder containing a package.json file. If that is not the // case we return 0 matches, which will trigger the default bash // complete. - var lastSlashIdx = opts.partialWord.lastIndexOf("/") + var lastSlashIdx = opts.partialWord.lastIndexOf('/') var partialName = opts.partialWord.slice(lastSlashIdx + 1) var partialPath = opts.partialWord.slice(0, lastSlashIdx) - if (partialPath === "") partialPath = "/" + if (partialPath === '') partialPath = '/' - function annotatePackageDirMatch (sibling, cb) { + var annotatePackageDirMatch = function (sibling, cb) { var fullPath = path.join(partialPath, sibling) if (sibling.slice(0, partialName.length) !== partialName) { return cb(null, null) // not name match @@ -59,7 +60,7 @@ install.completion = function (opts, cb) { null, { fullPath: fullPath, - isPackage: contents.indexOf("package.json") !== -1 + isPackage: contents.indexOf('package.json') !== -1 } ) }) @@ -86,1111 +87,629 @@ install.completion = function (opts, cb) { cb() } -var npm = require("./npm.js") - , semver = require("semver") - , readJson = require("read-package-json") - , readInstalled = require("read-installed") - , log = require("npmlog") - , path = require("path") - , fs = require("graceful-fs") - , writeFileAtomic = require("write-file-atomic") - , cache = require("./cache.js") - , asyncMap = require("slide").asyncMap - , chain = require("slide").chain - , url = require("url") - , mkdir = require("mkdirp") - , lifecycle = require("./utils/lifecycle.js") - , archy = require("archy") - , npmInstallChecks = require("npm-install-checks") - , sortedObject = require("sorted-object") - , mapToRegistry = require("./utils/map-to-registry.js") - , npa = require("npm-package-arg") - , inflight = require("inflight") - , locker = require("./utils/locker.js") - , lock = locker.lock - , unlock = locker.unlock - , warnStrict = require("./utils/warn-deprecated.js")("engineStrict") - , warnPeers = require("./utils/warn-deprecated.js")("peerDependencies") - -function install (args, cb_) { - var hasArguments = !!args.length - - function cb (er, installed) { - if (er) return cb_(er) - - validateInstall(where, function (er, problem) { - if (er) return cb_(er) - - if (problem) { - var peerInvalidError = new Error("The package " + problem._id + - " does not satisfy its siblings' peerDependencies requirements!") - peerInvalidError.code = "EPEERINVALID" - peerInvalidError.packageName = problem.name - peerInvalidError.packageVersion = problem.version - peerInvalidError.peersDepending = problem.peersDepending - return cb(peerInvalidError) - } - - var tree = treeify(installed || []) - , pretty = prettify(tree, installed).trim() - - if (pretty) console.log(pretty) - save(where, installed, tree, pretty, hasArguments, cb_) - }) - } - - // the /path/to/node_modules/.. - var where = path.resolve(npm.dir, "..") - - // internal api: install(where, what, cb) - if (arguments.length === 3) { - where = args - args = [].concat(cb_) // pass in [] to do default dep-install - cb_ = arguments[2] - log.verbose("install", "where, what", [where, args]) - } - - if (!npm.config.get("global")) { - args = args.filter(function (a) { - return path.resolve(a) !== where - }) - } - - mkdir(where, function (er) { - if (er) return cb(er) - // install dependencies locally by default, - // or install current folder globally - if (!args.length) { - var opt = { dev: npm.config.get("dev") || !npm.config.get("production") } - - if (npm.config.get("global")) args = ["."] - else return readDependencies(null, where, opt, function (er, data) { - if (er) { - log.error("install", "Couldn't read dependencies") - return cb(er) - } - var deps = Object.keys(data.dependencies || {}) - log.verbose("install", "where, deps", [where, deps]) - - // FIXME: Install peerDependencies as direct dependencies, but only at - // the top level. Should only last until peerDependencies are nerfed to - // no longer implicitly install themselves. - var peers = [] - Object.keys(data.peerDependencies || {}).forEach(function (dep) { - if (!data.dependencies[dep]) { - log.verbose( - "install", - "peerDependency", dep, "wasn't going to be installed; adding" - ) - warnPeers([ - "The peer dependency "+dep+" included from "+data.name+" will no", - "longer be automatically installed to fulfill the peerDependency ", - "in npm 3+. Your application will need to depend on it explicitly." - ], dep+","+data.name) - peers.push(dep) - } - }) - log.verbose("install", "where, peers", [where, peers]) - - var context = { family: {} - , ancestors: {} - , explicit: false - , parent: data - , root: true - , wrap: null } - - if (data.name === path.basename(where) && - path.basename(path.dirname(where)) === "node_modules") { - // Only include in ancestry if it can actually be required. - // Otherwise, it does not count. - context.family[data.name] = - context.ancestors[data.name] = data.version - } - - installManyTop(deps.map(function (dep) { - var target = data.dependencies[dep] - return dep + "@" + target - }).concat(peers.map(function (dep) { - var target = data.peerDependencies[dep] - return dep + "@" + target - })), where, context, function(er, results) { - if (er || npm.config.get("production")) return cb(er, results) - lifecycle(data, "prepublish", where, function(er) { - return cb(er, results) - }) - }) +// system packages +var fs = require('fs') +var path = require('path') + +// dependencies +var log = require('npmlog') +var readPackageTree = require('read-package-tree') +var chain = require('slide').chain +var asyncMap = require('slide').asyncMap +var archy = require('archy') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var iferr = require('iferr') +var validate = require('aproba') + +// npm internal utils +var npm = require('./npm.js') +var locker = require('./utils/locker.js') +var lock = locker.lock +var unlock = locker.unlock +var ls = require('./ls.js') +var parseJSON = require('./utils/parse-json.js') + +// install specific libraries +var copyTree = require('./install/copy-tree.js') +var readShrinkwrap = require('./install/read-shrinkwrap.js') +var recalculateMetadata = require('./install/deps.js').recalculateMetadata +var loadDeps = require('./install/deps.js').loadDeps +var loadDevDeps = require('./install/deps.js').loadDevDeps +var getAllMetadata = require('./install/deps.js').getAllMetadata +var loadRequestedDeps = require('./install/deps.js').loadRequestedDeps +var loadExtraneous = require('./install/deps.js').loadExtraneous +var pruneTree = require('./install/prune-tree.js') +var diffTrees = require('./install/diff-trees.js') +var checkPermissions = require('./install/check-permissions.js') +var decomposeActions = require('./install/decompose-actions.js') +var filterInvalidActions = require('./install/filter-invalid-actions.js') +var validateTree = require('./install/validate-tree.js') +var validateArgs = require('./install/validate-args.js') +var saveRequested = require('./install/save.js').saveRequested +var getSaveType = require('./install/save.js').getSaveType +var doSerialActions = require('./install/actions.js').doSerial +var doReverseSerialActions = require('./install/actions.js').doReverseSerial +var doParallelActions = require('./install/actions.js').doParallel +var doOneAction = require('./install/actions.js').doOne +var packageId = require('./utils/package-id.js') +var moduleName = require('./utils/module-name.js') + +function unlockCB (lockPath, name, cb) { + validate('SSF', arguments) + return function (installEr) { + var args = arguments + try { + unlock(lockPath, name, reportErrorAndReturn) + } catch (unlockEx) { + process.nextTick(function () { + reportErrorAndReturn(unlockEx) }) } - - // initial "family" is the name:version of the root, if it's got - // a package.json file. - var jsonPath = path.resolve(where, "package.json") - log.verbose('install', 'initial load of', jsonPath) - readJson(jsonPath, log.warn, function (er, data) { - if (er - && er.code !== "ENOENT" - && er.code !== "ENOTDIR") return cb(er) - if (er) data = null - var context = { family: {} - , ancestors: {} - , explicit: true - , parent: data - , root: true - , wrap: null } - if (data && data.name === path.basename(where) && - path.basename(path.dirname(where)) === "node_modules") { - context.family[data.name] = context.ancestors[data.name] = data.version + function reportErrorAndReturn (unlockEr) { + if (installEr) { + if (unlockEr && unlockEr.code !== 'ENOTLOCKED') { + log.warn('unlock' + name, unlockEr) + } + return cb.apply(null, args) } - var fn = npm.config.get("global") ? installMany : installManyTop - fn(args, where, context, cb) - }) - }) -} - -function validateInstall (where, cb) { - var jsonPath = path.resolve(where, 'package.json') - log.verbose('validateInstall', 'loading', jsonPath, 'for validation') - readJson(jsonPath, log.warn, function (er, data) { - if (er - && er.code !== 'ENOENT' - && er.code !== 'ENOTDIR') return cb(er) - - if (data && data.engineStrict) { - warnStrict([ - "Per-package engineStrict (found in this package's package.json) ", - "won't be used in npm 3+. Use the config setting `engine-strict` instead." - ], data.name) + if (unlockEr) return cb(unlockEr) + return cb.apply(null, args) } - - readInstalled(where, { log: log.warn, dev: true }, function (er, data) { - if (er) return cb(er) - - cb(null, findPeerInvalid_(data.dependencies, [])) - }) - }) + } } -function findPeerInvalid_ (packageMap, fpiList) { - if (fpiList.indexOf(packageMap) !== -1) - return undefined - - fpiList.push(packageMap) - - for (var packageName in packageMap) { - var pkg = packageMap[packageName] +function install (where, args, cb) { + if (!cb) { + cb = args + args = where + where = null + } + var globalTop = path.resolve(npm.globalDir, '..') + if (!where) { + where = npm.config.get('global') + ? globalTop + : npm.prefix + } + validate('SAF', [where, args, cb]) + // the /path/to/node_modules/.. + var dryrun = !!npm.config.get('dry-run') - if (pkg.peerInvalid) { - var peersDepending = {} - for (var peerName in packageMap) { - var peer = packageMap[peerName] - if (peer.peerDependencies && peer.peerDependencies[packageName]) { - peersDepending[peer.name + "@" + peer.version] = - peer.peerDependencies[packageName] - } - } - return { name: pkg.name, peersDepending: peersDepending, version: pkg.version, _id: pkg._id } - } + if (npm.config.get('dev')) { + log.warn('install', 'Usage of the `--dev` option is deprecated. Use `--only=dev` instead.') + } - if (pkg.dependencies) { - var invalid = findPeerInvalid_(pkg.dependencies, fpiList) - if (invalid) - return invalid - } + if (where === globalTop && !args.length) { + args = ['.'] } + args = args.filter(function (a) { + return path.resolve(a) !== npm.prefix + }) - return null + new Installer(where, dryrun, args).run(cb) } -// reads dependencies for the package at "where". There are several cases, -// depending on our current state and the package's configuration: -// -// 1. If "context" is specified, then we examine the context to see if there's a -// shrinkwrap there. In that case, dependencies are read from the shrinkwrap. -// 2. Otherwise, if an npm-shrinkwrap.json file is present, dependencies are -// read from there. -// 3. Otherwise, dependencies come from package.json. -// -// Regardless of which case we fall into, "cb" is invoked with a first argument -// describing the full package (as though readJson had been used) but with -// "dependencies" read as described above. The second argument to "cb" is the -// shrinkwrap to use in processing this package's dependencies, which may be -// "wrap" (in case 1) or a new shrinkwrap (in case 2). -function readDependencies (context, where, opts, cb) { - var wrap = context ? context.wrap : null - - var jsonPath = path.resolve(where, 'package.json') - log.verbose('readDependencies', 'loading dependencies from', jsonPath) - readJson(jsonPath, log.warn, function (er, data) { - if (er && er.code === "ENOENT") er.code = "ENOPACKAGEJSON" - if (er) return cb(er) - - if (opts && opts.dev) { - if (!data.dependencies) data.dependencies = {} - Object.keys(data.devDependencies || {}).forEach(function (k) { - if (data.dependencies[k]) { - log.warn("package.json", "Dependency '%s' exists in both dependencies " + - "and devDependencies, using '%s@%s' from dependencies", - k, k, data.dependencies[k]) - } else { - data.dependencies[k] = data.devDependencies[k] - } - }) - } - - if (!npm.config.get("optional") && data.optionalDependencies) { - Object.keys(data.optionalDependencies).forEach(function (d) { - delete data.dependencies[d] - }) +function Installer (where, dryrun, args) { + validate('SBA', arguments) + this.where = where + this.dryrun = dryrun + this.args = args + this.currentTree = null + this.idealTree = null + this.differences = [] + this.todo = [] + this.progress = {} + this.noPackageJsonOk = !!args.length + this.topLevelLifecycles = !args.length + this.npat = npm.config.get('npat') + this.dev = npm.config.get('dev') || (!/^prod(uction)?$/.test(npm.config.get('only')) && !npm.config.get('production')) || /^dev(elopment)?$/.test(npm.config.get('only')) + this.prod = !/^dev(elopment)?$/.test(npm.config.get('only')) + this.rollback = npm.config.get('rollback') + this.link = npm.config.get('link') + this.global = this.where === path.resolve(npm.globalDir, '..') +} +Installer.prototype = {} + +Installer.prototype.run = function (cb) { + validate('F', arguments) + + // FIXME: This is bad and I should feel bad. + // lib/install needs to have some way of sharing _limited_ + // state with the things it calls. Passing the object is too + // much. The global config is WAY too much. =( =( + // But not having this is gonna break linked modules in + // subtle stupid ways, and refactoring all this code isn't + // the right thing to do just yet. + if (this.global) { + var prevGlobal = npm.config.get('global') + npm.config.set('global', true) + var next = cb + cb = function () { + npm.config.set('global', prevGlobal) + next.apply(null, arguments) } + } - // User has opted out of shrinkwraps entirely - if (npm.config.get("shrinkwrap") === false) - return cb(null, data, null) - - if (wrap) { - log.verbose("readDependencies: using existing wrap", [where, wrap]) - var rv = {} - Object.keys(data).forEach(function (key) { - rv[key] = data[key] - }) - rv.dependencies = {} - Object.keys(wrap).forEach(function (key) { - log.verbose("from wrap", [key, wrap[key]]) - rv.dependencies[key] = readWrap(wrap[key]) - }) - log.verbose("readDependencies returned deps", rv.dependencies) - return cb(null, rv, wrap) + var installSteps = [] + var postInstallSteps = [] + installSteps.push( + [this.newTracker(log, 'loadCurrentTree', 4)], + [this, this.loadCurrentTree], + [this, this.finishTracker, 'loadCurrentTree'], + + [this.newTracker(log, 'loadIdealTree', 12)], + [this, this.loadIdealTree], + [this, this.finishTracker, 'loadIdealTree'], + + [this, this.debugTree, 'currentTree', 'currentTree'], + [this, this.debugTree, 'idealTree', 'idealTree'], + + [this.newTracker(log, 'generateActionsToTake')], + [this, this.generateActionsToTake], + [this, this.finishTracker, 'generateActionsToTake'], + + [this, this.debugActions, 'diffTrees', 'differences'], + [this, this.debugActions, 'decomposeActions', 'todo']) + if (!this.dryrun) { + installSteps.push( + [this.newTracker(log, 'executeActions', 8)], + [this, this.executeActions], + [this, this.finishTracker, 'executeActions']) + var node_modules = path.resolve(this.where, 'node_modules') + var staging = path.resolve(node_modules, '.staging') + postInstallSteps.push( + [this.newTracker(log, 'rollbackFailedOptional', 1)], + [this, this.rollbackFailedOptional, staging, this.todo], + [this, this.finishTracker, 'rollbackFailedOptional'], + [this, this.commit, staging, this.todo], + [this.newTracker(log, 'runTopLevelLifecycles', 2)], + [this, this.runTopLevelLifecycles], + [this, this.finishTracker, 'runTopLevelLifecycles']) + + if (getSaveType(this.args)) { + postInstallSteps.push( + [this, this.saveToDependencies]) } - - var wrapfile = path.resolve(where, "npm-shrinkwrap.json") - - fs.readFile(wrapfile, "utf8", function (er, wrapjson) { - if (er) return cb(null, data, null) - - log.verbose("readDependencies", "npm-shrinkwrap.json is overriding dependencies") - var newwrap - try { - newwrap = JSON.parse(wrapjson) - } catch (ex) { - return cb(ex) - } - - log.info("shrinkwrap", "file %j", wrapfile) - var rv = {} - Object.keys(data).forEach(function (key) { - rv[key] = data[key] - }) - rv.dependencies = {} - Object.keys(newwrap.dependencies || {}).forEach(function (key) { - rv.dependencies[key] = readWrap(newwrap.dependencies[key]) - }) - - // fold in devDependencies if not already present, at top level - if (opts && opts.dev) { - Object.keys(data.devDependencies || {}).forEach(function (k) { - rv.dependencies[k] = rv.dependencies[k] || data.devDependencies[k] + } + postInstallSteps.push( + [this, this.printInstalled]) + + var self = this + chain(installSteps, function (installEr) { + if (installEr) self.failing = true + chain(postInstallSteps, function (postInstallEr) { + if (self.idealTree) { + self.idealTree.warnings.forEach(function (warning) { + if (warning.code === 'EPACKAGEJSON' && self.global) return + if (warning.code === 'ENOTDIR') return + log.warn(warning.code, warning.message) }) } - - log.verbose("readDependencies returned deps", rv.dependencies) - return cb(null, rv, newwrap.dependencies) + if (installEr && postInstallEr) { + log.warn('error', postInstallEr.message) + log.verbose('error', postInstallEr.stack) + } + cb(installEr || postInstallEr, self.getInstalledModules(), self.idealTree) }) }) } -function readWrap (w) { - return (w.resolved) ? w.resolved - : (w.from && url.parse(w.from).protocol) ? w.from - : w.version +Installer.prototype.loadArgMetadata = function (next) { + var self = this + getAllMetadata(this.args, this.currentTree, iferr(next, function (args) { + self.args = args + next() + })) } -// if the -S|--save option is specified, then write installed packages -// as dependencies to a package.json file. -function save (where, installed, tree, pretty, hasArguments, cb) { - if (!hasArguments || - !npm.config.get("save") && - !npm.config.get("save-dev") && - !npm.config.get("save-optional") || - npm.config.get("global")) { - return cb(null, installed, tree, pretty) +Installer.prototype.newTracker = function (tracker, name, size) { + validate('OS', [tracker, name]) + if (size) validate('N', [size]) + this.progress[name] = tracker.newGroup(name, size) + var self = this + return function (next) { + self.progress[name].silly(name, 'Starting') + next() } +} - 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") +Installer.prototype.finishTracker = function (name, cb) { + validate('SF', arguments) + this.progress[name].silly(name, 'Finishing') + this.progress[name].finish() + cb() +} - asyncMap(Object.keys(tree), function (k, cb) { - // if "from" is remote, git, or hosted, then save that instead. - var t = tree[k] - , f = npa(t.from) - , a = npa(t.what) - , w = [a.name, a.spec] +Installer.prototype.loadCurrentTree = function (cb) { + validate('F', arguments) + log.silly('install', 'loadCurrentTree') + var todo = [] + if (this.global) { + todo.push([this, this.readGlobalPackageData]) + } else { + todo.push([this, this.readLocalPackageData]) + } + todo.push( + [this, this.normalizeTree, log.newGroup('normalizeTree')]) + chain(todo, cb) +} +Installer.prototype.loadIdealTree = function (cb) { + validate('F', arguments) + log.silly('install', 'loadIdealTree') - fs.stat(t.from, function (er){ - if (!er) { - w[1] = "file:" + t.from - } else if (['hosted', 'git', 'remote'].indexOf(f.type) !== -1) { - 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") - ? savePrefix : "" - set[k[0]] = rangeDescriptor + k[1] - 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 - } + chain([ + [this.newTracker(this.progress.loadIdealTree, 'cloneCurrentTree')], + [this, this.cloneCurrentTreeToIdealTree], + [this, this.finishTracker, 'cloneCurrentTree'], - if (er) { - return cb(null, installed, tree, pretty) - } + [this.newTracker(this.progress.loadIdealTree, 'loadShrinkwrap')], + [this, this.loadShrinkwrap], + [this, this.finishTracker, 'loadShrinkwrap'], - var deps = npm.config.get("save-optional") ? "optionalDependencies" - : npm.config.get("save-dev") ? "devDependencies" - : "dependencies" + [this.newTracker(this.progress.loadIdealTree, 'loadAllDepsIntoIdealTree', 10)], + [this, this.loadAllDepsIntoIdealTree], + [this, this.finishTracker, 'loadAllDepsIntoIdealTree'], - if (saveBundle) { - var bundle = data.bundleDependencies || data.bundledDependencies - delete data.bundledDependencies - if (!Array.isArray(bundle)) bundle = [] - data.bundleDependencies = bundle.sort() - } + [this, function (next) { recalculateMetadata(this.idealTree, log, next) }], + [this, this.debugTree, 'idealTree:prePrune', 'idealTree'], + [this, function (next) { next(pruneTree(this.idealTree)) }] + ], cb) +} - log.verbose("save", "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() - } - }) +Installer.prototype.loadAllDepsIntoIdealTree = function (cb) { + validate('F', arguments) + log.silly('install', 'loadAllDepsIntoIdealTree') + var saveDeps = getSaveType(this.args) + + var cg = this.progress.loadAllDepsIntoIdealTree + var installNewModules = !!this.args.length + var steps = [] + + if (installNewModules) { + steps.push([validateArgs, this.idealTree, this.args]) + steps.push([loadRequestedDeps, this.args, this.idealTree, saveDeps, cg.newGroup('loadRequestedDeps')]) + } else { + if (this.prod) { + steps.push( + [loadDeps, this.idealTree, cg.newGroup('loadDeps')]) + } + if (this.dev) { + steps.push( + [loadDevDeps, this.idealTree, cg.newGroup('loadDevDeps')]) + } + } + steps.push( + [loadExtraneous.andResolveDeps, this.idealTree, cg.newGroup('loadExtraneous')]) + chain(steps, cb) +} - data[deps] = sortedObject(data[deps]) +Installer.prototype.generateActionsToTake = function (cb) { + validate('F', arguments) + log.silly('install', 'generateActionsToTake') + var cg = this.progress.generateActionsToTake + chain([ + [validateTree, this.idealTree, cg.newGroup('validateTree')], + [diffTrees, this.currentTree, this.idealTree, this.differences, cg.newGroup('diffTrees')], + [this, this.computeLinked], + [filterInvalidActions, this.where, this.differences], + [checkPermissions, this.differences], + [decomposeActions, this.differences, this.todo] + ], cb) +} - log.silly("save", "writing", saveTarget) - data = JSON.stringify(data, null, 2) + "\n" - writeFileAtomic(saveTarget, data, function (er) { - cb(er, installed, tree, pretty) - }) +Installer.prototype.computeLinked = function (cb) { + validate('F', arguments) + if (!this.link || this.global) return cb() + var linkTodoList = [] + var self = this + asyncMap(this.differences, function (action, next) { + var cmd = action[0] + var pkg = action[1] + if (cmd !== 'add' && cmd !== 'update') return next() + var isReqByTop = pkg.package._requiredBy.filter(function (name) { return name === '/' }).length + var isReqByUser = pkg.package._requiredBy.filter(function (name) { return name === '#USER' }).length + var isExtraneous = pkg.package._requiredBy.length === 0 + if (!isReqByTop && !isReqByUser && !isExtraneous) return next() + isLinkable(pkg, function (install, link) { + if (install) linkTodoList.push(['global-install', pkg]) + if (link) linkTodoList.push(['global-link', pkg]) + if (install || link) { + pkg.parent.children = pkg.parent.children.filter(function (child) { return child !== pkg }) + } + next() }) + }, function () { + if (linkTodoList.length === 0) return cb() + pruneTree(self.idealTree) + self.differences.length = 0 + Array.prototype.push.apply(self.differences, linkTodoList) + diffTrees(self.currentTree, self.idealTree, self.differences, log.newGroup('d2'), cb) }) } - -// Outputting *all* the installed modules is a bit confusing, -// because the length of the path does not make it clear -// 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) { - 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 = 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 = 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] - }).reduce(red, {}) - return o +function isLinkable (pkg, cb) { + var globalPackage = path.resolve(npm.globalPrefix, 'lib', 'node_modules', moduleName(pkg)) + var globalPackageJson = path.resolve(globalPackage, 'package.json') + fs.stat(globalPackage, function (er) { + if (er) return cb(true, true) + fs.readFile(globalPackageJson, function (er, data) { + var json = parseJSON.noExceptions(data) + cb(false, json && json.version === pkg.package.version) }) - - return JSON.stringify(tree, null, 2) - } - if (npm.config.get("parseable")) return parseable(installed) - - return Object.keys(tree).map(function (p) { - return archy({ label: tree[p].what + " " + p - , nodes: (tree[p].children || []).map(function P (c) { - if (npm.config.get("long")) { - return { label: c.what, nodes: c.children.map(P) } - } - var g = c.children.map(function (g) { - return g.what - }).join(", ") - if (g) g = " (" + g + ")" - return c.what + g - }) - }, "", { unicode: npm.config.get("unicode") }) - }).join("\n") + }) } -function parseable (installed) { - var long = npm.config.get("long") - , cwd = process.cwd() - return installed.map(function (item) { - return path.resolve(cwd, item[1]) + - ( long ? ":" + item[0] : "" ) - }).join("\n") -} +Installer.prototype.executeActions = function (cb) { + validate('F', arguments) + log.silly('install', 'executeActions') + var todo = this.todo + var cg = this.progress.executeActions + + var node_modules = path.resolve(this.where, 'node_modules') + var staging = path.resolve(node_modules, '.staging') + var steps = [] + var trackLifecycle = cg.newGroup('lifecycle') + + cb = unlockCB(node_modules, '.staging', cb) + + steps.push( + [doSerialActions, 'global-install', staging, todo, trackLifecycle.newGroup('global-install')], + [doParallelActions, 'fetch', staging, todo, cg.newGroup('fetch', 10)], + [lock, node_modules, '.staging'], + [rimraf, staging], + [mkdirp, staging], + [doParallelActions, 'extract', staging, todo, cg.newGroup('extract', 10)], + [doParallelActions, 'preinstall', staging, todo, trackLifecycle.newGroup('preinstall')], + [doReverseSerialActions, 'remove', staging, todo, cg.newGroup('remove')], + // FIXME: We do this here to commit the removes prior to trying to move + // anything into place. Once we can rollback removes we should find + // a better solution for this. + // This is to protect against cruft in the node_modules folder (like dot files) + // that stop it from being removed. + [this, this.commit, staging, this.todo], + [doSerialActions, 'move', staging, todo, cg.newGroup('move')], + [doSerialActions, 'finalize', staging, todo, cg.newGroup('finalize')], + [doSerialActions, 'build', staging, todo, trackLifecycle.newGroup('build')], + [doSerialActions, 'global-link', staging, todo, trackLifecycle.newGroup('global-link')], + [doParallelActions, 'update-linked', staging, todo, trackLifecycle.newGroup('update-linked')], + [doSerialActions, 'install', staging, todo, trackLifecycle.newGroup('install')], + [doSerialActions, 'postinstall', staging, todo, trackLifecycle.newGroup('postinstall')]) + if (this.npat) { + steps.push( + [doParallelActions, 'test', staging, todo, trackLifecycle.newGroup('npat')]) + } -function treeify (installed) { - // each item is [what, where, parent, parentDir] - // If no parent, then report it. - // otherwise, tack it into the parent's children list. - // If the parent isn't a top-level then ignore it. - var whatWhere = installed.reduce(function (l, r) { - var parentDir = r[3] - , parent = r[2] - , where = r[1] - , what = r[0] - , from = r[4] - l[where] = { parentDir: parentDir - , parent: parent - , children: [] - , where: where - , what: what - , from: from } - return l - }, {}) - - // log.warn("install", whatWhere, "whatWhere") - return Object.keys(whatWhere).reduce(function (l, r) { - var ww = whatWhere[r] - //log.warn("r, ww", [r, ww]) - if (!ww.parent) { - l[r] = ww + var self = this + chain(steps, function (er) { + if (!er || self.rollback) { + rimraf(staging, function () { cb(er) }) } else { - var p = whatWhere[ww.parentDir] - if (p) p.children.push(ww) - else l[r] = ww + cb(er) } - return l - }, {}) + }) } +Installer.prototype.rollbackFailedOptional = function (staging, actionsToRun, cb) { + if (!this.rollback) return cb() + var failed = actionsToRun.map(function (action) { + return action[1] + }).filter(function (pkg) { + return pkg.failed && pkg.rollback + }) + asyncMap(failed, function (pkg, next) { + asyncMap(pkg.rollback, function (rollback, done) { + rollback(staging, pkg, done) + }, next) + }, cb) +} -// just like installMany, but also add the existing packages in -// where/node_modules to the family object. -function installManyTop (what, where, context, cb_) { - function cb (er, d) { - if (context.explicit || er) return cb_(er, d) - // since this wasn't an explicit install, let's build the top - // folder, so that `npm install` also runs the lifecycle scripts. - npm.commands.build([where], false, true, function (er) { - return cb_(er, d) +Installer.prototype.commit = function (staging, actionsToRun, cb) { + var toCommit = actionsToRun.map(function (action) { return action[1] }).filter(function (pkg) { return !pkg.failed && pkg.commit }) + asyncMap(toCommit, function (pkg, next) { + asyncMap(pkg.commit, function (commit, done) { + commit(staging, pkg, done) + }, function () { + pkg.commit = [] + next.apply(null, arguments) }) - } - - if (context.explicit) return next() + }, cb) +} - var jsonPath = path.join(where, 'package.json') - log.verbose('installManyTop', 'reading for lifecycle', jsonPath) - readJson(jsonPath, log.warn, function (er, data) { - if (er) return next(er) - lifecycle(data, "preinstall", where, next) - }) +Installer.prototype.runTopLevelLifecycles = function (cb) { + validate('F', arguments) + if (this.failing) return cb() + log.silly('install', 'runTopLevelLifecycles') + var steps = [] + var trackLifecycle = this.progress.runTopLevelLifecycles + if (!this.topLevelLifecycles) { + trackLifecycle.finish() + return cb() + } - function next (er) { - if (er) return cb(er) - installManyTop_(what, where, context, cb) + steps.push( + [doOneAction, 'preinstall', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('preinstall:.')], + [doOneAction, 'build', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('build:.')], + [doOneAction, 'install', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('install:.')], + [doOneAction, 'postinstall', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('postinstall:.')]) + if (this.npat) { + steps.push( + [doOneAction, 'test', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('npat:.')]) + } + if (this.dev) { + steps.push( + [doOneAction, 'prepublish', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('prepublish')]) } + chain(steps, cb) } -function installManyTop_ (what, where, context, cb) { - var nm = path.resolve(where, "node_modules") - - fs.readdir(nm, function (er, pkgs) { - if (er) return installMany(what, where, context, cb) - - var scopes = [], unscoped = [] - pkgs.filter(function (p) { - return !p.match(/^[\._-]/) - }).forEach(function (p) { - // @names deserve deeper investigation - if (p[0] === "@") { - scopes.push(p) - } - else { - unscoped.push(p) - } - }) - - maybeScoped(scopes, nm, function (er, scoped) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - // recombine unscoped with @scope/package packages - asyncMap(unscoped.concat(scoped).map(function (p) { - return path.resolve(nm, p, "package.json") - }), function (jsonPath, cb) { - log.verbose('installManyTop', 'reading scoped package data from', jsonPath) - readJson(jsonPath, log.info, function (er, data) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - if (er) return cb(null, []) - cb(null, [[data.name, data.version]]) - }) - }, function (er, packages) { - // if there's nothing in node_modules, then don't freak out. - if (er) packages = [] - // add all the existing packages to the family list. - // however, do not add to the ancestors list. - packages.forEach(function (p) { - context.family[p[0]] = p[1] - }) - installMany(what, where, context, cb) - }) - }) - }) +Installer.prototype.saveToDependencies = function (cb) { + validate('F', arguments) + if (this.failing) return cb() + log.silly('install', 'saveToDependencies') + saveRequested(this.args, this.idealTree, cb) } -function maybeScoped (scopes, where, cb) { - // find packages in scopes - asyncMap(scopes, function (scope, cb) { - fs.readdir(path.resolve(where, scope), function (er, scoped) { - if (er) return cb(er) - var paths = scoped.map(function (p) { - return path.join(scope, p) +Installer.prototype.readGlobalPackageData = function (cb) { + validate('F', arguments) + log.silly('install', 'readGlobalPackageData') + var self = this + this.loadArgMetadata(iferr(cb, function () { + mkdirp(self.where, iferr(cb, function () { + var pkgs = {} + self.args.forEach(function (pkg) { + pkgs[pkg.name] = true }) - cb(null, paths) - }) - }, cb) + readPackageTree(self.where, function (ctx, kid) { return ctx.parent || pkgs[kid] }, iferr(cb, function (currentTree) { + self.currentTree = currentTree + return cb() + })) + })) + })) } -function installMany (what, where, context, cb) { - // readDependencies takes care of figuring out whether the list of - // dependencies we'll iterate below comes from an existing shrinkwrap from a - // parent level, a new shrinkwrap at this level, or package.json at this - // level, as well as which shrinkwrap (if any) our dependencies should use. - var opt = { dev: npm.config.get("dev") } - readDependencies(context, where, opt, function (er, data, wrap) { - if (er) data = {} - - var parent = data - - // if we're explicitly installing "what" into "where", then the shrinkwrap - // for "where" doesn't apply. This would be the case if someone were adding - // a new package to a shrinkwrapped package. (data.dependencies will not be - // used here except to indicate what packages are already present, so - // there's no harm in using that.) - if (context.explicit) wrap = null - - var deps = data.dependencies || {} - var devDeps = data.devDependencies || {} - - // what is a list of things. - // resolve each one. - asyncMap( what - , targetResolver(where, context, deps, devDeps) - , function (er, targets) { - - if (er) return cb(er) - - var bundled = data.bundleDependencies || data.bundledDependencies || [] - // only take the hit for readInstalled if there are probably bundled - // dependencies to read - if (bundled.length) { - readInstalled(where, { dev: true }, andBuildResolvedTree) - } else { - andBuildResolvedTree() +Installer.prototype.readLocalPackageData = function (cb) { + validate('F', arguments) + log.silly('install', 'readLocalPackageData') + var self = this + mkdirp(this.where, iferr(cb, function () { + readPackageTree(self.where, iferr(cb, function (currentTree) { + self.currentTree = currentTree + self.currentTree.warnings = [] + if (!self.noPackageJsonOk && !currentTree.package) { + log.error('install', "Couldn't read dependencies") + var er = new Error("ENOENT, open '" + path.join(self.where, 'package.json') + "'") + er.code = 'ENOPACKAGEJSON' + er.errno = 34 + return cb(er) } - - function andBuildResolvedTree (er, current) { - if (er) return cb(er) - - // each target will be a data object corresponding - // to a package, folder, or whatever that is in the cache now. - var newPrev = Object.create(context.family) - , newAnc = Object.create(context.ancestors) - - if (!context.root) { - newAnc[data.name] = data.version - } - bundled.forEach(function (bundle) { - var bundleData = current.dependencies[bundle] - if ((!bundleData || !bundleData.version) && current.devDependencies) { - log.verbose( - 'installMany', bundle, 'was bundled with', - data.name + '@' + data.version + - ", but wasn't found in dependencies. Trying devDependencies" - ) - bundleData = current.devDependencies[bundle] - } - - if (!bundleData || !bundleData.version) { - log.warn( - 'installMany', bundle, 'was bundled with', - data.name + '@' + data.version + - ", but bundled package wasn't found in unpacked tree" - ) - } else { - log.verbose( - 'installMany', bundle + '@' + bundleData.version, - 'was bundled with', data.name + '@' + data.version - ) - newPrev[bundle] = bundleData.version + if (!currentTree.package) currentTree.package = {} + self.loadArgMetadata(iferr(cb, function () { + if (currentTree.package._shrinkwrap) return cb() + fs.readFile(path.join(self.where, 'npm-shrinkwrap.json'), function (er, data) { + if (er) return cb() + try { + currentTree.package._shrinkwrap = parseJSON(data) + } catch (ex) { + return cb(ex) } + return cb() }) - targets.forEach(function (t) { - newPrev[t.name] = t.version - }) - log.silly("install resolved", targets) - targets.filter(function (t) { return t }).forEach(function (t) { - log.info("install", "%s into %s", t._id, where) - }) - asyncMap(targets, function (target, cb) { - log.info("installOne", target._id) - var wrapData = wrap ? wrap[target.name] : null - var newWrap = wrapData && wrapData.dependencies - ? wrap[target.name].dependencies || {} - : null - var newContext = { family: newPrev - , ancestors: newAnc - , parent: parent - , explicit: false - , wrap: newWrap } - installOne(target, where, newContext, cb) - }, cb) - } - }) - }) + })) + })) + })) } -function targetResolver (where, context, deps, devDeps) { - var alreadyInstalledManually = [] - , resolveLeft = 0 - , nm = path.resolve(where, "node_modules") - , parent = context.parent - , wrap = context.wrap - - if (!context.explicit) readdir(nm) - - function readdir(name) { - resolveLeft++ - fs.readdir(name, function (er, inst) { - if (er) return resolveLeft-- - - // don't even mess with non-package looking things - inst = inst.filter(function (p) { - if (!p.match(/^[@\._-]/)) return true - // scoped packages - readdir(path.join(name, p)) - }) - - asyncMap(inst, function (pkg, cb) { - var jsonPath = path.resolve(name, pkg, 'package.json') - log.verbose('targetResolver', 'reading package data from', jsonPath) - readJson(jsonPath, log.info, 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 - var isBundled = bd && bd.indexOf(d.name) !== -1 - var expectedVersion = deps[d.name] || (devDeps && devDeps[d.name]) || "*" - var currentIsSatisfactory = semver.satisfies(d.version, expectedVersion, true) - if (isBundled || currentIsSatisfactory || deps[d.name] === d._resolved) { - return cb(null, d.name) - } - - // 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) - } +Installer.prototype.cloneCurrentTreeToIdealTree = function (cb) { + validate('F', arguments) + log.silly('install', 'cloneCurrentTreeToIdealTree') + this.idealTree = copyTree(this.currentTree) + this.idealTree.warnings = [] + cb() +} - // 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-- - }) - }) +Installer.prototype.loadShrinkwrap = function (cb) { + validate('F', arguments) + log.silly('install', 'loadShrinkwrap') + var installNewModules = !!this.args.length + if (installNewModules) { + readShrinkwrap(this.idealTree, cb) + } else { + readShrinkwrap.andInflate(this.idealTree, cb) } +} - var to = 0 - return function resolver (what, cb) { - 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(npa(what).name) !== -1) { - log.verbose("already installed", "skipping %s %s", what, where) - return cb(null, []) - } - - // check for a version installed higher in the tree. - // If installing from a shrinkwrap, it must match exactly. - if (context.family[what]) { - log.verbose('install', what, 'is installed as', context.family[what]) - if (wrap && wrap[what].version === context.family[what]) { - log.verbose("shrinkwrap", "use existing", what) - return cb(null, []) - } - } - - // if it's identical to its parent, then it's probably someone - // doing `npm install foo` inside of the foo project. Print - // a warning, and skip it. - if (parent && parent.name === what && !npm.config.get("force")) { - log.warn("install", "Refusing to install %s as a dependency of itself" - , what) - return cb(null, []) - } - - if (wrap) { - var name = npa(what).name - if (wrap[name]) { - var wrapTarget = readWrap(wrap[name]) - what = name + "@" + wrapTarget - } else { - log.verbose("shrinkwrap", "skipping %s (not in shrinkwrap)", what) - } - } else if (deps[what]) { - what = what + "@" + deps[what] - } - - // This is where we actually fetch the package, if it's not already - // in the cache. - // If it's a git repo, then we want to install it, even if the parent - // 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. - 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(npa(what).name)) { - log.warn("optional dep failed, continuing", what) - log.verbose("optional dep failed, continuing", [what, er]) - return cb(null, []) - } - - var type = npa(what).type - var isGit = type === "git" || type === "hosted" - - if (!er && - data && - !context.explicit && - context.family[data.name] === data.version && - !npm.config.get("force") && - !isGit) { - log.info("already installed", data.name + "@" + data.version) - return cb(null, []) +Installer.prototype.normalizeTree = function (log, cb) { + validate('OF', arguments) + log.silly('install', 'normalizeTree') + recalculateMetadata(this.currentTree, log, iferr(cb, function (tree) { + tree.children.forEach(function (child) { + if (child.package._requiredBy.length === 0) { + child.package._requiredBy.push('#EXISTING') } - - - if (data && !data._from) data._from = what - if (er && parent && parent.name) er.parent = parent.name - return cb(er, data || []) }) - } + cb(null, tree) + })) } -// we've already decided to install this. if anything's in the way, -// then uninstall it first. -function installOne (target, where, context, cb) { - // the --link flag makes this a "link" command if it's at the - // the top level. - var isGit = false - var type = npa(target._from).type - if (target && target._from) isGit = type === 'git' || type === 'hosted' - - if (where === npm.prefix && npm.config.get("link") - && !npm.config.get("global") && !isGit) { - return localLink(target, where, context, cb) - } - installOne_(target, where, context, function (er, installedWhat) { - - // check if this one is optional to its parent. - if (er && context.parent && context.parent.optionalDependencies && - context.parent.optionalDependencies.hasOwnProperty(target.name)) { - log.warn("optional dep failed, continuing", target._id) - log.verbose("optional dep failed, continuing", [target._id, er]) - er = null - } - - cb(er, installedWhat) +Installer.prototype.getInstalledModules = function () { + return this.differences.filter(function (action) { + var mutation = action[0] + return (mutation === 'add' || mutation === 'update') + }).map(function (action) { + var child = action[1] + return [child.package._id, child.path] }) - } -function localLink (target, where, context, cb) { - log.verbose("localLink", target._id) - var jsonPath = path.resolve(npm.globalDir, target.name , 'package.json') - var parent = context.parent - - log.verbose('localLink', 'reading data to link', target.name, 'from', jsonPath) - readJson(jsonPath, 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) { - install( path.resolve(npm.globalDir, "..") - , target._id - , function (er) { - if (er) return cb(er, []) - thenLink() - }) - } else thenLink() - } else { - log.verbose("localLink", "install locally (no link)", target._id) - installOne_(target, where, context, cb) +Installer.prototype.printInstalled = function (cb) { + validate('F', arguments) + log.silly('install', 'printInstalled') + var self = this + log.clearProgress() + this.differences.forEach(function (action) { + var mutation = action[0] + var child = action[1] + var name = packageId(child) + var where = path.relative(self.where, child.path) + if (mutation === 'remove') { + console.log('- ' + name + ' ' + where) + } else if (mutation === 'move') { + var oldWhere = path.relative(self.where, child.fromPath) + console.log(name + ' ' + oldWhere + ' -> ' + where) } }) -} - -function resultList (target, where, parentId) { - var nm = path.resolve(where, "node_modules") - , targetFolder = path.resolve(nm, target.name) - , prettyWhere = where - - if (!npm.config.get("global")) { - prettyWhere = path.relative(process.cwd(), where) - } - - if (prettyWhere === ".") prettyWhere = null - - if (!npm.config.get("global")) { - // print out the folder relative to where we are right now. - targetFolder = path.relative(process.cwd(), targetFolder) - } - - return [ target._id - , targetFolder - , prettyWhere && parentId - , parentId && prettyWhere - , target._from ] -} - -var installed = Object.create(null) - -function installOne_ (target, where, context, cb_) { - var nm = path.resolve(where, "node_modules") - , targetFolder = path.resolve(nm, target.name) - , prettyWhere = path.relative(process.cwd(), where) - , parent = context.parent - - if (prettyWhere === ".") prettyWhere = null - - cb_ = inflight(target.name + ":" + where, cb_) - if (!cb_) { - return log.verbose("installOne", "of", target.name, "to", where, "already in flight; waiting") - } - else { - log.verbose("installOne", "of", target.name, "to", where, "not in flight; installing") - } - - function cb(er, data) { - unlock(nm, target.name, function () { cb_(er, data) }) - } - - lock(nm, target.name, function (er) { - if (er) return cb(er) - - if (targetFolder in installed) { - log.error("install", "trying to install", target.version, "to", targetFolder) - log.error("install", "but already installed versions", installed[targetFolder]) - installed[targetFolder].push(target.version) - } - else { - installed[targetFolder] = [target.version] - } - - var force = npm.config.get("force") - , nodeVersion = npm.config.get("node-version") - , strict = npm.config.get("engine-strict") - , c = npmInstallChecks - - chain( - [ [c.checkEngine, target, npm.version, nodeVersion, force, strict] - , [c.checkPlatform, target, force] - , [c.checkCycle, target, context.ancestors] - , [c.checkGit, targetFolder] - , [write, target, targetFolder, context] ] - , function (er, d) { - if (er) return cb(er) - - d.push(resultList(target, where, parent && parent._id)) - cb(er, d) - } - ) + var addedOrMoved = this.differences.filter(function (action) { + var mutation = action[0] + var child = action[1] + return !child.failed && (mutation === 'add' || mutation === 'update') + }).map(function (action) { + var child = action[1] + return packageId(child) }) -} - -function write (target, targetFolder, context, cb_) { - var up = npm.config.get("unsafe-perm") - , user = up ? null : npm.config.get("user") - , group = up ? null : npm.config.get("group") - , family = context.family - - function cb (er, data) { - // cache.unpack returns the data object, and all we care about - // is the list of installed packages from that last thing. - if (!er) return cb_(er, data) - - if (npm.config.get("rollback") === false) return cb_(er) - npm.rollbacks.push(targetFolder) - cb_(er, data) - } - - var bundled = [] - - log.silly("install write", "writing", target.name, target.version, "to", targetFolder) - chain( - [ [ cache.unpack, target.name, target.version, targetFolder, null, null, user, group ], - function writePackageJSON (cb) { - var jsonPath = path.resolve(targetFolder, 'package.json') - log.verbose('write', 'writing to', jsonPath) - writeFileAtomic(jsonPath, JSON.stringify(target, null, 2) + '\n', cb) - }, - [ lifecycle, target, "preinstall", targetFolder ], - function collectBundled (cb) { - if (!target.bundleDependencies) return cb() - - var bd = path.resolve(targetFolder, "node_modules") - fs.readdir(bd, function (er, b) { - // nothing bundled, maybe - if (er) return cb() - bundled = b || [] - cb() - }) - } ] - - // nest the chain so that we can throw away the results returned - // up until this point, since we really don't care about it. - , function X (er) { - if (er) return cb(er) - - // before continuing to installing dependencies, check for a shrinkwrap. - var opt = { dev: npm.config.get("dev") } - readDependencies(context, targetFolder, opt, function (er, data, wrap) { - if (er) return cb(er); - var deps = prepareForInstallMany(data, "dependencies", bundled, wrap, - family) - var depsTargetFolder = targetFolder - var depsContext = { family: family - , ancestors: context.ancestors - , parent: target - , explicit: false - , wrap: wrap } - - var actions = - [ [ installManyAndBuild, deps, depsTargetFolder, depsContext ] ] - - // FIXME: This is an accident waiting to happen! - // - // 1. If multiple children at the same level of the tree share a - // peerDependency that's not in the parent's dependencies, because - // the peerDeps don't get added to the family, they will keep - // getting reinstalled (worked around by inflighting installOne). - // 2. The installer can't safely build at the parent level because - // that's already being done by the parent's installAndBuild. This - // runs the risk of the peerDependency never getting built. - // - // The fix: Don't install peerDependencies; require them to be - // included as explicit dependencies / devDependencies, and warn - // or error when they're missing. See #5080 for more arguments in - // favor of killing implicit peerDependency installs with fire. - var peerDeps = prepareForInstallMany(data, "peerDependencies", bundled, - wrap, family) - peerDeps.forEach(function (pd) { - warnPeers([ - "The peer dependency "+pd+" included from "+data.name+" will no", - "longer be automatically installed to fulfill the peerDependency ", - "in npm 3+. Your application will need to depend on it explicitly." - ], pd+","+data.name) - }) - - // Package scopes cause an addditional tree level which needs to be - // considered when resolving a peerDependency's target folder. - var pdTargetFolder - if (npa(target.name).scope) { - pdTargetFolder = path.resolve(targetFolder, '../../..') - } else { - pdTargetFolder = path.resolve(targetFolder, '../..') - } - - var pdContext = context - if (peerDeps.length > 0) { - actions.push( - [ installMany, peerDeps, pdTargetFolder, pdContext ] - ) - } - - chain(actions, cb) - }) + log.showProgress() + if (!addedOrMoved.length) return cb() + recalculateMetadata(this.idealTree, log, iferr(cb, function (tree) { + log.clearProgress() + ls.fromTree(self.where, tree, addedOrMoved, false, function () { + log.showProgress() + cb() }) + })) } -function installManyAndBuild (deps, targetFolder, context, cb) { - installMany(deps, targetFolder, context, function (er, d) { - log.verbose("about to build", targetFolder) - if (er) return cb(er) - npm.commands.build( [targetFolder] - , npm.config.get("global") - , true - , function (er) { return cb(er, d) }) +Installer.prototype.debugActions = function (name, actionListName, cb) { + validate('SSF', arguments) + var actionsToLog = this[actionListName] + log.silly(name, 'action count', actionsToLog.length) + actionsToLog.forEach(function (action) { + log.silly(name, action.map(function (value) { + return (value && value.package) ? packageId(value) : value + }).join(' ')) }) + cb() } -function prepareForInstallMany (packageData, depsKey, bundled, wrap, family) { - var deps = Object.keys(packageData[depsKey] || {}) +// This takes an object and a property name instead of a value to allow us +// to define the arguments for use by chain before the property exists yet. +Installer.prototype.debugTree = function (name, treeName, cb) { + validate('SSF', arguments) + log.silly(name, this.prettify(this[treeName]).trim()) + cb() +} - // don't install bundleDependencies, unless they're missing. - if (packageData.bundleDependencies) { - deps = deps.filter(function (d) { - return packageData.bundleDependencies.indexOf(d) === -1 || - bundled.indexOf(d) === -1 - }) +Installer.prototype.prettify = function (tree) { + validate('O', arguments) + var seen = {} + function byName (aa, bb) { + return packageId(aa).localeCompare(packageId(bb)) } - - return deps.filter(function (d) { - // prefer to not install things that are satisfied by - // something in the "family" list, unless we're installing - // from a shrinkwrap. - if (wrap) return wrap - if (semver.validRange(family[d], true)) { - return !semver.satisfies(family[d], packageData[depsKey][d], true) + function expandTree (tree) { + seen[tree.path] = true + return { + label: packageId(tree), + nodes: tree.children.filter(function (tree) { return !seen[tree.path] }).sort(byName).map(expandTree) } - return true - }).map(function (d) { - var v = packageData[depsKey][d] - var t = d + "@" + v - log.silly("prepareForInstallMany", "adding", t, "from", packageData.name, depsKey) - return t - }) + } + return archy(expandTree(tree), '', { unicode: npm.config.get('unicode') }) } diff --git a/deps/npm/lib/install/access-error.js b/deps/npm/lib/install/access-error.js new file mode 100644 index 00000000000000..ff94be98576379 --- /dev/null +++ b/deps/npm/lib/install/access-error.js @@ -0,0 +1,8 @@ +'use strict' +module.exports = function (dir, er) { + if (!er) return + var accessEr = new Error("EACCES, access '" + dir + "'", -13) + accessEr.code = 'EACCES' + accessEr.path = dir + return accessEr +} diff --git a/deps/npm/lib/install/action/build.js b/deps/npm/lib/install/action/build.js new file mode 100644 index 00000000000000..ffb870d6865888 --- /dev/null +++ b/deps/npm/lib/install/action/build.js @@ -0,0 +1,13 @@ +'use strict' +var chain = require('slide').chain +var build = require('../../build.js') +var npm = require('../../npm.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('build', packageId(pkg)) + chain([ + [build.linkStuff, pkg.package, pkg.path, npm.config.get('global'), true], + [build.writeBuiltinConf, pkg.package, pkg.path] + ], next) +} diff --git a/deps/npm/lib/install/action/extract.js b/deps/npm/lib/install/action/extract.js new file mode 100644 index 00000000000000..b427768498461e --- /dev/null +++ b/deps/npm/lib/install/action/extract.js @@ -0,0 +1,19 @@ +'use strict' +var updatePackageJson = require('../update-package-json') +var npm = require('../../npm.js') +var packageId = require('../../utils/package-id.js') +var cache = require('../../cache.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('extract', packageId(pkg)) + var up = npm.config.get('unsafe-perm') + var user = up ? null : npm.config.get('user') + var group = up ? null : npm.config.get('group') + cache.unpack(pkg.package.name, pkg.package.version + , buildpath + , null, null, user, group, + function (er) { + if (er) return next(er) + updatePackageJson(pkg, buildpath, next) + }) +} diff --git a/deps/npm/lib/install/action/fetch.js b/deps/npm/lib/install/action/fetch.js new file mode 100644 index 00000000000000..a706b1967b172d --- /dev/null +++ b/deps/npm/lib/install/action/fetch.js @@ -0,0 +1,29 @@ +'use strict' +// var cache = require('../../cache.js') +// var packageId = require('../../utils/package-id.js') +// var moduleName = require('../../utils/module-name.js') + +module.exports = function (top, buildpath, pkg, log, next) { + next() +/* +// FIXME: Unnecessary as long as we have to have the tarball to resolve all deps, which +// is progressively seeming to be likely for the indefinite future. +// ALSO fails for local deps specified with relative URLs outside of the top level. + + var name = moduleName(pkg) + var version + switch (pkg.package._requested.type) { + case 'version': + case 'range': + version = pkg.package.version + break + case 'hosted': + name = name + '@' + pkg.package._requested.spec + break + default: + name = pkg.package._requested.raw + } + log.silly('fetch', packageId(pkg)) + cache.add(name, version, top, false, next) +*/ +} diff --git a/deps/npm/lib/install/action/finalize.js b/deps/npm/lib/install/action/finalize.js new file mode 100644 index 00000000000000..08e9c149c46349 --- /dev/null +++ b/deps/npm/lib/install/action/finalize.js @@ -0,0 +1,120 @@ +'use strict' +var path = require('path') +var rimraf = require('rimraf') +var fs = require('graceful-fs') +var mkdirp = require('mkdirp') +var asyncMap = require('slide').asyncMap +var iferr = require('iferr') + +function getTree (pkg) { + while (pkg.parent) pkg = pkg.parent + return pkg +} + +function warn (pkg, code, msg) { + var tree = getTree(pkg) + var err = new Error(msg) + err.code = code + tree.warnings.push(err) +} + +function pathToShortname (modpath) { + return modpath.replace(/node_modules[/]/g, '').replace(/[/]/g, ' > ') +} + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('finalize', pkg.path) + + var delpath = path.join(path.dirname(pkg.path), '.' + path.basename(pkg.path) + '.DELETE') + + mkdirp(path.resolve(pkg.path, '..'), whenParentExists) + + function whenParentExists (mkdirEr) { + if (mkdirEr) return next(mkdirEr) + // We stat first, because we can't rely on ENOTEMPTY from Windows. + // Windows, by contrast, gives the generic EPERM of a folder already exists. + fs.lstat(pkg.path, destStated) + } + + function destStated (doesNotExist) { + if (doesNotExist) { + fs.rename(buildpath, pkg.path, whenMoved) + } else { + moveAway() + } + } + + function whenMoved (renameEr) { + if (!renameEr) return next() + if (renameEr.code !== 'ENOTEMPTY') return next(renameEr) + moveAway() + } + + function moveAway () { + fs.rename(pkg.path, delpath, whenOldMovedAway) + } + + function whenOldMovedAway (renameEr) { + if (renameEr) return next(renameEr) + fs.rename(buildpath, pkg.path, whenConflictMoved) + } + + function whenConflictMoved (renameEr) { + // if we got an error we'll try to put back the original module back, + // succeed or fail though we want the original error that caused this + if (renameEr) return fs.rename(delpath, pkg.path, function () { next(renameEr) }) + fs.readdir(path.join(delpath, 'node_modules'), makeTarget) + } + + function makeTarget (readdirEr, files) { + if (readdirEr) return cleanup() + if (!files.length) return cleanup() + mkdirp(path.join(pkg.path, 'node_modules'), function (mkdirEr) { moveModules(mkdirEr, files) }) + } + + function moveModules (mkdirEr, files) { + if (mkdirEr) return next(mkdirEr) + asyncMap(files, function (file, done) { + // `from` wins over `to`, because if `from` was there it's because the + // module installer wanted it to be there. By contrast, `to` is just + // whatever was bundled in this module. And the intentions of npm's + // installer should always beat out random module contents. + var from = path.join(delpath, 'node_modules', file) + var to = path.join(pkg.path, 'node_modules', file) + fs.stat(to, function (er, info) { + if (er) return fs.rename(from, to, done) + + var shortname = pathToShortname(path.relative(getTree(pkg).path, to)) + warn(pkg, 'EBUNDLEOVERRIDE', 'Replacing bundled ' + shortname + ' with new installed version') + rimraf(to, iferr(done, function () { + fs.rename(from, to, done) + })) + }) + }, cleanup) + } + + function cleanup (moveEr) { + if (moveEr) return next(moveEr) + rimraf(delpath, afterCleanup) + } + + function afterCleanup (rimrafEr) { + if (rimrafEr) log.warn('finalize', rimrafEr) + next() + } +} + +module.exports.rollback = function (buildpath, pkg, next) { + var top = path.resolve(buildpath, '..') + rimraf(pkg.path, function () { + removeEmptyParents(pkg.path) + }) + function removeEmptyParents (pkgdir) { + if (path.relative(top, pkgdir)[0] === '.') return next() + fs.rmdir(pkgdir, function (er) { + // FIXME: Make sure windows does what we want here + if (er && er.code !== 'ENOENT') return next() + removeEmptyParents(path.resolve(pkgdir, '..')) + }) + } +} diff --git a/deps/npm/lib/install/action/global-install.js b/deps/npm/lib/install/action/global-install.js new file mode 100644 index 00000000000000..a2aa59402568c5 --- /dev/null +++ b/deps/npm/lib/install/action/global-install.js @@ -0,0 +1,17 @@ +'use strict' +var path = require('path') +var npm = require('../../npm.js') +var Installer = require('../../install.js').Installer +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('global-install', packageId(pkg)) + var globalRoot = path.resolve(npm.globalDir, '..') + npm.config.set('global', true) + var install = new Installer(globalRoot, false, [pkg.package.name + '@' + pkg.package._requested.spec]) + install.link = false + install.run(function () { + npm.config.set('global', false) + next.apply(null, arguments) + }) +} diff --git a/deps/npm/lib/install/action/global-link.js b/deps/npm/lib/install/action/global-link.js new file mode 100644 index 00000000000000..daad48e97425ef --- /dev/null +++ b/deps/npm/lib/install/action/global-link.js @@ -0,0 +1,8 @@ +'use strict' +var npm = require('../../npm.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('global-link', packageId(pkg)) + npm.link(pkg.package.name, next) +} diff --git a/deps/npm/lib/install/action/install.js b/deps/npm/lib/install/action/install.js new file mode 100644 index 00000000000000..f7b3295534c8b0 --- /dev/null +++ b/deps/npm/lib/install/action/install.js @@ -0,0 +1,8 @@ +'use strict' +var lifecycle = require('../../utils/lifecycle.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('install', packageId(pkg), buildpath) + lifecycle(pkg.package, 'install', pkg.path, false, false, next) +} diff --git a/deps/npm/lib/install/action/move.js b/deps/npm/lib/install/action/move.js new file mode 100644 index 00000000000000..9bdfbc7bf25577 --- /dev/null +++ b/deps/npm/lib/install/action/move.js @@ -0,0 +1,59 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var chain = require('slide').chain +var iferr = require('iferr') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var rmStuff = require('../../unbuild.js').rmStuff +var lifecycle = require('../../utils/lifecycle.js') +var updatePackageJson = require('../update-package-json') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('move', pkg.fromPath, pkg.path) + chain([ + [lifecycle, pkg.package, 'preuninstall', pkg.fromPath, false, true], + [lifecycle, pkg.package, 'uninstall', pkg.fromPath, false, true], + [rmStuff, pkg.package, pkg.fromPath], + [lifecycle, pkg.package, 'postuninstall', pkg.fromPath, false, true], + [moveModuleOnly, pkg.fromPath, pkg.path], + [lifecycle, pkg.package, 'preinstall', pkg.path, false, true], + [removeEmptyParents, path.resolve(pkg.fromPath, '..')], + [updatePackageJson, pkg, pkg.path] + ], next) +} + +function removeEmptyParents (pkgdir, next) { + fs.rmdir(pkgdir, function (er) { + // FIXME: Make sure windows does what we want here + if (er && er.code !== 'ENOENT') return next() + removeEmptyParents(path.resolve(pkgdir, '..'), next) + }) +} + +function moveModuleOnly (from, to, done) { + var from_modules = path.join(from, 'node_modules') + var temp_modules = from + '.node_modules' + + rimraf(to, iferr(done, makeDestination)) + + function makeDestination () { + mkdirp(path.resolve(to, '..'), iferr(done, moveNodeModules)) + } + + function moveNodeModules () { + fs.rename(from_modules, temp_modules, function (er) { + doMove(er ? done : moveNodeModulesBack) + }) + } + + function doMove (next) { + fs.rename(from, to, iferr(done, next)) + } + + function moveNodeModulesBack () { + mkdirp(from, iferr(done, function () { + fs.rename(temp_modules, from_modules, done) + })) + } +} diff --git a/deps/npm/lib/install/action/postinstall.js b/deps/npm/lib/install/action/postinstall.js new file mode 100644 index 00000000000000..4ca4c8baec272f --- /dev/null +++ b/deps/npm/lib/install/action/postinstall.js @@ -0,0 +1,8 @@ +'use strict' +var lifecycle = require('../../utils/lifecycle.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('postinstall', packageId(pkg), buildpath) + lifecycle(pkg.package, 'postinstall', pkg.path, false, false, next) +} diff --git a/deps/npm/lib/install/action/preinstall.js b/deps/npm/lib/install/action/preinstall.js new file mode 100644 index 00000000000000..abd767016e36ab --- /dev/null +++ b/deps/npm/lib/install/action/preinstall.js @@ -0,0 +1,8 @@ +'use strict' +var lifecycle = require('../../utils/lifecycle.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('preinstall', packageId(pkg), buildpath) + lifecycle(pkg.package, 'preinstall', buildpath, false, false, next) +} diff --git a/deps/npm/lib/install/action/prepublish.js b/deps/npm/lib/install/action/prepublish.js new file mode 100644 index 00000000000000..b9a5a5d6f1ba67 --- /dev/null +++ b/deps/npm/lib/install/action/prepublish.js @@ -0,0 +1,8 @@ +'use strict' +var lifecycle = require('../../utils/lifecycle.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('prepublish', packageId(pkg), buildpath) + lifecycle(pkg.package, 'prepublish', buildpath, false, false, next) +} diff --git a/deps/npm/lib/install/action/remove.js b/deps/npm/lib/install/action/remove.js new file mode 100644 index 00000000000000..b3126a58005394 --- /dev/null +++ b/deps/npm/lib/install/action/remove.js @@ -0,0 +1,82 @@ +'use strict' +var path = require('path') +var fs = require('graceful-fs') +var rimraf = require('rimraf') +var asyncMap = require('slide').asyncMap +var mkdirp = require('mkdirp') +var npm = require('../../npm.js') +var andIgnoreErrors = require('../and-ignore-errors.js') + +// This is weird because we want to remove the module but not it's node_modules folder +// allowing for this allows us to not worry about the order of operations +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('remove', pkg.path) + if (pkg.target) { + removeLink(pkg, next) + } else { + removeDir(pkg, log, next) + } +} + +function removeLink (pkg, next) { + npm.commands.unbuild(pkg.path, true, next) +} + +function removeDir (pkg, log, next) { + var modpath = path.join(path.dirname(pkg.path), '.' + path.basename(pkg.path) + '.MODULES') + + fs.rename(path.join(pkg.path, 'node_modules'), modpath, unbuildPackage) + + function unbuildPackage (renameEr) { + npm.commands.unbuild(pkg.path, true, renameEr ? andRemoveEmptyParents(pkg.path) : moveModulesBack) + } + + function andRemoveEmptyParents (path) { + return function (er) { + if (er) return next(er) + removeEmptyParents(pkg.path) + } + } + + function moveModulesBack () { + fs.readdir(modpath, makeTarget) + } + + function makeTarget (readdirEr, files) { + if (readdirEr) return cleanup() + if (!files.length) return cleanup() + mkdirp(path.join(pkg.path, 'node_modules'), function (mkdirEr) { moveModules(mkdirEr, files) }) + } + + function moveModules (mkdirEr, files) { + if (mkdirEr) return next(mkdirEr) + asyncMap(files, function (file, done) { + var from = path.join(modpath, file) + var to = path.join(pkg.path, 'node_modules', file) + // we ignore errors here, because they can legitimately happen, for instance, + // bundled modules will be in both node_modules folders + fs.rename(from, to, andIgnoreErrors(done)) + }, cleanup) + } + + function cleanup () { + rimraf(modpath, afterCleanup) + } + + function afterCleanup (rimrafEr) { + if (rimrafEr) log.warn('finalize', rimrafEr) + removeEmptyParents(path.resolve(pkg.path, '..')) + } + + function removeEmptyParents (pkgdir) { + fs.rmdir(pkgdir, function (er) { + // FIXME: Make sure windows does what we want here + if (er && er.code !== 'ENOENT') return next() + removeEmptyParents(path.resolve(pkgdir, '..')) + }) + } +} + +module.exports.commit = function (staging, pkg, next) { + rimraf(pkg.path, next) +} diff --git a/deps/npm/lib/install/action/test.js b/deps/npm/lib/install/action/test.js new file mode 100644 index 00000000000000..ee315290ad0554 --- /dev/null +++ b/deps/npm/lib/install/action/test.js @@ -0,0 +1,8 @@ +'use strict' +var lifecycle = require('../../utils/lifecycle.js') +var packageId = require('../../utils/package-id.js') + +module.exports = function (top, buildpath, pkg, log, next) { + log.silly('test', packageId(pkg), buildpath) + lifecycle(pkg.package, 'test', buildpath, false, false, next) +} diff --git a/deps/npm/lib/install/action/update-linked.js b/deps/npm/lib/install/action/update-linked.js new file mode 100644 index 00000000000000..46c4cdfadd1509 --- /dev/null +++ b/deps/npm/lib/install/action/update-linked.js @@ -0,0 +1,8 @@ +'use strict' +var path = require('path') + +module.exports = function (top, buildpath, pkg, log, next) { + log.warn('update-linked', path.relative(top, pkg.path), 'needs updating to', pkg.package.version, + 'from', pkg.oldPkg.package.version, "but we can't, as it's a symlink") + next() +} diff --git a/deps/npm/lib/install/actions.js b/deps/npm/lib/install/actions.js new file mode 100644 index 00000000000000..face4b457bced4 --- /dev/null +++ b/deps/npm/lib/install/actions.js @@ -0,0 +1,129 @@ +'use strict' +var path = require('path') +var validate = require('aproba') +var chain = require('slide').chain +var asyncMap = require('slide').asyncMap +var uniqueFilename = require('unique-filename') +var log = require('npmlog') +var andFinishTracker = require('./and-finish-tracker.js') +var andAddParentToErrors = require('./and-add-parent-to-errors.js') +var failedDependency = require('./deps.js').failedDependency +var packageId = require('../utils/package-id.js') +var moduleName = require('../utils/module-name.js') + +var actions = {} + +actions.fetch = require('./action/fetch.js') +actions.extract = require('./action/extract.js') +actions.build = require('./action/build.js') +actions.test = require('./action/test.js') +actions.preinstall = require('./action/preinstall.js') +actions.install = require('./action/install.js') +actions.postinstall = require('./action/postinstall.js') +actions.prepublish = require('./action/prepublish.js') +actions.finalize = require('./action/finalize.js') +actions.remove = require('./action/remove.js') +actions.move = require('./action/move.js') +actions['update-linked'] = require('./action/update-linked.js') +actions['global-install'] = require('./action/global-install.js') +actions['global-link'] = require('./action/global-link.js') + +// FIXME: We wrap actions like three ways to sunday here. +// Rewrite this to only work one way. + +Object.keys(actions).forEach(function (actionName) { + var action = actions[actionName] + actions[actionName] = function (top, buildpath, pkg, log, next) { + validate('SSOOF', arguments) + // refuse to run actions for failed packages + if (pkg.failed) return next() + if (action.rollback) { + if (!pkg.rollback) pkg.rollback = [] + pkg.rollback.unshift(action.rollback) + } + if (action.commit) { + if (!pkg.commit) pkg.commit = [] + pkg.commit.push(action.commit) + } + return action(top, buildpath, pkg, log, andFinishTracker(log, andAddParentToErrors(pkg.parent, andHandleOptionalDepErrors(pkg, next)))) + } +}) + +function markAsFailed (pkg) { + pkg.failed = true + pkg.requires.forEach(function (req) { + req.requiredBy = req.requiredBy.filter(function (reqReqBy) { return reqReqBy !== pkg }) + if (req.requiredBy.length === 0 && !req.userRequired && !req.existing) { + markAsFailed(req) + } + }) +} + +function andHandleOptionalDepErrors (pkg, next) { + return function (er) { + if (!er) return next.apply(null, arguments) + markAsFailed(pkg) + var anyFatal = pkg.directlyRequested || !pkg.parent + for (var ii = 0; ii < pkg.requiredBy.length; ++ii) { + var parent = pkg.requiredBy[ii] + var isFatal = failedDependency(parent, pkg) + if (isFatal) anyFatal = true + } + if (anyFatal) return next.apply(null, arguments) + log.warn('install:' + packageId(pkg), er.message) + log.verbose('install:' + packageId(pkg), er.stack) + next() + } +} + +function prepareAction (staging, log) { + validate('SO', arguments) + return function (action) { + validate('SO', action) + var cmd = action[0] + var pkg = action[1] + if (!actions[cmd]) throw new Error('Unknown decomposed command "' + cmd + '" (is it new?)') + var buildpath = uniqueFilename(staging, moduleName(pkg), pkg.realpath) + var top = path.resolve(staging, '../..') + return [actions[cmd], top, buildpath, pkg, log.newGroup(cmd + ':' + moduleName(pkg))] + } +} + +exports.actions = actions + +function execAction (todo, done) { + validate('AF', arguments) + var cmd = todo.shift() + todo.push(done) + cmd.apply(null, todo) +} + +exports.doOne = function (cmd, staging, pkg, log, next) { + validate('SSOOF', arguments) + execAction(prepareAction(staging, log)([cmd, pkg]), next) +} + +exports.doSerial = function (type, staging, actionsToRun, log, next) { + validate('SSAOF', arguments) + actionsToRun = actionsToRun + .filter(function (value) { return value[0] === type }) + log.silly('doSerial', '%s %d', type, actionsToRun.length) + chain(actionsToRun.map(prepareAction(staging, log)), andFinishTracker(log, next)) +} + +exports.doReverseSerial = function (type, staging, actionsToRun, log, next) { + validate('SSAOF', arguments) + actionsToRun = actionsToRun + .filter(function (value) { return value[0] === type }) + .reverse() + log.silly('doReverseSerial', '%s %d', type, actionsToRun.length) + chain(actionsToRun.map(prepareAction(staging, log)), andFinishTracker(log, next)) +} + +exports.doParallel = function (type, staging, actionsToRun, log, next) { + validate('SSAOF', arguments) + actionsToRun = actionsToRun.filter(function (value) { return value[0] === type }) + log.silly('doParallel', type + ' ' + actionsToRun.length) + + asyncMap(actionsToRun.map(prepareAction(staging, log)), execAction, andFinishTracker(log, next)) +} diff --git a/deps/npm/lib/install/and-add-parent-to-errors.js b/deps/npm/lib/install/and-add-parent-to-errors.js new file mode 100644 index 00000000000000..62a86bd4a6c360 --- /dev/null +++ b/deps/npm/lib/install/and-add-parent-to-errors.js @@ -0,0 +1,13 @@ +'use strict' +var validate = require('aproba') + +module.exports = function (parent, cb) { + validate('F', [cb]) + return function (er) { + if (!er) return cb.apply(null, arguments) + if (er instanceof Error && parent && parent.package && parent.package.name) { + er.parent = parent.package.name + } + cb(er) + } +} diff --git a/deps/npm/lib/install/and-finish-tracker.js b/deps/npm/lib/install/and-finish-tracker.js new file mode 100644 index 00000000000000..2bab60ddc40080 --- /dev/null +++ b/deps/npm/lib/install/and-finish-tracker.js @@ -0,0 +1,16 @@ +'use strict' +var validate = require('aproba') + +module.exports = function (tracker, cb) { + validate('OF', [tracker, cb]) + return function () { + tracker.finish() + cb.apply(null, arguments) + } +} + +module.exports.now = function (tracker, cb) { + validate('OF', [tracker, cb]) + tracker.finish() + cb.apply(null, Array.prototype.slice.call(arguments, 2)) +} diff --git a/deps/npm/lib/install/and-ignore-errors.js b/deps/npm/lib/install/and-ignore-errors.js new file mode 100644 index 00000000000000..cf46ad82155b5c --- /dev/null +++ b/deps/npm/lib/install/and-ignore-errors.js @@ -0,0 +1,9 @@ +'use strict' + +module.exports = function (cb) { + return function () { + var args = Array.prototype.slice.call(arguments, 1) + if (args.length) args.unshift(null) + return cb.apply(null, args) + } +} diff --git a/deps/npm/lib/install/check-permissions.js b/deps/npm/lib/install/check-permissions.js new file mode 100644 index 00000000000000..7806fcff993e19 --- /dev/null +++ b/deps/npm/lib/install/check-permissions.js @@ -0,0 +1,69 @@ +'use strict' +var path = require('path') +var log = require('npmlog') +var validate = require('aproba') +var uniq = require('lodash.uniq') +var asyncMap = require('slide').asyncMap +var npm = require('../npm.js') +var exists = require('./exists.js') +var writable = require('./writable.js') + +module.exports = function (actions, next) { + validate('AF', arguments) + var errors = [] + asyncMap(actions, function (action, done) { + var cmd = action[0] + var pkg = action[1] + switch (cmd) { + case 'add': + hasAnyWriteAccess(path.resolve(pkg.path, '..'), errors, done) + break + case 'update': + case 'remove': + hasWriteAccess(pkg.path, errors, andHasWriteAccess(path.resolve(pkg.path, '..'), errors, done)) + break + case 'move': + hasAnyWriteAccess(pkg.path, errors, andHasWriteAccess(path.resolve(pkg.fromPath, '..'), errors, done)) + break + default: + done() + } + }, function () { + if (!errors.length) return next() + uniq(errors.map(function (er) { return 'Missing write access to ' + er.path })).forEach(function (er) { + log.warn('checkPermissions', er) + }) + npm.config.get('force') ? next() : next(errors[0]) + }) +} + +function andHasWriteAccess (dir, errors, done) { + validate('SAF', arguments) + return function () { + hasWriteAccess(dir, errors, done) + } +} + +function hasAnyWriteAccess (dir, errors, done) { + validate('SAF', arguments) + findNearestDir() + function findNearestDir () { + var nextDir = path.resolve(dir, '..') + exists(dir, function (dirDoesntExist) { + if (!dirDoesntExist || nextDir === dir) { + return hasWriteAccess(dir, errors, done) + } else { + dir = nextDir + findNearestDir() + } + }) + } +} + +function hasWriteAccess (dir, errors, done) { + validate('SAF', arguments) + writable(dir, function (er) { + if (er) errors.push(er) + done() + }) +} diff --git a/deps/npm/lib/install/copy-tree.js b/deps/npm/lib/install/copy-tree.js new file mode 100644 index 00000000000000..67a9c687a22d25 --- /dev/null +++ b/deps/npm/lib/install/copy-tree.js @@ -0,0 +1,25 @@ +'use strict' + +module.exports = function (tree) { + return copyTree(tree, {}) +} + +function copyTree (tree, cache) { + if (cache[tree.path]) return cache[tree.path] + var newTree = cache[tree.path] = Object.create(tree) + copyModuleList(newTree, 'children', cache) + newTree.children.forEach(function (child) { + child.parent = newTree + }) + copyModuleList(newTree, 'requires', cache) + copyModuleList(newTree, 'requiredBy', cache) + return newTree +} + +function copyModuleList (tree, key, cache) { + var newList = [] + tree[key].forEach(function (child) { + newList.push(copyTree(child, cache)) + }) + tree[key] = newList +} diff --git a/deps/npm/lib/install/decompose-actions.js b/deps/npm/lib/install/decompose-actions.js new file mode 100644 index 00000000000000..b5390c0b22644b --- /dev/null +++ b/deps/npm/lib/install/decompose-actions.js @@ -0,0 +1,61 @@ +'use strict' +var validate = require('aproba') +var asyncMap = require('slide').asyncMap + +module.exports = function (differences, decomposed, next) { + validate('AAF', arguments) + asyncMap(differences, function (action, done) { + var cmd = action[0] + var pkg = action[1] + switch (cmd) { + case 'add': + case 'update': + addSteps(decomposed, pkg, done) + break + case 'move': + moveSteps(decomposed, pkg, done) + break + case 'rebuild': + rebuildSteps(decomposed, pkg, done) + break + case 'remove': + case 'update-linked': + default: + defaultSteps(decomposed, cmd, pkg, done) + } + }, next) +} + +function addSteps (decomposed, pkg, done) { + decomposed.push(['fetch', pkg]) + decomposed.push(['extract', pkg]) + decomposed.push(['preinstall', pkg]) + decomposed.push(['build', pkg]) + decomposed.push(['install', pkg]) + decomposed.push(['postinstall', pkg]) + decomposed.push(['test', pkg]) + decomposed.push(['finalize', pkg]) + done() +} + +function moveSteps (decomposed, pkg, done) { + decomposed.push(['move', pkg]) + decomposed.push(['build', pkg]) + decomposed.push(['install', pkg]) + decomposed.push(['postinstall', pkg]) + decomposed.push(['test', pkg]) + done() +} + +function rebuildSteps (decomposed, pkg, done) { + decomposed.push(['preinstall', pkg]) + decomposed.push(['build', pkg]) + decomposed.push(['install', pkg]) + decomposed.push(['postinstall', pkg]) + done() +} + +function defaultSteps (decomposed, cmd, pkg, done) { + decomposed.push([cmd, pkg]) + done() +} diff --git a/deps/npm/lib/install/deps.js b/deps/npm/lib/install/deps.js new file mode 100644 index 00000000000000..3afe8af012f7f1 --- /dev/null +++ b/deps/npm/lib/install/deps.js @@ -0,0 +1,582 @@ +'use strict' +var assert = require('assert') +var path = require('path') +var url = require('url') +var semver = require('semver') +var asyncMap = require('slide').asyncMap +var chain = require('slide').chain +var union = require('lodash.union') +var iferr = require('iferr') +var npa = require('npm-package-arg') +var validate = require('aproba') +var realizePackageSpecifier = require('realize-package-specifier') +var dezalgo = require('dezalgo') +var fetchPackageMetadata = require('../fetch-package-metadata.js') +var andAddParentToErrors = require('./and-add-parent-to-errors.js') +var addShrinkwrap = require('../fetch-package-metadata.js').addShrinkwrap +var addBundled = require('../fetch-package-metadata.js').addBundled +var readShrinkwrap = require('./read-shrinkwrap.js') +var inflateShrinkwrap = require('./inflate-shrinkwrap.js') +var inflateBundled = require('./inflate-bundled.js') +var andFinishTracker = require('./and-finish-tracker.js') +var npm = require('../npm.js') +var flatName = require('./flatten-tree.js').flatName +var createChild = require('./node.js').create +var resetMetadata = require('./node.js').reset +var andIgnoreErrors = require('./and-ignore-errors.js') +var isInstallable = require('./validate-args.js').isInstallable +var packageId = require('../utils/package-id.js') +var moduleName = require('../utils/module-name.js') + +exports.test = {} // used to hold functions for testing by unit tests + +// The export functions in this module mutate a dependency tree, adding +// items to them. + +function isDep (tree, child) { + if (child.fromShrinkwrap) return true + var name = moduleName(child) + var requested = isProdDep(tree, name) + var matches + if (requested) matches = doesChildVersionMatch(child, requested, tree) + if (matches) return matches + requested = isDevDep(tree, name) + if (!requested) return + return doesChildVersionMatch(child, requested, tree) +} + +function isDevDep (tree, name) { + var devDeps = tree.package.devDependencies || {} + var reqVer = devDeps[name] + if (reqVer == null) return + return npa(name + '@' + reqVer) +} + +function isProdDep (tree, name) { + var deps = tree.package.dependencies || {} + var reqVer = deps[name] + if (reqVer == null) return false + return npa(name + '@' + reqVer) +} + +var registryTypes = { range: true, version: true } + +function doesChildVersionMatch (child, requested, requestor) { + // we always consider deps provided by a shrinkwrap as "correct" or else + // we'll subvert them if they're intentionally "invalid" + if (child.parent === requestor && child.fromShrinkwrap) return true + // ranges of * ALWAYS count as a match, because when downloading we allow + // prereleases to match * if there are ONLY prereleases + if (requested.spec === '*') return true + + var childReq = child.package._requested + if (childReq) { + if (childReq.rawSpec === requested.rawSpec) return true + if (childReq.type === requested.type && childReq.spec === requested.spec) return true + } + if (!registryTypes[requested.type]) return requested.rawSpec === child.package._from + return semver.satisfies(child.package.version, requested.spec) +} + +exports.recalculateMetadata = function (tree, log, next) { + recalculateMetadata(tree, log, {}, next) +} + +function recalculateMetadata (tree, log, seen, next) { + validate('OOOF', arguments) + if (seen[tree.path]) return next() + seen[tree.path] = true + if (tree.parent == null) resetMetadata(tree) + function markDeps (spec, done) { + validate('SF', arguments) + realizePackageSpecifier(spec, packageRelativePath(tree), function (er, req) { + if (er || !req.name) return done() + var child = findRequirement(tree, req.name, req) + if (child) { + resolveWithExistingModule(child, tree, log, andIgnoreErrors(done)) + } else if (tree.package.dependencies[req.name] != null) { + tree.missingDeps[req.name] = req.rawSpec + done() + } else if (tree.package.devDependencies[req.name] != null) { + tree.missingDevDeps[req.name] = req.rawSpec + done() + } else { + done() + } + }) + } + function specs (deps) { + return Object.keys(deps).map(function (depname) { return depname + '@' + deps[depname] }) + } + var tomark = specs(tree.package.dependencies) + if (!tree.parent && (npm.config.get('dev') || !npm.config.get('production'))) { + tomark = union(tomark, specs(tree.package.devDependencies)) + } + tree.children = tree.children.filter(function (child) { return !child.failed }) + chain([ + [asyncMap, tomark, markDeps], + [asyncMap, tree.children, function (child, done) { recalculateMetadata(child, log, seen, done) }] + ], function () { + tree.userRequired = tree.package._requiredBy.some(function (req) { req === '#USER' }) + tree.existing = tree.package._requiredBy.some(function (req) { req === '#EXISTING' }) + tree.package._location = flatNameFromTree(tree) + next(null, tree) + }) +} + +function addRequiredDep (tree, child) { + if (!isDep(tree, child)) return false + var name = isProdDep(tree, moduleName(child)) ? flatNameFromTree(tree) : '#DEV:' + flatNameFromTree(tree) + replaceModuleName(child.package, '_requiredBy', name) + replaceModule(child, 'requiredBy', tree) + replaceModule(tree, 'requires', child) + return true +} + +function removeObsoleteDep (child) { + if (child.removed) return + child.removed = true + var requires = child.requires || [] + requires.forEach(function (requirement) { + requirement.requiredBy = requirement.requiredBy.filter(function (reqBy) { reqBy !== child }) + if (requirement.requiredBy.length === 0) removeObsoleteDep(requirement) + }) +} + +function matchingDep (tree, name) { + if (tree.package.dependencies && tree.package.dependencies[name]) return tree.package.dependencies[name] + if (tree.package.devDependencies && tree.package.devDependencies[name]) return tree.package.devDependencies[name] + return +} + +function packageRelativePath (tree) { + if (!tree) return '' + var requested = tree.package._requested || {} + var isLocal = requested.type === 'directory' || requested.type === 'local' + return isLocal ? requested.spec : tree.path +} + +function getShrinkwrap (tree, name) { + return tree.package._shrinkwrap && tree.package._shrinkwrap.dependencies && tree.package._shrinkwrap.dependencies[name] +} + +exports.getAllMetadata = function (args, tree, next) { + asyncMap(args, function (spec, done) { + if (tree && spec.lastIndexOf('@') <= 0) { + var sw = getShrinkwrap(tree, spec) + if (sw) { + // FIXME: This is duplicated in inflate-shrinkwrap and should be factoed + // into a shared function + spec = sw.resolved + ? spec + '@' + sw.resolved + : (sw.from && url.parse(sw.from).protocol) + ? spec + '@' + sw.from + : spec + '@' + sw.version + } else { + var version = matchingDep(tree, spec) + if (version != null) { + spec += '@' + version + } + } + } + fetchPackageMetadata(spec, packageRelativePath(tree), done) + }, next) +} + +// Add a list of args to tree's top level dependencies +exports.loadRequestedDeps = function (args, tree, saveToDependencies, log, next) { + validate('AOOF', [args, tree, log, next]) + asyncMap(args, function (pkg, done) { + var depLoaded = andAddParentToErrors(tree, done) + resolveWithNewModule(pkg, tree, log.newGroup('loadRequestedDeps'), iferr(depLoaded, function (child, tracker) { + validate('OO', arguments) + if (npm.config.get('global')) { + child.isGlobal = true + } + var childName = moduleName(child) + if (saveToDependencies) { + tree.package[saveToDependencies][childName] = + child.package._requested.rawSpec || child.package._requested.spec + } + if (saveToDependencies && saveToDependencies !== 'devDependencies') { + tree.package.dependencies[childName] = + child.package._requested.rawSpec || child.package._requested.spec + } + child.directlyRequested = true + child.save = saveToDependencies + + // For things the user asked to install, that aren't a dependency (or + // won't be when we're done), flag it as "depending" on the user + // themselves, so we don't remove it as a dep that no longer exists + if (!addRequiredDep(tree, child)) { + replaceModuleName(child.package, '_requiredBy', '#USER') + child.directlyRequested = true + } + depLoaded(null, child, tracker) + })) + }, andForEachChild(loadDeps, andFinishTracker(log, next))) +} + +function moduleNameMatches (name) { + return function (child) { return moduleName(child) === name } +} + +function noModuleNameMatches (name) { + return function (child) { return moduleName(child) !== name } +} + +// while this implementation does not require async calling, doing so +// gives this a consistent interface with loadDeps et al +exports.removeDeps = function (args, tree, saveToDependencies, log, next) { + validate('AOOF', [args, tree, log, next]) + args.forEach(function (pkg) { + var pkgName = moduleName(pkg) + if (saveToDependencies) { + var toRemove = tree.children.filter(moduleNameMatches(pkgName)) + replaceModule(tree, 'removed', toRemove[0]) + toRemove.forEach(function (parent) { + parent.save = saveToDependencies + }) + } + tree.children = tree.children.filter(noModuleNameMatches(pkgName)) + }) + log.finish() + next() +} + +function andForEachChild (load, next) { + validate('F', [next]) + next = dezalgo(next) + return function (er, children, logs) { + // when children is empty, logs won't be passed in at all (asyncMap is weird) + // so shortcircuit before arg validation + if (!er && (!children || children.length === 0)) return next() + validate('EAA', arguments) + if (er) return next(er) + assert(children.length === logs.length) + var cmds = [] + for (var ii = 0; ii < children.length; ++ii) { + cmds.push([load, children[ii], logs[ii]]) + } + var sortedCmds = cmds.sort(function installOrder (aa, bb) { + return moduleName(aa[1]).localeCompare(moduleName(bb[1])) + }) + chain(sortedCmds, next) + } +} + +function isDepOptional (tree, name) { + if (!tree.package.optionalDependencies) return false + if (tree.package.optionalDependencies[name] != null) return true + return false +} + +var failedDependency = exports.failedDependency = function (tree, name_pkg) { + var name, pkg + if (typeof name_pkg === 'string') { + name = name_pkg + } else { + pkg = name_pkg + name = moduleName(pkg) + } + + tree.children = tree.children.filter(noModuleNameMatches(name)) + + if (isDepOptional(tree, name)) { + return false + } + + tree.failed = true + + if (!tree.parent) return true + + for (var ii = 0; ii < tree.requiredBy.length; ++ii) { + var requireParent = tree.requiredBy[ii] + if (failedDependency(requireParent, tree.package)) { + return true + } + } + return false +} + +function andHandleOptionalErrors (log, tree, name, done) { + validate('OOSF', arguments) + return function (er, child, childLog) { + if (!er) validate('OO', [child, childLog]) + if (!er) return done(er, child, childLog) + var isFatal = failedDependency(tree, name) + if (er && !isFatal) { + tree.children = tree.children.filter(noModuleNameMatches(name)) + log.warn('install', "Couldn't install optional dependency:", er.message) + log.verbose('install', er.stack) + return done() + } else { + return done(er, child, childLog) + } + } +} + +// Load any missing dependencies in the given tree +exports.loadDeps = loadDeps +function loadDeps (tree, log, next) { + validate('OOF', arguments) + if (tree.loaded || (tree.parent && tree.parent.failed)) return andFinishTracker.now(log, next) + if (tree.parent) tree.loaded = true + if (!tree.package.dependencies) tree.package.dependencies = {} + asyncMap(Object.keys(tree.package.dependencies), function (dep, done) { + var version = tree.package.dependencies[dep] + if (tree.package.optionalDependencies && + tree.package.optionalDependencies[dep] && + !npm.config.get('optional')) { + return done() + } + + addDependency(dep, version, tree, log.newGroup('loadDep:' + dep), andHandleOptionalErrors(log, tree, dep, done)) + }, andForEachChild(loadDeps, andFinishTracker(log, next))) +} + +// Load development dependencies into the given tree +exports.loadDevDeps = function (tree, log, next) { + validate('OOF', arguments) + if (!tree.package.devDependencies) return andFinishTracker.now(log, next) + asyncMap(Object.keys(tree.package.devDependencies), function (dep, done) { + // things defined as both dev dependencies and regular dependencies are treated + // as the former + if (tree.package.dependencies[dep]) return done() + + var logGroup = log.newGroup('loadDevDep:' + dep) + addDependency(dep, tree.package.devDependencies[dep], tree, logGroup, done) + }, andForEachChild(loadDeps, andFinishTracker(log, next))) +} + +exports.loadExtraneous = function loadExtraneous (tree, log, next) { + var seen = {} + function loadExtraneous (tree, log, next) { + validate('OOF', arguments) + if (seen[tree.path]) return next() + seen[tree.path] = true + asyncMap(tree.children.filter(function (child) { return !child.loaded }), function (child, done) { + resolveWithExistingModule(child, tree, log, done) + }, andForEachChild(loadExtraneous, andFinishTracker(log, next))) + } + loadExtraneous(tree, log, next) +} + +exports.loadExtraneous.andResolveDeps = function (tree, log, next) { + validate('OOF', arguments) + asyncMap(tree.children.filter(function (child) { return !child.loaded }), function (child, done) { + resolveWithExistingModule(child, tree, log, done) + }, andForEachChild(loadDeps, andFinishTracker(log, next))) +} + +function addDependency (name, versionSpec, tree, log, done) { + validate('SSOOF', arguments) + var next = andAddParentToErrors(tree, done) + var spec = name + '@' + versionSpec + realizePackageSpecifier(spec, packageRelativePath(tree), iferr(done, function (req) { + var child = findRequirement(tree, name, req) + if (child) { + resolveWithExistingModule(child, tree, log, iferr(next, function (child, log) { + if (child.package._shrinkwrap === undefined) { + readShrinkwrap.andInflate(child, function (er) { next(er, child, log) }) + } else { + next(null, child, log) + } + })) + } else { + resolveWithNewModule(req, tree, log, next) + } + })) +} + +function resolveWithExistingModule (child, tree, log, next) { + validate('OOOF', arguments) + addRequiredDep(tree, child) + + if (tree.parent && child.parent !== tree) updatePhantomChildren(tree.parent, child) + + next(null, child, log) +} + +var updatePhantomChildren = exports.updatePhantomChildren = function (current, child) { + validate('OO', arguments) + while (current && current !== child.parent) { + // FIXME: phantomChildren doesn't actually belong in the package.json + if (!current.package._phantomChildren) current.package._phantomChildren = {} + current.package._phantomChildren[moduleName(child)] = child.package.version + current = current.parent + } +} + +function flatNameFromTree (tree) { + validate('O', arguments) + if (!tree.parent) return '/' + var path = flatNameFromTree(tree.parent) + if (path !== '/') path += '/' + return flatName(path, tree) +} + +exports.test.replaceModuleName = replaceModuleName +function replaceModuleName (obj, key, name) { + validate('OSS', arguments) + obj[key] = union(obj[key] || [], [name]) +} + +exports.test.replaceModule = replaceModule +function replaceModule (obj, key, child) { + validate('OSO', arguments) + if (!obj[key]) obj[key] = [] + // we replace children with a new array object instead of mutating it + // because mutating it results in weird failure states. + // I would very much like to know _why_ this is. =/ + var children = [].concat(obj[key]) + var childName = moduleName(child) + for (var replaceAt = 0; replaceAt < children.length; ++replaceAt) { + if (moduleName(children[replaceAt]) === childName) break + } + var replacing = children.splice(replaceAt, 1, child) + obj[key] = children + return replacing[0] +} + +function resolveWithNewModule (pkg, tree, log, next) { + validate('OOOF', arguments) + if (pkg.type) { + return fetchPackageMetadata(pkg, packageRelativePath(tree), log.newItem('fetchMetadata'), iferr(next, function (pkg) { + resolveWithNewModule(pkg, tree, log, next) + })) + } + + if (!pkg._installable) { + log.silly('resolveWithNewModule', packageId(pkg), 'checking installable status') + return isInstallable(pkg, iferr(next, function () { + pkg._installable = true + resolveWithNewModule(pkg, tree, log, next) + })) + } + + if (!pkg._from) { + pkg._from = pkg._requested.name + '@' + pkg._requested.spec + } + addShrinkwrap(pkg, iferr(next, function () { + addBundled(pkg, iferr(next, function () { + var parent = earliestInstallable(tree, tree, pkg) || tree + var child = createChild({ + package: pkg, + parent: parent, + path: path.join(parent.path, 'node_modules', pkg.name), + realpath: path.resolve(parent.realpath, 'node_modules', pkg.name), + children: pkg._bundled || [], + isLink: tree.isLink + }) + + var replaced = replaceModule(parent, 'children', child) + if (replaced) removeObsoleteDep(replaced) + addRequiredDep(tree, child) + pkg._location = flatNameFromTree(child) + + if (tree.parent && parent !== tree) updatePhantomChildren(tree.parent, child) + + if (pkg._bundled) { + inflateBundled(child, child.children) + } + + if (pkg._shrinkwrap && pkg._shrinkwrap.dependencies) { + return inflateShrinkwrap(child, pkg._shrinkwrap.dependencies, function (er) { + next(er, child, log) + }) + } + + next(null, child, log) + })) + })) +} + +var validatePeerDeps = exports.validatePeerDeps = function (tree, onInvalid) { + if (!tree.package.peerDependencies) return + Object.keys(tree.package.peerDependencies).forEach(function (pkgname) { + var version = tree.package.peerDependencies[pkgname] + var match = findRequirement(tree.parent || tree, pkgname, npa(pkgname + '@' + version)) + if (!match) onInvalid(tree, pkgname, version) + }) +} + +exports.validateAllPeerDeps = function (tree, onInvalid) { + validateAllPeerDeps(tree, onInvalid, {}) +} + +function validateAllPeerDeps (tree, onInvalid, seen) { + validate('OFO', arguments) + if (seen[tree.path]) return + seen[tree.path] = true + validatePeerDeps(tree, onInvalid) + tree.children.forEach(function (child) { validateAllPeerDeps(child, onInvalid, seen) }) +} + +// Determine if a module requirement is already met by the tree at or above +// our current location in the tree. +var findRequirement = exports.findRequirement = function (tree, name, requested, requestor) { + validate('OSO', [tree, name, requested]) + if (!requestor) requestor = tree + var nameMatch = function (child) { + return moduleName(child) === name && child.parent && !child.removed + } + var versionMatch = function (child) { + return doesChildVersionMatch(child, requested, requestor) + } + if (nameMatch(tree)) { + // this *is* the module, but it doesn't match the version, so a + // new copy will have to be installed + return versionMatch(tree) ? tree : null + } + + var matches = tree.children.filter(nameMatch) + if (matches.length) { + matches = matches.filter(versionMatch) + // the module exists as a dependent, but the version doesn't match, so + // a new copy will have to be installed above here + if (matches.length) return matches[0] + return null + } + if (!tree.parent) return null + return findRequirement(tree.parent, name, requested, requestor) +} + +// Find the highest level in the tree that we can install this module in. +// If the module isn't installed above us yet, that'd be the very top. +// If it is, then it's the level below where its installed. +var earliestInstallable = exports.earliestInstallable = function (requiredBy, tree, pkg) { + validate('OOO', arguments) + + function undeletedModuleMatches (child) { + return !child.removed && moduleName(child) === pkg.name + } + if (tree.children.some(undeletedModuleMatches)) return null + + // If any of the children of this tree have conflicting + // binaries then we need to decline to install this package here. + var binaryMatches = typeof pkg.bin === 'object' && tree.children.some(function (child) { + if (child.removed) return false + if (typeof child.package.bin !== 'object') return false + return Object.keys(child.package.bin).some(function (bin) { + return pkg.bin[bin] + }) + }) + if (binaryMatches) return null + + // if this tree location requested the same module then we KNOW it + // isn't compatible because if it were findRequirement would have + // found that version. + var deps = tree.package.dependencies || {} + if (!tree.removed && requiredBy !== tree && deps[pkg.name]) { + return null + } + + // FIXME: phantomChildren doesn't actually belong in the package.json + if (tree.package._phantomChildren && tree.package._phantomChildren[pkg.name]) return null + + if (!tree.parent) return tree + if (tree.isGlobal) return tree + + return (earliestInstallable(requiredBy, tree.parent, pkg) || tree) +} diff --git a/deps/npm/lib/install/diff-trees.js b/deps/npm/lib/install/diff-trees.js new file mode 100644 index 00000000000000..59567bf3193be1 --- /dev/null +++ b/deps/npm/lib/install/diff-trees.js @@ -0,0 +1,162 @@ +'use strict' +var validate = require('aproba') +var npa = require('npm-package-arg') +var npm = require('../npm.js') +var flattenTree = require('./flatten-tree.js') + +function nonRegistrySource (pkg) { + validate('O', arguments) + var requested = pkg._requested || (pkg._from && npa(pkg._from)) + if (!requested) return false + + if (requested.type === 'hosted') return true + if (requested.type === 'local') return true + return false +} + +function pkgAreEquiv (aa, bb) { + var aaSha = (aa.dist && aa.dist.shasum) || aa._shasum + var bbSha = (bb.dist && bb.dist.shasum) || bb._shasum + if (aaSha === bbSha) return true + if (aaSha || bbSha) return false + if (nonRegistrySource(aa) || nonRegistrySource(bb)) return false + if (aa.version === bb.version) return true + return false +} + +function getNameAndVersion (pkg) { + var versionspec = pkg._shasum + + if (!versionspec && nonRegistrySource(pkg)) { + if (pkg._requested) { + versionspec = pkg._requested.spec + } else if (pkg._from) { + versionspec = npa(pkg._from).spec + } + } + if (!versionspec) { + versionspec = pkg.version + } + return pkg.name + '@' + versionspec +} + +function pushAll (aa, bb) { + Array.prototype.push.apply(aa, bb) +} + +module.exports = function (oldTree, newTree, differences, log, next) { + validate('OOAOF', arguments) + pushAll(differences, sortActions(diffTrees(oldTree, newTree))) + log.finish() + next() +} + +function isLink (node) { + return node && node.isLink +} + +function requiredByAllLinked (node) { + if (!node.requiredBy.length) return false + return node.requiredBy.filter(isLink).length === node.requiredBy.length +} + +function isNotReqByTop (req) { + return req !== '/' && // '/' is the top level itself + req !== '#USER' && // #USER + req !== '#EXTRANEOUS' +} + +var sortActions = module.exports.sortActions = function (differences) { + var actions = {} + differences.forEach(function (action) { + var child = action[1] + actions[child.package._location] = action + }) + + var sorted = [] + var added = {} + + var sortedlocs = Object.keys(actions).sort(sortByLocation) + + // Do top level deps first, this stops the sorting by required order from + // unsorting these deps. + var toplocs = sortedlocs.filter(function (location) { + var mod = actions[location][1] + if (!mod.package._requiredBy) return true + // If the module is required by ANY non-top level package + // then we don't want to include this. + return !mod.package._requiredBy.some(isNotReqByTop) + }) + + toplocs.concat(sortedlocs).forEach(function (location) { + sortByDeps(actions[location]) + }) + + function sortByLocation (aa, bb) { + return bb.localeCompare(aa) + } + function sortByDeps (action) { + var mod = action[1] + if (added[mod.package._location]) return + added[mod.package._location] = action + mod.package._requiredBy.sort().forEach(function (location) { + if (actions[location]) sortByDeps(actions[location]) + }) + sorted.unshift(action) + } + + return sorted +} + +function diffTrees (oldTree, newTree) { + validate('OO', arguments) + var differences = [] + var flatOldTree = flattenTree(oldTree) + var flatNewTree = flattenTree(newTree) + var toRemove = {} + var toRemoveByNameAndVer = {} + // find differences + Object.keys(flatOldTree).forEach(function (flatname) { + if (flatNewTree[flatname]) return + var pkg = flatOldTree[flatname] + toRemove[flatname] = pkg + var namever = getNameAndVersion(pkg.package) + if (!toRemoveByNameAndVer[namever]) toRemoveByNameAndVer[namever] = [] + toRemoveByNameAndVer[namever].push(flatname) + }) + Object.keys(flatNewTree).forEach(function (path) { + var pkg = flatNewTree[path] + pkg.oldPkg = flatOldTree[path] + pkg.isInLink = (pkg.oldPkg && isLink(pkg.oldPkg.parent)) || + (pkg.parent && isLink(pkg.parent)) || + requiredByAllLinked(pkg) + if (pkg.fromBundle) { + if (npm.config.get('rebuild-bundle')) differences.push(['rebuild', pkg]) + if (pkg.oldPkg) differences.push(['remove', pkg]) + } else if (pkg.oldPkg) { + if (!pkg.directlyRequested && pkgAreEquiv(pkg.oldPkg.package, pkg.package)) return + if (!pkg.isInLink && (isLink(pkg.oldPkg) || isLink(pkg))) { + differences.push(['update-linked', pkg]) + } else { + differences.push(['update', pkg]) + } + } else { + var vername = getNameAndVersion(pkg.package) + if (toRemoveByNameAndVer[vername] && toRemoveByNameAndVer[vername].length) { + var flatname = toRemoveByNameAndVer[vername].shift() + pkg.fromPath = toRemove[flatname].path + differences.push(['move', pkg]) + delete toRemove[flatname] + } else { + differences.push(['add', pkg]) + } + } + }) + Object + .keys(toRemove) + .map(function (path) { return toRemove[path] }) + .forEach(function (pkg) { + differences.push(['remove', pkg]) + }) + return differences +} diff --git a/deps/npm/lib/install/exists.js b/deps/npm/lib/install/exists.js new file mode 100644 index 00000000000000..59100d63ba0d94 --- /dev/null +++ b/deps/npm/lib/install/exists.js @@ -0,0 +1,27 @@ +'use strict' +var fs = require('fs') +var inflight = require('inflight') +var accessError = require('./access-error.js') +var isFsAccessAvailable = require('./is-fs-access-available.js') + +if (isFsAccessAvailable) { + module.exports = fsAccessImplementation +} else { + module.exports = fsStatImplementation +} + +// exposed only for testing purposes +module.exports.fsAccessImplementation = fsAccessImplementation +module.exports.fsStatImplementation = fsStatImplementation + +function fsAccessImplementation (dir, done) { + done = inflight('exists:' + dir, done) + if (!done) return + fs.access(dir, fs.F_OK, done) +} + +function fsStatImplementation (dir, done) { + done = inflight('exists:' + dir, done) + if (!done) return + fs.stat(dir, function (er) { done(accessError(dir, er)) }) +} diff --git a/deps/npm/lib/install/filter-invalid-actions.js b/deps/npm/lib/install/filter-invalid-actions.js new file mode 100644 index 00000000000000..f90bf0b4ea6f73 --- /dev/null +++ b/deps/npm/lib/install/filter-invalid-actions.js @@ -0,0 +1,36 @@ +'use strict' +var path = require('path') +var validate = require('aproba') +var log = require('npmlog') +var packageId = require('../utils/package-id.js') + +module.exports = function (top, differences, next) { + validate('SAF', arguments) + var action + var keep = [] + + differences.forEach(function (action) { + var cmd = action[0] + var pkg = action[1] + if (cmd === 'remove') { + pkg.removing = true + } + }) + + /*eslint no-cond-assign:0*/ + while (action = differences.shift()) { + var cmd = action[0] + var pkg = action[1] + if (pkg.isInLink || pkg.parent.target || pkg.parent.isLink) { + // we want to skip warning if this is a child of another module that we're removing + if (!pkg.parent.removing) { + log.warn('skippingAction', 'Module is inside a symlinked module: not running ' + + cmd + ' ' + packageId(pkg) + ' ' + path.relative(top, pkg.path)) + } + } else { + keep.push(action) + } + } + differences.push.apply(differences, keep) + next() +} diff --git a/deps/npm/lib/install/flatten-tree.js b/deps/npm/lib/install/flatten-tree.js new file mode 100644 index 00000000000000..869685a4e8450c --- /dev/null +++ b/deps/npm/lib/install/flatten-tree.js @@ -0,0 +1,30 @@ +'use strict' +var validate = require('aproba') +var moduleName = require('../utils/module-name.js') + +module.exports = function (tree) { + validate('O', arguments) + var seen = {} + var flat = {} + var todo = [[tree, '/']] + while (todo.length) { + var next = todo.shift() + var pkg = next[0] + seen[pkg.path] = true + var path = next[1] + flat[path] = pkg + if (path !== '/') path += '/' + for (var ii = 0; ii < pkg.children.length; ++ii) { + var child = pkg.children[ii] + if (!seen[child.path]) { + todo.push([child, flatName(path, child)]) + } + } + } + return flat +} + +var flatName = module.exports.flatName = function (path, child) { + validate('SO', arguments) + return path + (moduleName(child) || 'TOP') +} diff --git a/deps/npm/lib/install/inflate-bundled.js b/deps/npm/lib/install/inflate-bundled.js new file mode 100644 index 00000000000000..c597e7a566dbb7 --- /dev/null +++ b/deps/npm/lib/install/inflate-bundled.js @@ -0,0 +1,15 @@ +'use strict' +var validate = require('aproba') +var childPath = require('../utils/child-path.js') + +module.exports = function inflateBundled (parent, children) { + validate('OA', arguments) + children.forEach(function (child) { + child.fromBundle = true + child.parent = parent + child.path = childPath(parent.path, child) + child.realpath = childPath(parent.path, child) + child.isLink = child.isLink || parent.isLink || parent.target + inflateBundled(child, child.children) + }) +} diff --git a/deps/npm/lib/install/inflate-shrinkwrap.js b/deps/npm/lib/install/inflate-shrinkwrap.js new file mode 100644 index 00000000000000..ce22f4e4c53734 --- /dev/null +++ b/deps/npm/lib/install/inflate-shrinkwrap.js @@ -0,0 +1,59 @@ +'use strict' +var url = require('url') +var asyncMap = require('slide').asyncMap +var validate = require('aproba') +var iferr = require('iferr') +var fetchPackageMetadata = require('../fetch-package-metadata.js') +var addShrinkwrap = require('../fetch-package-metadata.js').addShrinkwrap +var addBundled = require('../fetch-package-metadata.js').addBundled +var inflateBundled = require('./inflate-bundled.js') +var npm = require('../npm.js') +var createChild = require('./node.js').create +var moduleName = require('../utils/module-name.js') +var childPath = require('../utils/child-path.js') + +var inflateShrinkwrap = module.exports = function (tree, swdeps, finishInflating) { + validate('OOF', arguments) + if (!npm.config.get('shrinkwrap')) return finishInflating() + var onDisk = {} + tree.children.forEach(function (child) { onDisk[moduleName(child)] = child }) + tree.children = [] + asyncMap(Object.keys(swdeps), function (name, next) { + var sw = swdeps[name] + var spec = sw.resolved + ? name + '@' + sw.resolved + : (sw.from && url.parse(sw.from).protocol) + ? name + '@' + sw.from + : name + '@' + sw.version + var child = onDisk[name] + if (child && (child.fromShrinkwrap || + (sw.resolved && child.package._resolved === sw.resolved) || + (sw.from && url.parse(sw.from).protocol && child.package._from === sw.from) || + child.package.version === sw.version)) { + if (!child.fromShrinkwrap) child.fromShrinkwrap = spec + tree.children.push(child) + return next() + } + fetchPackageMetadata(spec, tree.path, iferr(next, function (pkg) { + pkg._from = sw.from || spec + addShrinkwrap(pkg, iferr(next, function () { + addBundled(pkg, iferr(next, function () { + var child = createChild({ + package: pkg, + loaded: false, + parent: tree, + fromShrinkwrap: spec, + path: childPath(tree.path, pkg), + realpath: childPath(tree.realpath, pkg), + children: pkg._bundled || [] + }) + tree.children.push(child) + if (pkg._bundled) { + inflateBundled(child, child.children) + } + inflateShrinkwrap(child, sw.dependencies || {}, next) + })) + })) + })) + }, finishInflating) +} diff --git a/deps/npm/lib/install/is-dev.js b/deps/npm/lib/install/is-dev.js new file mode 100644 index 00000000000000..b1f2c4b6614975 --- /dev/null +++ b/deps/npm/lib/install/is-dev.js @@ -0,0 +1,7 @@ +'use strict' +var isDev = exports.isDev = function (node) { + return node.package._requiredBy.some(function (req) { return req === '#DEV:/' }) +} +exports.isOnlyDev = function (node) { + return node.package._requiredBy.length === 1 && isDev(node) +} diff --git a/deps/npm/lib/install/is-extraneous.js b/deps/npm/lib/install/is-extraneous.js new file mode 100644 index 00000000000000..cd4d954668426a --- /dev/null +++ b/deps/npm/lib/install/is-extraneous.js @@ -0,0 +1,14 @@ +'use strict' +var path = require('path') +var isDev = require('./is-dev.js').isDev +var npm = require('../npm.js') + +module.exports = function (tree) { + var pkg = tree.package + var requiredBy = pkg._requiredBy.filter(function (req) { return req[0] !== '#' }) + var isTopLevel = tree.parent == null + var isChildOfTop = !isTopLevel && tree.parent.parent == null + var isTopGlobal = isChildOfTop && tree.parent.path === path.resolve(npm.globalDir, '..') + var topHasNoPackageJson = isChildOfTop && tree.parent.error + return !isTopLevel && (!isChildOfTop || !topHasNoPackageJson) && !isTopGlobal && requiredBy.length === 0 && !isDev(tree) +} diff --git a/deps/npm/lib/install/is-fs-access-available.js b/deps/npm/lib/install/is-fs-access-available.js new file mode 100644 index 00000000000000..a7d2640d794b5d --- /dev/null +++ b/deps/npm/lib/install/is-fs-access-available.js @@ -0,0 +1,22 @@ +'use strict' +var fs = require('fs') +var semver = require('semver') +var isWindows = process.platform === 'win32' + +// fs.access first introduced in node 0.12 / io.js +if (!fs.access) { + module.exports = false +} else if (!isWindows) { + // fs.access always works on non-Windows OSes + module.exports = true +} else { + // The Windows implementation of `fs.access` has a bug where it will + // sometimes return access errors all the time for directories, even + // when access is available. As all we actually test ARE directories, this + // is a bit of a problem. + // This was fixed in io.js version 1.5.0 + // As of 2015-07-20, it is still unfixed in node: + // https://github.com/joyent/node/issues/25657 + + module.exports = semver.gte(process.version, '1.5.0') +} diff --git a/deps/npm/lib/install/mutate-into-logical-tree.js b/deps/npm/lib/install/mutate-into-logical-tree.js new file mode 100644 index 00000000000000..833aa94c9400cc --- /dev/null +++ b/deps/npm/lib/install/mutate-into-logical-tree.js @@ -0,0 +1,113 @@ +'use strict' +var union = require('lodash.union') +var without = require('lodash.without') +var validate = require('aproba') +var flattenTree = require('./flatten-tree.js') +var isExtraneous = require('./is-extraneous.js') +var validateAllPeerDeps = require('./deps.js').validateAllPeerDeps +var packageId = require('../utils/package-id.js') +var moduleName = require('../utils/module-name.js') + +var mutateIntoLogicalTree = module.exports = function (tree) { + validate('O', arguments) + + validateAllPeerDeps(tree, function (tree, pkgname, version) { + if (!tree.missingPeers) tree.missingPeers = {} + tree.missingPeers[pkgname] = version + }) + + var flat = flattenTree(tree) + + function getNode (flatname) { + return flatname.substr(0, 5) === '#DEV:' + ? flat[flatname.substr(5)] + : flat[flatname] + } + + Object.keys(flat).sort().forEach(function (flatname) { + var node = flat[flatname] + var requiredBy = node.package._requiredBy || [] + var requiredByNames = requiredBy.filter(function (parentFlatname) { + var parentNode = getNode(parentFlatname) + if (!parentNode) return false + return parentNode.package.dependencies[moduleName(node)] || + (parentNode.package.devDependencies && parentNode.package.devDependencies[moduleName(node)]) + }) + requiredBy = requiredByNames.map(getNode) + + node.requiredBy = requiredBy + + if (!requiredBy.length) return + + if (node.parent) node.parent.children = without(node.parent.children, node) + + requiredBy.forEach(function (parentNode) { + parentNode.children = union(parentNode.children, [node]) + }) + if (node.package._requiredBy.some(function (nodename) { return nodename[0] === '#' })) { + tree.children = union(tree.children, [node]) + } + }) + return tree +} + +module.exports.asReadInstalled = function (tree) { + mutateIntoLogicalTree(tree) + return translateTree(tree) +} + +function translateTree (tree) { + return translateTree_(tree, {}) +} + +function translateTree_ (tree, seen) { + var pkg = tree.package + if (seen[tree.path]) return pkg + seen[tree.path] = pkg + if (pkg._dependencies) return pkg + pkg._dependencies = pkg.dependencies + pkg.dependencies = {} + tree.children.forEach(function (child) { + pkg.dependencies[moduleName(child)] = translateTree_(child, seen) + }) + Object.keys(tree.missingDeps).forEach(function (name) { + if (pkg.dependencies[name]) { + pkg.dependencies[name].invalid = true + pkg.dependencies[name].realName = name + pkg.dependencies[name].extraneous = false + } else { + pkg.dependencies[name] = { + requiredBy: tree.missingDeps[name], + missing: true, + optional: !!pkg.optionalDependencies[name] + } + } + }) + var checkForMissingPeers = (tree.parent ? [] : [tree]).concat(tree.children) + checkForMissingPeers.filter(function (child) { + return child.missingPeers + }).forEach(function (child) { + Object.keys(child.missingPeers).forEach(function (pkgname) { + var version = child.missingPeers[pkgname] + var peerPkg = pkg.dependencies[pkgname] + if (!peerPkg) { + peerPkg = pkg.dependencies[pkgname] = { + _id: pkgname + '@' + version, + name: pkgname, + version: version + } + } + if (!peerPkg.peerMissing) peerPkg.peerMissing = [] + peerPkg.peerMissing.push({ + requiredBy: packageId(child), + requires: pkgname + '@' + version + }) + }) + }) + pkg.path = tree.path + + pkg.error = tree.error + pkg.extraneous = isExtraneous(tree) + if (tree.target && tree.parent && !tree.parent.target) pkg.link = tree.realpath + return pkg +} diff --git a/deps/npm/lib/install/node.js b/deps/npm/lib/install/node.js new file mode 100644 index 00000000000000..c76dc765ba493c --- /dev/null +++ b/deps/npm/lib/install/node.js @@ -0,0 +1,61 @@ +'use strict' + +var defaultTemplate = { + package: { + dependencies: {}, + devDependencies: {}, + optionalDependencies: {}, + _requiredBy: [], + _phantomChildren: {} + }, + loaded: false, + children: [], + requiredBy: [], + requires: [], + missingDeps: {}, + missingDevDeps: {}, + path: null, + realpath: null, + userRequired: false, + existing: false +} + +function isLink (node) { + return node && node.isLink +} + +var create = exports.create = function (node, template) { + if (!template) template = defaultTemplate + Object.keys(template).forEach(function (key) { + if (template[key] != null && typeof template[key] === 'object' && !(template[key] instanceof Array)) { + if (!node[key]) node[key] = {} + return create(node[key], template[key]) + } + if (node[key] != null) return + node[key] = template[key] + }) + if (isLink(node) || isLink(node.parent)) { + node.isLink = true + } + return node +} + +exports.reset = function (node) { + reset(node, {}) +} + +function reset (node, seen) { + if (seen[node.path]) return + seen[node.path] = true + var child = create(node) + child.package._requiredBy = child.package._requiredBy.filter(function (req) { + return req[0] === '#' + }) + child.requiredBy = [] + child.package._phantomChildren = {} + // FIXME: cleaning up after read-package-json's mess =( + if (child.package._id === '@') delete child.package._id + child.missingDeps = {} + child.children.forEach(function (child) { reset(child, seen) }) + if (!child.package.version) child.package.version = '' +} diff --git a/deps/npm/lib/install/prune-tree.js b/deps/npm/lib/install/prune-tree.js new file mode 100644 index 00000000000000..eb3edf4f75bafc --- /dev/null +++ b/deps/npm/lib/install/prune-tree.js @@ -0,0 +1,36 @@ +'use strict' +var validate = require('aproba') +var flattenTree = require('./flatten-tree.js') + +function isNotPackage (mod) { + return function (parentMod) { return mod !== parentMod } +} + +module.exports = function pruneTree (tree) { + validate('O', arguments) + var flat = flattenTree(tree) + // we just do this repeatedly until there are no more orphaned packages + // which isn't as effecient as it could be on a REALLY big tree + // but we'll face that if it proves to be an issue + var removedPackage + do { + removedPackage = false + Object.keys(flat).forEach(function (flatname) { + var child = flat[flatname] + if (!child.parent) return + child.package._requiredBy = (child.package._requiredBy || []).filter(function (req) { + var isDev = req.substr(0, 4) === '#DEV' + if (req[0] === '#' && !isDev) return true + if (flat[req]) return true + if (!isDev) return false + var reqChildAsDevDep = flat[req.substr(5)] + return reqChildAsDevDep && !reqChildAsDevDep.parent + }) + if (!child.package._requiredBy.length) { + removedPackage = true + delete flat[flatname] + child.parent.children = child.parent.children.filter(isNotPackage(child)) + } + }) + } while (removedPackage) +} diff --git a/deps/npm/lib/install/read-shrinkwrap.js b/deps/npm/lib/install/read-shrinkwrap.js new file mode 100644 index 00000000000000..35180b688dbadc --- /dev/null +++ b/deps/npm/lib/install/read-shrinkwrap.js @@ -0,0 +1,32 @@ +'use strict' +var path = require('path') +var fs = require('graceful-fs') +var iferr = require('iferr') +var inflateShrinkwrap = require('./inflate-shrinkwrap.js') +var parseJSON = require('../utils/parse-json.js') + +var readShrinkwrap = module.exports = function (child, next) { + fs.readFile(path.join(child.path, 'npm-shrinkwrap.json'), function (er, data) { + if (er) { + child.package._shrinkwrap = null + return next() + } + try { + child.package._shrinkwrap = parseJSON(data) + } catch (ex) { + child.package._shrinkwrap = null + return next(ex) + } + return next() + }) +} + +module.exports.andInflate = function (child, next) { + readShrinkwrap(child, iferr(next, function () { + if (child.package._shrinkwrap) { + return inflateShrinkwrap(child, child.package._shrinkwrap.dependencies || {}, next) + } else { + return next() + } + })) +} diff --git a/deps/npm/lib/install/save.js b/deps/npm/lib/install/save.js new file mode 100644 index 00000000000000..efe0e20ad7cfd7 --- /dev/null +++ b/deps/npm/lib/install/save.js @@ -0,0 +1,219 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var url = require('url') +var writeFileAtomic = require('write-file-atomic') +var log = require('npmlog') +var semver = require('semver') +var iferr = require('iferr') +var validate = require('aproba') +var without = require('lodash.without') +var npm = require('../npm.js') +var deepSortObject = require('../utils/deep-sort-object.js') +var parseJSON = require('../utils/parse-json.js') +var moduleName = require('../utils/module-name.js') + +// if the -S|--save option is specified, then write installed packages +// as dependencies to a package.json file. + +exports.saveRequested = function (args, tree, andReturn) { + validate('AOF', arguments) + savePackageJson(args, tree, andWarnErrors(andSaveShrinkwrap(tree, andReturn))) +} + +function andSaveShrinkwrap (tree, andReturn) { + validate('OF', arguments) + return function (er) { + validate('E', arguments) + saveShrinkwrap(tree, andWarnErrors(andReturn)) + } +} + +function andWarnErrors (cb) { + validate('F', arguments) + return function (er) { + if (er) log.warn('saveError', er.message) + arguments[0] = null + cb.apply(null, arguments) + } +} + +function saveShrinkwrap (tree, next) { + validate('OF', arguments) + var saveTarget = path.resolve(tree.path, 'npm-shrinkwrap.json') + fs.stat(saveTarget, function (er, stat) { + if (er) return next() + var save = npm.config.get('save') + var saveDev = npm.config.get('save-dev') + var saveOptional = npm.config.get('save-optional') + + var shrinkwrap = tree.package._shrinkwrap || {dependencies: {}} + var hasDevOnlyDeps = tree.requires.filter(function (dep) { + var devReqs = dep.package._requiredBy.filter(function (name) { return name.substr(0, 4) === '#DEV' }) + return devReqs.length === dep.package._requiredBy.length + }).some(function (dep) { + return shrinkwrap.dependencies[dep.package.name] != null + }) + + if (!saveOptional && saveDev && !hasDevOnlyDeps) return next() + if (saveOptional || !save) return next() + + if (hasDevOnlyDeps) { + var dev = npm.config.get('dev') + npm.config.set('dev', true) + npm.commands.shrinkwrap([], true, function () { + npm.config.set('dev', dev) + next.apply(this, arguments) + }) + } else { + npm.commands.shrinkwrap([], true, next) + } + }) +} + +function savePackageJson (args, tree, next) { + validate('AOF', arguments) + var saveBundle = npm.config.get('save-bundle') + + // 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(tree.path, 'package.json') + // 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, iferr(next, function (packagejson) { + try { + packagejson = parseJSON(packagejson) + } catch (ex) { + return next(ex) + } + + // If we're saving bundled deps, normalize the key before we start + if (saveBundle) { + var bundle = packagejson.bundleDependencies || packagejson.bundledDependencies + delete packagejson.bundledDependencies + if (!Array.isArray(bundle)) bundle = [] + } + + var toSave = getThingsToSave(tree) + var toRemove = getThingsToRemove(args, tree) + var savingTo = {} + toSave.forEach(function (pkg) { savingTo[pkg.save] = true }) + toRemove.forEach(function (pkg) { savingTo[pkg.save] = true }) + + Object.keys(savingTo).forEach(function (save) { + if (!packagejson[save]) packagejson[save] = {} + }) + + log.verbose('saving', toSave) + toSave.forEach(function (pkg) { + packagejson[pkg.save][pkg.name] = pkg.spec + if (saveBundle) { + var ii = bundle.indexOf(pkg.name) + if (ii === -1) bundle.push(pkg.name) + } + }) + + toRemove.forEach(function (pkg) { + delete packagejson[pkg.save][pkg.name] + if (saveBundle) { + bundle = without(bundle, pkg.name) + } + }) + + Object.keys(savingTo).forEach(function (key) { + packagejson[key] = deepSortObject(packagejson[key]) + }) + if (saveBundle) { + packagejson.bundledDependencies = deepSortObject(bundle) + } + + var json = JSON.stringify(packagejson, null, 2) + '\n' + writeFileAtomic(saveTarget, json, next) + })) +} + +var getSaveType = exports.getSaveType = function (args) { + validate('A', arguments) + var nothingToSave = !args.length + var globalInstall = npm.config.get('global') + var noSaveFlags = !npm.config.get('save') && + !npm.config.get('save-dev') && + !npm.config.get('save-optional') + if (nothingToSave || globalInstall || noSaveFlags) return null + + if (npm.config.get('save-optional')) return 'optionalDependencies' + else if (npm.config.get('save-dev')) return 'devDependencies' + else return 'dependencies' +} + +function computeVersionSpec (child) { + validate('O', arguments) + var requested = child.package._requested + if (!requested || requested.type === 'tag') { + requested = { + type: 'version', + spec: child.package.version + } + } + if (requested.type === 'version' || requested.type === 'range') { + var version = child.package.version + var rangeDescriptor = '' + if (semver.valid(version, true) && + semver.gte(version, '0.1.0', true) && + !npm.config.get('save-exact')) { + rangeDescriptor = npm.config.get('save-prefix') + } + return rangeDescriptor + version + } else if (requested.type === 'directory' || requested.type === 'local') { + var relativePath = path.relative(child.parent.path, requested.spec) + if (/^[.][.]/.test(relativePath)) { + return url.format({ + protocol: 'file', + slashes: true, + pathname: requested.spec + }) + } else { + return url.format({ + protocol: 'file', + slashes: false, + pathname: relativePath + }) + } + } else { + return requested.spec + } +} + +function getThingsToSave (tree) { + validate('O', arguments) + var toSave = tree.children.filter(function (child) { + return child.save + }).map(function (child) { + return { + name: moduleName(child), + spec: computeVersionSpec(child), + save: child.save + } + }) + return toSave +} + +function getThingsToRemove (args, tree) { + validate('AO', arguments) + if (!tree.removed) return [] + var toRemove = tree.removed.map(function (child) { + return { + name: moduleName(child), + save: child.save + } + }) + var saveType = getSaveType(args) + args.forEach(function (arg) { + toRemove.push({ + name: arg, + save: saveType + }) + }) + return toRemove +} diff --git a/deps/npm/lib/install/update-package-json.js b/deps/npm/lib/install/update-package-json.js new file mode 100644 index 00000000000000..97b2f05bb0fa97 --- /dev/null +++ b/deps/npm/lib/install/update-package-json.js @@ -0,0 +1,18 @@ +'use strict' +var path = require('path') +var writeFileAtomic = require('write-file-atomic') +var deepSortObject = require('../utils/deep-sort-object.js') + +module.exports = function (pkg, buildpath, next) { + // FIXME: This bundled dance is because we're sticking a big tree of bundled + // deps into the parsed package.json– it probably doesn't belong there =/ + // But the real reason we don't just dump it out is that it's the result + // of npm-read-tree, which produces circular data structures, due to the + // parent and children keys. + var bundled = pkg.package._bundled + delete pkg.package._bundled // FIXME + var packagejson = deepSortObject(pkg.package) + var data = JSON.stringify(packagejson, null, 2) + '\n' + pkg.package._bundled = bundled + writeFileAtomic(path.resolve(buildpath, 'package.json'), data, next) +} diff --git a/deps/npm/lib/install/validate-args.js b/deps/npm/lib/install/validate-args.js new file mode 100644 index 00000000000000..653dc1b4aeb570 --- /dev/null +++ b/deps/npm/lib/install/validate-args.js @@ -0,0 +1,44 @@ +'use strict' +var validate = require('aproba') +var asyncMap = require('slide').asyncMap +var chain = require('slide').chain +var npmInstallChecks = require('npm-install-checks') +var checkEngine = npmInstallChecks.checkEngine +var checkPlatform = npmInstallChecks.checkPlatform +var npm = require('../npm.js') + +module.exports = function (idealTree, args, next) { + validate('OAF', arguments) + var force = npm.config.get('force') + + asyncMap(args, function (pkg, done) { + chain([ + [checkSelf, idealTree, pkg, force], + [isInstallable, pkg] + ], done) + }, next) +} + +var isInstallable = module.exports.isInstallable = function (pkg, next) { + var force = npm.config.get('force') + var nodeVersion = npm.config.get('node-version') + var strict = npm.config.get('engine-strict') + chain([ + [checkEngine, pkg, npm.version, nodeVersion, force, strict], + [checkPlatform, pkg, force] + ], next) +} + +function checkSelf (idealTree, pkg, force, next) { + if (idealTree.package && idealTree.package.name !== pkg.name) return next() + if (force) { + var warn = new Error("Wouldn't install " + pkg.name + ' as a dependency of itself, but being forced') + warn.code = 'ENOSELF' + idealTree.warnings.push(warn) + next() + } else { + var er = new Error('Refusing to install ' + pkg.name + ' as a dependency of itself') + er.code = 'ENOSELF' + next(er) + } +} diff --git a/deps/npm/lib/install/validate-tree.js b/deps/npm/lib/install/validate-tree.js new file mode 100644 index 00000000000000..b3caefb55617f2 --- /dev/null +++ b/deps/npm/lib/install/validate-tree.js @@ -0,0 +1,69 @@ +'use strict' +var path = require('path') +var validate = require('aproba') +var asyncMap = require('slide').asyncMap +var chain = require('slide').chain +var npmInstallChecks = require('npm-install-checks') +var checkGit = npmInstallChecks.checkGit +var clone = require('lodash.clonedeep') +var normalizePackageData = require('normalize-package-data') +var npm = require('../npm.js') +var andFinishTracker = require('./and-finish-tracker.js') +var flattenTree = require('./flatten-tree.js') +var validateAllPeerDeps = require('./deps.js').validateAllPeerDeps +var packageId = require('../utils/package-id.js') + +module.exports = function (idealTree, log, next) { + validate('OOF', arguments) + var moduleMap = flattenTree(idealTree) + var modules = Object.keys(moduleMap).map(function (name) { return moduleMap[name] }) + + chain([ + [asyncMap, modules, function (mod, done) { + chain([ + mod.parent && !mod.isLink && [checkGit, mod.realpath], + [checkErrors, mod, idealTree] + ], done) + }], + [thenValidateAllPeerDeps, idealTree], + [thenCheckTop, idealTree] + ], andFinishTracker(log, next)) +} + +function checkErrors (mod, idealTree, next) { + if (mod.error && (mod.parent || path.resolve(npm.globalDir, '..') !== mod.path)) idealTree.warnings.push(mod.error) + next() +} + +function thenValidateAllPeerDeps (idealTree, next) { + validate('OF', arguments) + validateAllPeerDeps(idealTree, function (tree, pkgname, version) { + var warn = new Error(packageId(tree) + ' requires a peer of ' + pkgname + '@' + + version + ' but none was installed.') + warn.code = 'EPEERINVALID' + idealTree.warnings.push(warn) + }) + next() +} + +function thenCheckTop (idealTree, next) { + validate('OF', arguments) + if (idealTree.package.error) return next() + + // FIXME: when we replace read-package-json with something less magic, + // this should done elsewhere. + // As it is, the package has already been normalized and thus some + // errors are suppressed. + var pkg = clone(idealTree.package) + try { + normalizePackageData(pkg, function (warn) { + var warnObj = new Error(packageId(idealTree) + ' ' + warn) + warnObj.code = 'EPACKAGEJSON' + idealTree.warnings.push(warnObj) + }, false) + } catch (er) { + er.code = 'EPACKAGEJSON' + idealTree.warnings.push(er) + } + next() +} diff --git a/deps/npm/lib/install/writable.js b/deps/npm/lib/install/writable.js new file mode 100644 index 00000000000000..199b48f5970688 --- /dev/null +++ b/deps/npm/lib/install/writable.js @@ -0,0 +1,35 @@ +'use strict' +var path = require('path') +var fs = require('fs') +var inflight = require('inflight') +var accessError = require('./access-error.js') +var andIgnoreErrors = require('./and-ignore-errors.js') +var isFsAccessAvailable = require('./is-fs-access-available.js') + +if (isFsAccessAvailable) { + module.exports = fsAccessImplementation +} else { + module.exports = fsOpenImplementation +} + +// exposed only for testing purposes +module.exports.fsAccessImplementation = fsAccessImplementation +module.exports.fsOpenImplementation = fsOpenImplementation + +function fsAccessImplementation (dir, done) { + done = inflight('writable:' + dir, done) + if (!done) return + fs.access(dir, fs.W_OK, done) +} + +function fsOpenImplementation (dir, done) { + done = inflight('writable:' + dir, done) + if (!done) return + var tmp = path.join(dir, '.npm.check.permissions') + fs.open(tmp, 'w', function (er, fd) { + if (er) return done(accessError(dir, er)) + fs.close(fd, function () { + fs.unlink(tmp, andIgnoreErrors(done)) + }) + }) +} diff --git a/deps/npm/lib/link.js b/deps/npm/lib/link.js index 19c5dd062906e6..7ee518419fe7af 100644 --- a/deps/npm/lib/link.js +++ b/deps/npm/lib/link.js @@ -1,20 +1,21 @@ // link with no args: symlink the folder to the global location // link with package arg: symlink the global to the local -var npm = require("./npm.js") - , symlink = require("./utils/link.js") - , fs = require("graceful-fs") - , log = require("npmlog") - , asyncMap = require("slide").asyncMap - , chain = require("slide").chain - , path = require("path") - , build = require("./build.js") - , npa = require("npm-package-arg") +var npm = require('./npm.js') +var symlink = require('./utils/link.js') +var fs = require('graceful-fs') +var log = require('npmlog') +var asyncMap = require('slide').asyncMap +var chain = require('slide').chain +var path = require('path') +var build = require('./build.js') +var npa = require('npm-package-arg') module.exports = link -link.usage = "npm link (in package dir)" - + "\nnpm link (link global into local)" +link.usage = 'npm link (in package dir)' + + '\nnpm link [<@scope>/][@]' + + '\n\nalias: npm ln' link.completion = function (opts, cb) { var dir = npm.globalDir @@ -37,30 +38,44 @@ function link (args, cb) { } } - if (npm.config.get("global")) { - return cb(new Error("link should never be --global.\n" - +"Please re-run this command with --local")) + if (npm.config.get('global')) { + return cb(new Error( + 'link should never be --global.\n' + + 'Please re-run this command with --local' + )) } - if (args.length === 1 && args[0] === ".") args = [] + if (args.length === 1 && args[0] === '.') args = [] if (args.length) return linkInstall(args, cb) linkPkg(npm.prefix, cb) } +function parentFolder (id, folder) { + if (id[0] === '@') { + return path.resolve(folder, '..', '..') + } else { + return path.resolve(folder, '..') + } +} + 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) + var t = path.resolve(npm.globalDir, '..') + var pp = path.resolve(npm.globalDir, pkg) + var rp = null + var 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] + // we want the ONE thing that was installed into the global dir + var installed = data.filter(function (info) { + var id = info[0] + var folder = info[1] + return parentFolder(id, folder) === npm.globalDir + }) + var id = installed[0][0] + pp = installed[0][1] + var what = npa(id) pkg = what.name target = path.resolve(npm.dir, pkg) next() @@ -68,7 +83,7 @@ function linkInstall (pkgs, cb) { // 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)) { + 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) @@ -82,13 +97,13 @@ function linkInstall (pkgs, cb) { fs.lstat(pp, function (er, st) { if (er) { rp = pp - return npm.commands.install(t, pkg, n) + return npm.commands.install(t, [pkg], n) } else if (!st.isSymbolicLink()) { rp = pp next() } else { return fs.realpath(pp, function (er, real) { - if (er) log.warn("invalid symbolic link", pkg) + if (er) log.warn('invalid symbolic link', pkg) else rp = real next() }) @@ -96,39 +111,44 @@ function linkInstall (pkgs, cb) { }) function next () { - chain - ( [ [function (cb) { - log.verbose("link", "symlinking %s to %s", pp, target) - cb() - }] - , [symlink, pp, target] + if (npm.config.get('dry-run')) return resultPrinter(pkg, pp, target, rp, cb) + chain( + [ + [ function (cb) { + log.verbose('link', 'symlinking %s to %s', pp, target) + cb() + } ], + [symlink, pp, target], // do not run any scripts - , rp && [build, [target], npm.config.get("global"), build._noLC, true] - , [ resultPrinter, pkg, pp, target, rp ] ] - , cb ) + rp && [build, [target], npm.config.get('global'), build._noLC, true], + [resultPrinter, pkg, pp, target, rp] + ], + cb + ) } }, cb) } function linkPkg (folder, cb_) { var me = folder || npm.prefix - , readJson = require("read-package-json") + var readJson = require('read-package-json') - log.verbose("linkPkg", folder) + log.verbose('linkPkg', folder) - readJson(path.resolve(me, "package.json"), function (er, d) { + readJson(path.resolve(me, 'package.json'), function (er, d) { function cb (er) { return cb_(er, [[d && d._id, target, null, null]]) } if (er) return cb(er) if (!d.name) { - er = new Error("Package must have a name field to be linked") + er = new Error('Package must have a name field to be linked') return cb(er) } + if (npm.config.get('dry-run')) return resultPrinter(path.basename(me), me, target, cb) var target = path.resolve(npm.globalDir, d.name) symlink(me, target, false, true, function (er) { if (er) return cb(er) - log.verbose("link", "build target", target) + log.verbose('link', 'build target', target) // also install missing dependencies. npm.commands.install(me, [], function (er) { if (er) return cb(er) @@ -144,16 +164,21 @@ function linkPkg (folder, cb_) { } function resultPrinter (pkg, src, dest, rp, cb) { - if (typeof cb !== "function") cb = rp, rp = null + if (typeof cb !== 'function') { + cb = rp + rp = null + } var where = dest - rp = (rp || "").trim() - src = (src || "").trim() + rp = (rp || '').trim() + src = (src || '').trim() // XXX If --json is set, then look up the data from the package.json - if (npm.config.get("parseable")) { + if (npm.config.get('parseable')) { return parseableOutput(dest, rp || src, cb) } if (rp === src) rp = null - console.log(where + " -> " + src + (rp ? " -> " + rp: "")) + log.clearProgress() + console.log(where + ' -> ' + src + (rp ? ' -> ' + rp : '')) + log.showProgress() cb() } @@ -161,10 +186,12 @@ function parseableOutput (dest, rp, cb) { // XXX this should match ls --parseable and install --parseable // look up the data from package.json, format it the same way. // - // link is always effectively "long", since it doesn't help much to + // link is always effectively 'long', since it doesn't help much to // *just* print the target folder. // However, we don't actually ever read the version number, so // the second field is always blank. - console.log(dest + "::" + rp) + log.clearProgress() + console.log(dest + '::' + rp) + log.showProgress() cb() } diff --git a/deps/npm/lib/logout.js b/deps/npm/lib/logout.js index 64635be4decc4c..c1ac2818ef1837 100644 --- a/deps/npm/lib/logout.js +++ b/deps/npm/lib/logout.js @@ -1,39 +1,34 @@ module.exports = logout -var dezalgo = require("dezalgo") -var log = require("npmlog") +var dezalgo = require('dezalgo') +var log = require('npmlog') -var npm = require("./npm.js") -var mapToRegistry = require("./utils/map-to-registry.js") +var npm = require('./npm.js') +var mapToRegistry = require('./utils/map-to-registry.js') -logout.usage = "npm logout [--registry] [--scope]" +logout.usage = 'npm logout [--registry=] [--scope=<@scope>]' function logout (args, cb) { - npm.spinner.start() cb = dezalgo(cb) - mapToRegistry("/", npm.config, function (err, uri, auth, normalized) { + mapToRegistry('/', npm.config, function (err, uri, auth, normalized) { if (err) return cb(err) if (auth.token) { - log.verbose("logout", "clearing session token for", normalized) + log.verbose('logout', 'clearing session token for', normalized) npm.registry.logout(normalized, { auth: auth }, function (err) { if (err) return cb(err) npm.config.clearCredentialsByURI(normalized) - npm.spinner.stop() - npm.config.save("user", cb) + npm.config.save('user', cb) }) - } - else if (auth.username || auth.password) { - log.verbose("logout", "clearing user credentials for", normalized) + } else if (auth.username || auth.password) { + log.verbose('logout', 'clearing user credentials for', normalized) npm.config.clearCredentialsByURI(normalized) - npm.spinner.stop() - npm.config.save("user", cb) - } - else { + npm.config.save('user', cb) + } else { cb(new Error( - "Not logged in to", normalized + ",", "so can't log out." + 'Not logged in to', normalized + ',', "so can't log out." )) } }) diff --git a/deps/npm/lib/ls.js b/deps/npm/lib/ls.js index c7877b925e6be7..51f0b51550085a 100644 --- a/deps/npm/lib/ls.js +++ b/deps/npm/lib/ls.js @@ -1,4 +1,3 @@ - // show the installed versions of packages // // --parseable creates output like this: @@ -7,74 +6,99 @@ module.exports = exports = ls -var npm = require("./npm.js") - , readInstalled = require("read-installed") - , log = require("npmlog") - , path = require("path") - , archy = require("archy") - , semver = require("semver") - , url = require("url") - , color = require("ansicolors") - , npa = require("npm-package-arg") - -ls.usage = "npm ls" - -ls.completion = require("./utils/completion/installed-deep.js") +var path = require('path') +var url = require('url') +var readPackageTree = require('read-package-tree') +var log = require('npmlog') +var archy = require('archy') +var semver = require('semver') +var color = require('ansicolors') +var npa = require('npm-package-arg') +var iferr = require('iferr') +var npm = require('./npm.js') +var mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js') +var recalculateMetadata = require('./install/deps.js').recalculateMetadata +var packageId = require('./utils/package-id.js') + +ls.usage = 'npm ls [[<@scope>/] ...]' + + '\n\naliases: list, la, ll' + +ls.completion = require('./utils/completion/installed-deep.js') function ls (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } + var dir = path.resolve(npm.dir, '..') + readPackageTree(dir, andRecalculateMetadata(iferr(cb, function (physicalTree) { + lsFromTree(dir, physicalTree, args, silent, cb) + }))) +} - var dir = path.resolve(npm.dir, "..") +function andRecalculateMetadata (next) { + return function (er, tree) { + recalculateMetadata(tree || {}, log, next) + } +} - // npm ls 'foo@~1.3' bar 'baz@<2' - if (!args) args = [] - else args = args.map(function (a) { - var p = npa(a) - , name = p.name - , ver = semver.validRange(p.rawSpec) || "" +var lsFromTree = ls.fromTree = function (dir, physicalTree, args, silent, cb) { + if (typeof cb !== 'function') { + cb = silent + silent = false + } - return [ name, ver ] - }) + // npm ls 'foo@~1.3' bar 'baz@<2' + if (!args) { + args = [] + } else { + args = args.map(function (a) { + var p = npa(a) + var name = p.name + var ver = semver.validRange(p.rawSpec) || '' + + return [ name, ver ] + }) + } - var depth = npm.config.get("depth") - var opt = { depth: depth, log: log.warn, dev: true } - readInstalled(dir, opt, function (er, data) { - pruneNestedExtraneous(data) - filterByEnv(data) - var bfs = bfsify(data, args) - , lite = getLite(bfs) - - if (er || silent) return cb(er, data, lite) - - var long = npm.config.get("long") - , json = npm.config.get("json") - , out - if (json) { - var seen = [] - var d = long ? bfs : lite - // the raw data can be circular - out = JSON.stringify(d, function (k, o) { - if (typeof o === "object") { - if (-1 !== seen.indexOf(o)) return "[Circular]" - seen.push(o) - } - return o - }, 2) - } else if (npm.config.get("parseable")) { - out = makeParseable(bfs, long, dir) - } else if (data) { - out = makeArchy(bfs, long, dir) - } - console.log(out) + var data = mutateIntoLogicalTree.asReadInstalled(physicalTree) + + pruneNestedExtraneous(data) + filterByEnv(data) + var bfs = filterFound(bfsify(data), args) + var lite = getLite(bfs) + + if (silent) return cb(null, data, lite) + + var long = npm.config.get('long') + var json = npm.config.get('json') + var out + if (json) { + var seen = [] + var d = long ? bfs : lite + // the raw data can be circular + out = JSON.stringify(d, function (k, o) { + if (typeof o === 'object') { + if (seen.indexOf(o) !== -1) return '[Circular]' + seen.push(o) + } + return o + }, 2) + } else if (npm.config.get('parseable')) { + out = makeParseable(bfs, long, dir) + } else if (data) { + out = makeArchy(bfs, long, dir) + } + console.log(out) - if (args.length && !data._found) process.exitCode = 1 + if (args.length && !data._found) process.exitCode = 1 - // if any errors were found, then complain and exit status 1 - if (lite.problems && lite.problems.length) { - er = lite.problems.join("\n") - } - cb(er, data, lite) - }) + var er + // if any errors were found, then complain and exit status 1 + if (lite.problems && lite.problems.length) { + er = lite.problems.join('\n') + } + cb(er, data, lite) } function pruneNestedExtraneous (data, visited) { @@ -90,15 +114,15 @@ function pruneNestedExtraneous (data, visited) { } function filterByEnv (data) { - var dev = npm.config.get("dev") - var production = npm.config.get("production") - if (dev === production) return + var dev = npm.config.get('dev') || /^dev(elopment)?$/.test(npm.config.get('only')) + var production = npm.config.get('production') || /^prod(uction)?$/.test(npm.config.get('only')) var dependencies = {} var devDependencies = data.devDependencies || [] Object.keys(data.dependencies).forEach(function (name) { var keys = Object.keys(devDependencies) - if (production && keys.indexOf(name) !== -1) return - if (dev && keys.indexOf(name) === -1) return + if (production && !dev && keys.indexOf(name) !== -1) return + if (dev && !production && keys.indexOf(name) === -1) return + if (!dev && keys.indexOf(name) !== -1 && data.dependencies[name].missing) return dependencies[name] = data.dependencies[name] }) data.dependencies = dependencies @@ -111,59 +135,84 @@ function alphasort (a, b) { : a < b ? -1 : 0 } +function isCruft (data) { + return data.extraneous && data.error && data.error.code === 'ENOTDIR' +} + function getLite (data, noname) { var lite = {} - , maxDepth = npm.config.get("depth") + + if (isCruft(data)) return lite + + var maxDepth = npm.config.get('depth') if (!noname && data.name) lite.name = data.name if (data.version) lite.version = data.version if (data.extraneous) { lite.extraneous = true lite.problems = lite.problems || [] - lite.problems.push( "extraneous: " - + data.name + "@" + data.version - + " " + (data.path || "") ) + lite.problems.push('extraneous: ' + packageId(data) + ' ' + (data.path || '')) } - if (data._from) + if (data.error && data.path !== path.resolve(npm.globalDir, '..') && + (data.error.code !== 'ENOENT' || noname)) { + lite.invalid = true + lite.problems = lite.problems || [] + var message = data.error.message + lite.problems.push('error in ' + data.path + ': ' + message) + } + + if (data._from) { lite.from = data._from + } - if (data._resolved) + if (data._resolved) { lite.resolved = data._resolved + } if (data.invalid) { lite.invalid = true lite.problems = lite.problems || [] - lite.problems.push( "invalid: " - + data.name + "@" + data.version - + " " + (data.path || "") ) + lite.problems.push('invalid: ' + + packageId(data) + + ' ' + (data.path || '')) } if (data.peerInvalid) { lite.peerInvalid = true lite.problems = lite.problems || [] - lite.problems.push( "peer invalid: " - + data.name + "@" + data.version - + " " + (data.path || "") ) + lite.problems.push('peer dep not met: ' + + packageId(data) + + ' ' + (data.path || '')) } - if (data.dependencies) { - var deps = Object.keys(data.dependencies) - if (deps.length) lite.dependencies = deps.map(function (d) { + var deps = (data.dependencies && Object.keys(data.dependencies)) || [] + if (deps.length) { + lite.dependencies = deps.map(function (d) { var dep = data.dependencies[d] - if (typeof dep === "string") { + if (dep.missing && !dep.optional) { lite.problems = lite.problems || [] var p if (data.depth > maxDepth) { - p = "max depth reached: " + p = 'max depth reached: ' } else { - p = "missing: " + p = 'missing: ' } - p += d + "@" + dep - + ", required by " - + data.name + "@" + data.version + p += d + '@' + dep.requiredBy + + ', required by ' + + packageId(data) lite.problems.push(p) - return [d, { required: dep, missing: true }] + return [d, { required: dep.requiredBy, missing: true }] + } else if (dep.peerMissing) { + lite.problems = lite.problems || [] + dep.peerMissing.forEach(function (missing) { + var pdm = 'peer dep missing: ' + + missing.requires + + ', required by ' + + missing.requiredBy + lite.problems.push(pdm) + }) + return [d, { required: dep, peerMissing: true }] } return [d, getLite(dep, true)] }).reduce(function (deps, d) { @@ -178,7 +227,7 @@ function getLite (data, noname) { return lite } -function bfsify (root, args, current, queue, seen) { +function bfsify (root) { // walk over the data, and turn it from this: // +-- a // | `-- b @@ -188,137 +237,162 @@ function bfsify (root, args, current, queue, seen) { // +-- a // `-- b // which looks nicer - args = args || [] - current = current || root - queue = queue || [] - seen = seen || [root] - var deps = current.dependencies = current.dependencies || {} - Object.keys(deps).forEach(function (d) { - var dep = deps[d] - if (typeof dep !== "object") return - if (seen.indexOf(dep) !== -1) { - if (npm.config.get("parseable") || !npm.config.get("long")) { - delete deps[d] - return - } else { - dep = deps[d] = Object.create(dep) - dep.dependencies = {} + var queue = [root] + var seen = [root] + + while (queue.length) { + var current = queue.shift() + var deps = current.dependencies = current.dependencies || {} + Object.keys(deps).forEach(function (d) { + var dep = deps[d] + if (dep.missing) return + if (seen.indexOf(dep) !== -1) { + if (npm.config.get('parseable') || !npm.config.get('long')) { + delete deps[d] + return + } else { + dep = deps[d] = Object.create(dep) + dep.dependencies = {} + } } - } - queue.push(dep) - seen.push(dep) - }) - - if (!queue.length) { - // if there were args, then only show the paths to found nodes. - return filterFound(root, args) + queue.push(dep) + seen.push(dep) + }) } - return bfsify(root, args, queue.shift(), queue, seen) + + return root } function filterFound (root, args) { if (!args.length) return root var deps = root.dependencies - if (deps) Object.keys(deps).forEach(function (d) { - var dep = filterFound(deps[d], args) - - // see if this one itself matches - var found = false - for (var i = 0; !found && i < args.length; i ++) { - if (d === args[i][0]) { - found = semver.satisfies(dep.version, args[i][1], true) + if (deps) { + Object.keys(deps).forEach(function (d) { + var dep = filterFound(deps[d], args) + if (dep.peerMissing) return + + // see if this one itself matches + var found = false + for (var i = 0; !found && i < args.length; i++) { + if (d === args[i][0]) { + found = semver.satisfies(dep.version, args[i][1], true) + } } - } - // included explicitly - if (found) dep._found = true - // included because a child was included - if (dep._found && !root._found) root._found = 1 - // not included - if (!dep._found) delete deps[d] - }) + // included explicitly + if (found) dep._found = true + // included because a child was included + if (dep._found && !root._found) root._found = 1 + // not included + if (!dep._found) delete deps[d] + }) + } if (!root._found) root._found = false return root } function makeArchy (data, long, dir) { var out = makeArchy_(data, long, dir, 0) - return archy(out, "", { unicode: npm.config.get("unicode") }) + return archy(out, '', { unicode: npm.config.get('unicode') }) } function makeArchy_ (data, long, dir, depth, parent, d) { - if (typeof data === "string") { - if (depth -1 <= npm.config.get("depth")) { + if (data.missing) { + if (depth - 1 <= npm.config.get('depth')) { // just missing - var unmet = "UNMET DEPENDENCY" + var unmet = 'UNMET ' + (data.optional ? 'OPTIONAL ' : '') + 'DEPENDENCY' if (npm.color) { - unmet = color.bgBlack(color.red(unmet)) + if (data.optional) { + unmet = color.bgBlack(color.yellow(unmet)) + } else { + unmet = color.bgBlack(color.red(unmet)) + } } - data = unmet + " " + d + "@" + data + data = unmet + ' ' + d + '@' + data.requiredBy } else { - data = d+"@"+ data + data = d + '@' + data.requiredBy } return data } var out = {} // the top level is a bit special. - out.label = data._id || "" + out.label = data._id || '' if (data._found === true && data._id) { if (npm.color) { - out.label = color.bgBlack(color.yellow(out.label.trim())) + " " + out.label = color.bgBlack(color.yellow(out.label.trim())) + ' ' } else { - out.label = out.label.trim() + " " + out.label = out.label.trim() + ' ' } } - if (data.link) out.label += " -> " + data.link + if (data.link) out.label += ' -> ' + data.link if (data.invalid) { - if (data.realName !== data.name) out.label += " ("+data.realName+")" - var invalid = "invalid" + if (data.realName !== data.name) out.label += ' (' + data.realName + ')' + var invalid = 'invalid' if (npm.color) invalid = color.bgBlack(color.red(invalid)) - out.label += " " + invalid + out.label += ' ' + invalid } if (data.peerInvalid) { - var peerInvalid = "peer invalid" + var peerInvalid = 'peer invalid' if (npm.color) peerInvalid = color.bgBlack(color.red(peerInvalid)) - out.label += " " + peerInvalid + out.label += ' ' + peerInvalid + } + + if (data.peerMissing) { + var peerMissing = 'UNMET PEER DEPENDENCY' + if (npm.color) peerMissing = color.bgBlack(color.red(peerMissing)) + out.label = peerMissing + ' ' + out.label } if (data.extraneous && data.path !== dir) { - var extraneous = "extraneous" + var extraneous = 'extraneous' if (npm.color) extraneous = color.bgBlack(color.green(extraneous)) - out.label += " " + extraneous + out.label += ' ' + extraneous + } + + if (data.error && depth) { + var message = data.error.message + if (message.indexOf('\n')) message = message.slice(0, message.indexOf('\n')) + var error = 'error: ' + message + if (npm.color) error = color.bgRed(color.brightWhite(error)) + out.label += ' ' + error } // add giturl to name@version if (data._resolved) { - var type = npa(data._resolved).type - var isGit = type === 'git' || type === 'hosted' - if (isGit) { - out.label += ' (' + data._resolved + ')' + try { + var type = npa(data._resolved).type + var isGit = type === 'git' || type === 'hosted' + if (isGit) { + out.label += ' (' + data._resolved + ')' + } + } catch (ex) { + // npa threw an exception then it ain't git so whatev } } if (long) { - if (dir === data.path) out.label += "\n" + dir - out.label += "\n" + getExtras(data, dir) + if (dir === data.path) out.label += '\n' + dir + out.label += '\n' + getExtras(data, dir) } else if (dir === data.path) { - if (out.label) out.label += " " + if (out.label) out.label += ' ' out.label += dir } // now all the children. out.nodes = [] - if (depth <= npm.config.get("depth")) { + if (depth <= npm.config.get('depth')) { out.nodes = Object.keys(data.dependencies || {}) - .sort(alphasort).map(function (d) { + .sort(alphasort).filter(function (d) { + return !isCruft(data.dependencies[d]) + }).map(function (d) { return makeArchy_(data.dependencies[d], long, dir, depth + 1, data, d) }) } if (out.nodes.length === 0 && data.path === dir) { - out.nodes = ["(empty)"] + out.nodes = ['(empty)'] } return out @@ -332,16 +406,15 @@ function getExtras (data) { if (data.homepage) extras.push(data.homepage) if (data._from) { var from = data._from - if (from.indexOf(data.name + "@") === 0) { + if (from.indexOf(data.name + '@') === 0) { from = from.substr(data.name.length + 1) } var u = url.parse(from) if (u.protocol) extras.push(from) } - return extras.join("\n") + return extras.join('\n') } - function makeParseable (data, long, dir, depth, parent, d) { depth = depth || 0 @@ -351,36 +424,38 @@ function makeParseable (data, long, dir, depth, parent, d) { return makeParseable(data.dependencies[d], long, dir, depth + 1, data, d) })) .filter(function (x) { return x }) - .join("\n") + .join('\n') } function makeParseable_ (data, long, dir, depth, parent, d) { - if (data.hasOwnProperty("_found") && data._found !== true) return "" - - if (typeof data === "string") { - if (data.depth < npm.config.get("depth")) { - data = npm.config.get("long") - ? path.resolve(parent.path, "node_modules", d) - + ":"+d+"@"+JSON.stringify(data)+":INVALID:MISSING" - : "" + if (data.hasOwnProperty('_found') && data._found !== true) return '' + + if (data.missing) { + if (depth < npm.config.get('depth')) { + data = npm.config.get('long') + ? path.resolve(parent.path, 'node_modules', d) + + ':' + d + '@' + JSON.stringify(data.requiredBy) + ':INVALID:MISSING' + : '' } else { - data = path.resolve(data.path || "", "node_modules", d || "") - + (npm.config.get("long") - ? ":" + d + "@" + JSON.stringify(data) - + ":" // no realpath resolved - + ":MAXDEPTH" - : "") + data = path.resolve(dir || '', 'node_modules', d || '') + + (npm.config.get('long') + ? ':' + d + '@' + JSON.stringify(data.requiredBy) + + ':' + // no realpath resolved + ':MAXDEPTH' + : '') } return data } - if (!npm.config.get("long")) return data.path + if (!npm.config.get('long')) return data.path - return data.path - + ":" + (data._id || "") - + ":" + (data.realPath !== data.path ? data.realPath : "") - + (data.extraneous ? ":EXTRANEOUS" : "") - + (data.invalid ? ":INVALID" : "") - + (data.peerInvalid ? ":PEERINVALID" : "") + return data.path + + ':' + (data._id || '') + + ':' + (data.realPath !== data.path ? data.realPath : '') + + (data.extraneous ? ':EXTRANEOUS' : '') + + (data.error && data.path !== path.resolve(npm.globalDir, '..') ? ':ERROR' : '') + + (data.invalid ? ':INVALID' : '') + + (data.peerInvalid ? ':PEERINVALID' : '') + + (data.peerMissing ? ':PEERINVALID:MISSING' : '') } diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index c049d95ba6e24b..b714a82481ec64 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -1,469 +1,483 @@ -;(function(){ -// windows: running "npm blah" in this folder will invoke WSH, not node. -if (typeof WScript !== "undefined") { - WScript.echo("npm does not work when run\n" - +"with the Windows Scripting Host\n\n" - +"'cd' to a different directory,\n" - +"or type 'npm.cmd ',\n" - +"or type 'node npm '.") - WScript.quit(1) - return -} - - -var EventEmitter = require("events").EventEmitter - , npm = module.exports = new EventEmitter() - , npmconf = require("./config/core.js") - , log = require("npmlog") - , gfs = require('graceful-fs') - , fs = gfs.gracefulify(require('fs')) - , path = require("path") - , abbrev = require("abbrev") - , which = require("which") - , CachingRegClient = require("./cache/caching-client.js") - , charSpin = require("char-spinner") - -npm.config = { - loaded: false, - get: function() { - throw new Error('npm.load() required') - }, - set: function() { - throw new Error('npm.load() required') +;(function () { + // windows: running 'npm blah' in this folder will invoke WSH, not node. + /*globals WScript*/ + if (typeof WScript !== 'undefined') { + WScript.echo( + 'npm does not work when run\n' + + 'with the Windows Scripting Host\n\n' + + '"cd" to a different directory,\n' + + 'or type "npm.cmd ",\n' + + 'or type "node npm ".' + ) + WScript.quit(1) + return } -} -npm.commands = {} + var gfs = require('graceful-fs') + // Patch the global fs module here at the app level + var fs = gfs.gracefulify(require('fs')) + + var EventEmitter = require('events').EventEmitter + var npm = module.exports = new EventEmitter() + var npmconf = require('./config/core.js') + var log = require('npmlog') + + var path = require('path') + var abbrev = require('abbrev') + var which = require('which') + var CachingRegClient = require('./cache/caching-client.js') + var parseJSON = require('./utils/parse-json.js') + + npm.config = { + loaded: false, + get: function () { + throw new Error('npm.load() required') + }, + set: function () { + throw new Error('npm.load() required') + } + } -npm.rollbacks = [] + npm.commands = {} + + npm.rollbacks = [] -try { - // startup, ok to do this synchronously - var j = JSON.parse(fs.readFileSync( - path.join(__dirname, "../package.json"))+"") - npm.version = j.version -} catch (ex) { try { - log.info("error reading version", ex) - } catch (er) {} - npm.version = ex -} + // startup, ok to do this synchronously + var j = parseJSON(fs.readFileSync( + path.join(__dirname, '../package.json')) + '') + npm.version = j.version + } catch (ex) { + try { + log.info('error reading version', ex) + } catch (er) {} + npm.version = ex + } + + var commandCache = {} -var commandCache = {} // short names for common things - , aliases = { "rm" : "uninstall" - , "r" : "uninstall" - , "un" : "uninstall" - , "unlink" : "uninstall" - , "remove" : "uninstall" - , "rb" : "rebuild" - , "list" : "ls" - , "la" : "ls" - , "ll" : "ls" - , "ln" : "link" - , "i" : "install" - , "isntall" : "install" - , "up" : "update" - , "upgrade" : "update" - , "c" : "config" - , "dist-tags" : "dist-tag" - , "info" : "view" - , "show" : "view" - , "find" : "search" - , "s" : "search" - , "se" : "search" - , "author" : "owner" - , "home" : "docs" - , "issues": "bugs" - , "unstar": "star" // same function - , "apihelp" : "help" - , "login": "adduser" - , "add-user": "adduser" - , "tst": "test" - , "t": "test" - , "find-dupes": "dedupe" - , "ddp": "dedupe" - , "v": "view" - , "verison": "version" - } - - , aliasNames = Object.keys(aliases) - // these are filenames in . - , cmdList = [ "install" - , "uninstall" - , "cache" - , "config" - , "set" - , "get" - , "update" - , "outdated" - , "prune" - , "pack" - , "dedupe" - - , "rebuild" - , "link" - - , "publish" - , "star" - , "stars" - , "tag" - , "adduser" - , "logout" - , "unpublish" - , "owner" - , "access" - , "team" - , "deprecate" - , "shrinkwrap" - - , "help" - , "help-search" - , "ls" - , "search" - , "view" - , "init" - , "version" - , "edit" - , "explore" - , "docs" - , "repo" - , "bugs" - , "faq" - , "root" - , "prefix" - , "bin" - , "whoami" - , "dist-tag" - , "ping" - - , "test" - , "stop" - , "start" - , "restart" - , "run-script" - , "completion" - ] - , plumbing = [ "build" - , "unbuild" - , "xmas" - , "substack" - , "visnup" - ] - , littleGuys = [ "isntall" ] - , fullList = cmdList.concat(aliasNames).filter(function (c) { - return plumbing.indexOf(c) === -1 - }) - , abbrevs = abbrev(fullList) - -// we have our reasons -fullList = npm.fullList = fullList.filter(function (c) { - return littleGuys.indexOf(c) === -1 -}) - -npm.spinner = - { int: null - , started: false - , start: function () { - if (npm.spinner.int) return - var c = npm.config.get("spin") - if (!c) return - var stream = npm.config.get("logstream") - var opt = { tty: c !== "always", stream: stream } - opt.cleanup = !npm.spinner.started - npm.spinner.int = charSpin(opt) - npm.spinner.started = true - } - , stop: function () { - clearInterval(npm.spinner.int) - npm.spinner.int = null - } + var aliases = { + 'rm': 'uninstall', + 'r': 'uninstall', + 'un': 'uninstall', + 'unlink': 'uninstall', + 'remove': 'uninstall', + 'rb': 'rebuild', + 'list': 'ls', + 'la': 'ls', + 'll': 'ls', + 'ln': 'link', + 'i': 'install', + 'isntall': 'install', + 'up': 'update', + 'upgrade': 'update', + 'c': 'config', + 'dist-tags': 'dist-tag', + 'info': 'view', + 'show': 'view', + 'find': 'search', + 's': 'search', + 'se': 'search', + 'author': 'owner', + 'home': 'docs', + 'issues': 'bugs', + 'unstar': 'star', // same function + 'apihelp': 'help', + 'login': 'adduser', + 'add-user': 'adduser', + 'tst': 'test', + 't': 'test', + 'find-dupes': 'dedupe', + 'ddp': 'dedupe', + 'v': 'view', + 'verison': 'version' } -Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) { - Object.defineProperty(npm.commands, c, { get : function () { - if (!loaded) throw new Error( - "Call npm.load(config, cb) before using this command.\n"+ - "See the README.md or cli.js for example usage.") - var a = npm.deref(c) - if (c === "la" || c === "ll") { - npm.config.set("long", true) - } + var aliasNames = Object.keys(aliases) - npm.command = c - if (commandCache[a]) return commandCache[a] + // these are filenames in . + var cmdList = [ + 'install', + 'uninstall', + 'cache', + 'config', + 'set', + 'get', + 'update', + 'outdated', + 'prune', + 'pack', + 'dedupe', + + 'rebuild', + 'link', + + 'publish', + 'star', + 'stars', + 'tag', + 'adduser', + 'logout', + 'unpublish', + 'owner', + 'access', + 'team', + 'deprecate', + 'shrinkwrap', + + 'help', + 'help-search', + 'ls', + 'search', + 'view', + 'init', + 'version', + 'edit', + 'explore', + 'docs', + 'repo', + 'bugs', + 'faq', + 'root', + 'prefix', + 'bin', + 'whoami', + 'dist-tag', + 'ping', + + 'test', + 'stop', + 'start', + 'restart', + 'run-script', + 'completion' + ] + var plumbing = [ + 'build', + 'unbuild', + 'xmas', + 'substack', + 'visnup' + ] + var littleGuys = [ 'isntall' ] + var fullList = cmdList.concat(aliasNames).filter(function (c) { + return plumbing.indexOf(c) === -1 + }) + var abbrevs = abbrev(fullList) - var cmd = require(__dirname+"/"+a+".js") + // we have our reasons + fullList = npm.fullList = fullList.filter(function (c) { + return littleGuys.indexOf(c) === -1 + }) - commandCache[a] = function () { - var args = Array.prototype.slice.call(arguments, 0) - if (typeof args[args.length - 1] !== "function") { - args.push(defaultCb) + Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) { + Object.defineProperty(npm.commands, c, { get: function () { + if (!loaded) { + throw new Error( + 'Call npm.load(config, cb) before using this command.\n' + + 'See the README.md or cli.js for example usage.' + ) } - if (args.length === 1) args.unshift([]) - - npm.registry.version = npm.version - if (!npm.registry.refer) { - npm.registry.refer = [a].concat(args[0]).map(function (arg) { - // exclude anything that might be a URL, path, or private module - // Those things will always have a slash in them somewhere - if (arg && arg.match && arg.match(/\/|\\/)) { - return "[REDACTED]" - } else { - return arg - } - }).filter(function (arg) { - return arg && arg.match - }).join(" ") + var a = npm.deref(c) + if (c === 'la' || c === 'll') { + npm.config.set('long', true) } - cmd.apply(npm, args) - } + npm.command = c + if (commandCache[a]) return commandCache[a] + + var cmd = require(__dirname + '/' + a + '.js') + + commandCache[a] = function () { + var args = Array.prototype.slice.call(arguments, 0) + if (typeof args[args.length - 1] !== 'function') { + args.push(defaultCb) + } + if (args.length === 1) args.unshift([]) + + npm.registry.version = npm.version + if (!npm.registry.refer) { + npm.registry.refer = [a].concat(args[0]).map(function (arg) { + // exclude anything that might be a URL, path, or private module + // Those things will always have a slash in them somewhere + if (arg && arg.match && arg.match(/\/|\\/)) { + return '[REDACTED]' + } else { + return arg + } + }).filter(function (arg) { + return arg && arg.match + }).join(' ') + } + + cmd.apply(npm, args) + } - Object.keys(cmd).forEach(function (k) { - commandCache[a][k] = cmd[k] - }) + Object.keys(cmd).forEach(function (k) { + commandCache[a][k] = cmd[k] + }) - return commandCache[a] - }, enumerable: fullList.indexOf(c) !== -1, configurable: true }) + return commandCache[a] + }, enumerable: fullList.indexOf(c) !== -1, configurable: true }) - // make css-case commands callable via camelCase as well - if (c.match(/\-([a-z])/)) { - addCommand(c.replace(/\-([a-z])/g, function (a, b) { - return b.toUpperCase() - })) - } -}) + // make css-case commands callable via camelCase as well + if (c.match(/\-([a-z])/)) { + addCommand(c.replace(/\-([a-z])/g, function (a, b) { + return b.toUpperCase() + })) + } + }) -function defaultCb (er, data) { - if (er) console.error(er.stack || er.message) - else console.log(data) -} + function defaultCb (er, data) { + log.disableProgress() + if (er) console.error(er.stack || er.message) + else console.log(data) + } -npm.deref = function (c) { - if (!c) return "" - if (c.match(/[A-Z]/)) c = c.replace(/([A-Z])/g, function (m) { - return "-" + m.toLowerCase() - }) - if (plumbing.indexOf(c) !== -1) return c - var a = abbrevs[c] - if (aliases[a]) a = aliases[a] - return a -} - -var loaded = false - , loading = false - , loadErr = null - , loadListeners = [] - -function loadCb (er) { - loadListeners.forEach(function (cb) { - process.nextTick(cb.bind(npm, er, npm)) - }) - loadListeners.length = 0 -} - -npm.load = function (cli, cb_) { - if (!cb_ && typeof cli === "function") cb_ = cli , cli = {} - if (!cb_) cb_ = function () {} - if (!cli) cli = {} - loadListeners.push(cb_) - if (loaded || loadErr) return cb(loadErr) - if (loading) return - loading = true - var onload = true - - function cb (er) { - if (loadErr) return - loadErr = er - if (er) return cb_(er) - if (npm.config.get("force")) { - log.warn("using --force", "I sure hope you know what you are doing.") - } - npm.config.loaded = true - loaded = true - loadCb(loadErr = er) - if (onload = onload && npm.config.get("onload-script")) { - require(onload) - onload = false + npm.deref = function (c) { + if (!c) return '' + if (c.match(/[A-Z]/)) { + c = c.replace(/([A-Z])/g, function (m) { + return '-' + m.toLowerCase() + }) } + if (plumbing.indexOf(c) !== -1) return c + var a = abbrevs[c] + if (aliases[a]) a = aliases[a] + return a } - log.pause() + var loaded = false + var loading = false + var loadErr = null + var loadListeners = [] - load(npm, cli, cb) -} + function loadCb (er) { + loadListeners.forEach(function (cb) { + process.nextTick(cb.bind(npm, er, npm)) + }) + loadListeners.length = 0 + } -function load (npm, cli, cb) { - which(process.argv[0], function (er, node) { - if (!er && node.toUpperCase() !== process.execPath.toUpperCase()) { - log.verbose("node symlink", node) - process.execPath = node - process.installPrefix = path.resolve(node, "..", "..") + npm.load = function (cli, cb_) { + if (!cb_ && typeof cli === 'function') { + cb_ = cli + cli = {} } - - // look up configs - //console.error("about to look up configs") - - var builtin = path.resolve(__dirname, "..", "npmrc") - npmconf.load(cli, builtin, function (er, config) { - if (er === config) er = null - - npm.config = config - if (er) return cb(er) - - // if the "project" config is not a filename, and we're - // not in global mode, then that means that it collided - // with either the default or effective userland config - if (!config.get("global") - && config.sources.project - && config.sources.project.type !== "ini") { - log.verbose("config" - , "Skipping project config: %s. " - + "(matches userconfig)" - , config.localPrefix + "/.npmrc") + if (!cb_) cb_ = function () {} + if (!cli) cli = {} + loadListeners.push(cb_) + if (loaded || loadErr) return cb(loadErr) + if (loading) return + loading = true + var onload = true + + function cb (er) { + if (loadErr) return + loadErr = er + if (er) return cb_(er) + if (npm.config.get('force')) { + log.warn('using --force', 'I sure hope you know what you are doing.') } - - // Include npm-version and node-version in user-agent - var ua = config.get("user-agent") || "" - ua = ua.replace(/\{node-version\}/gi, process.version) - ua = ua.replace(/\{npm-version\}/gi, npm.version) - ua = ua.replace(/\{platform\}/gi, process.platform) - ua = ua.replace(/\{arch\}/gi, process.arch) - config.set("user-agent", ua) - - var color = config.get("color") - - log.level = config.get("loglevel") - log.heading = config.get("heading") || "npm" - log.stream = config.get("logstream") - - switch (color) { - case "always": - log.enableColor() - npm.color = true - break - case false: - log.disableColor() - npm.color = false - break - default: - var tty = require("tty") - if (process.stdout.isTTY) npm.color = true - else if (!tty.isatty) npm.color = true - else if (tty.isatty(1)) npm.color = true - else npm.color = false - break + npm.config.loaded = true + loaded = true + loadCb(loadErr = er) + onload = onload && npm.config.get('onload-script') + if (onload) { + require(onload) + onload = false } + } - log.resume() - - // at this point the configs are all set. - // go ahead and spin up the registry client. - npm.registry = new CachingRegClient(npm.config) - - var umask = npm.config.get("umask") - npm.modes = { exec: 0777 & (~umask) - , file: 0666 & (~umask) - , umask: umask } + log.pause() - var gp = Object.getOwnPropertyDescriptor(config, "globalPrefix") - Object.defineProperty(npm, "globalPrefix", gp) + load(npm, cli, cb) + } - var lp = Object.getOwnPropertyDescriptor(config, "localPrefix") - Object.defineProperty(npm, "localPrefix", lp) + function load (npm, cli, cb) { + which(process.argv[0], function (er, node) { + if (!er && node.toUpperCase() !== process.execPath.toUpperCase()) { + log.verbose('node symlink', node) + process.execPath = node + process.installPrefix = path.resolve(node, '..', '..') + } - return cb(null, npm) + // look up configs + var builtin = path.resolve(__dirname, '..', 'npmrc') + npmconf.load(cli, builtin, function (er, config) { + if (er === config) er = null + + npm.config = config + if (er) return cb(er) + + // if the 'project' config is not a filename, and we're + // not in global mode, then that means that it collided + // with either the default or effective userland config + if (!config.get('global') && + config.sources.project && + config.sources.project.type !== 'ini') { + log.verbose( + 'config', + 'Skipping project config: %s. (matches userconfig)', + config.localPrefix + '/.npmrc' + ) + } + + // Include npm-version and node-version in user-agent + var ua = config.get('user-agent') || '' + ua = ua.replace(/\{node-version\}/gi, process.version) + ua = ua.replace(/\{npm-version\}/gi, npm.version) + ua = ua.replace(/\{platform\}/gi, process.platform) + ua = ua.replace(/\{arch\}/gi, process.arch) + config.set('user-agent', ua) + + var color = config.get('color') + + log.level = config.get('loglevel') + log.heading = config.get('heading') || 'npm' + log.stream = config.get('logstream') + + switch (color) { + case 'always': + log.enableColor() + npm.color = true + break + case false: + log.disableColor() + npm.color = false + break + default: + var tty = require('tty') + if (process.stdout.isTTY) npm.color = true + else if (!tty.isatty) npm.color = true + else if (tty.isatty(1)) npm.color = true + else npm.color = false + break + } + + log.resume() + + if (config.get('progress')) { + log.enableProgress() + } else { + log.disableProgress() + } + + // at this point the configs are all set. + // go ahead and spin up the registry client. + npm.registry = new CachingRegClient(npm.config) + + var umask = npm.config.get('umask') + npm.modes = { + exec: parseInt('0777', 8) & (~umask), + file: parseInt('0666', 8) & (~umask), + umask: umask + } + + var gp = Object.getOwnPropertyDescriptor(config, 'globalPrefix') + Object.defineProperty(npm, 'globalPrefix', gp) + + var lp = Object.getOwnPropertyDescriptor(config, 'localPrefix') + Object.defineProperty(npm, 'localPrefix', lp) + + return cb(null, npm) + }) }) - }) -} + } -Object.defineProperty(npm, "prefix", - { get : function () { - return npm.config.get("global") ? npm.globalPrefix : npm.localPrefix - } - , set : function (r) { - var k = npm.config.get("global") ? "globalPrefix" : "localPrefix" - return npm[k] = r - } - , enumerable : true - }) + Object.defineProperty(npm, 'prefix', + { + get: function () { + return npm.config.get('global') ? npm.globalPrefix : npm.localPrefix + }, + set: function (r) { + var k = npm.config.get('global') ? 'globalPrefix' : 'localPrefix' + npm[k] = r + return r + }, + enumerable: true + }) -Object.defineProperty(npm, "bin", - { get : function () { - if (npm.config.get("global")) return npm.globalBin - return path.resolve(npm.root, ".bin") - } - , enumerable : true - }) + Object.defineProperty(npm, 'bin', + { + get: function () { + if (npm.config.get('global')) return npm.globalBin + return path.resolve(npm.root, '.bin') + }, + enumerable: true + }) -Object.defineProperty(npm, "globalBin", - { get : function () { - var b = npm.globalPrefix - if (process.platform !== "win32") b = path.resolve(b, "bin") - return b - } - }) + Object.defineProperty(npm, 'globalBin', + { + get: function () { + var b = npm.globalPrefix + if (process.platform !== 'win32') b = path.resolve(b, 'bin') + return b + } + }) -Object.defineProperty(npm, "dir", - { get : function () { - if (npm.config.get("global")) return npm.globalDir - return path.resolve(npm.prefix, "node_modules") - } - , enumerable : true - }) + Object.defineProperty(npm, 'dir', + { + get: function () { + if (npm.config.get('global')) return npm.globalDir + return path.resolve(npm.prefix, 'node_modules') + }, + enumerable: true + }) -Object.defineProperty(npm, "globalDir", - { get : function () { - return (process.platform !== "win32") - ? path.resolve(npm.globalPrefix, "lib", "node_modules") - : path.resolve(npm.globalPrefix, "node_modules") - } - , enumerable : true - }) + Object.defineProperty(npm, 'globalDir', + { + get: function () { + return (process.platform !== 'win32') + ? path.resolve(npm.globalPrefix, 'lib', 'node_modules') + : path.resolve(npm.globalPrefix, 'node_modules') + }, + enumerable: true + }) -Object.defineProperty(npm, "root", - { get : function () { return npm.dir } }) + Object.defineProperty(npm, 'root', + { get: function () { return npm.dir } }) -Object.defineProperty(npm, "cache", - { get : function () { return npm.config.get("cache") } - , set : function (r) { return npm.config.set("cache", r) } - , enumerable : true - }) + Object.defineProperty(npm, 'cache', + { get: function () { return npm.config.get('cache') }, + set: function (r) { return npm.config.set('cache', r) }, + enumerable: true + }) -var tmpFolder -var rand = require("crypto").randomBytes(4).toString("hex") -Object.defineProperty(npm, "tmp", - { get : function () { - if (!tmpFolder) tmpFolder = "npm-" + process.pid + "-" + rand - return path.resolve(npm.config.get("tmp"), tmpFolder) - } - , enumerable : true - }) + var tmpFolder + var rand = require('crypto').randomBytes(4).toString('hex') + Object.defineProperty(npm, 'tmp', + { + get: function () { + if (!tmpFolder) tmpFolder = 'npm-' + process.pid + '-' + rand + return path.resolve(npm.config.get('tmp'), tmpFolder) + }, + enumerable: true + }) -// the better to repl you with -Object.getOwnPropertyNames(npm.commands).forEach(function (n) { - if (npm.hasOwnProperty(n) || n === "config") return + // the better to repl you with + Object.getOwnPropertyNames(npm.commands).forEach(function (n) { + if (npm.hasOwnProperty(n) || n === 'config') return - Object.defineProperty(npm, n, { get: function () { - return function () { - var args = Array.prototype.slice.call(arguments, 0) - , cb = defaultCb + Object.defineProperty(npm, n, { get: function () { + return function () { + var args = Array.prototype.slice.call(arguments, 0) + var cb = defaultCb - if (args.length === 1 && Array.isArray(args[0])) { - args = args[0] - } + if (args.length === 1 && Array.isArray(args[0])) { + args = args[0] + } - if (typeof args[args.length - 1] === "function") { - cb = args.pop() + if (typeof args[args.length - 1] === 'function') { + cb = args.pop() + } + npm.commands[n](args, cb) } + }, enumerable: false, configurable: true }) + }) - npm.commands[n](args, cb) - } - }, enumerable: false, configurable: true }) -}) - -if (require.main === module) { - require("../bin/npm-cli.js") -} + if (require.main === module) { + require('../bin/npm-cli.js') + } })() diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js index ab49d109690ee6..44dd8bf0067252 100644 --- a/deps/npm/lib/outdated.js +++ b/deps/npm/lib/outdated.js @@ -16,97 +16,130 @@ packages. module.exports = outdated -outdated.usage = "npm outdated [ [ ...]]" - -outdated.completion = require("./utils/completion/installed-deep.js") - - -var path = require("path") - , readJson = require("read-package-json") - , cache = require("./cache.js") - , asyncMap = require("slide").asyncMap - , npm = require("./npm.js") - , url = require("url") - , 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") - , readInstalled = require("read-installed") - , long = npm.config.get("long") - , log = require("npmlog") +outdated.usage = 'npm outdated [[<@scope>/] ...]' + +outdated.completion = require('./utils/completion/installed-deep.js') + +var os = require('os') +var url = require('url') +var path = require('path') +var log = require('npmlog') +var readPackageTree = require('read-package-tree') +var readJson = require('read-package-json') +var asyncMap = require('slide').asyncMap +var color = require('ansicolors') +var styles = require('ansistyles') +var table = require('text-table') +var semver = require('semver') +var npa = require('npm-package-arg') +var mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js') +var cache = require('./cache.js') +var npm = require('./npm.js') +var long = npm.config.get('long') +var mapToRegistry = require('./utils/map-to-registry.js') +var isExtraneous = require('./install/is-extraneous.js') +var recalculateMetadata = require('./install/deps.js').recalculateMetadata +var moduleName = require('./utils/module-name.js') + +function uniqName (item) { + return item[0].path + '|' + item[1] + '|' + item[7] +} + +function uniq (list) { + var uniqed = [] + var seen = {} + list.forEach(function (item) { + var name = uniqName(item) + if (seen[name]) return + seen[name] = true + uniqed.push(item) + }) + return uniqed +} + +function andRecalculateMetadata (next) { + return function (er, tree) { + if (er) return next(er) + recalculateMetadata(tree, log, next) + } +} function outdated (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false - var dir = path.resolve(npm.dir, "..") + if (typeof cb !== 'function') { + cb = silent + silent = false + } + var dir = path.resolve(npm.dir, '..') // default depth for `outdated` is 0 (cf. `ls`) - if (npm.config.get("depth") === Infinity) npm.config.set("depth", 0) - - outdated_(args, dir, {}, 0, function (er, list) { - if (!list) list = [] - if (er || silent || list.length === 0) return cb(er, list) - list.sort(function(a, b) { - var aa = a[1].toLowerCase() - , bb = b[1].toLowerCase() - return aa === bb ? 0 - : aa < bb ? -1 : 1 - }) - if (npm.config.get("json")) { - console.log(makeJSON(list)) - } else if (npm.config.get("parseable")) { - console.log(makeParseable(list)) - } else { - var outList = list.map(makePretty) - var outHead = [ "Package" - , "Current" - , "Wanted" - , "Latest" - , "Location" - ] - if (long) outHead.push("Package Type") - var outTable = [outHead].concat(outList) - - if (npm.color) { - outTable[0] = outTable[0].map(function(heading) { - return styles.underline(heading) - }) - } + if (npm.config.get('depth') === Infinity) npm.config.set('depth', 0) + + readPackageTree(dir, andRecalculateMetadata(function (er, tree) { + mutateIntoLogicalTree(tree) + outdated_(args, '', tree, {}, 0, function (er, list) { + list = uniq(list || []).sort(function (aa, bb) { + return aa[0].path.localeCompare(bb[0].path) || + aa[1].localeCompare(bb[1]) + }) + if (er || silent || list.length === 0) return cb(er, list) + log.disableProgress() + if (npm.config.get('json')) { + console.log(makeJSON(list)) + } else if (npm.config.get('parseable')) { + console.log(makeParseable(list)) + } else { + var outList = list.map(makePretty) + var outHead = [ 'Package', + 'Current', + 'Wanted', + 'Latest', + 'Location' + ] + if (long) outHead.push('Package Type') + var outTable = [outHead].concat(outList) + + if (npm.color) { + outTable[0] = outTable[0].map(function (heading) { + return styles.underline(heading) + }) + } - var tableOpts = { align: ["l", "r", "r", "r", "l"] - , stringLength: function(s) { return ansiTrim(s).length } - } - console.log(table(outTable, tableOpts)) - } - cb(null, list) - }) + var tableOpts = { + align: ['l', 'r', 'r', 'r', 'l'], + stringLength: function (s) { return ansiTrim(s).length } + } + console.log(table(outTable, tableOpts)) + } + cb(null, list.map(function (item) { return [item[0].parent.path].concat(item.slice(1, 7)) })) + }) + })) } // [[ dir, dep, has, want, latest, type ]] function makePretty (p) { - var dep = p[1] - , dir = path.resolve(p[0], "node_modules", dep) - , has = p[2] - , want = p[3] - , latest = p[4] - , type = p[6] - - if (!npm.config.get("global")) { + var dep = p[0] + var depname = p[1] + var dir = dep.path + var has = p[2] + var want = p[3] + var latest = p[4] + var type = p[6] + var deppath = p[7] + + if (!npm.config.get('global')) { dir = path.relative(process.cwd(), dir) } - var columns = [ dep - , has || "MISSING" - , want - , latest - , dirToPrettyLocation(dir) + var columns = [ depname, + has || 'MISSING', + want, + latest, + deppath ] if (long) columns[5] = type if (npm.color) { - columns[0] = color[has === want ? "yellow" : "red"](columns[0]) // dep + columns[0] = color[has === want ? 'yellow' : 'red'](columns[0]) // dep columns[2] = color.green(columns[2]) // want columns[3] = color.magenta(columns[3]) // latest columns[4] = color.brightBlack(columns[4]) // dir @@ -117,171 +150,162 @@ 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") - return str.replace(r, "") -} - -function dirToPrettyLocation (dir) { - return dir.replace(/^node_modules[/\\]/, "") - .replace(/[[/\\]node_modules[/\\]/g, " > ") + var r = new RegExp('\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|' + + '\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)', 'g') + return str.replace(r, '') } function makeParseable (list) { return list.map(function (p) { - - var dep = p[1] - , dir = path.resolve(p[0], "node_modules", dep) - , has = p[2] - , want = p[3] - , latest = p[4] - , type = p[6] - - var out = [ dir - , dep + "@" + want - , (has ? (dep + "@" + has) : "MISSING") - , dep + "@" + latest - ] - if (long) out.push(type) - - return out.join(":") + var dep = p[0] + var depname = p[1] + var dir = dep.path + var has = p[2] + var want = p[3] + var latest = p[4] + var type = p[6] + + var out = [ + dir, + depname + '@' + want, + (has ? (depname + '@' + has) : 'MISSING'), + depname + '@' + latest + ] + if (long) out.push(type) + + return out.join(':') }).join(os.EOL) } function makeJSON (list) { var out = {} list.forEach(function (p) { - var dir = path.resolve(p[0], "node_modules", p[1]) - if (!npm.config.get("global")) { + var dep = p[0] + var depname = p[1] + var dir = dep.path + var has = p[2] + var want = p[3] + var latest = p[4] + var type = p[6] + if (!npm.config.get('global')) { dir = path.relative(process.cwd(), dir) } - out[p[1]] = { current: p[2] - , wanted: p[3] - , latest: p[4] - , location: dir + out[depname] = { current: has, + wanted: want, + latest: latest, + location: dir } - if (long) out[p[1]].type = p[6] + if (long) out[depname].type = type }) return JSON.stringify(out, null, 2) } -function outdated_ (args, dir, parentHas, depth, cb) { - // get the deps from package.json, or {:"*"} - // asyncMap over deps: - // shouldHave = cache.add(dep, req).version - // if has === shouldHave then - // return outdated(args, dir/node_modules/dep, parentHas + has) - // else if dep in args or args is empty - // return [dir, dep, has, shouldHave] - - if (depth > npm.config.get("depth")) { +function outdated_ (args, path, tree, parentHas, depth, cb) { + if (!tree.package) tree.package = {} + if (path && tree.package.name) path += ' > ' + tree.package.name + if (!path && tree.package.name) path = tree.package.name + if (depth > npm.config.get('depth')) { return cb(null, []) } - var deps = null var types = {} - readJson(path.resolve(dir, "package.json"), function (er, d) { - d = d || {} - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - deps = (er) ? true : (d.dependencies || {}) - if (!er) { - Object.keys(deps).forEach(function (k) { - types[k] = "dependencies" - }) - } - - if (npm.config.get("save-dev")) { - deps = d.devDependencies || {} - Object.keys(deps).forEach(function (k) { - types[k] = "devDependencies" - }) + var pkg = tree.package - return next() - } - - if (npm.config.get("save")) { - // remove optional dependencies from dependencies during --save. - Object.keys(d.optionalDependencies || {}).forEach(function (k) { - delete deps[k] - }) - return next() - } + var deps = tree.children.filter(function (child) { return !isExtraneous(child) }) || [] - if (npm.config.get("save-optional")) { - deps = d.optionalDependencies || {} - Object.keys(deps).forEach(function (k) { - types[k] = "optionalDependencies" - }) - return next() - } - - var doUpdate = npm.config.get("dev") || - (!npm.config.get("production") && - !Object.keys(parentHas).length && - !npm.config.get("global")) - - if (!er && d && doUpdate) { - Object.keys(d.devDependencies || {}).forEach(function (k) { - if (!(k in parentHas)) { - deps[k] = d.devDependencies[k] - types[k] = "devDependencies" - } - }) - } - return next() + deps.forEach(function (dep) { + types[moduleName(dep)] = 'dependencies' }) - var has = null - readInstalled(path.resolve(dir), { dev : true }, function (er, data) { - if (er) { - has = Object.create(parentHas) - return next() - } - var pkgs = Object.keys(data.dependencies) - pkgs = pkgs.filter(function (p) { - return !p.match(/^[\._-]/) + Object.keys(tree.missingDeps).forEach(function (name) { + deps.push({ + package: { name: name }, + path: tree.path, + parent: tree, + isMissing: true }) - asyncMap(pkgs, function (pkg, cb) { - var jsonFile = path.resolve(dir, "node_modules", pkg, "package.json") - readJson(jsonFile, function (er, d) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - if (d && d.name && d.private) delete deps[d.name] - cb(null, er ? [] : [[d.name, d.version, d._from]]) - }) - }, function (er, pvs) { - if (er) return cb(er) - has = Object.create(parentHas) - pvs.forEach(function (pv) { - has[pv[0]] = { - version: pv[1], - from: pv[2] - } + types[name] = 'dependencies' + }) + + // If we explicitly asked for dev deps OR we didn't ask for production deps + // AND we asked to save dev-deps OR we didn't ask to save anything that's NOT + // dev deps then… + // (All the save checking here is because this gets called from npm-update currently + // and that requires this logic around dev deps.) + // FIXME: Refactor npm update to not be in terms of outdated. + var dev = npm.config.get('dev') || /^dev(elopment)?$/.test(npm.config.get('also')) + var prod = npm.config.get('production') || /^prod(uction)?$/.test(npm.config.get('only')) + if ((dev || !prod) && + (npm.config.get('save-dev') || ( + !npm.config.get('save') && !npm.config.get('save-optional')))) { + Object.keys(tree.missingDevDeps).forEach(function (name) { + deps.push({ + package: { name: name }, + path: tree.path, + parent: tree, + isMissing: true }) + if (!types[name]) { + types[name] = 'devDependencies' + } + }) + } - next() + if (npm.config.get('save-dev')) { + deps = deps.filter(function (dep) { return pkg.devDependencies[moduleName(dep)] }) + deps.forEach(function (dep) { + types[moduleName(dep)] = 'devDependencies' }) - }) + } else if (npm.config.get('save')) { + // remove optional dependencies from dependencies during --save. + deps = deps.filter(function (dep) { return !pkg.optionalDependencies[moduleName(dep)] }) + } else if (npm.config.get('save-optional')) { + deps = deps.filter(function (dep) { return pkg.optionalDependencies[moduleName(dep)] }) + deps.forEach(function (dep) { + types[moduleName(dep)] = 'optionalDependencies' + }) + } + var doUpdate = dev || ( + !prod && + !Object.keys(parentHas).length && + !npm.config.get('global') + ) + if (doUpdate) { + Object.keys(pkg.devDependencies).forEach(function (k) { + if (!(k in parentHas)) { + deps[k] = pkg.devDependencies[k] + types[k] = 'devDependencies' + } + }) + } - function next () { - if (!has || !deps) return - if (deps === true) { - deps = Object.keys(has).reduce(function (l, r) { - l[r] = "latest" - return l - }, {}) + var has = Object.create(parentHas) + tree.children.forEach(function (child) { + if (child.package.name && child.package.private) { + deps = deps.filter(function (dep) { return dep !== child }) } + has[child.package.name] = { + version: child.package.version, + from: child.package._from + } + }) - // now get what we should have, based on the dep. - // if has[dep] !== shouldHave[dep], then cb with the data - // otherwise dive into the folder - asyncMap(Object.keys(deps), function (dep, cb) { - if (!long) return shouldUpdate(args, dir, dep, has, deps[dep], depth, cb) - - shouldUpdate(args, dir, dep, has, deps[dep], depth, cb, types[dep]) - }, cb) - } + // now get what we should have, based on the dep. + // if has[dep] !== shouldHave[dep], then cb with the data + // otherwise dive into the folder + asyncMap(deps, function (dep, cb) { + var name = moduleName(dep) + var required = (tree.package.dependencies)[name] || + (tree.package.optionalDependencies)[name] || + (tree.package.devDependencies)[name] || + dep.package._requested && dep.package._requested.spec || + '*' + if (!long) return shouldUpdate(args, dep, name, has, required, depth, path, cb) + + shouldUpdate(args, dep, name, has, required, depth, path, cb, types[name]) + }, cb) } -function shouldUpdate (args, dir, dep, has, req, depth, cb, type) { +function shouldUpdate (args, tree, dep, has, req, depth, pkgpath, cb, type) { // look up the most recent version. // if that's what we already have, or if it's not on the args list, // then dive into it. Otherwise, cb() with the data. @@ -292,31 +316,32 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) { function skip (er) { // show user that no viable version can be found if (er) return cb(er) - outdated_( args - , path.resolve(dir, "node_modules", dep) - , has - , depth + 1 - , cb ) + outdated_(args, + pkgpath, + tree, + has, + depth + 1, + cb) } function doIt (wanted, latest) { if (!long) { - return cb(null, [[ dir, dep, curr && curr.version, wanted, latest, req]]) + return cb(null, [[tree, dep, curr && curr.version, wanted, latest, req, null, pkgpath]]) } - cb(null, [[ dir, dep, curr && curr.version, wanted, latest, req, type]]) + cb(null, [[tree, dep, curr && curr.version, wanted, latest, req, type, pkgpath]]) } if (args.length && args.indexOf(dep) === -1) return skip() var parsed = npa(dep + '@' + req) - if (parsed.type === "git" || (parsed.hosted && parsed.hosted.type === "github")) { - return doIt("git", "git") + if (parsed.type === 'git' || parsed.type === 'hosted') { + return doIt('git', 'git') } // search for the latest package mapToRegistry(dep, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, updateDeps) + npm.registry.get(uri, { auth: auth }, updateDeps) }) function updateLocalDeps (latestRegistryVersion) { @@ -348,13 +373,14 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) { return updateLocalDeps() } - 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. @@ -369,11 +395,11 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) { // We didn't find the version in the doc. See if cache can find it. cache.add(dep, req, null, false, onCacheAdd) - function onCacheAdd(er, d) { + 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) } @@ -385,14 +411,14 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb, type) { var dFromUrl = d._from && url.parse(d._from).protocol var cFromUrl = curr && curr.from && url.parse(curr.from).protocol - if (!curr || dFromUrl && cFromUrl && d._from !== curr.from - || d.version !== curr.version - || d.version !== l.version) { + if (!curr || + dFromUrl && cFromUrl && d._from !== curr.from || + d.version !== curr.version || + d.version !== l.version) { if (parsed.type === 'local') return updateLocalDeps(l.version) doIt(d.version, l.version) - } - else { + } else { skip() } } diff --git a/deps/npm/lib/owner.js b/deps/npm/lib/owner.js index c9adb792249d75..f32f405dd19e64 100644 --- a/deps/npm/lib/owner.js +++ b/deps/npm/lib/owner.js @@ -1,21 +1,21 @@ module.exports = owner -owner.usage = "npm owner add " - + "\nnpm owner rm " - + "\nnpm owner ls " +owner.usage = 'npm owner add [<@scope>/]' + + '\nnpm owner rm [<@scope>/]' + + '\nnpm owner ls [<@scope>/]' -var npm = require("./npm.js") - , log = require("npmlog") - , mapToRegistry = require("./utils/map-to-registry.js") - , readLocalPkg = require("./utils/read-local-package.js") +var npm = require('./npm.js') +var log = require('npmlog') +var mapToRegistry = require('./utils/map-to-registry.js') +var readLocalPkg = require('./utils/read-local-package.js') owner.completion = function (opts, cb) { var argv = opts.conf.argv.remain if (argv.length > 4) return cb() if (argv.length <= 2) { - var subs = ["add", "rm"] - if (opts.partialWord === "l") subs.push("ls") - else subs.push("ls", "list") + var subs = ['add', 'rm'] + if (opts.partialWord === 'l') subs.push('ls') + else subs.push('ls', 'list') return cb(null, subs) } @@ -25,44 +25,45 @@ owner.completion = function (opts, cb) { var un = encodeURIComponent(username) var byUser, theUser switch (argv[2]) { - case "ls": + case 'ls': // FIXME: there used to be registry completion here, but it stopped // making sense somewhere around 50,000 packages on the registry return cb() - case "rm": + case 'rm': if (argv.length > 3) { theUser = encodeURIComponent(argv[3]) - byUser = "-/by-user/" + theUser + "|" + un + byUser = '-/by-user/' + theUser + '|' + un return mapToRegistry(byUser, npm.config, function (er, uri, auth) { if (er) return cb(er) console.error(uri) - npm.registry.get(uri, { auth : auth }, function (er, d) { + npm.registry.get(uri, { auth: auth }, 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 + return un === 'isaacs' || d[un].indexOf(p) === -1 })) }) }) } // else fallthrough - case "add": + /*eslint no-fallthrough:0*/ + case 'add': if (argv.length > 3) { theUser = encodeURIComponent(argv[3]) - byUser = "-/by-user/" + theUser + "|" + un + byUser = '-/by-user/' + theUser + '|' + un return mapToRegistry(byUser, npm.config, function (er, uri, auth) { if (er) return cb(er) console.error(uri) - npm.registry.get(uri, { auth : auth }, function (er, d) { + npm.registry.get(uri, { auth: auth }, 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] || [] + var theirs = d[theUser] || [] return cb(null, mine.filter(function (p) { return theirs.indexOf(p) === -1 })) @@ -70,10 +71,10 @@ owner.completion = function (opts, cb) { }) } // just list all users who aren't me. - return mapToRegistry("-/users", npm.config, function (er, uri, auth) { + return mapToRegistry('-/users', npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, list) { + npm.registry.get(uri, { auth: auth }, function (er, list) { if (er) return cb() return cb(null, Object.keys(list).filter(function (n) { return n !== un @@ -90,34 +91,39 @@ owner.completion = function (opts, cb) { function owner (args, cb) { var action = args.shift() switch (action) { - case "ls": case "list": return ls(args[0], cb) - case "add": return add(args[0], args[1], cb) - case "rm": case "remove": return rm(args[0], args[1], cb) + case 'ls': case 'list': return ls(args[0], cb) + case 'add': return add(args[0], args[1], cb) + case 'rm': case 'remove': return rm(args[0], args[1], cb) default: return unknown(action, cb) } } function ls (pkg, cb) { - if (!pkg) return readLocalPkg(function (er, pkg) { - if (er) return cb(er) - if (!pkg) return cb(owner.usage) - ls(pkg, cb) - }) + if (!pkg) { + return readLocalPkg(function (er, pkg) { + if (er) return cb(er) + if (!pkg) return cb(owner.usage) + ls(pkg, cb) + }) + } mapToRegistry(pkg, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, data) { - var msg = "" + npm.registry.get(uri, { auth: auth }, function (er, data) { + var msg = '' if (er) { - log.error("owner ls", "Couldn't get owner data", pkg) + 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") + 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) }) @@ -126,20 +132,24 @@ function ls (pkg, cb) { function add (user, pkg, cb) { if (!user) return cb(owner.usage) - if (!pkg) return readLocalPkg(function (er, pkg) { - if (er) return cb(er) - if (!pkg) return cb(new Error(owner.usage)) - add(user, pkg, cb) - }) + if (!pkg) { + return readLocalPkg(function (er, pkg) { + if (er) return cb(er) + if (!pkg) return cb(new Error(owner.usage)) + add(user, pkg, cb) + }) + } - log.verbose("owner add", "%s to %s", user, pkg) + log.verbose('owner add', '%s to %s', user, pkg) mutate(pkg, user, function (u, owners) { if (!owners) owners = [] - for (var i = 0, l = owners.length; i < l; i ++) { + for (var i = 0, l = owners.length; i < l; i++) { var o = owners[i] if (o.name === u.name) { - log.info( "owner add" - , "Already a package owner: " + o.name + " <" + o.email + ">") + log.info( + 'owner add', + 'Already a package owner: ' + o.name + ' <' + o.email + '>' + ) return false } } @@ -149,58 +159,69 @@ function add (user, pkg, cb) { } function rm (user, pkg, cb) { - if (!pkg) return readLocalPkg(function (er, pkg) { - if (er) return cb(er) - if (!pkg) return cb(new Error(owner.usage)) - rm(user, pkg, cb) - }) + if (!pkg) { + return readLocalPkg(function (er, pkg) { + if (er) return cb(er) + if (!pkg) return cb(new Error(owner.usage)) + rm(user, pkg, cb) + }) + } - log.verbose("owner rm", "%s from %s", user, pkg) + log.verbose('owner rm', '%s from %s', user, pkg) mutate(pkg, user, function (u, owners) { var found = false - , m = owners.filter(function (o) { - var match = (o.name === user) - found = found || match - return !match - }) + var m = owners.filter(function (o) { + var match = (o.name === user) + found = found || match + 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( - "Cannot remove all owners of a package. Add someone else first.") + + if (!m.length) { + return new Error( + 'Cannot remove all owners of a package. Add someone else first.' + ) + } + return m }, cb) } function mutate (pkg, user, mutation, cb) { if (user) { - var byUser = "-/user/org.couchdb.user:" + user + var byUser = '-/user/org.couchdb.user:' + user mapToRegistry(byUser, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, mutate_) + npm.registry.get(uri, { auth: auth }, 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)) + if (!er && user && (!u || u.error)) { + er = new Error( + "Couldn't get user data for " + user + ': ' + JSON.stringify(u) + ) + } if (er) { - log.error("owner mutate", "Error getting user data for %s", user) + log.error('owner mutate', 'Error getting user data for %s', user) return cb(er) } - if (u) u = { "name" : u.name, "email" : u.email } + if (u) u = { name: u.name, email: u.email } mapToRegistry(pkg, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, data) { + npm.registry.get(uri, { auth: auth }, function (er, data) { if (er) { - log.error("owner mutate", "Error getting package data for %s", pkg) + log.error('owner mutate', 'Error getting package data for %s', pkg) return cb(er) } @@ -213,32 +234,30 @@ function mutate (pkg, user, mutation, cb) { if (m instanceof Error) return cb(m) // error data = { - _id : data._id, - _rev : data._rev, - maintainers : m + _id: data._id, + _rev: data._rev, + maintainers: m } - var dataPath = pkg.replace("/", "%2f") + "/-rev/" + data._rev + var dataPath = pkg.replace('/', '%2f') + '/-rev/' + data._rev mapToRegistry(dataPath, npm.config, function (er, uri, auth) { if (er) return cb(er) var params = { - method : "PUT", - body : data, - auth : auth + method: 'PUT', + body: data, + auth: auth } npm.registry.request(uri, params, function (er, data) { if (!er && data.error) { - er = new Error("Failed to update package metadata: "+JSON.stringify(data)) + er = new Error('Failed to update package metadata: ' + JSON.stringify(data)) } if (er) { - log.error("owner mutate", "Failed to update package metadata") - } - else if (m.length > beforeMutation) { - console.log("+ %s (%s)", user, pkg) - } - else if (m.length < beforeMutation) { - console.log("- %s (%s)", user, pkg) + log.error('owner mutate', 'Failed to update package metadata') + } else if (m.length > beforeMutation) { + console.log('+ %s (%s)', user, pkg) + } else if (m.length < beforeMutation) { + console.log('- %s (%s)', user, pkg) } cb(er, data) @@ -250,5 +269,5 @@ function mutate (pkg, user, mutation, 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 a5ce90094f6a3a..d596dd034b9b39 100644 --- a/deps/npm/lib/pack.js +++ b/deps/npm/lib/pack.js @@ -4,39 +4,42 @@ module.exports = pack -var npm = require("./npm.js") - , install = require("./install.js") - , cache = require("./cache.js") - , fs = require("graceful-fs") - , chain = require("slide").chain - , path = require("path") - , cwd = process.cwd() - , writeStream = require('fs-write-stream-atomic') - , cachedPackageRoot = require("./cache/cached-package-root.js") +var install = require('./install.js') +var cache = require('./cache.js') +var fs = require('graceful-fs') +var chain = require('slide').chain +var path = require('path') +var cwd = process.cwd() +var writeStream = require('fs-write-stream-atomic') +var cachedPackageRoot = require('./cache/cached-package-root.js') -pack.usage = "npm pack " +pack.usage = 'npm pack [[<@scope>/]...]' // if it can be installed, it can be packed. pack.completion = install.completion function pack (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } - if (args.length === 0) args = ["."] + if (args.length === 0) args = ['.'] - chain(args.map(function (arg) { return function (cb) { - pack_(arg, cb) - }}), function (er, files) { - if (er || silent) return cb(er, files) - printFiles(files, cb) - }) + chain( + args.map(function (arg) { return function (cb) { pack_(arg, cb) } }), + function (er, files) { + if (er || silent) return cb(er, files) + printFiles(files, cb) + } + ) } function printFiles (files, cb) { files = files.map(function (file) { return path.relative(cwd, file) }) - console.log(files.join("\n")) + console.log(files.join('\n')) cb() } @@ -47,17 +50,17 @@ function pack_ (pkg, cb) { // scoped packages get special treatment var name = data.name - if (name[0] === "@") name = name.substr(1).replace(/\//g, "-") - var fname = name + "-" + data.version + ".tgz" + if (name[0] === '@') name = name.substr(1).replace(/\//g, '-') + var fname = name + '-' + data.version + '.tgz' - var cached = path.join(cachedPackageRoot(data), "package.tgz") - , from = fs.createReadStream(cached) - , to = writeStream(fname) - , errState = null + var cached = path.join(cachedPackageRoot(data), 'package.tgz') + var from = fs.createReadStream(cached) + var to = writeStream(fname) + var errState = null - from.on("error", cb_) - to.on("error", cb_) - to.on("close", cb_) + from.on('error', cb_) + to.on('error', cb_) + to.on('close', cb_) from.pipe(to) function cb_ (er) { diff --git a/deps/npm/lib/prefix.js b/deps/npm/lib/prefix.js index e002edea155d12..42f61103f64a2e 100644 --- a/deps/npm/lib/prefix.js +++ b/deps/npm/lib/prefix.js @@ -1,11 +1,14 @@ module.exports = prefix -var npm = require("./npm.js") +var npm = require('./npm.js') -prefix.usage = "npm prefix\nnpm prefix -g\n(just prints the prefix folder)" +prefix.usage = 'npm prefix [-g]' function prefix (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } if (!silent) console.log(npm.prefix) process.nextTick(cb.bind(this, null, npm.prefix)) } diff --git a/deps/npm/lib/prune.js b/deps/npm/lib/prune.js index edba876013580b..46373742f59afd 100644 --- a/deps/npm/lib/prune.js +++ b/deps/npm/lib/prune.js @@ -2,28 +2,28 @@ module.exports = prune -prune.usage = "npm prune" +prune.usage = 'npm prune [[<@scope>/]...] [--production]' -var readInstalled = require("read-installed") - , npm = require("./npm.js") - , path = require("path") - , readJson = require("read-package-json") - , log = require("npmlog") +var readInstalled = require('read-installed') +var npm = require('./npm.js') +var path = require('path') +var readJson = require('read-package-json') +var log = require('npmlog') -prune.completion = require("./utils/completion/installed-deep.js") +prune.completion = require('./utils/completion/installed-deep.js') function prune (args, cb) { - //check if is a valid package.json file - var jsonFile = path.resolve(npm.dir, "..", "package.json" ) + // check if is a valid package.json file + var jsonFile = path.resolve(npm.dir, '..', 'package.json') readJson(jsonFile, log.warn, function (er) { if (er) return cb(er) next() }) - function next() { + function next () { var opt = { - depth: npm.config.get("depth"), - dev: !npm.config.get("production") || npm.config.get("dev") + depth: npm.config.get('depth'), + dev: !npm.config.get('production') || npm.config.get('dev') } readInstalled(npm.prefix, opt, function (er, data) { if (er) return cb(er) @@ -39,11 +39,9 @@ function prune_ (args, data, cb) { function prunables (args, data, seen) { var deps = data.dependencies || {} return Object.keys(deps).map(function (d) { - if (typeof deps[d] !== "object" - || seen.indexOf(deps[d]) !== -1) return null + if (typeof deps[d] !== 'object' || seen.indexOf(deps[d]) !== -1) return null seen.push(deps[d]) - if (deps[d].extraneous - && (args.length === 0 || args.indexOf(d) !== -1)) { + if (deps[d].extraneous && (args.length === 0 || args.indexOf(d) !== -1)) { var extra = deps[d] delete deps[d] return extra.path @@ -51,6 +49,6 @@ function prunables (args, data, seen) { return prunables(args, deps[d], seen) }).filter(function (d) { return d !== null }) .reduce(function FLAT (l, r) { - return l.concat(Array.isArray(r) ? r.reduce(FLAT,[]) : r) + return l.concat(Array.isArray(r) ? r.reduce(FLAT, []) : r) }, []) } diff --git a/deps/npm/lib/publish.js b/deps/npm/lib/publish.js index 8f1c73c3c98fe5..45de4f24b40ef9 100644 --- a/deps/npm/lib/publish.js +++ b/deps/npm/lib/publish.js @@ -1,23 +1,22 @@ module.exports = publish -var npm = require("./npm.js") - , log = require("npmlog") - , path = require("path") - , readJson = require("read-package-json") - , lifecycle = require("./utils/lifecycle.js") - , chain = require("slide").chain - , mapToRegistry = require("./utils/map-to-registry.js") - , cachedPackageRoot = require("./cache/cached-package-root.js") - , createReadStream = require("graceful-fs").createReadStream - , npa = require("npm-package-arg") - , semver = require('semver') - , getPublishConfig = require("./utils/get-publish-config.js") - -publish.usage = "npm publish [--tag ]" - + "\nnpm publish [--tag ]" - + "\n\nPublishes '.' if no argument supplied" - + "\n\nSets tag `latest` if no --tag specified" +var npm = require('./npm.js') +var log = require('npmlog') +var path = require('path') +var readJson = require('read-package-json') +var lifecycle = require('./utils/lifecycle.js') +var chain = require('slide').chain +var mapToRegistry = require('./utils/map-to-registry.js') +var cachedPackageRoot = require('./cache/cached-package-root.js') +var createReadStream = require('graceful-fs').createReadStream +var npa = require('npm-package-arg') +var semver = require('semver') +var getPublishConfig = require('./utils/get-publish-config.js') + +publish.usage = 'npm publish [|] [--tag ] [--access ]' + + "\n\nPublishes '.' if no argument supplied" + + '\n\nSets tag `latest` if no --tag specified' publish.completion = function (opts, cb) { // publish can complete to a folder with a package.json @@ -27,29 +26,29 @@ publish.completion = function (opts, cb) { } function publish (args, isRetry, cb) { - if (typeof cb !== "function") { + if (typeof cb !== 'function') { cb = isRetry isRetry = false } - if (args.length === 0) args = ["."] + if (args.length === 0) args = ['.'] if (args.length !== 1) return cb(publish.usage) - log.verbose("publish", args) + log.verbose('publish', args) var t = npm.config.get('tag').trim() if (semver.validRange(t)) { - var er = new Error("Tag name must not be a valid SemVer range: " + t) + var er = new Error('Tag name must not be a valid SemVer range: ' + t) return cb(er) } var arg = args[0] // if it's a local folder, then run the prepublish there, first. - readJson(path.resolve(arg, "package.json"), function (er, data) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + readJson(path.resolve(arg, 'package.json'), function (er, data) { + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) if (data) { - if (!data.name) return cb(new Error("No name provided")) - if (!data.version) return cb(new Error("No version provided")) + if (!data.name) return cb(new Error('No name provided')) + if (!data.version) return cb(new Error('No version provided')) } // Error is OK. Could be publishing a URL or tarball, however, that means @@ -61,26 +60,29 @@ function publish (args, isRetry, cb) { } // didPre in this case means that we already ran the prepublish script, -// and that the "dir" is an actual directory, and not something silly +// and that the 'dir' is an actual directory, and not something silly // like a tarball or name@version thing. // 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, null, false, function (er, data) { if (er) return cb(er) - log.silly("publish", data) - var cachedir = path.resolve(cachedPackageRoot(data), "package") - chain([ !didPre && - [lifecycle, data, "prepublish", cachedir] - , [publish_, dir, data, isRetry, cachedir] - , [lifecycle, data, "publish", didPre ? dir : cachedir] - , [lifecycle, data, "postpublish", didPre ? dir : cachedir] ] - , cb ) + log.silly('publish', data) + var cachedir = path.resolve(cachedPackageRoot(data), 'package') + chain( + [ + !didPre && [lifecycle, data, 'prepublish', cachedir], + [publish_, dir, data, isRetry, cachedir], + [lifecycle, data, 'publish', didPre ? dir : cachedir], + [lifecycle, data, 'postpublish', didPre ? dir : cachedir] + ], + cb + ) }) } function publish_ (arg, data, isRetry, cachedir, cb) { - if (!data) return cb(new Error("no package.json file found")) + if (!data) return cb(new Error('no package.json file found')) var mappedConfig = getPublishConfig( data.publishConfig, @@ -90,51 +92,52 @@ function publish_ (arg, data, isRetry, cachedir, cb) { var config = mappedConfig.config var registry = mappedConfig.client - data._npmVersion = npm.version + data._npmVersion = npm.version data._nodeVersion = process.versions.node delete data.modules - if (data.private) return cb( - new Error( - "This package has been marked as private\n" + + 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, auth, registryBase) { if (er) return cb(er) - var tarballPath = cachedir + ".tgz" + var tarballPath = cachedir + '.tgz' // we just want the base registry URL in this case - log.verbose("publish", "registryBase", registryBase) - log.silly("publish", "uploading", tarballPath) + log.verbose('publish', 'registryBase', registryBase) + log.silly('publish', 'uploading', tarballPath) data._npmUser = { - name : auth.username, - email : auth.email + name: auth.username, + email: auth.email } var params = { - metadata : data, - body : createReadStream(tarballPath), - auth : auth + metadata: data, + body: createReadStream(tarballPath), + auth: auth } // registry-frontdoor cares about the access level, which is only // configurable for scoped packages - if (config.get("access")) { - if (!npa(data.name).scope && config.get("access") === "restricted") { + if (config.get('access')) { + if (!npa(data.name).scope && config.get('access') === 'restricted') { return cb(new Error("Can't restrict access to unscoped packages.")) } - params.access = config.get("access") + params.access = config.get('access') } + log.showProgress('publish:' + data._id) registry.publish(registryBase, params, function (er) { - if (er && er.code === "EPUBLISHCONFLICT" && - npm.config.get("force") && !isRetry) { - log.warn("publish", "Forced publish over " + data._id) + 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. @@ -144,7 +147,8 @@ function publish_ (arg, data, isRetry, cachedir, 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) + log.clearProgress() + console.log('+ ' + data._id) cb() }) }) diff --git a/deps/npm/lib/rebuild.js b/deps/npm/lib/rebuild.js index ab372c6ec07c7e..0e36c6361efef0 100644 --- a/deps/npm/lib/rebuild.js +++ b/deps/npm/lib/rebuild.js @@ -1,27 +1,27 @@ module.exports = rebuild -var readInstalled = require("read-installed") - , semver = require("semver") - , log = require("npmlog") - , npm = require("./npm.js") - , npa = require("npm-package-arg") +var readInstalled = require('read-installed') +var semver = require('semver') +var log = require('npmlog') +var npm = require('./npm.js') +var npa = require('npm-package-arg') -rebuild.usage = "npm rebuild [[@] [name[@] ...]]" +rebuild.usage = 'npm rebuild [[<@scope>/]...]' -rebuild.completion = require("./utils/completion/installed-deep.js") +rebuild.completion = require('./utils/completion/installed-deep.js') function rebuild (args, cb) { - var opt = { depth: npm.config.get("depth"), dev: true } + var opt = { depth: npm.config.get('depth'), dev: true } readInstalled(npm.prefix, opt, function (er, data) { - log.info("readInstalled", typeof data) + log.info('readInstalled', typeof data) if (er) return cb(er) var set = filter(data, args) - , folders = Object.keys(set).filter(function (f) { - return f !== npm.prefix - }) + var folders = Object.keys(set).filter(function (f) { + return f !== npm.prefix + }) if (!folders.length) return cb() - log.silly("rebuild set", folders) + log.silly('rebuild set', folders) cleanBuild(folders, set, cb) }) } @@ -29,9 +29,11 @@ function rebuild (args, cb) { function cleanBuild (folders, set, cb) { npm.commands.build(folders, function (er) { if (er) return cb(er) + log.clearProgress() console.log(folders.map(function (f) { - return set[f] + " " + f - }).join("\n")) + return set[f] + ' ' + f + }).join('\n')) + log.showProgress() cb() }) } @@ -45,11 +47,11 @@ function filter (data, args, set, seen) { var pass if (!args.length) pass = true // rebuild everything else if (data.name && data._id) { - for (var i = 0, l = args.length; i < l; i ++) { + for (var i = 0, l = args.length; i < l; i++) { var arg = args[i] - , nv = npa(arg) - , n = nv.name - , v = nv.rawSpec + var nv = npa(arg) + var n = nv.name + var v = nv.rawSpec if (n !== data.name) continue if (!semver.satisfies(data.version, v, true)) continue pass = true @@ -57,7 +59,7 @@ function filter (data, args, set, seen) { } } if (pass && data._id) { - log.verbose("rebuild", "path, id", [data.path, data._id]) + log.verbose('rebuild', 'path, id', [data.path, data._id]) set[data.path] = data._id } // need to also dive through kids, always. @@ -66,7 +68,7 @@ function filter (data, args, set, seen) { Object.keys(data.dependencies || {}).forEach(function (d) { // return var dep = data.dependencies[d] - if (typeof dep === "string") return + if (typeof dep === 'string') return filter(dep, args, set, seen) }) return set diff --git a/deps/npm/lib/repo.js b/deps/npm/lib/repo.js index 1b0454773d74d7..caaf422cfeee2c 100644 --- a/deps/npm/lib/repo.js +++ b/deps/npm/lib/repo.js @@ -1,18 +1,12 @@ - module.exports = repo -repo.usage = "npm repo " +repo.usage = 'npm repo []' -var npm = require("./npm.js") - , opener = require("opener") - , github = require("github-url-from-git") - , githubUserRepo = require("github-url-from-username-repo") - , path = require("path") - , readJson = require("read-package-json") - , fs = require("fs") - , url_ = require("url") - , mapToRegistry = require("./utils/map-to-registry.js") - , npa = require("npm-package-arg") +var npm = require('./npm.js') +var opener = require('opener') +var hostedGitInfo = require('hosted-git-info') +var url_ = require('url') +var fetchPackageMetadata = require('./fetch-package-metadata.js') repo.completion = function (opts, cb) { // FIXME: there used to be registry completion here, but it stopped making @@ -21,58 +15,37 @@ repo.completion = function (opts, cb) { } function repo (args, cb) { - 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) - if (!s.isDirectory()) return callRegistry(n, cb) - readJson(path.resolve(n, "package.json"), function (er, d) { - if (er) return cb(er) - getUrlAndOpen(d, cb) - }) + var n = args.length ? args[0] : '.' + fetchPackageMetadata(n, '.', function (er, d) { + if (er) return cb(er) + getUrlAndOpen(d, cb) }) } function getUrlAndOpen (d, cb) { var r = d.repository - if (!r) return cb(new Error("no 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)) - r.url = githubUserRepo(r.url) + var info = hostedGitInfo.fromUrl(r.url) + var url = info ? info.browse() : unknownHostedUrl(r.url) - var url = (r.url && ~r.url.indexOf("github")) - ? github(r.url) - : nonGithubUrl(r.url) - - if (!url) - return cb(new Error("no repository: could not get url")) - opener(url, { command: npm.config.get("browser") }, cb) -} + if (!url) return cb(new Error('no repository: could not get url')) -function callRegistry (n, cb) { - mapToRegistry(n, npm.config, function (er, uri) { - if (er) return cb(er) - - npm.registry.get(uri + "/latest", { timeout : 3600 }, function (er, d) { - if (er) return cb(er) - getUrlAndOpen(d, cb) - }) - }) + opener(url, { command: npm.config.get('browser') }, cb) } -function nonGithubUrl (url) { +function unknownHostedUrl (url) { try { - var idx = url.indexOf("@") + var idx = url.indexOf('@') if (idx !== -1) { - url = url.slice(idx+1).replace(/:([^\d]+)/, "/$1") + url = url.slice(idx + 1).replace(/:([^\d]+)/, '/$1') } url = url_.parse(url) - var protocol = url.protocol === "https:" - ? "https:" - : "http:" - return protocol + "//" + (url.host || "") + - url.path.replace(/\.git$/, "") - } - catch(e) {} + var protocol = url.protocol === 'https:' + ? 'https:' + : 'http:' + return protocol + '//' + (url.host || '') + + url.path.replace(/\.git$/, '') + } catch (e) {} } diff --git a/deps/npm/lib/restart.js b/deps/npm/lib/restart.js index 69c4b913db62db..601249fd6b36b0 100644 --- a/deps/npm/lib/restart.js +++ b/deps/npm/lib/restart.js @@ -1 +1 @@ -module.exports = require("./utils/lifecycle.js").cmd("restart") +module.exports = require('./utils/lifecycle.js').cmd('restart') diff --git a/deps/npm/lib/root.js b/deps/npm/lib/root.js index b2f731ed55ae99..958361d351a4b0 100644 --- a/deps/npm/lib/root.js +++ b/deps/npm/lib/root.js @@ -1,11 +1,14 @@ module.exports = root -var npm = require("./npm.js") +var npm = require('./npm.js') -root.usage = "npm root\nnpm root -g\n(just prints the root folder)" +root.usage = 'npm root [-g]' function root (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } if (!silent) console.log(npm.dir) process.nextTick(cb.bind(this, null, npm.dir)) } diff --git a/deps/npm/lib/run-script.js b/deps/npm/lib/run-script.js index 2c805615a42e3a..ef5e6560047763 100644 --- a/deps/npm/lib/run-script.js +++ b/deps/npm/lib/run-script.js @@ -1,16 +1,16 @@ module.exports = runScript -var lifecycle = require("./utils/lifecycle.js") - , npm = require("./npm.js") - , path = require("path") - , readJson = require("read-package-json") - , log = require("npmlog") - , chain = require("slide").chain +var lifecycle = require('./utils/lifecycle.js') +var npm = require('./npm.js') +var path = require('path') +var readJson = require('read-package-json') +var log = require('npmlog') +var chain = require('slide').chain -runScript.usage = "npm run-script [-- ]" +runScript.usage = 'npm run-script [-- ...]' + + '\n\nalias: npm run' runScript.completion = function (opts, cb) { - // see if there's already a package specified. var argv = opts.conf.argv.remain @@ -19,20 +19,19 @@ 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.localPrefix, "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 && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) if (er) d = {} var scripts = Object.keys(d.scripts || {}) - console.error("local scripts", scripts) + console.error('local scripts', scripts) 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") + var pref = npm.config.get('global') ? npm.config.get('prefix') : npm.localPrefix - var pkgDir = path.resolve( pref, "node_modules" - , argv[2], "package.json" ) + var pkgDir = path.resolve(pref, 'node_modules', argv[2], 'package.json') readJson(pkgDir, function (er, d) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) if (er) d = {} var scripts = Object.keys(d.scripts || {}) return cb(null, scripts) @@ -40,8 +39,8 @@ runScript.completion = function (opts, cb) { }) } - readJson(path.join(npm.localPrefix, "package.json"), function (er, d) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) + readJson(path.join(npm.localPrefix, 'package.json'), function (er, d) { + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) d = d || {} cb(null, Object.keys(d.scripts || {})) }) @@ -51,23 +50,30 @@ function runScript (args, cb) { if (!args.length) return list(cb) var pkgdir = npm.localPrefix - , cmd = args.shift() + var cmd = args.shift() - readJson(path.resolve(pkgdir, "package.json"), function (er, d) { + readJson(path.resolve(pkgdir, 'package.json'), function (er, d) { if (er) return cb(er) run(d, pkgdir, cmd, args, cb) }) } -function list(cb) { - var json = path.join(npm.localPrefix, "package.json") - var cmdList = [ "publish", "install", "uninstall" - , "test", "stop", "start", "restart", "version" - ].reduce(function (l, p) { - return l.concat(["pre" + p, p, "post" + p]) - }, []) - return readJson(json, function(er, d) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) +function list (cb) { + var json = path.join(npm.localPrefix, 'package.json') + var cmdList = [ + 'publish', + 'install', + 'uninstall', + 'test', + 'stop', + 'start', + 'restart', + 'version' + ].reduce(function (l, p) { + return l.concat(['pre' + p, p, 'post' + p]) + }, []) + return readJson(json, function (er, d) { + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) if (er) d = {} var allScripts = Object.keys(d.scripts || {}) var scripts = [] @@ -77,37 +83,36 @@ function list(cb) { else runScripts.push(script) }) - if (log.level === "silent") { + if (log.level === 'silent') { return cb(null, allScripts) } - if (npm.config.get("json")) { + if (npm.config.get('json')) { console.log(JSON.stringify(d.scripts || {}, null, 2)) return cb(null, allScripts) } - if (npm.config.get("parseable")) { - allScripts.forEach(function(script) { - console.log(script + ":" + d.scripts[script]) + if (npm.config.get('parseable')) { + allScripts.forEach(function (script) { + console.log(script + ':' + d.scripts[script]) }) return cb(null, allScripts) } - var s = "\n " - var prefix = " " + var s = '\n ' + var prefix = ' ' if (scripts.length) { - console.log("Lifecycle scripts included in %s:", d.name) + console.log('Lifecycle scripts included in %s:', d.name) } - scripts.forEach(function(script) { + scripts.forEach(function (script) { console.log(prefix + script + s + d.scripts[script]) }) if (!scripts.length && runScripts.length) { - console.log("Scripts available in %s via `npm run-script`:", d.name) - } - else if (runScripts.length) { - console.log("\navailable via `npm run-script`:") + console.log('Scripts available in %s via `npm run-script`:', d.name) + } else if (runScripts.length) { + console.log('\navailable via `npm run-script`:') } - runScripts.forEach(function(script) { + runScripts.forEach(function (script) { console.log(prefix + script + s + d.scripts[script]) }) return cb(null, allScripts) @@ -118,38 +123,38 @@ function run (pkg, wd, cmd, args, cb) { if (!pkg.scripts) pkg.scripts = {} var cmds - if (cmd === "restart" && !pkg.scripts.restart) { + if (cmd === 'restart' && !pkg.scripts.restart) { cmds = [ - "prestop", "stop", "poststop", - "restart", - "prestart", "start", "poststart" + 'prestop', 'stop', 'poststop', + 'restart', + 'prestart', 'start', 'poststart' ] } else { if (!pkg.scripts[cmd]) { - if (cmd === "test") { - pkg.scripts.test = "echo \"Error: no test specified\"" - } else if (cmd === "env") { - if (process.platform === "win32") { - log.verbose("run-script using default platform env: SET (Windows)") - pkg.scripts[cmd] = "SET" + if (cmd === 'test') { + pkg.scripts.test = 'echo \'Error: no test specified\'' + } else if (cmd === 'env') { + if (process.platform === 'win32') { + log.verbose('run-script using default platform env: SET (Windows)') + pkg.scripts[cmd] = 'SET' } else { - log.verbose("run-script using default platform env: env (Unix)") - pkg.scripts[cmd] = "env" + log.verbose('run-script using default platform env: env (Unix)') + pkg.scripts[cmd] = 'env' } - } else if (npm.config.get("if-present")) { - return cb(null); + } else if (npm.config.get('if-present')) { + return cb(null) } else { - return cb(new Error("missing script: " + cmd)) + return cb(new Error('missing script: ' + cmd)) } } cmds = [cmd] } if (!cmd.match(/^(pre|post)/)) { - cmds = ["pre"+cmd].concat(cmds).concat("post"+cmd) + cmds = ['pre' + cmd].concat(cmds).concat('post' + cmd) } - log.verbose("run-script", cmds) + log.verbose('run-script', cmds) chain(cmds.map(function (c) { // pass cli arguments after -- to script. if (pkg.scripts[c] && c === cmd) { @@ -164,8 +169,8 @@ function run (pkg, wd, cmd, args, cb) { // join arguments after '--' and pass them to script, // handle special characters such as ', ", ' '. function joinArgs (args) { - var joinedArgs = "" - args.forEach(function(arg) { + var joinedArgs = '' + args.forEach(function (arg) { joinedArgs += ' "' + arg.replace(/"/g, '\\"') + '"' }) return joinedArgs diff --git a/deps/npm/lib/search.js b/deps/npm/lib/search.js index 840bc2f6b785df..4877417f0d79c7 100644 --- a/deps/npm/lib/search.js +++ b/deps/npm/lib/search.js @@ -1,17 +1,18 @@ module.exports = exports = search -var npm = require("./npm.js") - , columnify = require("columnify") - , updateIndex = require("./cache/update-index.js") +var npm = require('./npm.js') +var columnify = require('columnify') +var updateIndex = require('./cache/update-index.js') -search.usage = "npm search [some search terms ...]" +search.usage = 'npm search [--long] [search terms ...]' + + '\n\naliases: s, se' search.completion = function (opts, cb) { var compl = {} - , partial = opts.partialWord - , ipartial = partial.toLowerCase() - , plen = partial.length + var partial = opts.partialWord + var ipartial = partial.toLowerCase() + var plen = partial.length // get the batch of data that matches so far. // this is an example of using npm.commands.search programmatically @@ -19,7 +20,7 @@ search.completion = function (opts, cb) { search(opts.conf.argv.remain.slice(2), true, function (er, data) { if (er) return cb(er) Object.keys(data).forEach(function (name) { - data[name].words.split(" ").forEach(function (w) { + data[name].words.split(' ').forEach(function (w) { if (w.toLowerCase().indexOf(ipartial) === 0) { compl[partial + w.substr(plen)] = true } @@ -30,19 +31,25 @@ search.completion = function (opts, cb) { } function search (args, silent, staleness, cb) { - if (typeof cb !== "function") cb = staleness, staleness = 600 - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = staleness + staleness = 600 + } + if (typeof cb !== 'function') { + cb = silent + silent = false + } - var searchopts = npm.config.get("searchopts") - var searchexclude = npm.config.get("searchexclude") + var searchopts = npm.config.get('searchopts') + var searchexclude = npm.config.get('searchexclude') - if (typeof searchopts !== "string") searchopts = "" + if (typeof searchopts !== 'string') searchopts = '' searchopts = searchopts.split(/\s+/) var opts = searchopts.concat(args).map(function (s) { return s.toLowerCase() }).filter(function (s) { return s }) - if (typeof searchexclude === "string") { + if (typeof searchexclude === 'string') { searchexclude = searchexclude.split(/\s+/) } else { searchexclude = [] @@ -73,7 +80,7 @@ function filter (data, args, notArgs) { return Object.keys(data).map(function (d) { return data[d] }).filter(function (d) { - return typeof d === "object" + return typeof d === 'object' }).map(stripData).map(getWords).filter(function (data) { return filterWords(data, args, notArgs) }).reduce(function (l, r) { @@ -83,51 +90,52 @@ function filter (data, args, notArgs) { } function stripData (data) { - return { name: data.name - , description: npm.config.get("description") ? data.description : "" - , maintainers: (data.maintainers || []).map(function (m) { - return "=" + m.name - }) - , url: !Object.keys(data.versions || {}).length ? data.url : null - , keywords: data.keywords || [] - , version: Object.keys(data.versions || {})[0] || [] - , time: data.time - && data.time.modified - && (new Date(data.time.modified).toISOString() - .split("T").join(" ") - .replace(/:[0-9]{2}\.[0-9]{3}Z$/, "")) - .slice(0, -5) // remove time - || "prehistoric" - } + return { + name: data.name, + description: npm.config.get('description') ? data.description : '', + maintainers: (data.maintainers || []).map(function (m) { + return '=' + m.name + }), + url: !Object.keys(data.versions || {}).length ? data.url : null, + keywords: data.keywords || [], + version: Object.keys(data.versions || {})[0] || [], + time: data.time && + data.time.modified && + (new Date(data.time.modified).toISOString() // remove time + .split('T').join(' ') + .replace(/:[0-9]{2}\.[0-9]{3}Z$/, '')) + .slice(0, -5) || + 'prehistoric' + } } function getWords (data) { data.words = [ data.name ] .concat(data.description) .concat(data.maintainers) - .concat(data.url && ("<" + data.url + ">")) + .concat(data.url && ('<' + data.url + '>')) .concat(data.keywords) .map(function (f) { return f && f.trim && f.trim() }) .filter(function (f) { return f }) - .join(" ") + .join(' ') .toLowerCase() return data } function filterWords (data, args, notArgs) { var words = data.words - for (var i = 0, l = args.length; i < l; i ++) { + for (var i = 0, l = args.length; i < l; i++) { if (!match(words, args[i])) return false } - for (i = 0, l = notArgs.length; i < l; i ++) { + for (i = 0, l = notArgs.length; i < l; i++) { if (match(words, notArgs[i])) return false } return true } function match (words, arg) { - if (arg.charAt(0) === "/") { - arg = arg.replace(/\/$/, "") + if (arg.charAt(0) === '/') { + arg = arg.replace(/\/$/, '') arg = new RegExp(arg.substr(1, arg.length - 1)) return words.match(arg) } @@ -135,132 +143,135 @@ function match (words, arg) { } function prettify (data, args) { - var searchsort = (npm.config.get("searchsort") || "NAME").toLowerCase() - , sortField = searchsort.replace(/^\-+/, "") - , searchRev = searchsort.charAt(0) === "-" - , truncate = !npm.config.get("long") + var searchsort = (npm.config.get('searchsort') || 'NAME').toLowerCase() + var sortField = searchsort.replace(/^\-+/, '') + var searchRev = searchsort.charAt(0) === '-' + var truncate = !npm.config.get('long') if (Object.keys(data).length === 0) { - return "No match found for "+(args.map(JSON.stringify).join(" ")) + return 'No match found for ' + (args.map(JSON.stringify).join(' ')) } var lines = Object.keys(data).map(function (d) { // strip keyname return data[d] - }).map(function(dat) { + }).map(function (dat) { dat.author = dat.maintainers delete dat.maintainers dat.date = dat.time delete dat.time return dat - }).map(function(dat) { + }).map(function (dat) { // split keywords on whitespace or , - if (typeof dat.keywords === "string") { + if (typeof dat.keywords === 'string') { dat.keywords = dat.keywords.split(/[,\s]+/) } if (Array.isArray(dat.keywords)) { - dat.keywords = dat.keywords.join(" ") + dat.keywords = dat.keywords.join(' ') } // split author on whitespace or , - if (typeof dat.author === "string") { + if (typeof dat.author === 'string') { dat.author = dat.author.split(/[,\s]+/) } if (Array.isArray(dat.author)) { - dat.author = dat.author.join(" ") + dat.author = dat.author.join(' ') } return dat }) - lines.sort(function(a, b) { + lines.sort(function (a, b) { var aa = a[sortField].toLowerCase() - , bb = b[sortField].toLowerCase() + var bb = b[sortField].toLowerCase() return aa === bb ? 0 : aa < bb ? -1 : 1 }) if (searchRev) lines.reverse() - var columns = npm.config.get("description") - ? ["name", "description", "author", "date", "version", "keywords"] - : ["name", "author", "date", "version", "keywords"] - - var output = columnify(lines, { - include: columns - , truncate: truncate - , config: { - name: { maxWidth: 40, truncate: false, truncateMarker: "" } - , description: { maxWidth: 60 } - , author: { maxWidth: 20 } - , date: { maxWidth: 11 } - , version: { maxWidth: 11 } - , keywords: { maxWidth: Infinity } + var columns = npm.config.get('description') + ? ['name', 'description', 'author', 'date', 'version', 'keywords'] + : ['name', 'author', 'date', 'version', 'keywords'] + + var output = columnify( + lines, + { + include: columns, + truncate: truncate, + config: { + name: { maxWidth: 40, truncate: false, truncateMarker: '' }, + description: { maxWidth: 60 }, + author: { maxWidth: 20 }, + date: { maxWidth: 11 }, + version: { maxWidth: 11 }, + keywords: { maxWidth: Infinity } } - }) + } + ) output = trimToMaxWidth(output) output = highlightSearchTerms(output, args) return output } -var colors = [31, 33, 32, 36, 34, 35 ] - , cl = colors.length +var colors = [31, 33, 32, 36, 34, 35] +var cl = colors.length function addColorMarker (str, arg, i) { var m = i % cl + 1 - , markStart = String.fromCharCode(m) - , markEnd = String.fromCharCode(0) - - if (arg.charAt(0) === "/") { - //arg = arg.replace(/\/$/, "") - return str.replace( new RegExp(arg.substr(1, arg.length - 2), "gi") - , function (bit) { return markStart + bit + markEnd } ) - + var markStart = String.fromCharCode(m) + var markEnd = String.fromCharCode(0) + + if (arg.charAt(0) === '/') { + return str.replace( + new RegExp(arg.substr(1, arg.length - 2), 'gi'), + function (bit) { return markStart + bit + markEnd } + ) } // just a normal string, do the split/map thing var pieces = str.toLowerCase().split(arg.toLowerCase()) - , p = 0 + var p = 0 return pieces.map(function (piece) { piece = str.substr(p, piece.length) - var mark = markStart - + str.substr(p+piece.length, arg.length) - + markEnd + var mark = markStart + + str.substr(p + piece.length, arg.length) + + markEnd p += piece.length + arg.length return piece + mark - }).join("") + }).join('') } function colorize (line) { - for (var i = 0; i < cl; i ++) { + for (var i = 0; i < cl; i++) { var m = i + 1 - var color = npm.color ? "\033["+colors[i]+"m" : "" + var color = npm.color ? '\u001B[' + colors[i] + 'm' : '' line = line.split(String.fromCharCode(m)).join(color) } - var uncolor = npm.color ? "\033[0m" : "" - return line.split("\u0000").join(uncolor) + var uncolor = npm.color ? '\u001B[0m' : '' + return line.split('\u0000').join(uncolor) } -function getMaxWidth() { +function getMaxWidth () { var cols try { - var tty = require("tty") - , stdout = process.stdout + var tty = require('tty') + var stdout = process.stdout cols = !tty.isatty(stdout.fd) ? Infinity : process.stdout.getWindowSize()[0] cols = (cols === 0) ? Infinity : cols } catch (ex) { cols = Infinity } return cols } -function trimToMaxWidth(str) { +function trimToMaxWidth (str) { var maxWidth = getMaxWidth() - return str.split("\n").map(function(line) { + return str.split('\n').map(function (line) { return line.slice(0, maxWidth) - }).join("\n") + }).join('\n') } -function highlightSearchTerms(str, terms) { +function highlightSearchTerms (str, terms) { terms.forEach(function (arg, i) { str = addColorMarker(str, arg, i) }) diff --git a/deps/npm/lib/set.js b/deps/npm/lib/set.js index c83602ec1f6ce3..b5e7376fbd55f5 100644 --- a/deps/npm/lib/set.js +++ b/deps/npm/lib/set.js @@ -1,13 +1,13 @@ module.exports = set -set.usage = "npm set (See `npm config`)" +set.usage = 'npm set (See `npm config`)' -var npm = require("./npm.js") +var npm = require('./npm.js') set.completion = npm.commands.config.completion function set (args, cb) { if (!args.length) return cb(set.usage) - npm.commands.config(["set"].concat(args), cb) + npm.commands.config(['set'].concat(args), cb) } diff --git a/deps/npm/lib/shrinkwrap.js b/deps/npm/lib/shrinkwrap.js index 03192a3fa47225..9a6d8e76bd549e 100644 --- a/deps/npm/lib/shrinkwrap.js +++ b/deps/npm/lib/shrinkwrap.js @@ -3,84 +3,128 @@ module.exports = exports = shrinkwrap -var npm = require("./npm.js") - , log = require("npmlog") - , fs = require("fs") - , writeFileAtomic = require("write-file-atomic") - , path = require("path") - , readJson = require("read-package-json") - , sortedObject = require("sorted-object") +var path = require('path') +var log = require('npmlog') +var writeFileAtomic = require('write-file-atomic') +var iferr = require('iferr') +var readPackageTree = require('read-package-tree') +var validate = require('aproba') +var npm = require('./npm.js') +var recalculateMetadata = require('./install/deps.js').recalculateMetadata +var validatePeerDeps = require('./install/deps.js').validatePeerDeps +var isExtraneous = require('./install/is-extraneous.js') +var isOnlyDev = require('./install/is-dev.js').isOnlyDev +var packageId = require('./utils/package-id.js') +var moduleName = require('./utils/module-name.js') -shrinkwrap.usage = "npm shrinkwrap" +shrinkwrap.usage = 'npm shrinkwrap' function shrinkwrap (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } if (args.length) { - log.warn("shrinkwrap", "doesn't take positional args") + log.warn('shrinkwrap', "doesn't take positional args") } - // https://github.com/npm/npm/issues/7641 - // introduced because `npm ls` can now show dev and prod depenednecy - // trees separately - if (npm.config.get("dev")) { - npm.config.set("production", true) - } - npm.commands.ls([], true, function (er, _, pkginfo) { - if (er) return cb(er) - shrinkwrap_(pkginfo, silent, npm.config.get("dev"), cb) - }) + var dir = path.resolve(npm.dir, '..') + npm.config.set('production', true) + readPackageTree(dir, andRecalculateMetadata(iferr(cb, function (tree) { + var pkginfo = treeToShrinkwrap(tree, !!npm.config.get('dev') || /^dev(elopment)?$/.test(npm.config.get('also'))) + shrinkwrap_(pkginfo, silent, cb) + }))) } -function shrinkwrap_ (pkginfo, silent, dev, cb) { - if (pkginfo.problems) { - return cb(new Error("Problems were encountered\n" - +"Please correct and try again.\n" - +pkginfo.problems.join("\n"))) +function andRecalculateMetadata (next) { + validate('F', arguments) + return function (er, tree) { + validate('EO', arguments) + if (er) return next(er) + recalculateMetadata(tree, log, next) } +} - if (!dev) { - // remove dev deps unless the user does --dev - readJson(path.resolve(npm.prefix, "package.json"), function (er, data) { - if (er) - return cb(er) - if (data.devDependencies) { - Object.keys(data.devDependencies).forEach(function (dep) { - if (data.dependencies && data.dependencies[dep]) { - // do not exclude the dev dependency if it's also listed as a dependency - return - } +function treeToShrinkwrap (tree, dev) { + validate('OB', arguments) + var pkginfo = {} + if (tree.package.name) pkginfo.name = tree.package.name + if (tree.package.version) pkginfo.version = tree.package.version + var problems = [] + if (tree.children.length) { + shrinkwrapDeps(dev, problems, pkginfo.dependencies = {}, tree) + } + if (problems.length) pkginfo.problems = problems + return pkginfo +} - log.warn("shrinkwrap", "Excluding devDependency: %s", dep, data.dependencies) - delete pkginfo.dependencies[dep] - }) - } - save(pkginfo, silent, cb) +function shrinkwrapDeps (dev, problems, deps, tree, seen) { + validate('BAOO', [dev, problems, deps, tree]) + if (!seen) seen = {} + if (seen[tree.path]) return + seen[tree.path] = true + Object.keys(tree.missingDeps).forEach(function (name) { + var invalid = tree.children.filter(function (dep) { return moduleName(dep) === name })[0] + if (invalid) { + problems.push('invalid: have ' + invalid.package._id + ' (expected: ' + tree.missingDeps[name] + ') ' + invalid.path) + } else if (!tree.package.optionalDependencies || !tree.package.optionalDependencies[name]) { + var topname = packageId(tree) + problems.push('missing: ' + name + '@' + tree.package.dependencies[name] + + (topname ? ', required by ' + topname : '')) + } + }) + tree.children.sort(function (aa, bb) { return moduleName(aa).localeCompare(moduleName(bb)) }).forEach(function (child) { + if (!dev && isOnlyDev(child)) { + log.warn('shrinkwrap', 'Excluding devDependency: %s', packageId(child), child.parent.package.dependencies) + return + } + var pkginfo = deps[moduleName(child)] = {} + pkginfo.version = child.package.version + pkginfo.from = child.package._from + pkginfo.resolved = child.package._resolved + if (isExtraneous(child)) { + problems.push('extraneous: ' + child.package._id + ' ' + child.path) + } + validatePeerDeps(child, function (tree, pkgname, version) { + problems.push('peer invalid: ' + pkgname + '@' + version + + ', required by ' + child.package._id) }) - } else { - save(pkginfo, silent, cb) - } + if (child.children.length) { + shrinkwrapDeps(dev, problems, pkginfo.dependencies = {}, child, seen) + } + }) } +function shrinkwrap_ (pkginfo, silent, cb) { + if (pkginfo.problems) { + return cb(new Error('Problems were encountered\n' + + 'Please correct and try again.\n' + + pkginfo.problems.join('\n'))) + } + + save(pkginfo, silent, cb) +} function save (pkginfo, silent, cb) { // copy the keys over in a well defined order // because javascript objects serialize arbitrarily - pkginfo.dependencies = sortedObject(pkginfo.dependencies || {}) var swdata try { - swdata = JSON.stringify(pkginfo, null, 2) + "\n" + swdata = JSON.stringify(pkginfo, null, 2) + '\n' } catch (er) { - log.error("shrinkwrap", "Error converting package info to json") + log.error('shrinkwrap', 'Error converting package info to json') return cb(er) } - var file = path.resolve(npm.prefix, "npm-shrinkwrap.json") + var file = path.resolve(npm.prefix, 'npm-shrinkwrap.json') writeFileAtomic(file, swdata, function (er) { if (er) return cb(er) if (silent) return cb(null, pkginfo) - console.log("wrote npm-shrinkwrap.json") + log.clearProgress() + console.log('wrote npm-shrinkwrap.json') + log.showProgress() cb(null, pkginfo) }) } diff --git a/deps/npm/lib/star.js b/deps/npm/lib/star.js index 1f324336c0c57f..29c4037d0cb2b0 100644 --- a/deps/npm/lib/star.js +++ b/deps/npm/lib/star.js @@ -1,13 +1,12 @@ - module.exports = star -var npm = require("./npm.js") - , log = require("npmlog") - , asyncMap = require("slide").asyncMap - , mapToRegistry = require("./utils/map-to-registry.js") +var npm = require('./npm.js') +var log = require('npmlog') +var asyncMap = require('slide').asyncMap +var mapToRegistry = require('./utils/map-to-registry.js') -star.usage = "npm star [pkg, pkg, ...]\n" - + "npm unstar [pkg, pkg, ...]" +star.usage = 'npm star [...]\n' + + 'npm unstar [...]' star.completion = function (opts, cb) { // FIXME: there used to be registry completion here, but it stopped making @@ -17,22 +16,22 @@ star.completion = function (opts, cb) { function star (args, cb) { if (!args.length) return cb(star.usage) - var s = npm.config.get("unicode") ? "\u2605 " : "(*)" - , u = npm.config.get("unicode") ? "\u2606 " : "( )" - , using = !(npm.command.match(/^un/)) + var s = npm.config.get('unicode') ? '\u2605 ' : '(*)' + var u = npm.config.get('unicode') ? '\u2606 ' : '( )' + var using = !(npm.command.match(/^un/)) if (!using) s = u asyncMap(args, function (pkg, cb) { mapToRegistry(pkg, npm.config, function (er, uri, auth) { if (er) return cb(er) var params = { - starred : using, - auth : auth + starred: using, + auth: auth } npm.registry.star(uri, params, function (er, data, raw, req) { if (!er) { - console.log(s + " "+pkg) - log.verbose("star", data) + console.log(s + ' ' + pkg) + log.verbose('star', data) } cb(er, data, raw, req) }) diff --git a/deps/npm/lib/stars.js b/deps/npm/lib/stars.js index 01ec76e42c1f4c..4ad8f02e59dca9 100644 --- a/deps/npm/lib/stars.js +++ b/deps/npm/lib/stars.js @@ -1,10 +1,10 @@ module.exports = stars -stars.usage = "npm stars [username]" +stars.usage = 'npm stars []' -var npm = require("./npm.js") - , log = require("npmlog") - , mapToRegistry = require("./utils/map-to-registry.js") +var npm = require('./npm.js') +var log = require('npmlog') +var mapToRegistry = require('./utils/map-to-registry.js') function stars (args, cb) { npm.commands.whoami([], true, function (er, username) { @@ -20,12 +20,12 @@ function stars (args, cb) { if (er.code !== 'ENEEDAUTH') return cb(er) } - mapToRegistry("", npm.config, function (er, uri, auth) { + mapToRegistry('', npm.config, function (er, uri, auth) { if (er) return cb(er) var params = { - username : name, - auth : auth + username: name, + auth: auth } npm.registry.stars(uri, params, showstars) }) @@ -35,9 +35,9 @@ function stars (args, cb) { 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) { + data.rows.forEach(function (a) { console.log(a.value) }) } diff --git a/deps/npm/lib/start.js b/deps/npm/lib/start.js index 98823825bb17ba..85d61e78d0a43a 100644 --- a/deps/npm/lib/start.js +++ b/deps/npm/lib/start.js @@ -1 +1 @@ -module.exports = require("./utils/lifecycle.js").cmd("start") +module.exports = require('./utils/lifecycle.js').cmd('start') diff --git a/deps/npm/lib/stop.js b/deps/npm/lib/stop.js index 8ea5ba6aa61b99..e4d02ff28165b9 100644 --- a/deps/npm/lib/stop.js +++ b/deps/npm/lib/stop.js @@ -1 +1 @@ -module.exports = require("./utils/lifecycle.js").cmd("stop") +module.exports = require('./utils/lifecycle.js').cmd('stop') diff --git a/deps/npm/lib/substack.js b/deps/npm/lib/substack.js index 1929f187384949..c39a5dcc482a8d 100644 --- a/deps/npm/lib/substack.js +++ b/deps/npm/lib/substack.js @@ -1,15 +1,16 @@ module.exports = substack -var npm = require("./npm.js") +var npm = require('./npm.js') -var isms = - [ "\033[32mbeep \033[35mboop\033[m" - , "Replace your configs with services" - , "SEPARATE ALL THE CONCERNS!" - , "MODULE ALL THE THINGS!" - , "\\o/" - , "but first, burritos" - , "full time mad scientist here" - , "c/,,\\" ] +var isms = [ + '\u001b[32mbeep \u001b[35mboop\u001b[m', + 'Replace your configs with services', + 'SEPARATE ALL THE CONCERNS!', + 'MODULE ALL THE THINGS!', + '\\o/', + 'but first, burritos', + 'full time mad scientist here', + 'c/,,\\' +] function substack (args, cb) { var i = Math.floor(Math.random() * isms.length) diff --git a/deps/npm/lib/tag.js b/deps/npm/lib/tag.js index 75da0b2174fff7..01db4d8ea65b1d 100644 --- a/deps/npm/lib/tag.js +++ b/deps/npm/lib/tag.js @@ -1,40 +1,41 @@ // turns out tagging isn't very complicated // all the smarts are in the couch. module.exports = tag -tag.usage = "npm tag @ []" +tag.usage = '[DEPRECATED] npm tag @ []' + + '\nSee `dist-tag`' -tag.completion = require("./unpublish.js").completion +tag.completion = require('./unpublish.js').completion -var npm = require("./npm.js") - , mapToRegistry = require("./utils/map-to-registry.js") - , npa = require("npm-package-arg") - , semver = require("semver") - , log = require("npmlog") +var npm = require('./npm.js') +var mapToRegistry = require('./utils/map-to-registry.js') +var npa = require('npm-package-arg') +var semver = require('semver') +var log = require('npmlog') function tag (args, cb) { - var thing = npa(args.shift() || "") - , project = thing.name - , version = thing.rawSpec - , t = args.shift() || npm.config.get("tag") + var thing = npa(args.shift() || '') + var project = thing.name + var version = thing.rawSpec + var t = args.shift() || npm.config.get('tag') t = t.trim() - if (!project || !version || !t) return cb("Usage:\n"+tag.usage) + if (!project || !version || !t) return cb('Usage:\n' + tag.usage) if (semver.validRange(t)) { - var er = new Error("Tag name must not be a valid SemVer range: " + t) + var er = new Error('Tag name must not be a valid SemVer range: ' + t) return cb(er) } - log.warn("tag", "This command is deprecated. Use `npm dist-tag` instead.") + log.warn('tag', 'This command is deprecated. Use `npm dist-tag` instead.') mapToRegistry(project, npm.config, function (er, uri, auth) { if (er) return cb(er) var params = { - version : version, - tag : t, - auth : auth + version: version, + tag: t, + auth: auth } npm.registry.tag(uri, params, cb) }) diff --git a/deps/npm/lib/test.js b/deps/npm/lib/test.js index dd4994cf28d159..cbc75821708b12 100644 --- a/deps/npm/lib/test.js +++ b/deps/npm/lib/test.js @@ -1,12 +1,12 @@ module.exports = test -var testCmd = require("./utils/lifecycle.js").cmd("test") +var testCmd = require('./utils/lifecycle.js').cmd('test') function test (args, cb) { testCmd(args, function (er) { if (!er) return cb() - if (er.code === "ELIFECYCLE") { - return cb("Test failed. See above for more details.") + if (er.code === 'ELIFECYCLE') { + return cb('Test failed. See above for more details.') } return cb(er) }) diff --git a/deps/npm/lib/unbuild.js b/deps/npm/lib/unbuild.js index d5fe0e6a0d1541..e6605939de36ab 100644 --- a/deps/npm/lib/unbuild.js +++ b/deps/npm/lib/unbuild.js @@ -1,59 +1,70 @@ module.exports = unbuild -unbuild.usage = "npm unbuild \n(this is plumbing)" +module.exports.rmStuff = rmStuff +unbuild.usage = 'npm unbuild \n(this is plumbing)' -var readJson = require("read-package-json") - , gentlyRm = require("./utils/gently-rm.js") - , npm = require("./npm.js") - , path = require("path") - , isInside = require("path-is-inside") - , lifecycle = require("./utils/lifecycle.js") - , asyncMap = require("slide").asyncMap - , chain = require("slide").chain - , log = require("npmlog") - , build = require("./build.js") +var readJson = require('read-package-json') +var gentlyRm = require('./utils/gently-rm.js') +var npm = require('./npm.js') +var path = require('path') +var isInside = require('path-is-inside') +var lifecycle = require('./utils/lifecycle.js') +var asyncMap = require('slide').asyncMap +var chain = require('slide').chain +var log = require('npmlog') +var build = require('./build.js') // 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) } -function unbuild_ (silent) { return function (folder, cb_) { - function cb (er) { - cb_(er, path.relative(npm.root, folder)) - } - folder = path.resolve(folder) - var base = isInside(folder, npm.prefix) ? npm.prefix : folder - delete build._didBuild[folder] - log.verbose("unbuild", folder.substr(npm.prefix.length + 1)) - readJson(path.resolve(folder, "package.json"), function (er, pkg) { - // if no json, then just trash it, but no scripts or whatever. - if (er) return gentlyRm(folder, false, base, cb) - chain - ( [ [lifecycle, pkg, "preuninstall", folder, false, true] - , [lifecycle, pkg, "uninstall", folder, false, true] - , !silent && function(cb) { - console.log("unbuild " + pkg._id) +function unbuild_ (silent) { + return function (folder, cb_) { + function cb (er) { + cb_(er, path.relative(npm.root, folder)) + } + folder = path.resolve(folder) + var base = isInside(folder, npm.prefix) ? npm.prefix : folder + delete build._didBuild[folder] + log.verbose('unbuild', folder.substr(npm.prefix.length + 1)) + readJson(path.resolve(folder, 'package.json'), function (er, pkg) { + // if no json, then just trash it, but no scripts or whatever. + if (er) return gentlyRm(folder, false, base, cb) + chain( + [ + [lifecycle, pkg, 'preuninstall', folder, false, true], + [lifecycle, pkg, 'uninstall', folder, false, true], + !silent && function (cb) { + log.clearProgress() + console.log('unbuild ' + pkg._id) + log.showProgress() cb() - } - , [rmStuff, pkg, folder] - , [lifecycle, pkg, "postuninstall", folder, false, true] - , [gentlyRm, folder, false, base] ] - , cb ) - }) -}} + }, + [rmStuff, pkg, folder], + [lifecycle, pkg, 'postuninstall', folder, false, true], + [gentlyRm, folder, false, base] + ], + cb + ) + }) + } +} function rmStuff (pkg, folder, 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) - , gnm = npm.dir - , top = gnm === parent + var gnm = npm.dir + var top = gnm === parent - log.verbose("unbuild rmStuff", pkg._id, "from", gnm) - if (!top) log.verbose("unbuild rmStuff", "in", parent) + log.verbose('unbuild rmStuff', pkg._id, 'from', gnm) + if (!top) log.verbose('unbuild rmStuff', 'in', parent) asyncMap([rmBins, rmMans], function (fn, cb) { fn(pkg, folder, parent, top, cb) }, cb) @@ -61,26 +72,26 @@ function rmStuff (pkg, folder, cb) { function rmBins (pkg, folder, parent, top, cb) { if (!pkg.bin) return cb() - var binRoot = top ? npm.bin : path.resolve(parent, ".bin") + var binRoot = top ? npm.bin : path.resolve(parent, '.bin') asyncMap(Object.keys(pkg.bin), function (b, cb) { - if (process.platform === "win32") { - chain([ [gentlyRm, path.resolve(binRoot, b) + ".cmd", true] - , [gentlyRm, path.resolve(binRoot, b), true] ], cb) + if (process.platform === 'win32') { + chain([ [gentlyRm, path.resolve(binRoot, b) + '.cmd', true, folder], + [gentlyRm, path.resolve(binRoot, b), true, folder] ], cb) } else { - gentlyRm(path.resolve(binRoot, b), true, cb) + gentlyRm(path.resolve(binRoot, b), true, folder, cb) } }, cb) } function rmMans (pkg, folder, parent, top, cb) { - if (!pkg.man - || !top - || process.platform === "win32" - || !npm.config.get("global")) { + if (!pkg.man || + !top || + process.platform === 'win32' || + !npm.config.get('global')) { return cb() } - var manRoot = path.resolve(npm.config.get("prefix"), "share", "man") - log.verbose("rmMans", "man files are", pkg.man, "in", manRoot) + var manRoot = path.resolve(npm.config.get('prefix'), 'share', 'man') + log.verbose('rmMans', 'man files are', pkg.man, 'in', manRoot) asyncMap(pkg.man, function (man, cb) { if (Array.isArray(man)) { man.forEach(rmMan) @@ -89,25 +100,25 @@ function rmMans (pkg, folder, parent, top, cb) { } function rmMan (man) { - log.silly("rmMan", "preparing to remove", man) + log.silly('rmMan', 'preparing to remove', man) var parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) if (!parseMan) { log.error( - "rmMan", man, "is not a valid name for a man file.", - "Man files must end with a number, " + - "and optionally a .gz suffix if they are compressed." + 'rmMan', man, 'is not a valid name for a man file.', + 'Man files must end with a number, ' + + 'and optionally a .gz suffix if they are compressed.' ) return cb() } var stem = parseMan[1] var sxn = parseMan[2] - var gz = parseMan[3] || "" + var gz = parseMan[3] || '' var bn = path.basename(stem) var manDest = path.join( manRoot, - "man"+sxn, - (bn.indexOf(pkg.name) === 0 ? bn : pkg.name+"-"+bn)+"."+sxn+gz + 'man' + sxn, + (bn.indexOf(pkg.name) === 0 ? bn : pkg.name + '-' + bn) + '.' + sxn + gz ) gentlyRm(manDest, true, cb) } diff --git a/deps/npm/lib/uninstall.js b/deps/npm/lib/uninstall.js index 600c6819740f77..03a0a56303c3d5 100644 --- a/deps/npm/lib/uninstall.js +++ b/deps/npm/lib/uninstall.js @@ -1,128 +1,73 @@ - +'use strict' // remove a package. module.exports = uninstall +module.exports.Uninstaller = Uninstaller -uninstall.usage = "npm uninstall [@ [[@] ...]" - + "\nnpm rm [@ [[@] ...]" +uninstall.usage = 'npm uninstall [<@scope>/][@]... [--save|--save-dev|--save-optional]' + + '\n\naliases: remove, rm, r, un, unlink' -uninstall.completion = require("./utils/completion/installed-shallow.js") +var util = require('util') +var path = require('path') +var validate = require('aproba') +var chain = require('slide').chain +var readJson = require('read-package-json') +var npm = require('./npm.js') +var Installer = require('./install.js').Installer +var getSaveType = require('./install/save.js').getSaveType +var removeDeps = require('./install/deps.js').removeDeps +var loadExtraneous = require('./install/deps.js').loadExtraneous +var log = require('npmlog') -var fs = require("graceful-fs") - , writeFileAtomic = require("write-file-atomic") - , log = require("npmlog") - , readJson = require("read-package-json") - , path = require("path") - , npm = require("./npm.js") - , asyncMap = require("slide").asyncMap +uninstall.completion = require('./utils/completion/installed-shallow.js') function uninstall (args, cb) { - // this is super easy - // get the list of args that correspond to package names in either - // the global npm.dir, - // then call unbuild on all those folders to pull out their bins - // and mans and whatnot, and then delete the folder. - - var nm = npm.dir - if (args.length === 1 && args[0] === ".") args = [] - if (args.length) return uninstall_(args, nm, cb) + validate('AF', arguments) + // the /path/to/node_modules/.. + var dryrun = !!npm.config.get('dry-run') - // remove this package from the global space, if it's installed there - readJson(path.resolve(npm.localPrefix, "package.json"), function (er, pkg) { - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - if (er) return cb(uninstall.usage) - uninstall_( [pkg.name] - , npm.globalDir - , cb ) + if (args.length === 1 && args[0] === '.') args = [] + args = args.filter(function (a) { + return path.resolve(a) !== where }) -} - -function uninstall_ (args, nm, cb) { - // if we've been asked to --save or --save-dev or --save-optional, - // then also remove it from the associated dependencies hash. - var s = npm.config.get('save') - , d = npm.config.get('save-dev') - , o = npm.config.get('save-optional') - if (s || d || o) { - cb = saver(args, nm, cb) - } - - asyncMap(args, function (arg, cb) { - // uninstall .. should not delete /usr/local/lib/node_modules/.. - var p = path.join(path.resolve(nm), path.join("/", arg)) - if (path.resolve(p) === nm) { - log.warn("uninstall", "invalid argument: %j", arg) - return cb(null, []) - } - fs.lstat(p, function (er) { - if (er) { - log.warn("uninstall", "not installed in %s: %j", nm, arg) - return cb(null, []) - } - cb(null, p) + var where = npm.config.get('global') || !args.length + ? path.resolve(npm.globalDir, '..') + : npm.prefix + + if (args.length) { + new Uninstaller(where, dryrun, args).run(cb) + } else { + // remove this package from the global space, if it's installed there + readJson(path.resolve(npm.localPrefix, 'package.json'), function (er, pkg) { + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) + if (er) return cb(uninstall.usage) + new Uninstaller(where, dryrun, [pkg.name]).run(cb) }) - }, function (er, folders) { - if (er) return cb(er) - asyncMap(folders, npm.commands.unbuild, cb) - }) + } } -function saver (args, nm, cb_) { - return cb - function cb (er, data) { - var s = npm.config.get('save') - , d = npm.config.get('save-dev') - , o = npm.config.get('save-optional') - if (er || !(s || d || o)) return cb_(er, data) - var pj = path.resolve(nm, '..', 'package.json') - // don't use readJson here, because we don't want all the defaults - // filled in, for mans and other bs. - fs.readFile(pj, 'utf8', function (er, json) { - var pkg - try { - pkg = JSON.parse(json) - } catch (_) {} - if (!pkg) return cb_(null, data) - - var bundle - if (npm.config.get('save-bundle')) { - bundle = pkg.bundleDependencies || pkg.bundledDependencies - if (!Array.isArray(bundle)) bundle = undefined - } - - var changed = false - args.forEach(function (a) { - ; [ [s, 'dependencies'] - , [o, 'optionalDependencies'] - , [d, 'devDependencies'] ].forEach(function (f) { - var flag = f[0] - , field = f[1] - if (!flag || !pkg[field] || !pkg[field].hasOwnProperty(a)) return - changed = true +function Uninstaller (where, dryrun, args) { + validate('SBA', arguments) + Installer.call(this, where, dryrun, args) +} +util.inherits(Uninstaller, Installer) - if (bundle) { - var i = bundle.indexOf(a) - if (i !== -1) bundle.splice(i, 1) - } +Uninstaller.prototype.loadArgMetadata = function (next) { + this.args = this.args.map(function (arg) { return {name: arg} }) + next() +} - delete pkg[field][a] - }) - }) - if (!changed) return cb_(null, data) +Uninstaller.prototype.loadAllDepsIntoIdealTree = function (cb) { + validate('F', arguments) + log.silly('uninstall', 'loadAllDepsIntoIdealtree') + var saveDeps = getSaveType(this.args) - if (bundle) { - delete pkg.bundledDependencies - if (bundle.length) { - pkg.bundleDependencies = bundle - } else { - delete pkg.bundleDependencies - } - } + var cg = this.progress.loadAllDepsIntoIdealTree + var steps = [] - writeFileAtomic(pj, JSON.stringify(pkg, null, 2) + "\n", function (er) { - return cb_(er, data) - }) - }) - } + steps.push( + [removeDeps, this.args, this.idealTree, saveDeps, cg.newGroup('removeDeps')], + [loadExtraneous, this.idealTree, cg.newGroup('loadExtraneous')]) + chain(steps, cb) } diff --git a/deps/npm/lib/unpublish.js b/deps/npm/lib/unpublish.js index 111f27aa2d2997..63f87b8207d246 100644 --- a/deps/npm/lib/unpublish.js +++ b/deps/npm/lib/unpublish.js @@ -1,15 +1,15 @@ module.exports = unpublish -var log = require("npmlog") -var npm = require("./npm.js") -var readJson = require("read-package-json") -var path = require("path") -var mapToRegistry = require("./utils/map-to-registry.js") -var npa = require("npm-package-arg") -var getPublishConfig = require("./utils/get-publish-config.js") +var log = require('npmlog') +var npm = require('./npm.js') +var readJson = require('read-package-json') +var path = require('path') +var mapToRegistry = require('./utils/map-to-registry.js') +var npa = require('npm-package-arg') +var getPublishConfig = require('./utils/get-publish-config.js') -unpublish.usage = "npm unpublish [@]" +unpublish.usage = 'npm unpublish [<@scope>/][@]' unpublish.completion = function (opts, cb) { if (opts.conf.argv.remain.length >= 3) return cb() @@ -18,11 +18,11 @@ unpublish.completion = function (opts, cb) { var un = encodeURIComponent(username) if (!un) return cb() - var byUser = "-/by-user/" + un + var byUser = '-/by-user/' + un mapToRegistry(byUser, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, pkgs) { + npm.registry.get(uri, { auth: auth }, 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. @@ -36,12 +36,12 @@ unpublish.completion = function (opts, cb) { mapToRegistry(pkgs[0], npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, d) { + npm.registry.get(uri, { auth: auth }, 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 + return pkgs[0] + '@' + v })) }) }) @@ -54,24 +54,26 @@ function unpublish (args, cb) { if (args.length > 1) return cb(unpublish.usage) 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) + var project = thing.name + var 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 + ) } 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(npm.localPrefix, "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 && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) + if (er) return cb('Usage:\n' + unpublish.usage) log.verbose('unpublish', data) gotProject(data.name, data.version, data.publishConfig, cb) }) @@ -87,7 +89,7 @@ function gotProject (project, version, publishConfig, cb_) { function cb (er) { if (er) return cb_(er) - console.log("- " + project + (version ? "@" + version : "")) + console.log('- ' + project + (version ? '@' + version : '')) cb_() } @@ -96,9 +98,9 @@ function gotProject (project, version, publishConfig, cb_) { var registry = mappedConfig.client // remove from the cache first - npm.commands.cache(["clean", project, version], function (er) { + npm.commands.cache(['clean', project, version], function (er) { if (er) { - log.error("unpublish", "Failed to clean cache") + log.error('unpublish', 'Failed to clean cache') return cb(er) } diff --git a/deps/npm/lib/update.js b/deps/npm/lib/update.js index 3e9438e9231629..45f2817f5fc893 100644 --- a/deps/npm/lib/update.js +++ b/deps/npm/lib/update.js @@ -1,58 +1,60 @@ -/* -for each pkg in prefix that isn't a git repo - look for a new version of pkg that satisfies dep - if so, install it. - if not, then update it -*/ - module.exports = update -update.usage = "npm update [pkg]" - -var npm = require("./npm.js") - , asyncMap = require("slide").asyncMap - , log = require("npmlog") +update.usage = 'npm update [-g] [...]' - // load these, just so that we know that they'll be available, in case - // npm itself is getting overwritten. - , install = require("./install.js") - , build = require("./build.js") +var url = require('url') +var log = require('npmlog') +var chain = require('slide').chain +var npm = require('./npm.js') +var Installer = require('./install.js').Installer update.completion = npm.commands.outdated.completion function update (args, cb) { - npm.commands.outdated(args, true, function (er, outdated) { + var dryrun = false + if (npm.config.get('dry-run')) dryrun = true + + npm.commands.outdated(args, true, function (er, rawOutdated) { if (er) return cb(er) + var outdated = rawOutdated.map(function (ww) { + return { + dep: ww[0], + depname: ww[1], + current: ww[2], + wanted: ww[3], + latest: ww[4], + req: ww[5], + what: ww[1] + '@' + ww[3] + } + }) var wanted = outdated.filter(function (ww) { - var dep = ww[1] - var current = ww[2] - var wanted = ww[3] - var latest = ww[4] - if (current === wanted && wanted !== latest) { + if (ww.current === ww.wanted && ww.wanted !== ww.latest) { log.verbose( 'outdated', - 'not updating', dep, + 'not updating', ww.depname, "because it's currently at the maximum version that matches its specified semver range" ) } - return current !== wanted + return ww.current !== ww.wanted }) if (wanted.length === 0) return cb() log.info('outdated', 'updating', wanted) - asyncMap(wanted, function (ww, cb) { - // [[ dir, dep, has, want, req ]] - var where = ww[0] - , dep = ww[1] - , want = ww[3] - , what = dep + "@" + want - , req = ww[5] - , url = require('url') - + var toInstall = {} + wanted.forEach(function (ww) { // use the initial installation method (repo, tar, git) for updating - if (url.parse(req).protocol) what = req - npm.commands.install(where, what, cb) - }, cb) + if (url.parse(ww.req).protocol) ww.what = ww.req + + var where = ww.dep.parent && ww.dep.parent.path || ww.dep.path + if (toInstall[where]) { + toInstall[where].push(ww.what) + } else { + toInstall[where] = [ww.what] + } + }) + chain(Object.keys(toInstall).map(function (where) { + return [new Installer(where, dryrun, toInstall[where]), 'run'] + }), cb) }) } diff --git a/deps/npm/lib/utils/child-path.js b/deps/npm/lib/utils/child-path.js new file mode 100644 index 00000000000000..4594f43221ff62 --- /dev/null +++ b/deps/npm/lib/utils/child-path.js @@ -0,0 +1,10 @@ +'use strict' +var path = require('path') +var validate = require('aproba') +var moduleName = require('../utils/module-name.js') + +module.exports = childPath +function childPath (parentPath, child) { + validate('SO', arguments) + return path.join(parentPath, 'node_modules', moduleName(child)) +} diff --git a/deps/npm/lib/utils/completion/file-completion.js b/deps/npm/lib/utils/completion/file-completion.js index 6ce2f83467d012..78777a025ec88a 100644 --- a/deps/npm/lib/utils/completion/file-completion.js +++ b/deps/npm/lib/utils/completion/file-completion.js @@ -1,21 +1,24 @@ module.exports = fileCompletion -var mkdir = require("mkdirp") - , path = require("path") - , glob = require("glob") +var mkdir = require('mkdirp') +var path = require('path') +var glob = require('glob') function fileCompletion (root, req, depth, cb) { - if (typeof cb !== "function") cb = depth, depth = Infinity + if (typeof cb !== 'function') { + cb = depth + depth = Infinity + } mkdir(root, function (er) { if (er) return cb(er) // can be either exactly the req, or a descendent - var pattern = root + "/{" + req + "," + req + "/**/*}" - , opts = { mark: true, dot: true, maxDepth: depth } + var pattern = root + '/{' + req + ',' + req + '/**/*}' + var opts = { mark: true, dot: true, maxDepth: depth } glob(pattern, opts, function (er, files) { if (er) return cb(er) return cb(null, (files || []).map(function (f) { - var tail = f.substr(root.length + 1).replace(/^\//, "") + var tail = f.substr(root.length + 1).replace(/^\//, '') return path.join(req, tail) })) }) diff --git a/deps/npm/lib/utils/completion/installed-deep.js b/deps/npm/lib/utils/completion/installed-deep.js index 5fb67d263f12e7..dc9bfbee8a2da7 100644 --- a/deps/npm/lib/utils/completion/installed-deep.js +++ b/deps/npm/lib/utils/completion/installed-deep.js @@ -1,21 +1,25 @@ module.exports = installedDeep -var npm = require("../../npm.js") - , readInstalled = require("read-installed") +var npm = require('../../npm.js') +var readInstalled = require('read-installed') function installedDeep (opts, cb) { var local - , global - , depth = npm.config.get("depth") - , opt = { depth: depth, dev: true } + var global + var depth = npm.config.get('depth') + var opt = { depth: depth, dev: true } - if (npm.config.get("global")) local = [], next() - else readInstalled(npm.prefix, opt, function (er, data) { - local = getNames(data || {}) + if (npm.config.get('global')) { + local = [] next() - }) + } else { + readInstalled(npm.prefix, opt, function (er, data) { + local = getNames(data || {}) + next() + }) + } - readInstalled(npm.config.get("prefix"), opt, function (er, data) { + readInstalled(npm.config.get('prefix'), opt, function (er, data) { global = getNames(data || {}) next() }) @@ -37,14 +41,12 @@ function installedDeep (opts, cb) { function next () { if (!local || !global) return - if (!npm.config.get("global")) { + if (!npm.config.get('global')) { global = global.map(function (g) { - return [g, "-g"] + return [g, '-g'] }) } var names = local.concat(global) return cb(null, names) } - } - diff --git a/deps/npm/lib/utils/completion/installed-shallow.js b/deps/npm/lib/utils/completion/installed-shallow.js index 8d64649d5f66a9..bf692fedea3a5d 100644 --- a/deps/npm/lib/utils/completion/installed-shallow.js +++ b/deps/npm/lib/utils/completion/installed-shallow.js @@ -1,31 +1,39 @@ module.exports = installedShallow -var npm = require("../../npm.js") - , fs = require("graceful-fs") - , path = require("path") - , readJson = require("read-package-json") - , asyncMap = require("slide").asyncMap +var npm = require('../../npm.js') +var fs = require('graceful-fs') +var path = require('path') +var readJson = require('read-package-json') +var asyncMap = require('slide').asyncMap function installedShallow (opts, filter, cb) { - if (typeof cb !== "function") cb = filter, filter = null + if (typeof cb !== 'function') { + cb = filter + filter = null + } var conf = opts.conf - , args = conf.argv.remain + var args = conf.argv.remain if (args.length > 3) return cb() var local - , global - , localDir = npm.dir - , globalDir = npm.globalDir - if (npm.config.get("global")) local = [], next() - else fs.readdir(localDir, function (er, pkgs) { - local = (pkgs || []).filter(function (p) { - return p.charAt(0) !== "." - }) + var global + var localDir = npm.dir + var globalDir = npm.globalDir + if (npm.config.get('global')) { + local = [] next() - }) + } else { + fs.readdir(localDir, function (er, pkgs) { + local = (pkgs || []).filter(function (p) { + return p.charAt(0) !== '.' + }) + next() + }) + } + fs.readdir(globalDir, function (er, pkgs) { global = (pkgs || []).filter(function (p) { - return p.charAt(0) !== "." + return p.charAt(0) !== '.' }) next() }) @@ -37,7 +45,7 @@ function installedShallow (opts, filter, cb) { function filterInstalled (local, global, filter, cb) { var fl - , fg + var fg if (!filter) { fl = local @@ -46,7 +54,7 @@ function filterInstalled (local, global, filter, cb) { } asyncMap(local, function (p, cb) { - readJson(path.join(npm.dir, p, "package.json"), function (er, d) { + readJson(path.join(npm.dir, p, 'package.json'), function (er, d) { if (!d || !filter(d)) return cb(null, []) return cb(null, d.name) }) @@ -57,7 +65,7 @@ function filterInstalled (local, global, filter, cb) { var globalDir = npm.globalDir asyncMap(global, function (p, cb) { - readJson(path.join(globalDir, p, "package.json"), function (er, d) { + readJson(path.join(globalDir, p, 'package.json'), function (er, d) { if (!d || !filter(d)) return cb(null, []) return cb(null, d.name) }) @@ -68,12 +76,12 @@ function filterInstalled (local, global, filter, cb) { function next () { if (!fg || !fl) return - if (!npm.config.get("global")) { + if (!npm.config.get('global')) { fg = fg.map(function (g) { - return [g, "-g"] + return [g, '-g'] }) } - console.error("filtered", fl, fg) + console.error('filtered', fl, fg) return cb(null, fl.concat(fg)) } } diff --git a/deps/npm/lib/utils/deep-sort-object.js b/deps/npm/lib/utils/deep-sort-object.js new file mode 100644 index 00000000000000..c8003c207893a5 --- /dev/null +++ b/deps/npm/lib/utils/deep-sort-object.js @@ -0,0 +1,12 @@ +'use strict' +var sortedObject = require('sorted-object') + +module.exports = function deepSortObject (obj, sortBy) { + if (obj == null || typeof obj !== 'object') return obj + if (obj instanceof Array) return obj.sort(sortBy) + obj = sortedObject(obj) + Object.keys(obj).forEach(function (key) { + obj[key] = deepSortObject(obj[key], sortBy) + }) + return obj +} diff --git a/deps/npm/lib/utils/depr-check.js b/deps/npm/lib/utils/depr-check.js index 7166348b086607..89cf402739a841 100644 --- a/deps/npm/lib/utils/depr-check.js +++ b/deps/npm/lib/utils/depr-check.js @@ -1,13 +1,13 @@ -var log = require("npmlog") +var log = require('npmlog') var deprecated = {} - , deprWarned = {} +var deprWarned = {} module.exports = function deprCheck (data) { if (deprecated[data._id]) data.deprecated = deprecated[data._id] if (data.deprecated) deprecated[data._id] = data.deprecated else return if (!deprWarned[data._id]) { deprWarned[data._id] = true - log.warn("deprecated", "%s: %s", data._id, data.deprecated) + log.warn('deprecated', '%s: %s', data._id, data.deprecated) } } diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js index dac6a17f251c90..8a7b1c06daa4fc 100644 --- a/deps/npm/lib/utils/error-handler.js +++ b/deps/npm/lib/utils/error-handler.js @@ -2,45 +2,47 @@ module.exports = errorHandler var cbCalled = false - , log = require("npmlog") - , npm = require("../npm.js") - , rm = require("rimraf") - , itWorked = false - , path = require("path") - , wroteLogFile = false - , exitCode = 0 - , rollbacks = npm.rollbacks - , chain = require("slide").chain - , writeStream = require("fs-write-stream-atomic") - , nameValidator = require("validate-npm-package-name") - - -process.on("exit", function (code) { - // console.error("exit", code) +var log = require('npmlog') +var npm = require('../npm.js') +var rm = require('rimraf') +var itWorked = false +var path = require('path') +var wroteLogFile = false +var exitCode = 0 +var rollbacks = npm.rollbacks +var chain = require('slide').chain +var writeStream = require('fs-write-stream-atomic') +var nameValidator = require('validate-npm-package-name') + +process.on('exit', function (code) { + log.disableProgress() if (!npm.config || !npm.config.loaded) return if (code) itWorked = false - if (itWorked) log.info("ok") + if (itWorked) log.info('ok') else { if (!cbCalled) { - log.error("", "cb() never called!") + log.error('', 'cb() never called!') } if (wroteLogFile) { // 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")) + 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 } if (code) { - log.error("code", code) + log.error('code', code) } } - var doExit = npm.config.get("_exit") + var doExit = npm.config.get('_exit') if (doExit) { // actually exit. if (exitCode === 0 && !itWorked) { @@ -55,9 +57,9 @@ process.on("exit", function (code) { function exit (code, noLog) { exitCode = exitCode || process.exitCode || code - var doExit = npm.config ? npm.config.get("_exit") : true - log.verbose("exit", [code, doExit]) - if (log.level === "silent") noLog = true + var doExit = npm.config ? npm.config.get('_exit') : true + log.verbose('exit', [code, doExit]) + if (log.level === 'silent') noLog = true if (rollbacks.length) { chain(rollbacks.map(function (f) { @@ -66,22 +68,22 @@ function exit (code, noLog) { } }), function (er) { if (er) { - log.error("error rolling back", er) + log.error('error rolling back', er) if (!code) errorHandler(er) - else if (noLog) rm("npm-debug.log", reallyExit.bind(null, er)) + else if (noLog) rm('npm-debug.log', reallyExit.bind(null, er)) else writeLogFile(reallyExit.bind(this, er)) } else { if (!noLog && code) writeLogFile(reallyExit) - else rm("npm-debug.log", reallyExit) + else rm('npm-debug.log', reallyExit) } }) rollbacks.length = 0 } else if (code && !noLog) writeLogFile(reallyExit) - else rm("npm-debug.log", reallyExit) + else rm('npm-debug.log', reallyExit) function reallyExit (er) { - if (er && !code) code = typeof er.errno === "number" ? er.errno : 1 + if (er && !code) code = typeof er.errno === 'number' ? er.errno : 1 // truncate once it's been written. log.record.length = 0 @@ -91,298 +93,398 @@ function exit (code, noLog) { // just emit a fake exit event. // if we're really exiting, then let it exit on its own, so that // in-process stuff can finish or clean up first. - if (!doExit) process.emit("exit", code) - npm.spinner.stop() + if (!doExit) process.emit('exit', code) } } - function errorHandler (er) { - // console.error("errorHandler", er) + log.disableProgress() + // console.error('errorHandler', er) if (!npm.config || !npm.config.loaded) { // logging won't work unless we pretend that it's ready - er = er || new Error("Exit prior to config file resolving.") + er = er || new Error('Exit prior to config file resolving.') console.error(er.stack || er.message) } if (cbCalled) { - er = er || new Error("Callback called more than once.") + er = er || new Error('Callback called more than once.') } cbCalled = true if (!er) return exit(0) - if (typeof er === "string") { - log.error("", er) + if (typeof er === 'string') { + log.error('', er) return exit(1, true) } else if (!(er instanceof Error)) { - log.error("weird error", er) + log.error('weird error', er) return exit(1, true) } 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) - }) + if (m && !er.code) { + er.code = m + } - 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) - }) + ;[ + '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("") + 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")) - break - - case "EACCES": - case "EPERM": - log.error("", er) - log.error("", ["\nPlease try running this command again as root/Administrator." - ].join("\n")) - break - - case "ELIFECYCLE": - log.error("", er.message) - log.error("", ["","Failed at the "+er.pkgid+" "+er.stage+" script '"+er.script+"'." - ,"This is most likely a problem with the "+er.pkgname+" package," - ,"not with npm itself." - ,"Tell the author that this fails on your system:" - ," "+er.script - ,"You can get their info via:" - ," npm owner ls "+er.pkgname - ,"There is likely additional logging output above." - ].join("\n")) - break - - case "ENOGIT": - log.error("", er.message) - log.error("", ["","Failed using git." - ,"This is most likely not a problem with npm itself." - ,"Please check if you have git installed and in your PATH." - ].join("\n")) - break - - case "EJSONPARSE": - log.error("", er.message) - log.error("", "File: "+er.file) - log.error("", ["Failed to parse package.json data." - ,"package.json must be actual JSON, not just JavaScript." - ,"","This is not a bug in npm." - ,"Tell the package author to fix their package.json file." - ].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.") - - var valResult = nameValidator(er.pkgid) - - if (valResult.validForNewPackages) { - msg.push("You should bug the author to publish it (or use the name yourself!)") - } else { - msg.push("Your package name is not valid, because", "") + 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') + ) + break - var errorsArray = (valResult.errors || []).concat(valResult.warnings || []) - errorsArray.forEach(function(item, idx) { - msg.push(" " + (idx + 1) + ". " + item) - }) - } + case 'EACCES': + case 'EPERM': + log.error('', er) + log.error('', ['\nPlease try running this command again as root/Administrator.' + ].join('\n')) + break - if (er.parent) { - msg.push("It was specified as a dependency of '"+er.parent+"'") + case 'ELIFECYCLE': + log.error('', er.message) + log.error( + '', + [ + '', + 'Failed at the ' + er.pkgid + ' ' + er.stage + " script '" + er.script + "'.", + 'Make sure you have the latest version of node.js and npm installed.', + 'If you do, this is most likely a problem with the ' + er.pkgname + ' package,', + 'not with npm itself.', + 'Tell the author that this fails on your system:', + ' ' + er.script, + 'You can get their info via:', + ' npm owner ls ' + er.pkgname, + 'There is likely additional logging output above.' + ].join('\n') + ) + break + + case 'ENOGIT': + log.error('', er.message) + log.error( + '', + [ + '', + 'Failed using git.', + 'This is most likely not a problem with npm itself.', + 'Please check if you have git installed and in your PATH.' + ].join('\n') + ) + break + + case 'EJSONPARSE': + log.error('', er.message) + log.error('', 'File: ' + er.file) + log.error( + '', + [ + 'Failed to parse package.json data.', + 'package.json must be actual JSON, not just JavaScript.', + '', + 'This is not a bug in npm.', + 'Tell the package author to fix their package.json file.' + ].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.") + + var valResult = nameValidator(er.pkgid) + + if (valResult.validForNewPackages) { + msg.push('You should bug the author to publish it (or use the name yourself!)') + } else { + msg.push('Your package name is not valid, because', '') + + var errorsArray = (valResult.errors || []).concat(valResult.warnings || []) + errorsArray.forEach(function (item, idx) { + msg.push(' ' + (idx + 1) + '. ' + item) + }) + } + + if (er.parent) { + msg.push("It was specified as a dependency of '" + er.parent + "'") + } + msg.push( + '\nNote that you can also install from a', + 'tarball, folder, http url, or git url.' + ) } - msg.push("\nNote that you can also install from a" - ,"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 - - case "EPUBLISHCONFLICT": - log.error("publish fail", ["Cannot publish over existing version." - ,"Update the 'version' field in package.json and try again." - ,"" - ,"To automatically increment version numbers, see:" - ," npm help version" - ].join("\n")) - break - - case "EISGIT": - log.error("git", [er.message - ," "+er.path - ,"Refusing to remove it. Update manually," - ,"or move it out of the way first." - ].join("\n")) - break - - case "ECYCLE": - log.error("cycle", [er.message - ,"While installing: "+er.pkgid - ,"Found a pathological dependency case that npm cannot solve." - ,"Please report this to the package author." - ].join("\n")) - break - - case "EBADPLATFORM": - log.error("notsup", [er.message - ,"Not compatible with your operating system or architecture: "+er.pkgid - ,"Valid OS: "+er.os.join(",") - ,"Valid Arch: "+er.cpu.join(",") - ,"Actual OS: "+process.platform - ,"Actual Arch: "+process.arch - ].join("\n")) - break - - case "EEXIST": - log.error([er.message - ,"File exists: "+er.path - ,"Move it away, and try again."].join("\n")) - break - - case "ENEEDAUTH": - log.error("need auth", [er.message - ,"You need to authorize this machine using `npm adduser`" - ].join("\n")) - break - - case "EPEERINVALID": - var peerErrors = Object.keys(er.peersDepending).map(function (peer) { - return "Peer " + peer + " wants " + er.packageName + "@" - + er.peersDepending[peer] - }) - log.error("peerinvalid", [er.message].concat(peerErrors).join("\n")) - break - - case "ECONNRESET": - case "ENOTFOUND": - case "ETIMEDOUT": - case "EAI_FAIL": - log.error("network", [er.message - ,"This is most likely not a problem with npm itself" - ,"and is related to network connectivity." - ,"In most cases you are behind a proxy or have bad network settings." - ,"\nIf you are behind a proxy, please make sure that the" - ,"'proxy' config is set properly. See: 'npm help config'" - ].join("\n")) - break - - case "ENOPACKAGEJSON": - log.error("package.json", [er.message - ,"This is most likely not a problem with npm itself." - ,"npm can't find a package.json file in your current directory." - ].join("\n")) - break - - case "ETARGET": - var msg = [er.message - ,"This is most likely not a problem with npm itself." - ,"In most cases you or one of your dependencies are requesting" - ,"a package version that doesn't exist." - ] + // 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 + + case 'EPUBLISHCONFLICT': + log.error( + 'publish fail', + [ + 'Cannot publish over existing version.', + "Update the 'version' field in package.json and try again.", + '', + 'To automatically increment version numbers, see:', + ' npm help version' + ].join('\n') + ) + break + + case 'EISGIT': + log.error( + 'git', + [ + er.message, + ' ' + er.path, + 'Refusing to remove it. Update manually,', + 'or move it out of the way first.' + ].join('\n') + ) + break + + case 'ECYCLE': + log.error( + 'cycle', + [ + er.message, + 'While installing: ' + er.pkgid, + 'Found a pathological dependency case that npm cannot solve.', + 'Please report this to the package author.' + ].join('\n') + ) + break + + case 'EBADPLATFORM': + log.error( + 'notsup', + [ + er.message, + 'Not compatible with your operating system or architecture: ' + er.pkgid, + 'Valid OS: ' + er.os.join(','), + 'Valid Arch: ' + er.cpu.join(','), + 'Actual OS: ' + process.platform, + 'Actual Arch: ' + process.arch + ].join('\n') + ) + break + + case 'EEXIST': + log.error( + [ + er.message, + 'File exists: ' + er.path, + 'Move it away, and try again.' + ].join('\n') + ) + break + + case 'ENEEDAUTH': + log.error( + 'need auth', + [ + er.message, + 'You need to authorize this machine using `npm adduser`' + ].join('\n') + ) + break + + case 'EPEERINVALID': + var peerErrors = Object.keys(er.peersDepending).map(function (peer) { + return 'Peer ' + peer + ' wants ' + + er.packageName + '@' + er.peersDepending[peer] + }) + log.error('peerinvalid', [er.message].concat(peerErrors).join('\n')) + break + + case 'ECONNRESET': + case 'ENOTFOUND': + case 'ETIMEDOUT': + case 'EAI_FAIL': + log.error( + 'network', + [ + er.message, + 'This is most likely not a problem with npm itself', + 'and is related to network connectivity.', + 'In most cases you are behind a proxy or have bad network settings.', + '\nIf you are behind a proxy, please make sure that the', + "'proxy' config is set properly. See: 'npm help config'" + ].join('\n') + ) + break + + case 'ENOPACKAGEJSON': + log.error( + 'package.json', + [ + er.message, + 'This is most likely not a problem with npm itself.', + "npm can't find a package.json file in your current directory." + ].join('\n') + ) + break + + case 'ETARGET': + msg = [ + er.message, + 'This is most likely not a problem with npm itself.', + 'In most cases you or one of your dependencies are requesting', + "a package version that doesn't exist." + ] if (er.parent) { - msg.push("\nIt was specified as a dependency of '"+er.parent+"'\n") + msg.push("\nIt was specified as a dependency of '" + er.parent + "'\n") } - log.error("notarget", msg.join("\n")) - break - - case "ENOTSUP": - if (er.required) { - log.error("notsup", [er.message - ,"Not compatible with your version of node/npm: "+er.pkgid - ,"Required: "+JSON.stringify(er.required) - ,"Actual: " - +JSON.stringify({npm:npm.version - ,node:npm.config.get("node-version")}) - ].join("\n")) + log.error('notarget', msg.join('\n')) + break + + case 'ENOTSUP': + if (er.required) { + log.error( + 'notsup', + [ + er.message, + 'Not compatible with your version of node/npm: ' + er.pkgid, + 'Required: ' + JSON.stringify(er.required), + 'Actual: ' + JSON.stringify({ + npm: npm.version, + node: npm.config.get('node-version') + }) + ].join('\n') + ) + break + } // else passthrough + /*eslint no-fallthrough:0*/ + + case 'ENOSPC': + log.error( + 'nospc', + [ + er.message, + 'This is most likely not a problem with npm itself', + 'and is related to insufficient space on your system.' + ].join('\n') + ) + break + + case 'EROFS': + log.error( + 'rofs', + [ + er.message, + 'This is most likely not a problem with npm itself', + 'and is related to the file system being read-only.', + '\nOften virtualized file systems, or other file systems', + "that don't support symlinks, give this error." + ].join('\n') + ) + break + + case 'ENOENT': + log.error( + 'enoent', + [ + er.message, + 'This is most likely not a problem with npm itself', + 'and is related to npm not being able to find a file.', + er.file ? "\nCheck if the file '" + er.file + "' is present." : '' + ].join('\n') + ) + break + + case 'EMISSINGARG': + case 'EUNKNOWNTYPE': + case 'EINVALIDTYPE': + case 'ETOOMANYARGS': + log.error( + 'typeerror', + [ + er.stack, + 'This is an error with npm itself. Please report this error at:', + ' ' + ].join('\n') + ) + break + + case 'EISDIR': + log.error( + 'eisdir', + [ + er.message, + 'This is most likely not a problem with npm itself', + 'and is related to npm not being able to find a package.json in', + 'a package you are trying to install.' + ].join('\n') + ) + break + + default: + log.error('', er.message || er) + log.error( + '', + [ + '', + 'If you need help, you may report this error at:', + ' ' + ].join('\n') + ) break - } // else passthrough - - case "ENOSPC": - log.error("nospc", [er.message - ,"This is most likely not a problem with npm itself" - ,"and is related to insufficient space on your system." - ].join("\n")) - break - - case "EROFS": - log.error("rofs", [er.message - ,"This is most likely not a problem with npm itself" - ,"and is related to the file system being read-only." - ,"\nOften virtualized file systems, or other file systems" - ,"that don't support symlinks, give this error." - ].join("\n")) - break - - case "ENOENT": - log.error("enoent", [er.message - ,"This is most likely not a problem with npm itself" - ,"and is related to npm not being able to find a file." - ,er.file?"\nCheck if the file '"+er.file+"' is present.":"" - ].join("\n")) - break - - case "EISDIR": - log.error("eisdir", [er.message - ,"This is most likely not a problem with npm itself" - ,"and is related to npm not being able to find a package.json in" - ,"a package you are trying to install." - ].join("\n")) - break - - default: - log.error("", er.message || er) - log.error("", ["", "If you need help, you may report this error at:" - ," " - ].join("\n")) - break } - exit(typeof er.errno === "number" ? er.errno : 1) + exit(typeof er.errno === 'number' ? er.errno : 1) } var writingLogFile = false @@ -391,22 +493,22 @@ function writeLogFile (cb) { writingLogFile = true wroteLogFile = true - var fstr = writeStream("npm-debug.log") - , os = require("os") - , out = "" + var fstr = writeStream('npm-debug.log') + var os = require('os') + var 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 }) }) fstr.end(out) - fstr.on("close", cb) + fstr.on('close', cb) } diff --git a/deps/npm/lib/utils/gently-rm.js b/deps/npm/lib/utils/gently-rm.js index ad0b4d039933c9..c73bb1bfc0ca56 100644 --- a/deps/npm/lib/utils/gently-rm.js +++ b/deps/npm/lib/utils/gently-rm.js @@ -14,6 +14,8 @@ var vacuum = require('fs-vacuum') var some = require('async-some') var asyncMap = require('slide').asyncMap var normalize = require('path').normalize +var readCmdShim = require('read-cmd-shim') +var iferr = require('iferr') function gentlyRm (target, gently, base, cb) { if (!cb) { @@ -53,73 +55,74 @@ function gentlyRm (target, gently, base, cb) { return cb(new Error('May not delete: ' + resolved)) } - var options = { log: log.silly.bind(log, 'vacuum-fs') } - if (npm.config.get('force') || !gently) options.purge = true - if (base) options.base = normalize(resolve(npm.prefix, base)) + follow(resolved, function (realpath) { + var options = { log: log.silly.bind(log, 'vacuum-fs') } + if (npm.config.get('force') || !gently) options.purge = true + if (base) options.base = normalize(resolve(npm.prefix, base)) - if (!gently) { - log.verbose('gentlyRm', "don't care about contents; nuking", resolved) - return vacuum(resolved, options, cb) - } - - var parent = options.base = normalize(base ? resolve(npm.prefix, base) : npm.prefix) - - // is the parent directory managed by npm? - log.silly('gentlyRm', 'verifying', parent, 'is an npm working directory') - some(prefixes, isManaged(parent), function (er, matched) { - if (er) return cb(er) - - if (!matched) { - log.error('gentlyRm', 'containing path', parent, "isn't under npm's control") - return clobberFail(resolved, parent, cb) - } - log.silly('gentlyRm', 'containing path', parent, "is under npm's control, in", matched) - - // is the target directly contained within the (now known to be - // managed) parent? - if (isInside(resolved, parent)) { - log.silly('gentlyRm', 'deletion target', resolved, 'is under', parent) - log.verbose('gentlyRm', 'vacuuming from', resolved, 'up to', parent) + if (!gently) { + log.verbose('gentlyRm', "don't care about contents; nuking", resolved) return vacuum(resolved, options, cb) } - log.silly('gentlyRm', resolved, 'is not under', parent) - // the target isn't directly within the parent, but is it itself managed? - log.silly('gentlyRm', 'verifying', resolved, 'is an npm working directory') - some(prefixes, isManaged(resolved), function (er, matched) { + var parent = options.base = normalize(base ? resolve(npm.prefix, base) : npm.prefix) + + // is the parent directory managed by npm? + log.silly('gentlyRm', 'verifying', parent, 'is an npm working directory') + some(prefixes, isManaged(parent), function (er, matched) { if (er) return cb(er) - if (matched) { - log.silly('gentlyRm', resolved, "is under npm's control, in", matched) - options.base = matched - log.verbose('gentlyRm', 'removing', resolved, 'with base', options.base) + if (!matched) { + log.error('gentlyRm', 'containing path', parent, "isn't under npm's control") + return clobberFail(resolved, parent, cb) + } + log.silly('gentlyRm', 'containing path', parent, "is under npm's control, in", matched) + + // is the target directly contained within the (now known to be + // managed) parent? + if (isInside(resolved, parent)) { + log.silly('gentlyRm', 'deletion target', resolved, 'is under', parent) + log.verbose('gentlyRm', 'vacuuming from', resolved, 'up to', parent) + options.base = parent return vacuum(resolved, options, cb) } - log.verbose('gentlyRm', resolved, "is not under npm's control") - - // the target isn't managed directly, but maybe it's a link... - log.silly('gentlyRm', 'checking to see if', resolved, 'is a link') - lstat(resolved, function (er, stat) { - if (er) { - // race conditions are common when unbuilding - if (er.code === 'ENOENT') return cb(null) - return cb(er) - } + log.silly('gentlyRm', realpath, 'is not under', parent) + + // the target isn't directly within the parent, but is it itself managed? + log.silly('gentlyRm', 'verifying', realpath, 'is an npm working directory') + some(prefixes, isManaged(realpath), function (er, matched) { + if (er) return cb(er) - if (!stat.isSymbolicLink()) { - log.error('gentlyRm', resolved, 'is outside', parent, 'and not a link') - return clobberFail(resolved, parent, cb) + if (matched) { + log.silly('gentlyRm', resolved, "is under npm's control, in", matched) + if (isInside(realpath, parent)) { + log.silly('gentlyRm', realpath, 'is controlled by', parent) + options.base = matched + log.verbose('gentlyRm', 'removing', resolved, 'with base', options.base) + return vacuum(resolved, options, cb) + } else if (resolved !== realpath) { + log.warn('gentlyRm', 'not removing', resolved, "as it wasn't installed by", parent) + return cb() + } } + log.verbose('gentlyRm', resolved, "is not under npm's control") - // ...and maybe the link source, when read... - log.silly('gentlyRm', resolved, 'is a link') - readlink(resolved, function (er, link) { + // the target isn't managed directly, but maybe it's a link... + log.silly('gentlyRm', 'checking to see if', resolved, 'is a link') + readLinkOrShim(resolved, function (er, link) { if (er) { // race conditions are common when unbuilding if (er.code === 'ENOENT') return cb(null) return cb(er) } + if (!link) { + log.error('gentlyRm', resolved, 'is outside', parent, 'and not a link') + return clobberFail(resolved, parent, cb) + } + + // ...and maybe the link source, when read... + log.silly('gentlyRm', resolved, 'is a link') // ...is inside the managed parent var source = resolve(dirname(resolved), link) if (isInside(source, parent)) { @@ -168,23 +171,19 @@ function isManaged (target) { if (cached) return cb(null, cached) // otherwise, check the path - lstat(resolved, function (er, stat) { + readLinkOrShim(resolved, function (er, source) { if (er) return cb(er) // if it's not a link, cache & return the path itself - if (!stat.isSymbolicLink()) { + if (!source) { resolvedPaths[resolved] = resolved return cb(null, resolved) } // otherwise, cache & return the link's source - readlink(resolved, function (er, source) { - if (er) return cb(er) - - resolved = resolve(resolved, source) - resolvedPaths[resolved] = resolved - cb(null, resolved) - }) + resolved = resolve(resolved, source) + resolvedPaths[resolved] = resolved + cb(null, resolved) }) } } @@ -195,3 +194,28 @@ function clobberFail (target, root, cb) { er.path = target return cb(er) } + +function readLinkOrShim (path, cb) { + lstat(path, iferr(cb, function (stat) { + if (stat.isSymbolicLink()) { + readlink(path, cb) + } else { + readCmdShim(path, function (er, source) { + if (!er) return cb(null, source) + // lstat wouldn't return an error on these, so we don't either. + if (er.code === 'ENOTASHIM' || er.code === 'EISDIR') { + return cb(null, null) + } else { + return cb(er) + } + }) + } + })) +} + +function follow (path, cb) { + readLinkOrShim(path, function (er, source) { + if (!source) return cb(path) + cb(normalize(resolve(dirname(path), source))) + }) +} diff --git a/deps/npm/lib/utils/git.js b/deps/npm/lib/utils/git.js index 9c80ea55375f78..2d9da1086e150b 100644 --- a/deps/npm/lib/utils/git.js +++ b/deps/npm/lib/utils/git.js @@ -1,20 +1,19 @@ - // handle some git configuration for windows exports.spawn = spawnGit exports.chainableExec = chainableExec exports.whichAndExec = whichAndExec -var exec = require("child_process").execFile - , spawn = require("./spawn") - , npm = require("../npm.js") - , which = require("which") - , git = npm.config.get("git") - , assert = require("assert") - , log = require("npmlog") +var exec = require('child_process').execFile +var spawn = require('./spawn') +var npm = require('../npm.js') +var which = require('which') +var git = npm.config.get('git') +var assert = require('assert') +var log = require('npmlog') function prefixGitArgs () { - return process.platform === "win32" ? ["-c", "core.longpaths=true"] : [] + return process.platform === 'win32' ? ['-c', 'core.longpaths=true'] : [] } function execGit (args, options, cb) { @@ -24,7 +23,7 @@ function execGit (args, options, cb) { } function spawnGit (args, options) { - log.info("git", args) + log.info('git', args) return spawn(git, prefixGitArgs().concat(args || []), options) } @@ -38,11 +37,11 @@ function whichGit (cb) { } function whichAndExec (args, options, cb) { - assert.equal(typeof cb, "function", "no callback provided") + assert.equal(typeof cb, 'function', 'no callback provided') // check for git whichGit(function (err) { if (err) { - err.code = "ENOGIT" + err.code = 'ENOGIT' return cb(err) } diff --git a/deps/npm/lib/utils/lifecycle.js b/deps/npm/lib/utils/lifecycle.js index 9805a1c0c1dc45..e2ec37c24114ac 100644 --- a/deps/npm/lib/utils/lifecycle.js +++ b/deps/npm/lib/utils/lifecycle.js @@ -2,20 +2,20 @@ exports = module.exports = lifecycle exports.cmd = cmd exports.makeEnv = makeEnv -var log = require("npmlog") -var spawn = require("./spawn") -var npm = require("../npm.js") -var path = require("path") -var fs = require("graceful-fs") -var chain = require("slide").chain -var Stream = require("stream").Stream -var PATH = "PATH" -var uidNumber = require("uid-number") -var umask = require("./umask") - -// windows calls it's path "Path" usually, but this is not guaranteed. -if (process.platform === "win32") { - PATH = "Path" +var log = require('npmlog') +var spawn = require('./spawn') +var npm = require('../npm.js') +var path = require('path') +var fs = require('graceful-fs') +var chain = require('slide').chain +var Stream = require('stream').Stream +var PATH = 'PATH' +var uidNumber = require('uid-number') +var umask = require('./umask') + +// windows calls it's path 'Path' usually, but this is not guaranteed. +if (process.platform === 'win32') { + PATH = 'Path' Object.keys(process.env).forEach(function (e) { if (e.match(/^PATH$/i)) { PATH = e @@ -23,27 +23,41 @@ if (process.platform === "win32") { }) } +function logid (pkg, stage) { + return pkg._id + '~' + stage + ':' +} + function lifecycle (pkg, stage, wd, unsafe, failOk, cb) { - if (typeof cb !== "function") cb = failOk, failOk = false - if (typeof cb !== "function") cb = unsafe, unsafe = false - if (typeof cb !== "function") cb = wd, wd = null + if (typeof cb !== 'function') { + cb = failOk + failOk = false + } + if (typeof cb !== 'function') { + cb = unsafe + unsafe = false + } + if (typeof cb !== 'function') { + cb = wd + wd = null + } while (pkg && pkg._data) pkg = pkg._data - if (!pkg) return cb(new Error("Invalid package data")) + if (!pkg) return cb(new Error('Invalid package data')) - log.info(stage, pkg._id) + log.info('lifecycle', logid(pkg, stage), pkg._id) if (!pkg.scripts || npm.config.get('ignore-scripts')) pkg.scripts = {} validWd(wd || path.resolve(npm.dir, pkg.name), function (er, wd) { if (er) return cb(er) - unsafe = unsafe || npm.config.get("unsafe-perm") + unsafe = unsafe || npm.config.get('unsafe-perm') if ((wd.indexOf(npm.dir) !== 0 || wd.indexOf(pkg.name) !== wd.length - pkg.name.length) && !unsafe && pkg.scripts[stage]) { - log.warn( "cannot run in wd", "%s %s (wd=%s)" - , pkg._id, pkg.scripts[stage], wd) + log.warn('lifecycle', logid(pkg, stage), 'cannot run in wd', + '%s %s (wd=%s)', pkg._id, pkg.scripts[stage], wd + ) return cb() } @@ -53,63 +67,61 @@ function lifecycle (pkg, stage, wd, unsafe, failOk, cb) { env.npm_node_execpath = env.NODE = env.NODE || process.execPath env.npm_execpath = require.main.filename - // "nobody" typically doesn't have permission to write to /tmp + // 'nobody' typically doesn't have permission to write to /tmp // even if it's never used, sh freaks out. - if (!npm.config.get("unsafe-perm")) env.TMPDIR = wd + if (!npm.config.get('unsafe-perm')) env.TMPDIR = wd lifecycle_(pkg, stage, wd, env, unsafe, failOk, cb) }) } -function checkForLink (pkg, cb) { - var f = path.join(npm.dir, pkg.name) - fs.lstat(f, function (er, s) { - cb(null, !(er || !s.isSymbolicLink())) - }) -} - function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) { var pathArr = [] - , p = wd.split("node_modules") - , acc = path.resolve(p.shift()) + var p = wd.split('node_modules') + var acc = path.resolve(p.shift()) p.forEach(function (pp) { - pathArr.unshift(path.join(acc, "node_modules", ".bin")) - acc = path.join(acc, "node_modules", pp) + pathArr.unshift(path.join(acc, 'node_modules', '.bin')) + acc = path.join(acc, 'node_modules', pp) }) - pathArr.unshift(path.join(acc, "node_modules", ".bin")) + pathArr.unshift(path.join(acc, 'node_modules', '.bin')) // we also unshift the bundled node-gyp-bin folder so that // the bundled one will be used for installing things. - pathArr.unshift(path.join(__dirname, "..", "..", "bin", "node-gyp-bin")) + pathArr.unshift(path.join(__dirname, '..', '..', 'bin', 'node-gyp-bin')) if (env[PATH]) pathArr.push(env[PATH]) - env[PATH] = pathArr.join(process.platform === "win32" ? ";" : ":") + env[PATH] = pathArr.join(process.platform === 'win32' ? ';' : ':') var packageLifecycle = pkg.scripts && pkg.scripts.hasOwnProperty(stage) if (packageLifecycle) { // define this here so it's available to all scripts. env.npm_lifecycle_script = pkg.scripts[stage] + } else { + log.silly('lifecycle', logid(pkg, stage), 'no script for ' + stage + ', continuing') } function done (er) { if (er) { - if (npm.config.get("force")) { - log.info("forced, continuing", er) + if (npm.config.get('force')) { + log.info('lifecycle', logid(pkg, stage), 'forced, continuing', er) er = null } else if (failOk) { - log.warn("continuing anyway", er.message) + log.warn('lifecycle', logid(pkg, stage), 'continuing anyway', er.message) er = null } } cb(er) } - chain - ( [ packageLifecycle && [runPackageLifecycle, pkg, env, wd, unsafe] - , [runHookLifecycle, pkg, env, wd, unsafe] ] - , done ) + chain( + [ + packageLifecycle && [runPackageLifecycle, pkg, env, wd, unsafe], + [runHookLifecycle, pkg, env, wd, unsafe] + ], + done + ) } function validWd (d, cb) { @@ -117,7 +129,7 @@ function validWd (d, cb) { if (er || !st.isDirectory()) { var p = path.dirname(d) if (p === d) { - return cb(new Error("Could not find suitable wd")) + return cb(new Error('Could not find suitable wd')) } return validWd(p, cb) } @@ -128,17 +140,16 @@ function validWd (d, cb) { function runPackageLifecycle (pkg, env, wd, unsafe, cb) { // run package lifecycle scripts in the package root, or the nearest parent. var stage = env.npm_lifecycle_event - , cmd = env.npm_lifecycle_script + var cmd = env.npm_lifecycle_script - var note = "\n> " + pkg._id + " " + stage + " " + wd - + "\n> " + cmd + "\n" + var note = '\n> ' + pkg._id + ' ' + stage + ' ' + wd + + '\n> ' + cmd + '\n' runCmd(note, cmd, pkg, env, stage, wd, unsafe, cb) } - var running = false var queue = [] -function dequeue() { +function dequeue () { running = false if (queue.length) { var r = queue.shift() @@ -154,18 +165,17 @@ function runCmd (note, cmd, pkg, env, stage, wd, unsafe, cb) { running = true log.pause() - var user = unsafe ? null : npm.config.get("user") - , group = unsafe ? null : npm.config.get("group") + var user = unsafe ? null : npm.config.get('user') + var group = unsafe ? null : npm.config.get('group') if (log.level !== 'silent') { - if (npm.spinner.int) { - npm.config.get("logstream").write("\r \r") - } + log.clearProgress() console.log(note) + log.showProgress() } - log.verbose("unsafe-perm in lifecycle", unsafe) + log.verbose('lifecycle', logid(pkg, stage), 'unsafe-perm in lifecycle', unsafe) - if (process.platform === "win32") { + if (process.platform === 'win32') { unsafe = true } @@ -179,17 +189,17 @@ function runCmd (note, cmd, pkg, env, stage, wd, unsafe, cb) { } function runCmd_ (cmd, pkg, env, wd, stage, unsafe, uid, gid, cb_) { - function cb (er) { cb_.apply(null, arguments) log.resume() process.nextTick(dequeue) } - var conf = { cwd: wd - , env: env - , stdio: [ 0, 1, 2 ] - } + var conf = { + cwd: wd, + env: env, + stdio: [ 0, 1, 2 ] + } if (!unsafe) { conf.uid = uid ^ 0 @@ -205,59 +215,59 @@ function runCmd_ (cmd, pkg, env, wd, stage, unsafe, uid, gid, cb_) { conf.windowsVerbatimArguments = true } + log.verbose('lifecycle', logid(pkg, stage), 'PATH:', env[PATH]) + log.verbose('lifecycle', logid(pkg, stage), 'CWD:', wd) + log.silly('lifecycle', logid(pkg, stage), 'Args:', [shFlag, cmd]) + + var progressEnabled = log.progressEnabled + if (progressEnabled) log.disableProgress() var proc = spawn(sh, [shFlag, cmd], conf) - proc.on("error", procError) - proc.on("close", function (code, signal) { + + proc.on('error', procError) + proc.on('close', function (code, signal) { + log.silly('lifecycle', logid(pkg, stage), 'Returned: code:', code, ' signal:', signal) if (signal) { - process.kill(process.pid, signal); + process.kill(process.pid, signal) } else if (code) { - var er = new Error("Exit status " + code) + var er = new Error('Exit status ' + code) } procError(er) }) function procError (er) { - if (er && !npm.ROLLBACK) { - log.info(pkg._id, "Failed to exec "+stage+" script") - er.message = pkg._id + " " - + stage + ": `" + cmd +"`\n" - + er.message - if (er.code !== "EPERM") { - er.code = "ELIFECYCLE" + if (progressEnabled) log.enableProgress() + if (er) { + log.info('lifecycle', logid(pkg, stage), 'Failed to exec ' + stage + ' script') + er.message = pkg._id + ' ' + stage + ': `' + cmd + '`\n' + + er.message + if (er.code !== 'EPERM') { + er.code = 'ELIFECYCLE' } er.pkgid = pkg._id er.stage = stage er.script = cmd er.pkgname = pkg.name - return cb(er) - } else if (er) { - log.error(pkg._id+"."+stage, er) - log.error(pkg._id+"."+stage, "continuing anyway") - return cb() } - cb(er) + return cb(er) } } - function runHookLifecycle (pkg, env, wd, unsafe, cb) { // check for a hook script, run if present. var stage = env.npm_lifecycle_event - , hook = path.join(npm.dir, ".hooks", stage) - , user = unsafe ? null : npm.config.get("user") - , group = unsafe ? null : npm.config.get("group") - , cmd = hook + var hook = path.join(npm.dir, '.hooks', stage) + var cmd = hook fs.stat(hook, function (er) { if (er) return cb() - var note = "\n> " + pkg._id + " " + stage + " " + wd - + "\n> " + cmd + var note = '\n> ' + pkg._id + ' ' + stage + ' ' + wd + + '\n> ' + cmd runCmd(note, hook, pkg, env, stage, wd, unsafe, cb) }) } function makeEnv (data, prefix, env) { - prefix = prefix || "npm_package_" + prefix = prefix || 'npm_package_' if (!env) { env = {} for (var i in process.env) if (!i.match(/^npm_/)) { @@ -265,52 +275,55 @@ function makeEnv (data, prefix, env) { } // npat asks for tap output - if (npm.config.get("npat")) env.TAP = 1 + if (npm.config.get('npat')) env.TAP = 1 // express and others respect the NODE_ENV value. - if (npm.config.get("production")) env.NODE_ENV = "production" - - } else if (!data.hasOwnProperty("_lifecycleEnv")) { - Object.defineProperty(data, "_lifecycleEnv", - { value : env - , enumerable : false - }) + if (npm.config.get('production')) env.NODE_ENV = 'production' + } else if (!data.hasOwnProperty('_lifecycleEnv')) { + Object.defineProperty(data, '_lifecycleEnv', + { + value: env, + enumerable: false + } + ) } - for (var i in data) if (i.charAt(0) !== "_") { - var envKey = (prefix+i).replace(/[^a-zA-Z0-9_]/g, '_') - if (i === "readme") { + for (i in data) if (i.charAt(0) !== '_') { + var envKey = (prefix + i).replace(/[^a-zA-Z0-9_]/g, '_') + if (i === 'readme') { continue } - if (data[i] && typeof(data[i]) === "object") { + if (data[i] && typeof data[i] === 'object') { try { // quick and dirty detection for cyclical structures JSON.stringify(data[i]) - makeEnv(data[i], envKey+"_", env) + makeEnv(data[i], envKey + '_', env) } catch (ex) { // usually these are package objects. // just get the path and basic details. var d = data[i] - makeEnv( { name: d.name, version: d.version, path:d.path } - , envKey+"_", env) + makeEnv( + { name: d.name, version: d.version, path: d.path }, + envKey + '_', + env + ) } } else { env[envKey] = String(data[i]) - env[envKey] = -1 !== env[envKey].indexOf("\n") - ? JSON.stringify(env[envKey]) - : env[envKey] + env[envKey] = env[envKey].indexOf('\n') !== -1 + ? JSON.stringify(env[envKey]) + : env[envKey] } - } - if (prefix !== "npm_package_") return env + if (prefix !== 'npm_package_') return env - prefix = "npm_config_" + prefix = 'npm_config_' var pkgConfig = {} - , keys = npm.config.keys - , pkgVerConfig = {} - , namePref = data.name + ":" - , verPref = data.name + "@" + data.version + ":" + var keys = npm.config.keys + var pkgVerConfig = {} + var namePref = data.name + ':' + var verPref = data.name + '@' + data.version + ':' keys.forEach(function (i) { // in some rare cases (e.g. working with nerf darts), there are segmented @@ -321,29 +334,30 @@ function makeEnv (data, prefix, env) { var value = npm.config.get(i) if (value instanceof Stream || Array.isArray(value)) return if (i.match(/umask/)) value = umask.toString(value) - if (!value) value = "" - else if (typeof value === "number") value = "" + value - else if (typeof value !== "string") value = JSON.stringify(value) + if (!value) value = '' + else if (typeof value === 'number') value = '' + value + else if (typeof value !== 'string') value = JSON.stringify(value) - value = -1 !== value.indexOf("\n") + value = value.indexOf('\n') !== -1 ? JSON.stringify(value) : value - i = i.replace(/^_+/, "") + i = i.replace(/^_+/, '') + var k if (i.indexOf(namePref) === 0) { - var k = i.substr(namePref.length).replace(/[^a-zA-Z0-9_]/g, "_") - pkgConfig[ k ] = value + k = i.substr(namePref.length).replace(/[^a-zA-Z0-9_]/g, '_') + pkgConfig[k] = value } else if (i.indexOf(verPref) === 0) { - var k = i.substr(verPref.length).replace(/[^a-zA-Z0-9_]/g, "_") - pkgVerConfig[ k ] = value + k = i.substr(verPref.length).replace(/[^a-zA-Z0-9_]/g, '_') + pkgVerConfig[k] = value } - var envKey = (prefix+i).replace(/[^a-zA-Z0-9_]/g, "_") + var envKey = (prefix + i).replace(/[^a-zA-Z0-9_]/g, '_') env[envKey] = value }) - prefix = "npm_package_config_" + prefix = 'npm_package_config_' ;[pkgConfig, pkgVerConfig].forEach(function (conf) { for (var i in conf) { - var envKey = (prefix+i) + var envKey = (prefix + i) env[envKey] = conf[i] } }) @@ -353,10 +367,10 @@ function makeEnv (data, prefix, env) { function cmd (stage) { function CMD (args, cb) { - npm.commands["run-script"]([stage].concat(args), cb) + npm.commands['run-script']([stage].concat(args), cb) } - CMD.usage = "npm "+stage+" [-- ]" - var installedShallow = require("./completion/installed-shallow.js") + CMD.usage = 'npm ' + stage + ' [-- ]' + var installedShallow = require('./completion/installed-shallow.js') CMD.completion = function (opts, cb) { installedShallow(opts, function (d) { return d.scripts && d.scripts[stage] diff --git a/deps/npm/lib/utils/link.js b/deps/npm/lib/utils/link.js index e353bfae9372a4..1091f46833c8c8 100644 --- a/deps/npm/lib/utils/link.js +++ b/deps/npm/lib/utils/link.js @@ -1,29 +1,44 @@ - module.exports = link link.ifExists = linkIfExists -var fs = require("graceful-fs") - , chain = require("slide").chain - , mkdir = require("mkdirp") - , rm = require("./gently-rm.js") - , path = require("path") - , npm = require("../npm.js") +var fs = require('graceful-fs') +var chain = require('slide').chain +var mkdir = require('mkdirp') +var rm = require('./gently-rm.js') +var path = require('path') +var npm = require('../npm.js') function linkIfExists (from, to, gently, cb) { fs.stat(from, function (er) { if (er) return cb() - link(from, to, gently, cb) + fs.readlink(to, function (er, fromOnDisk) { + // if the link already exists and matches what we would do, + // we don't need to do anything + if (!er) { + var toDir = path.dirname(to) + var absoluteFrom = path.resolve(toDir, from) + var absoluteFromOnDisk = path.resolve(toDir, fromOnDisk) + if (absoluteFrom === absoluteFromOnDisk) return cb() + } + link(from, to, gently, cb) + }) }) } function link (from, to, gently, abs, cb) { - if (typeof cb !== "function") cb = abs, abs = false - if (typeof cb !== "function") cb = gently, gently = null - if (npm.config.get("force")) gently = false + if (typeof cb !== 'function') { + cb = abs + abs = false + } + if (typeof cb !== 'function') { + cb = gently + gently = null + } + if (npm.config.get('force')) gently = false to = path.resolve(to) var target = from = path.resolve(from) - if (!abs && process.platform !== "win32") { + if (!abs && process.platform !== 'win32') { // junctions on windows must be absolute target = path.relative(path.dirname(to), from) // if there is no folder in common, then it will be much @@ -31,10 +46,13 @@ function link (from, to, gently, abs, cb) { if (target.length >= from.length) target = from } - chain - ( [ [fs, "stat", from] - , [rm, to, gently] - , [mkdir, path.dirname(to)] - , [fs, "symlink", target, to, "junction"] ] - , cb) + chain( + [ + [fs, 'stat', from], + [rm, to, gently], + [mkdir, path.dirname(to)], + [fs, 'symlink', target, to, 'junction'] + ], + cb + ) } diff --git a/deps/npm/lib/utils/locker.js b/deps/npm/lib/utils/locker.js index 293d2da052b956..9cd8b2c4fdac95 100644 --- a/deps/npm/lib/utils/locker.js +++ b/deps/npm/lib/utils/locker.js @@ -1,38 +1,39 @@ -var crypto = require("crypto") -var resolve = require("path").resolve +var crypto = require('crypto') +var resolve = require('path').resolve -var lockfile = require("lockfile") -var log = require("npmlog") -var mkdirp = require("mkdirp") +var lockfile = require('lockfile') +var log = require('npmlog') -var npm = require("../npm.js") +var npm = require('../npm.js') var correctMkdir = require('../utils/correct-mkdir.js') var installLocks = {} function lockFileName (base, name) { - var c = name.replace(/[^a-zA-Z0-9]+/g, "-").replace(/^-+|-+$/g, "") - , p = resolve(base, name) - , h = crypto.createHash("sha1").update(p).digest("hex") - , l = resolve(npm.cache, "_locks") + var c = name.replace(/[^a-zA-Z0-9]+/g, '-').replace(/^-+|-+$/g, '') + var p = resolve(base, name) + var h = crypto.createHash('sha1').update(p).digest('hex') + var l = resolve(npm.cache, '_locks') - return resolve(l, c.substr(0, 24)+"-"+h.substr(0, 16)+".lock") + return resolve(l, c.substr(0, 24) + '-' + h.substr(0, 16) + '.lock') } function lock (base, name, cb) { - var lockDir = resolve(npm.cache, "_locks") + var lockDir = resolve(npm.cache, '_locks') correctMkdir(lockDir, function (er) { if (er) return cb(er) - var opts = { stale: npm.config.get("cache-lock-stale") - , retries: npm.config.get("cache-lock-retries") - , wait: npm.config.get("cache-lock-wait") } + var opts = { + stale: npm.config.get('cache-lock-stale'), + retries: npm.config.get('cache-lock-retries'), + wait: npm.config.get('cache-lock-wait') + } var lf = lockFileName(base, name) lockfile.lock(lf, opts, function (er) { - if (er) log.warn("locking", lf, "failed", er) + if (er) log.warn('locking', lf, 'failed', er) if (!er) { - log.verbose("lock", "using", lf, "for", resolve(base, name)) + log.verbose('lock', 'using', lf, 'for', resolve(base, name)) installLocks[lf] = true } @@ -43,31 +44,30 @@ function lock (base, name, cb) { function unlock (base, name, cb) { var lf = lockFileName(base, name) - , locked = installLocks[lf] + var locked = installLocks[lf] if (locked === false) { return process.nextTick(cb) - } - else if (locked === true) { + } else if (locked === true) { lockfile.unlock(lf, function (er) { if (er) { - log.warn("unlocking", lf, "failed", er) - } - else { + log.warn('unlocking', lf, 'failed', er) + } else { installLocks[lf] = false - log.verbose("unlock", "done using", lf, "for", resolve(base, name)) + log.verbose('unlock', 'done using', lf, 'for', resolve(base, name)) } cb(er) }) - } - else { - throw new Error( - "Attempt to unlock " + resolve(base, name) + ", which hasn't been locked" + } else { + var notLocked = new Error( + 'Attempt to unlock ' + resolve(base, name) + ", which hasn't been locked" ) + notLocked.code = 'ENOTLOCKED' + throw notLocked } } module.exports = { - lock : lock, - unlock : unlock + lock: lock, + unlock: unlock } diff --git a/deps/npm/lib/utils/map-to-registry.js b/deps/npm/lib/utils/map-to-registry.js index bd68a26d42ef8e..34046d191769d3 100644 --- a/deps/npm/lib/utils/map-to-registry.js +++ b/deps/npm/lib/utils/map-to-registry.js @@ -1,56 +1,56 @@ -var url = require("url") +var url = require('url') -var log = require("npmlog") - , npa = require("npm-package-arg") +var log = require('npmlog') +var npa = require('npm-package-arg') module.exports = mapToRegistry -function mapToRegistry(name, config, cb) { - log.silly("mapToRegistry", "name", name) +function mapToRegistry (name, config, cb) { + log.silly('mapToRegistry', 'name', name) var registry // the name itself takes precedence var data = npa(name) if (data.scope) { // the name is definitely scoped, so escape now - name = name.replace("/", "%2f") + name = name.replace('/', '%2f') - log.silly("mapToRegistry", "scope (from package name)", data.scope) + log.silly('mapToRegistry', 'scope (from package name)', data.scope) - registry = config.get(data.scope + ":registry") + registry = config.get(data.scope + ':registry') if (!registry) { - log.verbose("mapToRegistry", "no registry URL found in name for scope", data.scope) + log.verbose('mapToRegistry', 'no registry URL found in name for scope', data.scope) } } // ...then --scope=@scope or --scope=scope - var scope = config.get("scope") + var scope = config.get('scope') if (!registry && scope) { // I'm an enabler, sorry - if (scope.charAt(0) !== "@") scope = "@" + scope + if (scope.charAt(0) !== '@') scope = '@' + scope - log.silly("mapToRegistry", "scope (from config)", scope) + log.silly('mapToRegistry', 'scope (from config)', scope) - registry = config.get(scope + ":registry") + registry = config.get(scope + ':registry') if (!registry) { - log.verbose("mapToRegistry", "no registry URL found in config for scope", scope) + log.verbose('mapToRegistry', 'no registry URL found in config for scope', scope) } } // ...and finally use the default registry if (!registry) { - log.silly("mapToRegistry", "using default registry") - registry = config.get("registry") + log.silly('mapToRegistry', 'using default registry') + registry = config.get('registry') } - log.silly("mapToRegistry", "registry", registry) + log.silly('mapToRegistry', 'registry', registry) var auth = config.getCredentialsByURI(registry) // normalize registry URL so resolution doesn't drop a piece of registry URL - var normalized = registry.slice(-1) !== "/" ? registry+"/" : registry + var normalized = registry.slice(-1) !== '/' ? registry + '/' : registry var uri = url.resolve(normalized, name) - log.silly("mapToRegistry", "uri", uri) + log.silly('mapToRegistry', 'uri', uri) cb(null, uri, auth, normalized) } diff --git a/deps/npm/lib/utils/module-name.js b/deps/npm/lib/utils/module-name.js new file mode 100644 index 00000000000000..7ca175487c0989 --- /dev/null +++ b/deps/npm/lib/utils/module-name.js @@ -0,0 +1,33 @@ +'use strict' +var path = require('path') +var validate = require('aproba') + +module.exports = moduleName +module.exports.test = {} + +module.exports.test.pathToPackageName = pathToPackageName +function pathToPackageName (dir) { + if (dir == null) return '' + if (dir === '') return '' + var name = path.relative(path.resolve(dir, '..'), dir) + var scoped = path.relative(path.resolve(dir, '../..'), dir) + if (scoped[0] === '@') return scoped + return name +} + +module.exports.test.isNotEmpty = isNotEmpty +function isNotEmpty (str) { + return str != null && str !== '' +} + +var unknown = 0 +function moduleName (tree) { + validate('O', arguments) + var pkg = tree.package || tree + if (isNotEmpty(pkg.name)) return pkg.name + var pkgName = pathToPackageName(tree.path) + if (pkgName !== '') return pkgName + if (tree._invalidName != null) return tree._invalidName + tree._invalidName = '!invalid#' + (++unknown) + return tree._invalidName +} diff --git a/deps/npm/lib/utils/package-id.js b/deps/npm/lib/utils/package-id.js new file mode 100644 index 00000000000000..2c5e3314694c31 --- /dev/null +++ b/deps/npm/lib/utils/package-id.js @@ -0,0 +1,15 @@ +'use strict' +var moduleName = require('./module-name.js') + +module.exports = function (tree) { + var pkg = tree.package || tree + // FIXME: Excluding the '@' here is cleaning up after the mess that + // read-package-json makes. =( + if (pkg._id && pkg._id !== '@') return pkg._id + var name = moduleName(tree) + if (pkg.version) { + return name + '@' + pkg.version + } else { + return name + } +} diff --git a/deps/npm/lib/utils/parse-json.js b/deps/npm/lib/utils/parse-json.js new file mode 100644 index 00000000000000..5c0b959a0d39ee --- /dev/null +++ b/deps/npm/lib/utils/parse-json.js @@ -0,0 +1,24 @@ +'use strict' +var parseJSON = module.exports = function (content) { + return JSON.parse(stripBOM(content)) +} + +parseJSON.noExceptions = function (content) { + try { + return parseJSON(content) + } catch (ex) { + return + } +} + +// from read-package-json +function stripBOM (content) { + content = content.toString() + // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM) + // because the buffer-to-string conversion in `fs.readFileSync()` + // translates it to FEFF, the UTF-16 BOM. + if (content.charCodeAt(0) === 0xFEFF) { + content = content.slice(1) + } + return content +} diff --git a/deps/npm/lib/utils/pulse-till-done.js b/deps/npm/lib/utils/pulse-till-done.js new file mode 100644 index 00000000000000..fc6450e0030015 --- /dev/null +++ b/deps/npm/lib/utils/pulse-till-done.js @@ -0,0 +1,21 @@ +'use strict' +var validate = require('aproba') +var log = require('npmlog') + +var pulsers = 0 +var pulse + +module.exports = function (prefix, cb) { + validate('SF', [prefix, cb]) + if (!pulsers++) { + pulse = setInterval(function () { + log.gauge.pulse('network') + }, 250) + } + return function () { + if (!--pulsers) { + clearInterval(pulse) + } + cb.apply(null, arguments) + } +} diff --git a/deps/npm/lib/utils/read-local-package.js b/deps/npm/lib/utils/read-local-package.js index ca6d613210f1da..27ca7b4e395376 100644 --- a/deps/npm/lib/utils/read-local-package.js +++ b/deps/npm/lib/utils/read-local-package.js @@ -1,12 +1,12 @@ exports = module.exports = readLocalPkg -var npm = require("../npm.js") - , readJson = require("read-package-json") +var npm = require('../npm.js') +var readJson = require('read-package-json') function readLocalPkg (cb) { - if (npm.config.get("global")) return cb() - var path = require("path") - readJson(path.resolve(npm.prefix, "package.json"), function (er, d) { + if (npm.config.get('global')) return cb() + var path = require('path') + readJson(path.resolve(npm.prefix, 'package.json'), function (er, d) { return cb(er, d && d.name) }) } diff --git a/deps/npm/lib/utils/spawn.js b/deps/npm/lib/utils/spawn.js index 74684521f741a0..e389d83e02c64d 100644 --- a/deps/npm/lib/utils/spawn.js +++ b/deps/npm/lib/utils/spawn.js @@ -1,16 +1,16 @@ module.exports = spawn -var _spawn = require("child_process").spawn -var EventEmitter = require("events").EventEmitter +var _spawn = require('child_process').spawn +var EventEmitter = require('events').EventEmitter function spawn (cmd, args, options) { var raw = _spawn(cmd, args, options) var cooked = new EventEmitter() - raw.on("error", function (er) { + raw.on('error', function (er) { er.file = cmd - cooked.emit("error", er) - }).on("close", function (code, signal) { + cooked.emit('error', er) + }).on('close', function (code, signal) { // Create ENOENT error because Node.js v0.8 will not emit // an `error` event if the command could not be found. if (code === 127) { @@ -21,7 +21,7 @@ function spawn (cmd, args, options) { er.file = cmd cooked.emit('error', er) } else { - cooked.emit("close", code, signal) + cooked.emit('close', code, signal) } }) diff --git a/deps/npm/lib/utils/tar.js b/deps/npm/lib/utils/tar.js index 7656b5d9754a3a..8eb2311d096a6c 100644 --- a/deps/npm/lib/utils/tar.js +++ b/deps/npm/lib/utils/tar.js @@ -1,22 +1,28 @@ // commands for packing and unpacking tarballs // this file is used by lib/cache.js -var npm = require("../npm.js") - , fs = require("graceful-fs") - , writeFileAtomic = require("write-file-atomic") - , writeStreamAtomic = require("fs-write-stream-atomic") - , path = require("path") - , log = require("npmlog") - , uidNumber = require("uid-number") - , rm = require("./gently-rm.js") - , readJson = require("read-package-json") - , myUid = process.getuid && process.getuid() - , myGid = process.getgid && process.getgid() - , tar = require("tar") - , zlib = require("zlib") - , fstream = require("fstream") - , Packer = require("fstream-npm") - , lifecycle = require("./lifecycle.js") +var fs = require('graceful-fs') +var path = require('path') +var writeFileAtomic = require('write-file-atomic') +var writeStreamAtomic = require('fs-write-stream-atomic') +var log = require('npmlog') +var uidNumber = require('uid-number') +var readJson = require('read-package-json') +var tar = require('tar') +var zlib = require('zlib') +var fstream = require('fstream') +var Packer = require('fstream-npm') +var iferr = require('iferr') +var inherits = require('inherits') +var npm = require('../npm.js') +var rm = require('./gently-rm.js') +var myUid = process.getuid && process.getuid() +var myGid = process.getgid && process.getgid() +var readPackageTree = require('read-package-tree') +var union = require('lodash.union') +var flattenTree = require('../install/flatten-tree.js') +var moduleName = require('./module-name.js') +var packageId = require('./package-id.js') if (process.env.SUDO_UID && myUid === 0) { if (!isNaN(process.env.SUDO_UID)) myUid = +process.env.SUDO_UID @@ -26,28 +32,148 @@ if (process.env.SUDO_UID && myUid === 0) { exports.pack = pack exports.unpack = unpack -function pack (tarball, folder, pkg, dfc, cb) { - log.verbose("tar pack", [tarball, folder]) - if (typeof cb !== "function") cb = dfc, dfc = false +function pack (tarball, folder, pkg, cb) { + log.verbose('tar pack', [tarball, folder]) + + log.verbose('tarball', tarball) + log.verbose('folder', folder) + + readJson(path.join(folder, 'package.json'), function (er, pkg) { + if (er || !pkg.bundleDependencies) { + pack_(tarball, folder, null, null, pkg, cb) + } else { + // we require this at runtime due to load-order issues, because recursive + // requires fail if you replace the exports object, and we do, not in deps, but + // in a dep of it. + var recalculateMetadata = require('../install/deps.js').recalculateMetadata + + readPackageTree(folder, iferr(cb, function (tree) { + recalculateMetadata(tree, log.newGroup('pack:' + pkg), iferr(cb, function () { + pack_(tarball, folder, tree, flattenTree(tree), pkg, cb) + })) + })) + } + }) +} - log.verbose("tarball", tarball) - log.verbose("folder", folder) +function BundledPacker (props) { + Packer.call(this, props) +} +inherits(BundledPacker, Packer) + +BundledPacker.prototype.applyIgnores = function (entry, partial, entryObj) { + // package.json files can never be ignored. + if (entry === 'package.json') return true + + // readme files should never be ignored. + if (entry.match(/^readme(\.[^\.]*)$/i)) return true + + // license files should never be ignored. + if (entry.match(/^(license|licence)(\.[^\.]*)?$/i)) return true + + // changelogs should never be ignored. + if (entry.match(/^(changes|changelog|history)(\.[^\.]*)?$/i)) return true + + // special rules. see below. + if (entry === 'node_modules' && this.packageRoot) return true + + // some files are *never* allowed under any circumstances + if (entry === '.git' || + entry === '.lock-wscript' || + entry.match(/^\.wafpickle-[0-9]+$/) || + entry === 'CVS' || + entry === '.svn' || + entry === '.hg' || + entry.match(/^\..*\.swp$/) || + entry === '.DS_Store' || + entry.match(/^\._/) || + entry === 'npm-debug.log' + ) { + return false + } - if (dfc) { - // do fancy crap - return lifecycle(pkg, "prepublish", folder, function (er) { - if (er) return cb(er) - pack_(tarball, folder, pkg, cb) - }) - } else { - pack_(tarball, folder, pkg, cb) + // in a node_modules folder, we only include bundled dependencies + // also, prevent packages in node_modules from being affected + // by rules set in the containing package, so that + // bundles don't get busted. + // Also, once in a bundle, everything is installed as-is + // To prevent infinite cycles in the case of cyclic deps that are + // linked with npm link, even in a bundle, deps are only bundled + // if they're not already present at a higher level. + if (this.bundleMagic) { + // bubbling up. stop here and allow anything the bundled pkg allows + if (entry.indexOf('/') !== -1) return true + + // never include the .bin. It's typically full of platform-specific + // stuff like symlinks and .cmd files anyway. + if (entry === '.bin') return false + + // the package root. + var p = this.parent + // the package before this one. + var pp = p && p.parent + + // if this entry has already been bundled, and is a symlink, + // and it is the *same* symlink as this one, then exclude it. + if (pp && pp.bundleLinks && this.bundleLinks && + pp.bundleLinks[entry] && + pp.bundleLinks[entry] === this.bundleLinks[entry]) { + return false + } + + // since it's *not* a symbolic link, if we're *already* in a bundle, + // then we should include everything. + if (pp && pp.package && pp.basename === 'node_modules') { + return true + } + + // only include it at this point if it's a bundleDependency + return this.isBundled(entry) } + // if (this.bundled) return true + + return Packer.prototype.applyIgnores.call(this, entry, partial, entryObj) } -function pack_ (tarball, folder, pkg, cb) { - new Packer({ path: folder, type: "Directory", isDirectory: true }) - .on("error", function (er) { - if (er) log.error("tar pack", "Error reading " + folder) +function nameMatch (name) { return function (other) { return name === moduleName(other) } } + +function pack_ (tarball, folder, tree, flatTree, pkg, cb) { + function InstancePacker (props) { + BundledPacker.call(this, props) + } + inherits(InstancePacker, BundledPacker) + InstancePacker.prototype.isBundled = function (name) { + var bd = this.package && this.package.bundleDependencies + if (!bd) return false + + if (!Array.isArray(bd)) { + throw new Error(packageId(this) + '\'s `bundledDependencies` should ' + + 'be an array') + } + if (!tree) return false + + if (bd.indexOf(name) !== -1) return true + var pkg = tree.children.filter(nameMatch(name))[0] + if (!pkg) return false + var requiredBy = union([], pkg.package._requiredBy) + var seen = {} + while (requiredBy.length) { + var req = requiredBy.shift() + if (seen[req]) continue + seen[req] = true + var reqPkg = flatTree[req] + if (!reqPkg) continue + if (reqPkg.parent === tree && bd.indexOf(moduleName(reqPkg)) !== -1) { + return true + } + requiredBy = union(requiredBy, reqPkg.package._requiredBy) + } + return false + } + + new InstancePacker({ path: folder, type: 'Directory', isDirectory: true }) + .on('error', function (er) { + if (er) log.error('tar pack', 'Error reading ' + folder) return cb(er) }) @@ -56,32 +182,43 @@ function pack_ (tarball, folder, pkg, cb) { // However, npm *itself* excludes these from its own package, // so that it can be more easily bootstrapped using old and // non-compliant tar implementations. - .pipe(tar.Pack({ noProprietary: !npm.config.get("proprietary-attribs") })) - .on("error", function (er) { - if (er) log.error("tar.pack", "tar creation error", tarball) + .pipe(tar.Pack({ noProprietary: !npm.config.get('proprietary-attribs') })) + .on('error', function (er) { + if (er) log.error('tar.pack', 'tar creation error', tarball) cb(er) }) .pipe(zlib.Gzip()) - .on("error", function (er) { - if (er) log.error("tar.pack", "gzip error "+tarball) + .on('error', function (er) { + if (er) log.error('tar.pack', 'gzip error ' + tarball) cb(er) }) .pipe(writeStreamAtomic(tarball)) - .on("error", function (er) { - if (er) log.error("tar.pack", "Could not write "+tarball) + .on('error', function (er) { + if (er) log.error('tar.pack', 'Could not write ' + tarball) cb(er) }) - .on("close", cb) + .on('close', cb) } - function unpack (tarball, unpackTarget, dMode, fMode, uid, gid, cb) { - log.verbose("tar", "unpack", tarball) - log.verbose("tar", "unpacking to", unpackTarget) - if (typeof cb !== "function") cb = gid, gid = null - if (typeof cb !== "function") cb = uid, uid = null - if (typeof cb !== "function") cb = fMode, fMode = npm.modes.file - if (typeof cb !== "function") cb = dMode, dMode = npm.modes.exec + log.verbose('tar', 'unpack', tarball) + log.verbose('tar', 'unpacking to', unpackTarget) + if (typeof cb !== 'function') { + cb = gid + gid = null + } + if (typeof cb !== 'function') { + cb = uid + uid = null + } + if (typeof cb !== 'function') { + cb = fMode + fMode = npm.modes.file + } + if (typeof cb !== 'function') { + cb = dMode + dMode = npm.modes.exec + } uidNumber(uid, gid, function (er, uid, gid) { if (er) return cb(er) @@ -89,26 +226,25 @@ function unpack (tarball, unpackTarget, dMode, fMode, uid, gid, cb) { }) } -function unpack_ ( tarball, unpackTarget, dMode, fMode, uid, gid, cb ) { +function unpack_ (tarball, unpackTarget, dMode, fMode, uid, gid, cb) { rm(unpackTarget, function (er) { if (er) return cb(er) // gzip {tarball} --decompress --stdout \ // | tar -mvxpf - --strip-components=1 -C {unpackTarget} - gunzTarPerm( tarball, unpackTarget - , dMode, fMode - , uid, gid - , function (er, folder) { - if (er) return cb(er) - readJson(path.resolve(folder, "package.json"), cb) - }) + gunzTarPerm(tarball, unpackTarget, + dMode, fMode, + uid, gid, + function (er, folder) { + if (er) return cb(er) + readJson(path.resolve(folder, 'package.json'), cb) + }) }) } - function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { if (!dMode) dMode = npm.modes.exec if (!fMode) fMode = npm.modes.file - log.silly("gunzTarPerm", "modes", [dMode.toString(8), fMode.toString(8)]) + log.silly('gunzTarPerm', 'modes', [dMode.toString(8), fMode.toString(8)]) var cbCalled = false function cb (er) { @@ -119,51 +255,51 @@ function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { var fst = fs.createReadStream(tarball) - fst.on("open", function (fd) { + fst.on('open', function (fd) { fs.fstat(fd, function (er, st) { - if (er) return fst.emit("error", er) + if (er) return fst.emit('error', er) if (st.size === 0) { - er = new Error("0-byte tarball\n" + - "Please run `npm cache clean`") - fst.emit("error", er) + er = new Error('0-byte tarball\n' + + 'Please run `npm cache clean`') + fst.emit('error', er) } }) }) // figure out who we're supposed to be, if we're not pretending // to be a specific user. - if (npm.config.get("unsafe-perm") && process.platform !== "win32") { + if (npm.config.get('unsafe-perm') && process.platform !== 'win32') { uid = myUid gid = myGid } function extractEntry (entry) { - log.silly("gunzTarPerm", "extractEntry", entry.path) + log.silly('gunzTarPerm', 'extractEntry', entry.path) // never create things that are user-unreadable, // or dirs that are user-un-listable. Only leads to headaches. var originalMode = entry.mode = entry.mode || entry.props.mode - entry.mode = entry.mode | (entry.type === "Directory" ? dMode : fMode) + entry.mode = entry.mode | (entry.type === 'Directory' ? dMode : fMode) entry.mode = entry.mode & (~npm.modes.umask) entry.props.mode = entry.mode if (originalMode !== entry.mode) { - log.silly( "gunzTarPerm", "modified mode" - , [entry.path, originalMode, entry.mode]) + log.silly('gunzTarPerm', 'modified mode', + [entry.path, originalMode, entry.mode]) } // if there's a specific owner uid/gid that we want, then set that - if (process.platform !== "win32" && - typeof uid === "number" && - typeof gid === "number") { + if (process.platform !== 'win32' && + typeof uid === 'number' && + typeof gid === 'number') { entry.props.uid = entry.uid = uid entry.props.gid = entry.gid = gid } } - var extractOpts = { type: "Directory", path: target, strip: 1 } + var extractOpts = { type: 'Directory', path: target, strip: 1 } - if (process.platform !== "win32" && - typeof uid === "number" && - typeof gid === "number") { + if (process.platform !== 'win32' && + typeof uid === 'number' && + typeof gid === 'number') { extractOpts.uid = uid extractOpts.gid = gid } @@ -172,9 +308,9 @@ function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { extractOpts.filter = function () { // symbolic links are not allowed in packages. if (this.type.match(/^.*Link$/)) { - log.warn( "excluding symbolic link" - , this.path.substr(target.length + 1) - + " -> " + this.linkpath ) + log.warn('excluding symbolic link', + this.path.substr(target.length + 1) + + ' -> ' + this.linkpath) return false } @@ -182,12 +318,12 @@ function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { // employed during tarball creation, in the fstream-npm module. // It is duplicated here to handle tarballs that are created // using other means, such as system tar or git archive. - if (this.type === "File") { + if (this.type === 'File') { var base = path.basename(this.path) - if (base === ".npmignore") { + if (base === '.npmignore') { sawIgnores[ this.path ] = true - } else if (base === ".gitignore") { - var npmignore = this.path.replace(/\.gitignore$/, ".npmignore") + } else if (base === '.gitignore') { + var npmignore = this.path.replace(/\.gitignore$/, '.npmignore') if (sawIgnores[npmignore]) { // Skip this one, already seen. return false @@ -202,13 +338,12 @@ function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { return true } - fst - .on("error", function (er) { - if (er) log.error("tar.unpack", "error reading "+tarball) + .on('error', function (er) { + if (er) log.error('tar.unpack', 'error reading ' + tarball) cb(er) }) - .on("data", function OD (c) { + .on('data', function OD (c) { // detect what it is. // Then, depending on that, we'll figure out whether it's // a single-file module, gzipped tarball, or naked tarball. @@ -218,59 +353,59 @@ function gunzTarPerm (tarball, target, dMode, fMode, uid, gid, cb_) { c[2] === 0x08) { fst .pipe(zlib.Unzip()) - .on("error", function (er) { - if (er) log.error("tar.unpack", "unzip error "+tarball) + .on('error', function (er) { + if (er) log.error('tar.unpack', 'unzip error ' + tarball) cb(er) }) .pipe(tar.Extract(extractOpts)) - .on("entry", extractEntry) - .on("error", function (er) { - if (er) log.error("tar.unpack", "untar error "+tarball) + .on('entry', extractEntry) + .on('error', function (er) { + if (er) log.error('tar.unpack', 'untar error ' + tarball) cb(er) }) - .on("close", cb) + .on('close', cb) } else if (hasTarHeader(c)) { // naked tar fst .pipe(tar.Extract(extractOpts)) - .on("entry", extractEntry) - .on("error", function (er) { - if (er) log.error("tar.unpack", "untar error "+tarball) + .on('entry', extractEntry) + .on('error', function (er) { + if (er) log.error('tar.unpack', 'untar error ' + tarball) cb(er) }) - .on("close", cb) + .on('close', cb) } else { // naked js file - var jsOpts = { path: path.resolve(target, "index.js") } + var jsOpts = { path: path.resolve(target, 'index.js') } - if (process.platform !== "win32" && - typeof uid === "number" && - typeof gid === "number") { + if (process.platform !== 'win32' && + typeof uid === 'number' && + typeof gid === 'number') { jsOpts.uid = uid jsOpts.gid = gid } fst .pipe(fstream.Writer(jsOpts)) - .on("error", function (er) { - if (er) log.error("tar.unpack", "copy error "+tarball) + .on('error', function (er) { + if (er) log.error('tar.unpack', 'copy error ' + tarball) cb(er) }) - .on("close", function () { - var j = path.resolve(target, "package.json") + .on('close', function () { + var j = path.resolve(target, 'package.json') readJson(j, function (er, d) { if (er) { - log.error("not a package", tarball) + log.error('not a package', tarball) return cb(er) } - writeFileAtomic(j, JSON.stringify(d) + "\n", cb) + writeFileAtomic(j, JSON.stringify(d) + '\n', cb) }) }) } // now un-hook, and re-emit the chunk - fst.removeListener("data", OD) - fst.emit("data", c) + fst.removeListener('data', OD) + fst.emit('data', c) }) } diff --git a/deps/npm/lib/utils/temp-filename.js b/deps/npm/lib/utils/temp-filename.js new file mode 100644 index 00000000000000..6b8245e8b790f0 --- /dev/null +++ b/deps/npm/lib/utils/temp-filename.js @@ -0,0 +1,7 @@ +'use strict' +var uniqueFilename = require('unique-filename') +var npm = require('../npm.js') + +module.exports = function (prefix) { + return uniqueFilename(npm.tmp, prefix) +} diff --git a/deps/npm/lib/utils/umask.js b/deps/npm/lib/utils/umask.js index 6ccb4a1194b658..2dde1befa69dce 100644 --- a/deps/npm/lib/utils/umask.js +++ b/deps/npm/lib/utils/umask.js @@ -1,5 +1,5 @@ -var umask = require("umask") -var npmlog = require("npmlog") +var umask = require('umask') +var npmlog = require('npmlog') var _fromString = umask.fromString module.exports = umask @@ -8,7 +8,7 @@ module.exports = umask umask.fromString = function (val) { _fromString(val, function (err, result) { if (err) { - npmlog.warn("invalid umask", err.message) + npmlog.warn('invalid umask', err.message) } val = result }) diff --git a/deps/npm/lib/utils/warn-deprecated.js b/deps/npm/lib/utils/warn-deprecated.js index ec821b9bd495b1..fe5c5ec82a304d 100644 --- a/deps/npm/lib/utils/warn-deprecated.js +++ b/deps/npm/lib/utils/warn-deprecated.js @@ -1,6 +1,6 @@ module.exports = warnDeprecated -var log = require("npmlog") +var log = require('npmlog') var deprecations = {} @@ -11,8 +11,7 @@ function warnDeprecated (type) { deprecations[type] = {} messages.forEach(function (m) { log.warn(type, m) }) } - } - else { + } else { if (!deprecations[type]) deprecations[type] = {} if (!deprecations[type][instance]) { diff --git a/deps/npm/lib/version.js b/deps/npm/lib/version.js index dbd48a0145a3d7..455bcc2dbadb55 100644 --- a/deps/npm/lib/version.js +++ b/deps/npm/lib/version.js @@ -12,6 +12,7 @@ var npm = require('./npm.js') var git = require('./utils/git.js') var assert = require('assert') var lifecycle = require('./utils/lifecycle.js') +var parseJSON = require('./utils/parse-json.js') version.usage = 'npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease]' + '\n(run in package dir)\n' + @@ -32,7 +33,7 @@ function version (args, silent, cb_) { fs.readFile(packagePath, function (er, data) { if (data) data = data.toString() try { - data = JSON.parse(data) + data = parseJSON(data) } catch (e) { er = e data = null @@ -107,7 +108,7 @@ function updateShrinkwrap (newVersion, cb) { try { data = data.toString() - data = JSON.parse(data) + data = parseJSON(data) } catch (er) { log.error('version', 'Bad npm-shrinkwrap.json data') return cb(er) diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js index 9199d352ae7ff8..9ca18d35402e1b 100644 --- a/deps/npm/lib/view.js +++ b/deps/npm/lib/view.js @@ -1,16 +1,17 @@ // npm view [pkg [pkg ...]] module.exports = view -view.usage = "npm view pkg[@version] [[.subfield]...]" - -var npm = require("./npm.js") - , readJson = require("read-package-json") - , log = require("npmlog") - , util = require("util") - , semver = require("semver") - , mapToRegistry = require("./utils/map-to-registry.js") - , npa = require("npm-package-arg") - , path = require("path") +view.usage = 'npm view [<@scope>/][@] [[.subfield]...]' + + '\n\naliases: info, show, v' + +var npm = require('./npm.js') +var readJson = require('read-package-json') +var log = require('npmlog') +var util = require('util') +var semver = require('semver') +var mapToRegistry = require('./utils/map-to-registry.js') +var npa = require('npm-package-arg') +var path = require('path') view.completion = function (opts, cb) { if (opts.conf.argv.remain.length <= 2) { @@ -19,14 +20,14 @@ view.completion = function (opts, cb) { return cb() } // have the package, get the fields. - var tag = npm.config.get("tag") + var tag = npm.config.get('tag') mapToRegistry(opts.conf.argv.remain[2], npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, d) { + npm.registry.get(uri, { auth: auth }, function (er, d) { if (er) return cb(er) - var dv = d.versions[d["dist-tags"][tag]] - , fields = [] + var dv = d.versions[d['dist-tags'][tag]] + var fields = [] d.versions = Object.keys(d.versions).sort(semver.compareLoose) fields = getFields(d).concat(getFields(dv)) cb(null, fields) @@ -38,48 +39,51 @@ view.completion = function (opts, cb) { if (!d) return f pref = pref || [] Object.keys(d).forEach(function (k) { - if (k.charAt(0) === "_" || k.indexOf(".") !== -1) return - var p = pref.concat(k).join(".") + if (k.charAt(0) === '_' || k.indexOf('.') !== -1) return + var p = pref.concat(k).join('.') f.push(p) if (Array.isArray(d[k])) { d[k].forEach(function (val, i) { - var pi = p + "[" + i + "]" - if (val && typeof val === "object") getFields(val, f, [p]) + var pi = p + '[' + i + ']' + if (val && typeof val === 'object') getFields(val, f, [p]) else f.push(pi) }) return } - if (typeof d[k] === "object") getFields(d[k], f, [p]) + if (typeof d[k] === 'object') getFields(d[k], f, [p]) }) return f } } function view (args, silent, cb) { - if (typeof cb !== "function") cb = silent, silent = false + if (typeof cb !== 'function') { + cb = silent + silent = false + } - if (!args.length) args = ["."] + if (!args.length) args = ['.'] var pkg = args.shift() - , nv = npa(pkg) - , name = nv.name - , local = (name === "." || !name) + var nv = npa(pkg) + var name = nv.name + var local = (name === '.' || !name) - if (npm.config.get("global") && local) { - return cb(new Error("Cannot use view command in global mode.")) + if (npm.config.get('global') && local) { + return cb(new Error('Cannot use view command in global mode.')) } if (local) { var dir = npm.prefix - readJson(path.resolve(dir, "package.json"), function (er, d) { + readJson(path.resolve(dir, 'package.json'), function (er, d) { d = d || {} - if (er && er.code !== "ENOENT" && er.code !== "ENOTDIR") return cb(er) - if (!d.name) return cb(new Error("Invalid package.json")) + if (er && er.code !== 'ENOENT' && er.code !== 'ENOTDIR') return cb(er) + if (!d.name) return cb(new Error('Invalid package.json')) var p = d.name nv = npa(p) - if (pkg && ~pkg.indexOf("@")) { - nv.rawSpec = pkg.split("@")[pkg.indexOf("@")] + if (pkg && ~pkg.indexOf('@')) { + nv.rawSpec = pkg.split('@')[pkg.indexOf('@')] } fetchAndRead(nv, args, silent, cb) @@ -92,53 +96,54 @@ function view (args, silent, cb) { function fetchAndRead (nv, args, silent, cb) { // get the data about this package var name = nv.name - , version = nv.rawSpec || npm.config.get("tag") + var version = nv.rawSpec || npm.config.get('tag') mapToRegistry(name, npm.config, function (er, uri, auth) { if (er) return cb(er) - npm.registry.get(uri, { auth : auth }, function (er, data) { + npm.registry.get(uri, { auth: auth }, function (er, data) { if (er) return cb(er) - if (data["dist-tags"] && data["dist-tags"].hasOwnProperty(version)) { - version = data["dist-tags"][version] + 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 = new Error('Unpublished by ' + u.name + ' on ' + u.time) er.statusCode = 404 - er.code = "E404" + er.code = 'E404' er.pkgid = data._id return cb(er, data) } - var results = [] - , error = null - , versions = data.versions || {} + var error = null + var versions = data.versions || {} data.versions = Object.keys(versions).sort(semver.compareLoose) - if (!args.length) args = [""] + if (!args.length) args = [''] // remove readme unless we asked for it - if (-1 === args.indexOf("readme")) { + if (args.indexOf('readme') === -1) { 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)) - }) + if (semver.satisfies(v, version, true)) { + args.forEach(function (args) { + // remove readme unless we asked for it + if (args.indexOf('readme') !== -1) { + delete versions[v].readme + } + results.push(showFields(data, versions[v], args)) + }) + } }) results = results.reduce(reducer, {}) var retval = results - if (args.length === 1 && args[0] === "") { + if (args.length === 1 && args[0] === '') { retval = cleanBlanks(retval) - log.silly("cleanup", retval) + log.silly('cleanup', retval) } if (error || silent) cb(error, retval) @@ -150,18 +155,21 @@ function fetchAndRead (nv, args, silent, cb) { function cleanBlanks (obj) { var clean = {} Object.keys(obj).forEach(function (version) { - clean[version] = obj[version][""] + clean[version] = obj[version][''] }) return clean } function reducer (l, r) { - if (r) Object.keys(r).forEach(function (v) { - l[v] = l[v] || {} - Object.keys(r[v]).forEach(function (t) { - l[v][t] = r[v][t] + if (r) { + Object.keys(r).forEach(function (v) { + l[v] = l[v] || {} + Object.keys(r[v]).forEach(function (t) { + l[v][t] = r[v][t] + }) }) - }) + } + return l } @@ -173,12 +181,12 @@ function showFields (data, version, fields) { o[k] = s[k] }) }) - return search(o, fields.split("."), version.version, fields) + return search(o, fields.split('.'), version.version, fields) } function search (data, fields, version, title) { var field - , tail = fields + var tail = fields while (!field && fields.length) field = tail.shift() fields = [field].concat(tail) var o @@ -195,7 +203,7 @@ function search (data, fields, version, title) { if (data.field && data.field.hasOwnProperty(index)) { return search(data[field][index], tail, version, title) } else { - field = field + "[" + index + "]" + field = field + '[' + index + ']' } } if (Array.isArray(data)) { @@ -205,8 +213,8 @@ function search (data, fields, version, title) { var results = [] data.forEach(function (data, i) { var tl = title.length - , newt = title.substr(0, tl-(fields.join(".").length) - 1) - + "["+i+"]" + [""].concat(fields).join(".") + var newt = title.substr(0, tl - fields.join('.').length - 1) + + '[' + i + ']' + [''].concat(fields).join('.') results.push(search(data, fields.slice(), version, newt)) }) results = results.reduce(reducer, {}) @@ -215,11 +223,11 @@ function search (data, fields, version, title) { if (!data.hasOwnProperty(field)) return undefined data = data[field] if (tail.length) { - if (typeof data === "object") { + if (typeof data === 'object') { // there are more fields to deal with. return search(data, tail, version, title) } else { - return new Error("Not an object: "+data) + return new Error('Not an object: ' + data) } } o = {} @@ -230,33 +238,33 @@ function search (data, fields, version, title) { function printData (data, name, cb) { var versions = Object.keys(data) - , msg = "" - , includeVersions = versions.length > 1 - , includeFields + var msg = '' + var includeVersions = versions.length > 1 + var includeFields versions.forEach(function (v) { var fields = Object.keys(data[v]) includeFields = includeFields || (fields.length > 1) fields.forEach(function (f) { var d = cleanup(data[v][f]) - if (includeVersions || includeFields || typeof d !== "string") { + if (includeVersions || includeFields || typeof d !== 'string') { d = cleanup(data[v][f]) - d = npm.config.get("json") + d = npm.config.get('json') ? JSON.stringify(d, null, 2) : util.inspect(d, false, 5, npm.color) - } else if (typeof d === "string" && npm.config.get("json")) { + } else if (typeof d === 'string' && npm.config.get('json')) { d = JSON.stringify(d) } - if (f && includeFields) f += " = " - if (d.indexOf("\n") !== -1) d = " \n" + d - msg += (includeVersions ? name + "@" + v + " " : "") - + (includeFields ? f : "") + d + "\n" + if (f && includeFields) f += ' = ' + if (d.indexOf('\n') !== -1) d = ' \n' + d + msg += (includeVersions ? name + '@' + v + ' ' : '') + + (includeFields ? f : '') + d + '\n' }) }) // preserve output symmetry by adding a whitespace-only line at the end if // there's one at the beginning - if (/^\s*\n/.test(msg)) msg += "\n" + if (/^\s*\n/.test(msg)) msg += '\n' // print directly to stdout to not unnecessarily add blank lines process.stdout.write(msg) @@ -265,38 +273,34 @@ function printData (data, name, cb) { } function cleanup (data) { if (Array.isArray(data)) { - if (data.length === 1) { - data = data[0] - } else { - return data.map(cleanup) - } + return data.map(cleanup) } - if (!data || typeof data !== "object") return data + if (!data || typeof data !== 'object') return data - if (typeof data.versions === "object" - && data.versions - && !Array.isArray(data.versions)) { + if (typeof data.versions === 'object' && + data.versions && + !Array.isArray(data.versions)) { data.versions = Object.keys(data.versions || {}) } var keys = Object.keys(data) keys.forEach(function (d) { - if (d.charAt(0) === "_") delete data[d] - else if (typeof data[d] === "object") data[d] = cleanup(data[d]) + if (d.charAt(0) === '_') delete data[d] + else if (typeof data[d] === 'object') data[d] = cleanup(data[d]) }) keys = Object.keys(data) - if (keys.length <= 3 - && data.name - && (keys.length === 1 - || keys.length === 3 && data.email && data.url - || keys.length === 2 && (data.email || data.url))) { + if (keys.length <= 3 && + data.name && + (keys.length === 1 || + keys.length === 3 && data.email && data.url || + keys.length === 2 && (data.email || data.url))) { data = unparsePerson(data) } return data } function unparsePerson (d) { - if (typeof d === "string") return d - return d.name - + (d.email ? " <"+d.email+">" : "") - + (d.url ? " ("+d.url+")" : "") + if (typeof d === 'string') return d + return d.name + + (d.email ? ' <' + d.email + '>' : '') + + (d.url ? ' (' + d.url + ')' : '') } diff --git a/deps/npm/lib/visnup.js b/deps/npm/lib/visnup.js index 8d710c20b0dcc8..b0352fd6d049f2 100644 --- a/deps/npm/lib/visnup.js +++ b/deps/npm/lib/visnup.js @@ -1,38 +1,38 @@ module.exports = visnup -var npm = require("./npm.js") +var npm = require('./npm.js') var handsomeFace = [ - [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 237, 236, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235, 236, 235, 233, 237, 235, 233, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 235, 233, 232, 235, 235, 234, 233, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 237, 235, 232, 232, 234, 233, 233, 232, 232, 233, 232, 232, 235, 232, 233, 234, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 232, 232, 232, 239, 238, 235, 233, 232, 232, 232, 232, 232, 232, 232, 233, 235, 232, 233, 233, 232, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 234, 234, 232, 233, 234, 233, 234, 235, 233, 235, 60, 238, 238, 234, 234, 233, 234, 233, 238, 251, 246, 233, 233, 232, 0, 0, 0, 0, 0, 0] - ,[0, 0, 233, 233, 233, 232, 232, 239, 249, 251, 252, 231, 231, 188, 250, 254, 59, 60, 255, 231, 231, 231, 252, 235, 239, 235, 232, 233, 0, 0, 0, 0, 0, 0] - ,[0, 0, 232, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 254, 238, 254, 231, 231, 231, 231, 231, 252, 233, 235, 237, 233, 234, 0, 0, 0, 0, 0] - ,[0, 0, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 251, 233, 233, 233, 236, 233, 0, 0, 0, 0] - ,[232, 233, 233, 232, 232, 246, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 249, 233, 234, 234, 0, 0, 0, 0] - ,[232, 232, 232, 232, 233, 249, 231, 255, 255, 255, 255, 254, 109, 60, 239, 237, 238, 237, 235, 235, 235, 235, 236, 235, 235, 235, 234, 232, 232, 232, 232, 232, 233, 0] - ,[0, 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 235, 236, 238, 238, 235, 188, 254, 254, 145, 236, 252, 254, 254, 254, 254, 249, 236, 235, 232, 232, 233, 0] - ,[0, 0, 233, 237, 249, 239, 233, 252, 231, 231, 231, 231, 231, 231, 254, 235, 235, 254, 231, 231, 251, 235, 237, 231, 231, 231, 231, 7, 237, 235, 232, 233, 233, 0] - ,[0, 0, 0, 0, 233, 248, 239, 233, 231, 231, 231, 231, 254, 233, 233, 235, 254, 255, 231, 254, 237, 236, 254, 239, 235, 235, 233, 233, 232, 232, 233, 232, 0, 0] - ,[0, 0, 0, 232, 233, 246, 255, 255, 236, 236, 236, 236, 236, 255, 231, 231, 231, 231, 231, 231, 252, 234, 248, 231, 231, 231, 231, 248, 232, 232, 232, 0, 0, 0] - ,[0, 0, 0, 0, 235, 237, 7, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 255, 238, 235, 7, 231, 231, 231, 246, 232, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 235, 103, 188, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 252, 232, 238, 231, 231, 255, 244, 232, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 235, 236, 103, 146, 253, 255, 231, 231, 231, 231, 231, 253, 251, 250, 250, 250, 246, 232, 235, 152, 255, 146, 66, 233, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 233, 103, 146, 146, 146, 146, 254, 231, 231, 231, 109, 103, 146, 255, 188, 239, 240, 103, 255, 253, 103, 238, 234, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 232, 235, 109, 146, 146, 146, 146, 146, 252, 152, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 103, 235, 233, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 235, 235, 103, 146, 146, 146, 146, 146, 146, 188, 188, 188, 188, 188, 188, 152, 146, 146, 146, 66, 235, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 233, 235, 66, 146, 146, 146, 146, 152, 255, 146, 240, 239, 241, 109, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 234, 237, 109, 146, 146, 146, 146, 146, 254, 231, 231, 188, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 233, 237, 60, 103, 146, 146, 146, 146, 146, 103, 66, 60, 235, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0] - ,[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 233, 233, 236, 235, 237, 235, 237, 237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]] - + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 237, 236, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 235, 236, 235, 233, 237, 235, 233, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 235, 233, 232, 235, 235, 234, 233, 236, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 237, 235, 232, 232, 234, 233, 233, 232, 232, 233, 232, 232, 235, 232, 233, 234, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 232, 232, 232, 239, 238, 235, 233, 232, 232, 232, 232, 232, 232, 232, 233, 235, 232, 233, 233, 232, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 234, 234, 232, 233, 234, 233, 234, 235, 233, 235, 60, 238, 238, 234, 234, 233, 234, 233, 238, 251, 246, 233, 233, 232, 0, 0, 0, 0, 0, 0], + [0, 0, 233, 233, 233, 232, 232, 239, 249, 251, 252, 231, 231, 188, 250, 254, 59, 60, 255, 231, 231, 231, 252, 235, 239, 235, 232, 233, 0, 0, 0, 0, 0, 0], + [0, 0, 232, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 254, 238, 254, 231, 231, 231, 231, 231, 252, 233, 235, 237, 233, 234, 0, 0, 0, 0, 0], + [0, 0, 233, 232, 232, 232, 248, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 251, 233, 233, 233, 236, 233, 0, 0, 0, 0], + [232, 233, 233, 232, 232, 246, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 249, 233, 234, 234, 0, 0, 0, 0], + [232, 232, 232, 232, 233, 249, 231, 255, 255, 255, 255, 254, 109, 60, 239, 237, 238, 237, 235, 235, 235, 235, 236, 235, 235, 235, 234, 232, 232, 232, 232, 232, 233, 0], + [0, 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 235, 236, 238, 238, 235, 188, 254, 254, 145, 236, 252, 254, 254, 254, 254, 249, 236, 235, 232, 232, 233, 0], + [0, 0, 233, 237, 249, 239, 233, 252, 231, 231, 231, 231, 231, 231, 254, 235, 235, 254, 231, 231, 251, 235, 237, 231, 231, 231, 231, 7, 237, 235, 232, 233, 233, 0], + [0, 0, 0, 0, 233, 248, 239, 233, 231, 231, 231, 231, 254, 233, 233, 235, 254, 255, 231, 254, 237, 236, 254, 239, 235, 235, 233, 233, 232, 232, 233, 232, 0, 0], + [0, 0, 0, 232, 233, 246, 255, 255, 236, 236, 236, 236, 236, 255, 231, 231, 231, 231, 231, 231, 252, 234, 248, 231, 231, 231, 231, 248, 232, 232, 232, 0, 0, 0], + [0, 0, 0, 0, 235, 237, 7, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 255, 238, 235, 7, 231, 231, 231, 246, 232, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 235, 103, 188, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 252, 232, 238, 231, 231, 255, 244, 232, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 235, 236, 103, 146, 253, 255, 231, 231, 231, 231, 231, 253, 251, 250, 250, 250, 246, 232, 235, 152, 255, 146, 66, 233, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 233, 103, 146, 146, 146, 146, 254, 231, 231, 231, 109, 103, 146, 255, 188, 239, 240, 103, 255, 253, 103, 238, 234, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 232, 235, 109, 146, 146, 146, 146, 146, 252, 152, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 103, 235, 233, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 235, 235, 103, 146, 146, 146, 146, 146, 146, 188, 188, 188, 188, 188, 188, 152, 146, 146, 146, 66, 235, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 233, 235, 66, 146, 146, 146, 146, 152, 255, 146, 240, 239, 241, 109, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 234, 237, 109, 146, 146, 146, 146, 146, 254, 231, 231, 188, 146, 146, 146, 103, 233, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 233, 237, 60, 103, 146, 146, 146, 146, 146, 103, 66, 60, 235, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0], + [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 233, 233, 236, 235, 237, 235, 237, 237, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] +] function visnup (args, cb) { handsomeFace.forEach(function (line) { console.log(line.map(function (ch) { - return "\033[" + (ch ? "48;5;" + ch : ch) + "m" + return '\u001b[' + (ch ? '48;5;' + ch : ch) + 'm' }).join(' ')) }) diff --git a/deps/npm/lib/whoami.js b/deps/npm/lib/whoami.js index bef0184a0065bd..feb6fab95ae89c 100644 --- a/deps/npm/lib/whoami.js +++ b/deps/npm/lib/whoami.js @@ -1,31 +1,30 @@ -var npm = require("./npm.js") +var npm = require('./npm.js') module.exports = whoami -whoami.usage = "npm whoami\n(just prints username according to given registry)" +whoami.usage = 'npm whoami [--registry ]\n(just prints username according to given registry)' function whoami (args, silent, cb) { // FIXME: need tighter checking on this, but is a breaking change - if (typeof cb !== "function") { + 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 registry = npm.config.get('registry') + if (!registry) return cb(new Error('no default registry set')) var auth = npm.config.getCredentialsByURI(registry) if (auth) { if (auth.username) { if (!silent) console.log(auth.username) return process.nextTick(cb.bind(this, null, auth.username)) - } - else if (auth.token) { - return npm.registry.whoami(registry, { auth : auth }, function (er, username) { + } else if (auth.token) { + return npm.registry.whoami(registry, { auth: auth }, function (er, username) { if (er) return cb(er) if (!username) { var needNewSession = new Error( - "Your auth token is no longer valid. Please log in again." + 'Your auth token is no longer valid. Please log in again.' ) needNewSession.code = 'ENEEDAUTH' return cb(needNewSession) @@ -40,7 +39,7 @@ function whoami (args, silent, cb) { // 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 needAuth = new Error( - "this command requires you to be logged in." + 'this command requires you to be logged in.' ) needAuth.code = 'ENEEDAUTH' process.nextTick(cb.bind(this, needAuth)) diff --git a/deps/npm/lib/xmas.js b/deps/npm/lib/xmas.js index fa8d1db556d9a5..25535533e10fbd 100644 --- a/deps/npm/lib/xmas.js +++ b/deps/npm/lib/xmas.js @@ -1,55 +1,59 @@ // happy xmas -var log = require("npmlog") +var log = require('npmlog') module.exports = function (args, cb) { -var s = process.platform === "win32" ? " *" : " \u2605" - , f = "\uFF0F" - , b = "\uFF3C" - , x = process.platform === "win32" ? " " : "" - , o = [ "\u0069" , "\u0020", "\u0020", "\u0020", "\u0020", "\u0020" - , "\u0020", "\u0020", "\u0020", "\u0020", "\u0020", "\u0020" - , "\u0020", "\u2E1B","\u2042","\u2E2E","&","@","\uFF61" ] - , oc = [21,33,34,35,36,37] - , l = "\u005e" + var s = process.platform === 'win32' ? ' *' : ' \u2605' + var f = '\uFF0F' + var b = '\uFF3C' + var x = process.platform === 'win32' ? ' ' : '' + var o = [ + '\u0069', '\u0020', '\u0020', '\u0020', '\u0020', '\u0020', + '\u0020', '\u0020', '\u0020', '\u0020', '\u0020', '\u0020', + '\u0020', '\u2E1B', '\u2042', '\u2E2E', '&', '@', '\uFF61' + ] + var oc = [21, 33, 34, 35, 36, 37] + var l = '\u005e' -function w (s) { process.stderr.write(s) } + function w (s) { process.stderr.write(s) } -w("\n") -;(function T (H) { - for (var i = 0; i < H; i ++) w(" ") - w(x+"\033[33m"+s+"\n") - var M = H * 2 - 1 - for (var L = 1; L <= H; L ++) { - var O = L * 2 - 2 - var S = (M - O) / 2 - for (i = 0; i < S; i ++) w(" ") - w(x+"\033[32m"+f) - for (i = 0; i < O; i ++) w( - "\033["+oc[Math.floor(Math.random()*oc.length)]+"m"+ - o[Math.floor(Math.random() * o.length)] - ) - w(x+"\033[32m"+b+"\n") - } - w(" ") - for (i = 1; i < H; i ++) w("\033[32m"+l) - w("| "+x+" |") - for (i = 1; i < H; i ++) w("\033[32m"+l) - if (H > 10) { - w("\n ") - for (i = 1; i < H; i ++) w(" ") - w("| "+x+" |") - for (i = 1; i < H; i ++) w(" ") - } -})(20) -w("\n\n") -log.heading = '' -log.addLevel('npm', 100000, log.headingStyle) -log.npm("loves you", "Happy Xmas, Noders!") -cb() + w('\n') + ;(function T (H) { + for (var i = 0; i < H; i++) w(' ') + w(x + '\u001b[33m' + s + '\n') + var M = H * 2 - 1 + for (var L = 1; L <= H; L++) { + var O = L * 2 - 2 + var S = (M - O) / 2 + for (i = 0; i < S; i++) w(' ') + w(x + '\u001b[32m' + f) + for (i = 0; i < O; i++) { + w( + '\u001b[' + oc[Math.floor(Math.random() * oc.length)] + 'm' + + o[Math.floor(Math.random() * o.length)] + ) + } + w(x + '\u001b[32m' + b + '\n') + } + w(' ') + for (i = 1; i < H; i++) w('\u001b[32m' + l) + w('| ' + x + ' |') + for (i = 1; i < H; i++) w('\u001b[32m' + l) + if (H > 10) { + w('\n ') + for (i = 1; i < H; i++) w(' ') + w('| ' + x + ' |') + for (i = 1; i < H; i++) w(' ') + } + })(20) + w('\n\n') + log.heading = '' + log.addLevel('npm', 100000, log.headingStyle) + log.npm('loves you', 'Happy Xmas, Noders!') + cb() } -var dg=false -Object.defineProperty(module.exports, "usage", {get:function () { +var dg = false +Object.defineProperty(module.exports, 'usage', {get: function () { if (dg) module.exports([], function () {}) dg = true - return " " + return ' ' }}) diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1 index 423811f5be80f1..ea9e7b1c078d05 100644 --- a/deps/npm/man/man1/npm-README.1 +++ b/deps/npm/man/man1/npm-README.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "October 2015" "" "" +.TH "NPM" "1" "November 2015" "" "" .SH "NAME" \fBnpm\fR \- a JavaScript package manager .P @@ -211,7 +211,7 @@ 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\. -.SS In plainer english +.SS In plainer English .P npm is the property of npm, Inc\. .P diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index 925f3a13998520..f1b8bc0e316dd0 100644 --- a/deps/npm/man/man1/npm-access.1 +++ b/deps/npm/man/man1/npm-access.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ACCESS" "1" "October 2015" "" "" +.TH "NPM\-ACCESS" "1" "November 2015" "" "" .SH "NAME" \fBnpm-access\fR \- Set access level on published packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index bea5f3722cffa9..f96eae96bce363 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ADDUSER" "1" "October 2015" "" "" +.TH "NPM\-ADDUSER" "1" "November 2015" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index 4f28530086d1c9..42b2b17d140fa1 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,11 +1,11 @@ -.TH "NPM\-BIN" "1" "October 2015" "" "" +.TH "NPM\-BIN" "1" "November 2015" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SH SYNOPSIS .P .RS 2 .nf -npm bin +npm bin [\-g|\-\-global] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 513355ae976c8d..0d0bf21688ab33 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,12 +1,11 @@ -.TH "NPM\-BUGS" "1" "October 2015" "" "" +.TH "NPM\-BUGS" "1" "November 2015" "" "" .SH "NAME" \fBnpm-bugs\fR \- Bugs for a package in a web browser maybe .SH SYNOPSIS .P .RS 2 .nf -npm bugs -npm bugs (with no args in a package dir) +npm bugs [] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1 index 8e20ab1770b086..1bac97e926e4e3 100644 --- a/deps/npm/man/man1/npm-build.1 +++ b/deps/npm/man/man1/npm-build.1 @@ -1,11 +1,11 @@ -.TH "NPM\-BUILD" "1" "October 2015" "" "" +.TH "NPM\-BUILD" "1" "November 2015" "" "" .SH "NAME" \fBnpm-build\fR \- Build a package .SH SYNOPSIS .P .RS 2 .nf -npm build +npm build [] .fi .RE .RS 0 diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1 index 0e6d0817bfda95..fa54e083415a82 100644 --- a/deps/npm/man/man1/npm-bundle.1 +++ b/deps/npm/man/man1/npm-bundle.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUNDLE" "1" "October 2015" "" "" +.TH "NPM\-BUNDLE" "1" "November 2015" "" "" .SH "NAME" \fBnpm-bundle\fR \- REMOVED .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index ff3e7c8058b95d..c4bca767c4496a 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CACHE" "1" "October 2015" "" "" +.TH "NPM\-CACHE" "1" "November 2015" "" "" .SH "NAME" \fBnpm-cache\fR \- Manipulates packages cache .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index ce7235fbd71c65..ba8d7dd802fefc 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,11 +1,11 @@ -.TH "NPM\-COMPLETION" "1" "October 2015" "" "" +.TH "NPM\-COMPLETION" "1" "November 2015" "" "" .SH "NAME" \fBnpm-completion\fR \- Tab Completion for npm .SH SYNOPSIS .P .RS 2 .nf -\|\. <(npm completion) +source <(npm completion) .fi .RE .SH DESCRIPTION @@ -15,7 +15,14 @@ Enables tab\-completion in all npm commands\. The synopsis above loads the completions into your current shell\. Adding it to your ~/\.bashrc or ~/\.zshrc will make the completions available -everywhere\. +everywhere: +.P +.RS 2 +.nf +npm completion >> ~/\.bashrc +npm completion >> ~/\.zshrc +.fi +.RE .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\fP if you have a system diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index 47a5bd197ebad3..f3030154303c90 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,18 +1,17 @@ -.TH "NPM\-CONFIG" "1" "October 2015" "" "" +.TH "NPM\-CONFIG" "1" "November 2015" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SH SYNOPSIS .P .RS 2 .nf -npm config set [\-\-global] +npm config set [\-g|\-\-global] npm config get npm config delete npm config list npm config edit -npm c [set|get|delete|list] npm get -npm set [\-\-global] +npm set [\-g|\-\-global] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index 9d73fcb177e764..145e27dd49108d 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEDUPE" "1" "October 2015" "" "" +.TH "NPM\-DEDUPE" "1" "November 2015" "" "" .SH "NAME" \fBnpm-dedupe\fR \- Reduce duplication .SH SYNOPSIS @@ -42,25 +42,20 @@ 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 +The deduplication algorithm walks the tree, moving each dependency as far +up in the tree as possible, even if duplicates are not found\. This will +result in both a flat and deduplicated 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\. +Arguments are ignored\. Dedupe always acts on the entire tree\. .P -This feature is experimental, and may change in future versions\. +Modules .P -The \fB\-\-tag\fP 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\. +Note that this operation transforms the dependency tree, but will never +result in new modules being installed\. .SH SEE ALSO .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index 1c41959dacdb9b..a3992ac1bb6459 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,11 +1,11 @@ -.TH "NPM\-DEPRECATE" "1" "October 2015" "" "" +.TH "NPM\-DEPRECATE" "1" "November 2015" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SH SYNOPSIS .P .RS 2 .nf -npm deprecate [@] +npm deprecate [@] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index 9d7742d8108432..8b30e986a4f78b 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DIST\-TAG" "1" "October 2015" "" "" +.TH "NPM\-DIST\-TAG" "1" "November 2015" "" "" .SH "NAME" \fBnpm-dist-tag\fR \- Modify package distribution tags .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index 328ad817fdf33e..d6690800c465d0 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCS" "1" "October 2015" "" "" +.TH "NPM\-DOCS" "1" "November 2015" "" "" .SH "NAME" \fBnpm-docs\fR \- Docs for a package in a web browser maybe .SH SYNOPSIS @@ -6,9 +6,9 @@ .RS 2 .nf npm docs [ [ \.\.\.]] -npm docs (with no args in a package dir) +npm docs \. npm home [ [ \.\.\.]] -npm home (with no args in a package dir) +npm home \. .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index c3cba10dcc9943..dd757fe87817ca 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,11 +1,11 @@ -.TH "NPM\-EDIT" "1" "October 2015" "" "" +.TH "NPM\-EDIT" "1" "November 2015" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SH SYNOPSIS .P .RS 2 .nf -npm edit [@] +npm edit [@] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index b588f8d2f2726b..797c84d737bd7d 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,11 +1,11 @@ -.TH "NPM\-EXPLORE" "1" "October 2015" "" "" +.TH "NPM\-EXPLORE" "1" "November 2015" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SH SYNOPSIS .P .RS 2 .nf -npm explore [ \-\- ] +npm explore [ \-\- ] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index 1fa13cc301775f..88654a1da3ad92 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,11 +1,11 @@ -.TH "NPM\-HELP\-SEARCH" "1" "October 2015" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "November 2015" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search npm help documentation .SH SYNOPSIS .P .RS 2 .nf -npm help\-search some search terms +npm help\-search .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index 5083a5866f9f9a..8022867ef46a22 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,12 +1,11 @@ -.TH "NPM\-HELP" "1" "October 2015" "" "" +.TH "NPM\-HELP" "1" "November 2015" "" "" .SH "NAME" \fBnpm-help\fR \- Get help on npm .SH SYNOPSIS .P .RS 2 .nf -npm help -npm help some search terms +npm help [] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 56da738cb8d521..8c6bf0397482eb 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INIT" "1" "October 2015" "" "" +.TH "NPM\-INIT" "1" "November 2015" "" "" .SH "NAME" \fBnpm-init\fR \- Interactively create a package\.json file .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 new file mode 100644 index 00000000000000..e2edecfc03a3bc --- /dev/null +++ b/deps/npm/man/man1/npm-install-test.1 @@ -0,0 +1,32 @@ +.TH "NPM" "" "November 2015" "" "" +.SH "NAME" +\fBnpm\fR +.SH SYNOPSIS +.P +.RS 2 +.nf +npm install\-test (with no args, in package dir) +npm install\-test [<@scope>/] +npm install\-test [<@scope>/]@ +npm install\-test [<@scope>/]@ +npm install\-test [<@scope>/]@ +npm install\-test +npm install\-test +npm install\-test + +alias: npm it +common options: [\-\-save|\-\-save\-dev|\-\-save\-optional] [\-\-save\-exact] [\-\-dry\-run] +.fi +.RE +.SH DESCRIPTION +.P +This command runs an \fBnpm install\fP followed immediately by an \fBnpm test\fP\|\. It +takes exactly the same arguments as \fBnpm install\fP\|\. +.SH SEE ALSO +.RS 0 +.IP \(bu 2 +npm help install +.IP \(bu 2 +npm help test + +.RE diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index c135dfb4a392f1..9219b7a024ce9a 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,19 +1,21 @@ -.TH "NPM\-INSTALL" "1" "October 2015" "" "" +.TH "NPM\-INSTALL" "1" "November 2015" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SH SYNOPSIS .P .RS 2 .nf -npm install (with no args in a package dir) +npm install (with no args, in package dir) +npm install [<@scope>/] +npm install [<@scope>/]@ +npm install [<@scope>/]@ +npm install [<@scope>/]@ 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) + +alias: npm i +common options: [\-S|\-\-save|\-D|\-\-save\-dev|\-O|\-\-save\-optional] [\-E|\-\-save\-exact] [\-\-dry\-run] .fi .RE .SH DESCRIPTION @@ -37,7 +39,7 @@ e) a \fB@\fP that points to (d) .IP \(bu 2 f) a \fB\fP that has a "latest" tag satisfying (e) .IP \(bu 2 -g) a \fB\fP that resolves to (b) +g) a \fB\fP that resolves to (a) .RE .P @@ -83,7 +85,7 @@ after packing it up into a tarball (b)\. .fi .RE .IP \(bu 2 -\fBnpm install [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional]\fP: +\fBnpm install [<@scope>/] [\-S|\-\-save|\-D|\-\-save\-dev|\-O|\-\-save\-optional]\fP: Do a \fB@\fP install, where \fB\fP is the "tag" config\. (See npm help 7 \fBnpm\-config\fP\|\.) In most cases, this will install the latest version @@ -99,17 +101,19 @@ after packing it up into a tarball (b)\. the package version in your main package\.json: .RS 0 .IP \(bu 2 -\fB\-\-save\fP: Package will appear in your \fBdependencies\fP\|\. +\fB\-S, \-\-save\fP: Package will appear in your \fBdependencies\fP\|\. .IP \(bu 2 -\fB\-\-save\-dev\fP: Package will appear in your \fBdevDependencies\fP\|\. +\fB\-D, \-\-save\-dev\fP: Package will appear in your \fBdevDependencies\fP\|\. .IP \(bu 2 -\fB\-\-save\-optional\fP: Package will appear in your \fBoptionalDependencies\fP\|\. +\fB\-O, \-\-save\-optional\fP: Package will appear in your \fBoptionalDependencies\fP\|\. When using any of the above options to save dependencies to your package\.json, there is an additional, optional flag: .IP \(bu 2 -\fB\-\-save\-exact\fP: Saved dependencies will be configured with an +\fB\-E, \-\-save\-exact\fP: Saved dependencies will be configured with an exact version rather than using npm's default semver range operator\. +Further, if you have an \fBnpm\-shrinkwrap\.json\fP then it will be updated as +well\. \fB\fP 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\fP\|\. @@ -142,7 +146,7 @@ fetch the package by name if it is not valid\. .RE .RS 0 .IP \(bu 2 -\fBnpm install [@/]@\fP: +\fBnpm install [<@scope>/]@\fP: 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\. @@ -155,7 +159,7 @@ fetch the package by name if it is not valid\. .fi .RE .IP \(bu 2 -\fBnpm install [@/]@\fP: +\fBnpm install [<@scope>/]@\fP: Install the specified version of the package\. This will fail if the version has not been published to the registry\. Example: @@ -167,7 +171,7 @@ fetch the package by name if it is not valid\. .fi .RE .IP \(bu 2 -\fBnpm install [@/]@\fP: +\fBnpm install [<@scope>/]@\fP: 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\fP\|\. Note that most version ranges must be put in quotes so that your shell will @@ -182,12 +186,12 @@ fetch the package by name if it is not valid\. .RE .IP \(bu 2 \fBnpm install \fP: - Install a package by cloning a git remote url\. The format of the git - url is: + Installs the package from the hosted git provider, cloning it with + \fBgit\fP\|\. First it tries via the https (git with github) and if that fails, via ssh\. .P .RS 2 .nf - ://[[:]@][:][:/][#] + ://[[:]@][:][:][/][#] .fi .RE \fB\fP is one of \fBgit\fP, \fBgit+ssh\fP, \fBgit+http\fP, or @@ -240,7 +244,7 @@ GIT_SSH_COMMAND='ssh \-i ~/\.ssh/custom_ident' npm install git+ssh://git@github\ \fBnpm install gist:[/][#]\fP: Install the package at \fBhttps://gist\.github\.com/gistID\fP by attempting to clone it using \fBgit\fP\|\. The GitHub username associated with the gist is - optional and will not be saved in \fBpackage\.json\fP if \fB\-\-save\fP is used\. + optional and will not be saved in \fBpackage\.json\fP if \fB\-S\fP or \fB\-\-save\fP is used\. If you don't specify a \fIcommit\-ish\fR then \fBmaster\fP will be used\. Example: .P @@ -289,7 +293,10 @@ The \fB\-\-tag\fP argument will apply to all of the specified install targets\. tag with the given name exists, the tagged version is preferred over newer versions\. .P -The \fB\-\-force\fP argument will force npm to fetch remote resources even if a +The \fB\-\-dry\-run\fP argument will report in the usual way what the install would +have done without actually installing anything\. +.P +The \fB\-f\fP or \fB\-\-force\fP argument will force npm to fetch remote resources even if a local copy exists on disk\. .P .RS 2 @@ -298,7 +305,7 @@ npm install sax \-\-force .fi .RE .P -The \fB\-\-global\fP argument will cause npm to install the package globally +The \fB\-g\fP or \fB\-\-global\fP argument will cause npm to install the package globally rather than locally\. See npm help 5 \fBnpm\-folders\fP\|\. .P The \fB\-\-link\fP argument will cause npm to link global installs into the @@ -316,6 +323,9 @@ shrinkwrap file and use the package\.json instead\. The \fB\-\-nodedir=/path/to/node/source\fP argument will allow npm to find the node source code so that npm can compile native modules\. .P +The \fB\-\-only={prod[uction]|dev[elopment]}\fP argument will cause either only +\fBdevDependencies\fP or only non\-\fBdevDependencies\fP to be installed regardless of the \fBNODE_ENV\fP\|\. +.P See npm help 7 \fBnpm\-config\fP\|\. Many of the configuration params have some effect on installation, since that's most of what npm does\. .SH ALGORITHM @@ -324,15 +334,16 @@ To install a package, npm uses the following algorithm: .P .RS 2 .nf -install(where, what, family, ancestors) -fetch what, unpack to /node_modules/ -for each dep in what\.dependencies - resolve dep to precise version -for each dep@version in what\.dependencies - not in /node_modules//node_modules/* - and not in - add precise version deps to - install(/node_modules/, dep, family) +load the existing node_modules tree from disk +clone the tree +fetch the package\.json and assorted metadata and add it to the clone +walk the clone and add any missing dependencies + dependencies will be added as close to the top as is possible + without breaking any other modules +compare the original tree with the cloned tree and make a list of +actions to take to convert one to the other +execute all of the actions, deepest first + kinds of actions are install, update, remove and move .fi .RE .P @@ -343,13 +354,29 @@ this algorithm produces: .nf A +\-\- B -`\-\- C - `\-\- D ++\-\- C ++\-\- D .fi .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\. +already caused C to be installed at a higher level\. D is still installed +at the top level because nothing conflicts with it\. +.P +For \fBA{B,C}, B{C,D@1}, C{D@2}\fP, this algorithm produces: +.P +.RS 2 +.nf +A ++\-\- B ++\-\- C + `\-\- D@2 ++\-\- D@1 +.fi +.RE +.P +Because B's D@1 will be installed in the top level, C now has to install D@2 +privately for itself\. .P See npm help 5 folders for a more detailed description of the specific folder structures that npm creates\. diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 7fee404349015f..9d0ea8f47c5ff7 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,13 +1,14 @@ -.TH "NPM\-LINK" "1" "October 2015" "" "" +.TH "NPM\-LINK" "1" "November 2015" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SH SYNOPSIS .P .RS 2 .nf -npm link (in package folder) -npm link [@/] -npm ln (with any of the previous argument usage) +npm link (in package dir) +npm link [<@scope>/][@] + +alias: npm ln .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index d7ea3cd978ff04..c194188ad64b89 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,11 +1,11 @@ -.TH "NPM\-LOGOUT" "1" "October 2015" "" "" +.TH "NPM\-LOGOUT" "1" "November 2015" "" "" .SH "NAME" \fBnpm-logout\fR \- Log out of the registry .SH SYNOPSIS .P .RS 2 .nf -npm logout [\-\-registry=url] [\-\-scope=@orgname] +npm logout [\-\-registry=] [\-\-scope=<@scope>] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index a65a3fa8902551..10dea443864242 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,14 +1,13 @@ -.TH "NPM\-LS" "1" "October 2015" "" "" +.TH "NPM\-LS" "1" "November 2015" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SH SYNOPSIS .P .RS 2 .nf -npm list [[@/] \.\.\.] -npm ls [[@/] \.\.\.] -npm la [[@/] \.\.\.] -npm ll [[@/] \.\.\.] +npm ls [[<@scope>/] \.\.\.] + +aliases: list, la, ll .fi .RE .SH DESCRIPTION @@ -23,7 +22,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@2.14.7 /path/to/npm +npm@3.3.12 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi @@ -35,6 +34,9 @@ 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 +The tree shown is the logical dependency tree, based on package +dependencies, not the physical layout of your node_modules folder\. +.P When run as \fBll\fP or \fBla\fP, it shows extended information by default\. .SH CONFIGURATION .SS json @@ -106,6 +108,16 @@ Default: false .RE .P Display only the dependency tree for packages in \fBdevDependencies\fP\|\. +.SS only +.RS 0 +.IP \(bu 2 +Type: String + +.RE +.P +When "dev" or "development", is an alias to \fBdev\fP\|\. +.P +When "prod" or "production", is an alias to \fBproduction\fP\|\.` .SH SEE ALSO .RS 0 .IP \(bu 2 diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 7f96b4e48cde03..b7ba130cb5e4b1 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,11 +1,11 @@ -.TH "NPM\-OUTDATED" "1" "October 2015" "" "" +.TH "NPM\-OUTDATED" "1" "November 2015" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SH SYNOPSIS .P .RS 2 .nf -npm outdated [ [ \.\.\.]] +npm outdated [[<@scope>/] \.\.\.] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index 28d2cc125f578c..1ce148d3fade74 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,13 +1,13 @@ -.TH "NPM\-OWNER" "1" "October 2015" "" "" +.TH "NPM\-OWNER" "1" "November 2015" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SH SYNOPSIS .P .RS 2 .nf -npm owner ls -npm owner add -npm owner rm +npm owner add [<@scope>/] +npm owner rm [<@scope>/] +npm owner ls [<@scope>/] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index 295d918bfed991..9bb591cdfe82f2 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,20 +1,20 @@ -.TH "NPM\-PACK" "1" "October 2015" "" "" +.TH "NPM\-PACK" "1" "November 2015" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SH SYNOPSIS .P .RS 2 .nf -npm pack [ [ \.\.\.]] +npm pack [[<@scope>/]\.\.\.] .fi .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\fP, and then write the filenames out to -stdout\. +tarball url, name@tag, name@version, name, or scoped name), this +command will fetch it to the cache, and then copy the tarball to the +current working directory as \fB\-\.tgz\fP, 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\. diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index af69ba3a784219..4d2b9a78bf0fcb 100644 --- a/deps/npm/man/man1/npm-ping.1 +++ b/deps/npm/man/man1/npm-ping.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PING" "1" "October 2015" "" "" +.TH "NPM\-PING" "1" "November 2015" "" "" .SH "NAME" \fBnpm-ping\fR \- Ping npm registry .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index 9ce37848d97d52..c6ea5f6fdfa75e 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PREFIX" "1" "October 2015" "" "" +.TH "NPM\-PREFIX" "1" "November 2015" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index bb9908f5152bb9..22c831d338dc1f 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,12 +1,11 @@ -.TH "NPM\-PRUNE" "1" "October 2015" "" "" +.TH "NPM\-PRUNE" "1" "November 2015" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SH SYNOPSIS .P .RS 2 .nf -npm prune [ [ [/]\.\.\.] [\-\-production] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index 20d1f36f6cd0d9..cd249e4fe9263e 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,12 +1,14 @@ -.TH "NPM\-PUBLISH" "1" "October 2015" "" "" +.TH "NPM\-PUBLISH" "1" "November 2015" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SH SYNOPSIS .P .RS 2 .nf -npm publish [\-\-tag ] [\-\-access ] -npm publish [\-\-tag ] [\-\-access ] +npm publish [|] [\-\-tag ] [\-\-access ] + +Publishes '\.' if no argument supplied +Sets tag 'latest' if no \-\-tag specified .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index b10caeef0d8b46..e850fa647fcf1a 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,19 +1,14 @@ -.TH "NPM\-REBUILD" "1" "October 2015" "" "" +.TH "NPM\-REBUILD" "1" "November 2015" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SH SYNOPSIS .P .RS 2 .nf -npm rebuild [ [ \.\.\.]] -npm rb [ [ \.\.\.]] -.fi -.RE -.RS 0 -.IP \(bu 2 -\fB\fP: -The package to rebuild +npm rebuild [[<@scope>/]\.\.\.] +alias: npm rb +.fi .RE .SH DESCRIPTION .P diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 14f228c9553ee5..7ee7d95f8f7831 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,12 +1,11 @@ -.TH "NPM\-REPO" "1" "October 2015" "" "" +.TH "NPM\-REPO" "1" "November 2015" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SH SYNOPSIS .P .RS 2 .nf -npm repo -npm repo (with no args in a package dir) +npm repo [] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index 31e61af29de800..0bc7541ccf80c6 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RESTART" "1" "October 2015" "" "" +.TH "NPM\-RESTART" "1" "November 2015" "" "" .SH "NAME" \fBnpm-restart\fR \- Restart a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-rm.1 b/deps/npm/man/man1/npm-rm.1 index 9c2506635a491d..ec0271980a4bee 100644 --- a/deps/npm/man/man1/npm-rm.1 +++ b/deps/npm/man/man1/npm-rm.1 @@ -31,4 +31,3 @@ npm help 7 config npm help 5 npmrc .RE - diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index 20e4a2f687ebea..bacb6ffb7de987 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,11 +1,11 @@ -.TH "NPM\-ROOT" "1" "October 2015" "" "" +.TH "NPM\-ROOT" "1" "November 2015" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SH SYNOPSIS .P .RS 2 .nf -npm root +npm root [\-g] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index e4da37dc2af7c5..ded6145a1f3480 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,12 +1,13 @@ -.TH "NPM\-RUN\-SCRIPT" "1" "October 2015" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "November 2015" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SH SYNOPSIS .P .RS 2 .nf -npm run\-script [command] [\-\- ] -npm run [command] [\-\- ] +npm run\-script [\-\- \.\.\.] + +alias: npm run .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index ea2a9c82431130..6307a345aa3a6e 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,13 +1,13 @@ -.TH "NPM\-SEARCH" "1" "October 2015" "" "" +.TH "NPM\-SEARCH" "1" "November 2015" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SH SYNOPSIS .P .RS 2 .nf -npm search [\-\-long] [search terms \.\.\.] -npm s [search terms \.\.\.] -npm se [search terms \.\.\.] +npm search [\-l|\-\-long] [search terms \.\.\.] + +aliases: s, se .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index 1a8abd78292a6f..39784dfe6f6359 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP" "1" "October 2015" "" "" +.TH "NPM\-SHRINKWRAP" "1" "November 2015" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- Lock down dependency versions .SH SYNOPSIS @@ -111,13 +111,17 @@ This generates \fBnpm\-shrinkwrap\.json\fP, which will look something like this: .nf { "name": "A", - "version": "0\.1\.0", + "version": "1\.1\.0", "dependencies": { "B": { - "version": "0\.0\.1", + "version": "1\.0\.1", + "from": "B@^1\.0\.0", + "resolved": "https://registry\.npmjs\.org/B/\-/B\-1\.0\.1\.tgz", "dependencies": { "C": { - "version": "0\.0\.1" + "version": "1\.0\.1", + "from": "org/C#v1\.0\.1", + "resolved": "git://github\.com/org/C\.git#5c380ae319fc4efe9e7f2d9c78b0faa588fd99b4" } } } @@ -126,15 +130,18 @@ This generates \fBnpm\-shrinkwrap\.json\fP, which will look something like this: .fi .RE .P -The shrinkwrap command has locked down the dependencies based on -what's currently installed in node_modules\. When \fBnpm install\fP -installs a package with an \fBnpm\-shrinkwrap\.json\fP in the package -root, the shrinkwrap file (rather than \fBpackage\.json\fP files) completely -drives the installation of that package and all of its dependencies -(recursively)\. So now the author publishes A@0\.1\.0, and subsequent -installs of this package will use B@0\.0\.1 and C@0\.0\.1, regardless the -dependencies and versions listed in A's, B's, and C's \fBpackage\.json\fP -files\. +The shrinkwrap command has locked down the dependencies based on what's +currently installed in \fBnode_modules\fP\|\. The installation behavior is changed to: +.RS 0 +.IP 1. 3 +The module tree described by the shrinkwrap is reproduced\. This means +reproducing the structure described in the file, using the specific files +referenced in "resolved" if available, falling back to normal package +resolution using "version" if one isn't\. +.IP 2. 3 +The tree is walked and any missing dependencies are installed in the usual fashion\. + +.RE .SS Using shrinkwrapped packages .P Using a shrinkwrapped package is no different than using any other @@ -161,17 +168,16 @@ To add or update a dependency in a shrinkwrapped package: Run \fBnpm install\fP in the package root to install the current versions of all dependencies\. .IP 2. 3 -Add or update dependencies\. \fBnpm install\fP each new or updated -package individually and then update \fBpackage\.json\fP\|\. Note that they -must be explicitly named in order to be installed: running \fBnpm -install\fP with no arguments will merely reproduce the existing +Add or update dependencies\. \fBnpm install \-\-save\fP each new or updated +package individually to update the \fBpackage\.json\fP and the shrinkwrap\. +Note that they must be explicitly named in order to be installed: running +\fBnpm install\fP with no arguments will merely reproduce the existing shrinkwrap\. .IP 3. 3 Validate that the package works as expected with the new dependencies\. .IP 4. 3 -Run \fBnpm shrinkwrap\fP, commit the new \fBnpm\-shrinkwrap\.json\fP, and -publish your package\. +Commit the new \fBnpm\-shrinkwrap\.json\fP, and publish your package\. .RE .P diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index 7bcb1db69f9685..e12124fd5d3dab 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,12 +1,12 @@ -.TH "NPM\-STAR" "1" "October 2015" "" "" +.TH "NPM\-STAR" "1" "November 2015" "" "" .SH "NAME" \fBnpm-star\fR \- Mark your favorite packages .SH SYNOPSIS .P .RS 2 .nf -npm star [, \.\.\.] -npm unstar [, \.\.\.] +npm star [\.\.\.] +npm unstar [\.\.\.] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 2d8c3b2c7def7f..c80a0f8a3ea586 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,12 +1,11 @@ -.TH "NPM\-STARS" "1" "October 2015" "" "" +.TH "NPM\-STARS" "1" "November 2015" "" "" .SH "NAME" \fBnpm-stars\fR \- View packages marked as favorites .SH SYNOPSIS .P .RS 2 .nf -npm stars -npm stars [username] +npm stars [] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index eb5f7b8aeac55c..9f027a9ffb9adf 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,4 +1,4 @@ -.TH "NPM\-START" "1" "October 2015" "" "" +.TH "NPM\-START" "1" "November 2015" "" "" .SH "NAME" \fBnpm-start\fR \- Start a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index 8e2510625533ac..044bbc066ac905 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STOP" "1" "October 2015" "" "" +.TH "NPM\-STOP" "1" "November 2015" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-tag.1 b/deps/npm/man/man1/npm-tag.1 index affc443d538540..e70976e800779f 100644 --- a/deps/npm/man/man1/npm-tag.1 +++ b/deps/npm/man/man1/npm-tag.1 @@ -1,11 +1,12 @@ -.TH "NPM\-TAG" "1" "October 2015" "" "" +.TH "NPM\-TAG" "1" "November 2015" "" "" .SH "NAME" \fBnpm-tag\fR \- Tag a published version .SH SYNOPSIS .P .RS 2 .nf -npm tag @ [] +[DEPRECATED] npm tag @ [] +See `dist\-tag` .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index afe5434c1ebb7c..69f03d6df160bf 100644 --- a/deps/npm/man/man1/npm-team.1 +++ b/deps/npm/man/man1/npm-team.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEAM" "1" "October 2015" "" "" +.TH "NPM\-TEAM" "1" "November 2015" "" "" .SH "NAME" \fBnpm-team\fR \- Manage organization teams and team memberships .SH SYNOPSIS @@ -21,7 +21,7 @@ npm team edit Used to manage teams in organizations, and change team memberships\. Does not handle permissions for packages\. .P -Teams must always be fully qualified with the organization/scope they belond to +Teams must always be fully qualified with the organization/scope they belong to when operating on them, separated by a colon (\fB:\fP)\. That is, if you have a \fBdevelopers\fP team on a \fBfoo\fP organization, you must always refer to that team as \fBdevelopers:foo\fP in these commands\. @@ -58,6 +58,6 @@ use the \fBnpm access\fP command to grant or revoke the appropriate permissions\ .IP \(bu 2 npm help access .IP \(bu 2 -npm help 7 registr +npm help 7 registry .RE diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index 08720089a6200f..c36e7f42adeeb9 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEST" "1" "October 2015" "" "" +.TH "NPM\-TEST" "1" "November 2015" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index fedb41b730f211..6bac5b55d0bb5a 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,12 +1,13 @@ -.TH "NPM\-RM" "1" "October 2015" "" "" +.TH "NPM\-RM" "1" "November 2015" "" "" .SH "NAME" \fBnpm-rm\fR \- Remove a package .SH SYNOPSIS .P .RS 2 .nf -npm uninstall [@/] [\-\-save|\-\-save\-dev|\-\-save\-optional] -npm rm (with any of the previous argument usage) +npm uninstall [<@scope>/][@]\.\.\. [\-S|\-\-save|\-D|\-\-save\-dev|\-O|\-\-save\-optional] + +aliases: remove, rm, r, un, unlink .fi .RE .SH DESCRIPTION @@ -29,14 +30,17 @@ it uninstalls the current package context as a global package\. the package version in your main package\.json: .RS 0 .IP \(bu 2 -\fB\-\-save\fP: Package will be removed from your \fBdependencies\fP\|\. +\fB\-S, \-\-save\fP: Package will be removed from your \fBdependencies\fP\|\. .IP \(bu 2 -\fB\-\-save\-dev\fP: Package will be removed from your \fBdevDependencies\fP\|\. +\fB\-D, \-\-save\-dev\fP: Package will be removed from your \fBdevDependencies\fP\|\. .IP \(bu 2 -\fB\-\-save\-optional\fP: Package will be removed from your \fBoptionalDependencies\fP\|\. +\fB\-O, \-\-save\-optional\fP: Package will be removed from your \fBoptionalDependencies\fP\|\. .RE .P +Further, if you have an \fBnpm\-shrinkwrap\.json\fP then it will be updated as +well\. +.P Scope is optional and follows the usual rules for npm help 7 \fBnpm\-scope\fP\|\. .P Examples: diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index f3c46aac93ac88..daa61e3a293e3f 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,11 +1,11 @@ -.TH "NPM\-UNPUBLISH" "1" "October 2015" "" "" +.TH "NPM\-UNPUBLISH" "1" "November 2015" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SH SYNOPSIS .P .RS 2 .nf -npm unpublish [@/][@] +npm unpublish [<@scope>/][@] .fi .RE .SH WARNING diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index 4e247b50082a94..62b3adc4afcdc0 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,11 +1,11 @@ -.TH "NPM\-UPDATE" "1" "October 2015" "" "" +.TH "NPM\-UPDATE" "1" "November 2015" "" "" .SH "NAME" \fBnpm-update\fR \- Update a package .SH SYNOPSIS .P .RS 2 .nf -npm update [\-g] [ [ \.\.\.]] +npm update [\-g] [\.\.\.] .fi .RE .SH DESCRIPTION @@ -124,7 +124,8 @@ version that satisfies \fB^0\.4\.0\fP (\fB>= 0\.4\.0 <0\.5\.0\fP) .P When you want to update a package and save the new version as the minimum required dependency in \fBpackage\.json\fP, you can use -\fBnpm update \-\-save\fP\|\. For example if \fBpackage\.json\fP contains +\fBnpm update \-S\fP or \fBnpm update \-\-save\fP\|\. For example if +\fBpackage\.json\fP contains: .P .RS 2 .nf diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index 5c04c279f913ab..f799cd9111584d 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VERSION" "1" "October 2015" "" "" +.TH "NPM\-VERSION" "1" "November 2015" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SH SYNOPSIS @@ -6,6 +6,10 @@ .RS 2 .nf npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease] + +\|'npm [\-v | \-\-version]' to print npm version +\|'npm view version' to view a package's published version +\|'npm ls' to inspect current package/dependency versions .fi .RE .SH DESCRIPTION @@ -21,10 +25,10 @@ the existing version will be incremented by 1 in the specified field\. If run in a git repo, it will also create a version commit and tag\. This behavior is controlled by \fBgit\-tag\-version\fP (see below), and can be disabled on the command line by running \fBnpm \-\-no\-git\-tag\-version version\fP\|\. -It will fail if the working directory is not clean, unless the \fB\-\-force\fP -flag is set\. +It will fail if the working directory is not clean, unless the \fB\-f\fP or +\fB\-\-force\fP flag is set\. .P -If supplied with \fB\-\-message\fP (shorthand: \fB\-m\fP) config option, npm will +If supplied with \fB\-m\fP or \fB\-\-message\fP config option, npm will use it as a commit message when creating a version commit\. If the \fBmessage\fP config contains \fB%s\fP then that will be replaced with the resulting version number\. For example: diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index ba3fe90030d0d7..9e3e44ff538a94 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,12 +1,13 @@ -.TH "NPM\-VIEW" "1" "October 2015" "" "" +.TH "NPM\-VIEW" "1" "November 2015" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SH SYNOPSIS .P .RS 2 .nf -npm view [@/][@] [[\.]\.\.\.] -npm v [@/][@] [[\.]\.\.\.] +npm view [<@scope>/][@] [[\.]\.\.\.] + +aliases: info, show, v .fi .RE .SH DESCRIPTION @@ -76,7 +77,7 @@ npm view express contributors[0]\.email .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 +For example, to get all the contributor names and email addresses, you can do this: .P .RS 2 diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index b52b509ebb670d..d356fe402373ec 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,11 +1,11 @@ -.TH "NPM\-WHOAMI" "1" "October 2015" "" "" +.TH "NPM\-WHOAMI" "1" "November 2015" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SH SYNOPSIS .P .RS 2 .nf -npm whoami +npm whoami [\-\-registry ] .fi .RE .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index 3837768230bf87..16c974e0edf9ff 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "October 2015" "" "" +.TH "NPM" "1" "November 2015" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SH SYNOPSIS @@ -10,7 +10,7 @@ npm [args] .RE .SH VERSION .P -2.14.7 +3.3.12 .SH DESCRIPTION .P npm is the package manager for the Node JavaScript platform\. It puts @@ -66,7 +66,7 @@ defaults to the current working directory\. Packages are installed to .RE .P -Local mode is the default\. Use \fB\-\-global\fP or \fB\-g\fP on any command to +Local mode is the default\. Use \fB\-g\fP or \fB\-\-global\fP on any command to operate in global mode instead\. .SH DEVELOPER USAGE .P diff --git a/deps/npm/man/man3/npm-bin.3 b/deps/npm/man/man3/npm-bin.3 deleted file mode 100644 index 31c2c4326d8b52..00000000000000 --- a/deps/npm/man/man3/npm-bin.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "NPM\-BIN" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-bin\fR \- Display npm bin folder -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.bin(args, cb) -.fi -.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\fP property\. - diff --git a/deps/npm/man/man3/npm-bugs.3 b/deps/npm/man/man3/npm-bugs.3 deleted file mode 100644 index 860af2e5762598..00000000000000 --- a/deps/npm/man/man3/npm-bugs.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "NPM\-BUGS" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-bugs\fR \- Bugs for a package in a web browser maybe -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.bugs(package, callback) -.fi -.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\fP -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 deleted file mode 100644 index 5ca2d8c7063e60..00000000000000 --- a/deps/npm/man/man3/npm-cache.3 +++ /dev/null @@ -1,34 +0,0 @@ -.TH "NPM\-CACHE" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-cache\fR \- manage the npm cache programmatically -.SH SYNOPSIS -.P -.RS 2 -.nf -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 -.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(\.\.\.)\fP functionality is a public -interface, and like all commands on the \fBnpm\.commands\fP 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 deleted file mode 100644 index 9036288732f2a3..00000000000000 --- a/deps/npm/man/man3/npm-commands.3 +++ /dev/null @@ -1,28 +0,0 @@ -.TH "NPM\-COMMANDS" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-commands\fR \- npm commands -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands[](args, callback) -.fi -.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\-\fP for command\-line -usage, or \fBman 3 npm\-\fP for programmatic usage\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm help 7 index - -.RE - diff --git a/deps/npm/man/man3/npm-config.3 b/deps/npm/man/man3/npm-config.3 deleted file mode 100644 index d27e2dcc453458..00000000000000 --- a/deps/npm/man/man3/npm-config.3 +++ /dev/null @@ -1,49 +0,0 @@ -.TH "NPM\-CONFIG" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-config\fR \- Manage the npm configuration files -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.config(args, callback) -var val = npm\.config\.get(key) -npm\.config\.set(key, val) -.fi -.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: -.RS 0 -.IP \(bu 2 -\fBset\fP - Sets a config parameter\. The second element in \fBargs\fP is interpreted as the - key, and the third element is interpreted as the value\. -.IP \(bu 2 -\fBget\fP - Gets the value of a config parameter\. The second element in \fBargs\fP is the - key to get the value of\. -.IP \(bu 2 -\fBdelete\fP (\fBrm\fP or \fBdel\fP) - Deletes a parameter from the config\. The second element in \fBargs\fP is the - key to delete\. -.IP \(bu 2 -\fBlist\fP (\fBls\fP) - Show all configs that aren't secret\. No parameters necessary\. -.IP \(bu 2 -\fBedit\fP: - 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\fP and \fBnpm\.config\.get\fP -functions instead\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm apihelp npm - -.RE - diff --git a/deps/npm/man/man3/npm-deprecate.3 b/deps/npm/man/man3/npm-deprecate.3 deleted file mode 100644 index 39cf6336c213ee..00000000000000 --- a/deps/npm/man/man3/npm-deprecate.3 +++ /dev/null @@ -1,43 +0,0 @@ -.TH "NPM\-DEPRECATE" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-deprecate\fR \- Deprecate a version of a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.deprecate(args, callback) -.fi -.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: -.RS 0 -.IP \(bu 2 -\fBpackage[@version]\fP - The \fBversion\fP portion is optional, and may be either a range, or a - specific version, or a tag\. -.IP \(bu 2 -\fBmessage\fP - 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\fP and \fBadduser\fP help topics\. -.P -To un\-deprecate a package, specify an empty string (\fB""\fP) for the \fBmessage\fP argument\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm apihelp publish -.IP \(bu 2 -npm apihelp unpublish -.IP \(bu 2 -npm help 7 registry - -.RE - diff --git a/deps/npm/man/man3/npm-docs.3 b/deps/npm/man/man3/npm-docs.3 deleted file mode 100644 index f0c01390e296bb..00000000000000 --- a/deps/npm/man/man3/npm-docs.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "NPM\-DOCS" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-docs\fR \- Docs for a package in a web browser maybe -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.docs(package, callback) -.fi -.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\fP -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 deleted file mode 100644 index c1c79f822970cd..00000000000000 --- a/deps/npm/man/man3/npm-edit.3 +++ /dev/null @@ -1,28 +0,0 @@ -.TH "NPM\-EDIT" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-edit\fR \- Edit an installed package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.edit(package, callback) -.fi -.RE -.SH DESCRIPTION -.P -Opens the package folder in the default editor (or whatever you've -configured as the npm \fBeditor\fP config \-\- see \fBnpm help config\fP\|\.) -.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\fP to install connect -into your package, and then \fBnpm\.commands\.edit(["connect"], callback)\fP -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 deleted file mode 100644 index 702d5bfc800c09..00000000000000 --- a/deps/npm/man/man3/npm-explore.3 +++ /dev/null @@ -1,22 +0,0 @@ -.TH "NPM\-EXPLORE" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-explore\fR \- Browse an installed package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.explore(args, callback) -.fi -.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 \fP 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\. - diff --git a/deps/npm/man/man3/npm-help-search.3 b/deps/npm/man/man3/npm-help-search.3 deleted file mode 100644 index 8e8053b588a062..00000000000000 --- a/deps/npm/man/man3/npm-help-search.3 +++ /dev/null @@ -1,41 +0,0 @@ -.TH "NPM\-HELP\-SEARCH" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-help-search\fR \- Search the help pages -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.helpSearch(args, [silent,] callback) -.fi -.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: -.RS 0 -.IP \(bu 2 -hits: -A map of args to number of hits on that arg\. For example, {"npm": 3} -.IP \(bu 2 -found: -Total number of unique args that matched\. -.IP \(bu 2 -totalHits: -Total number of hits\. -.IP \(bu 2 -lines: -An array of all matching lines (and some adjacent lines)\. -.IP \(bu 2 -file: -Name of the file that matched - -.RE -.P -The silent parameter is not necessary 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 deleted file mode 100644 index b2eab12fe34944..00000000000000 --- a/deps/npm/man/man3/npm-init.3 +++ /dev/null @@ -1,32 +0,0 @@ -.TH "NPM" "" "October 2015" "" "" -.SH "NAME" -\fBnpm\fR -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.init(args, callback) -.fi -.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\. -.P -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 -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, -then go ahead and use this programmatically\. -.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 deleted file mode 100644 index 75397cdc95bff2..00000000000000 --- a/deps/npm/man/man3/npm-install.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "NPM\-INSTALL" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-install\fR \- install a package programmatically -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.install([where,] packages, callback) -.fi -.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 -where the packages should be installed to\. -.P -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 -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 deleted file mode 100644 index 2829bab6af0ed5..00000000000000 --- a/deps/npm/man/man3/npm-link.3 +++ /dev/null @@ -1,41 +0,0 @@ -.TH "NPM\-LINK" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-link\fR \- Symlink a package folder -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.link(callback) -npm\.commands\.link(packages, callback) -.fi -.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\fP to the current folder\. -.P -With a parameters, link will create a symlink from the local \fBnode_modules\fP -folder to the global symlink\. -.P -When creating tarballs for \fBnpm publish\fP, 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: -.P -.RS 2 -.nf -npm\.commands\.link(cb) # creates global link from the cwd - # (say redis package) -npm\.commands\.link('redis', cb) # link\-install the package -.fi -.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 deleted file mode 100644 index dd0017ec748989..00000000000000 --- a/deps/npm/man/man3/npm-load.3 +++ /dev/null @@ -1,34 +0,0 @@ -.TH "NPM\-LOAD" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-load\fR \- Load config settings -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.load(conf, cb) -.fi -.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 containing 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: -.P -.RS 2 -.nf -{ - "dev": true -} -.fi -.RE -.P -For a list of all the available command\-line configs, see \fBnpm help config\fP - diff --git a/deps/npm/man/man3/npm-ls.3 b/deps/npm/man/man3/npm-ls.3 deleted file mode 100644 index 3f998266170e32..00000000000000 --- a/deps/npm/man/man3/npm-ls.3 +++ /dev/null @@ -1,68 +0,0 @@ -.TH "NPM\-LS" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-ls\fR \- List installed packages -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.ls(args, [silent,] callback) -.fi -.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\fP 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 -.RS 0 -.IP \(bu 2 -Default: false -.IP \(bu 2 -Type: Boolean - -.RE -.P -Show extended information\. -.SS parseable -.RS 0 -.IP \(bu 2 -Default: false -.IP \(bu 2 -Type: Boolean - -.RE -.P -Show parseable output instead of tree view\. -.SS global -.RS 0 -.IP \(bu 2 -Default: false -.IP \(bu 2 -Type: Boolean - -.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\. -This means that if a submodule has the 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 deleted file mode 100644 index 09e51e92ef0309..00000000000000 --- a/deps/npm/man/man3/npm-outdated.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "NPM\-OUTDATED" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-outdated\fR \- Check for outdated packages -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.outdated([packages,] callback) -.fi -.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\. - diff --git a/deps/npm/man/man3/npm-owner.3 b/deps/npm/man/man3/npm-owner.3 deleted file mode 100644 index d0b24cbd54e44a..00000000000000 --- a/deps/npm/man/man3/npm-owner.3 +++ /dev/null @@ -1,43 +0,0 @@ -.TH "NPM\-OWNER" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-owner\fR \- Manage package owners -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.owner(args, callback) -.fi -.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): -.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 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 2 -rm (user, package): -Remove a user from the package owner list\. This immediately revokes their -privileges\. - -.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 -that is not implemented at this time\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm apihelp publish -.IP \(bu 2 -npm help 7 registry - -.RE - diff --git a/deps/npm/man/man3/npm-pack.3 b/deps/npm/man/man3/npm-pack.3 deleted file mode 100644 index be86942dd4cd98..00000000000000 --- a/deps/npm/man/man3/npm-pack.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "NPM\-PACK" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-pack\fR \- Create a tarball from a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.pack([packages,] callback) -.fi -.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\fP, 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-ping.3 b/deps/npm/man/man3/npm-ping.3 deleted file mode 100644 index 9963edd15d665b..00000000000000 --- a/deps/npm/man/man3/npm-ping.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "NPM\-PING" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-ping\fR \- Ping npm registry -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.registry\.ping(registry, options, function (er, pong)) -.fi -.RE -.SH DESCRIPTION -.P -Attempts to connect to the given registry, returning a \fBpong\fP -object with various metadata if it succeeds\. -.P -This function is primarily useful for debugging connection issues -to npm registries\. diff --git a/deps/npm/man/man3/npm-prefix.3 b/deps/npm/man/man3/npm-prefix.3 deleted file mode 100644 index 33c118fc2fb6e3..00000000000000 --- a/deps/npm/man/man3/npm-prefix.3 +++ /dev/null @@ -1,19 +0,0 @@ -.TH "NPM\-PREFIX" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-prefix\fR \- Display prefix -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.prefix(args, callback) -.fi -.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\. -.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 deleted file mode 100644 index 49f4d0ad650ca6..00000000000000 --- a/deps/npm/man/man3/npm-prune.3 +++ /dev/null @@ -1,21 +0,0 @@ -.TH "NPM\-PRUNE" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-prune\fR \- Remove extraneous packages -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.prune([packages,] callback) -.fi -.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\. - diff --git a/deps/npm/man/man3/npm-publish.3 b/deps/npm/man/man3/npm-publish.3 deleted file mode 100644 index 5be59e838273ed..00000000000000 --- a/deps/npm/man/man3/npm-publish.3 +++ /dev/null @@ -1,41 +0,0 @@ -.TH "NPM\-PUBLISH" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-publish\fR \- Publish a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.publish([packages,] callback) -.fi -.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: -.RS 0 -.IP \(bu 2 -\fB\fP: -A folder containing a package\.json file -.IP \(bu 2 -\fB\fP: -A url or file path to a gzipped tar archive containing a single folder -with a package\.json file inside\. - -.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 -.RS 0 -.IP \(bu 2 -npm help 7 registry -.IP \(bu 2 -npm help adduser -.IP \(bu 2 -npm apihelp owner - -.RE - diff --git a/deps/npm/man/man3/npm-rebuild.3 b/deps/npm/man/man3/npm-rebuild.3 deleted file mode 100644 index 714c5778b8f184..00000000000000 --- a/deps/npm/man/man3/npm-rebuild.3 +++ /dev/null @@ -1,19 +0,0 @@ -.TH "NPM\-REBUILD" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-rebuild\fR \- Rebuild a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.rebuild([packages,] callback) -.fi -.RE -.SH DESCRIPTION -.P -This command runs the \fBnpm build\fP 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 -.P -See \fBnpm help build\fP - diff --git a/deps/npm/man/man3/npm-repo.3 b/deps/npm/man/man3/npm-repo.3 deleted file mode 100644 index dae556f6a92812..00000000000000 --- a/deps/npm/man/man3/npm-repo.3 +++ /dev/null @@ -1,23 +0,0 @@ -.TH "NPM\-REPO" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-repo\fR \- Open package repository page in the browser -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.repo(package, callback) -.fi -.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\fP -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 deleted file mode 100644 index dad6281d126e8f..00000000000000 --- a/deps/npm/man/man3/npm-restart.3 +++ /dev/null @@ -1,58 +0,0 @@ -.TH "NPM\-RESTART" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-restart\fR \- Restart a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.restart(packages, callback) -.fi -.RE -.SH DESCRIPTION -.P -This restarts a package (or multiple packages)\. -.P -This runs a package's "stop", "restart", and "start" scripts, and associated -pre\- and post\- scripts, in the order given below: -.RS 0 -.IP 1. 3 -prerestart -.IP 2. 3 -prestop -.IP 3. 3 -stop -.IP 4. 3 -poststop -.IP 5. 3 -restart -.IP 6. 3 -prestart -.IP 7. 3 -start -.IP 8. 3 -poststart -.IP 9. 3 -postrestart - -.RE -.P -If no version is specified, then it restarts the "active" version\. -.P -npm can restart multiple packages\. Just specify multiple packages in -the \fBpackages\fP parameter\. -.SH NOTE -.P -Note that the "restart" script is run \fBin addition to\fR the "stop" -and "start" scripts, not instead of them\. -.P -This is the behavior as of \fBnpm\fP major version 2\. A change in this -behavior will be accompanied by an increase in major version number -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm apihelp start -.IP \(bu 2 -npm apihelp stop - -.RE - diff --git a/deps/npm/man/man3/npm-root.3 b/deps/npm/man/man3/npm-root.3 deleted file mode 100644 index 3fd75ab7b16c51..00000000000000 --- a/deps/npm/man/man3/npm-root.3 +++ /dev/null @@ -1,19 +0,0 @@ -.TH "NPM\-ROOT" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-root\fR \- Display npm root -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.root(args, callback) -.fi -.RE -.SH DESCRIPTION -.P -Print the effective \fBnode_modules\fP folder to standard out\. -.P -\|'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 deleted file mode 100644 index bc4508c0409221..00000000000000 --- a/deps/npm/man/man3/npm-run-script.3 +++ /dev/null @@ -1,37 +0,0 @@ -.TH "NPM\-RUN\-SCRIPT" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-run-script\fR \- Run arbitrary package scripts -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.run\-script(args, callback) -.fi -.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 -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 -.RS 0 -.IP \(bu 2 -npm help 7 scripts -.IP \(bu 2 -npm apihelp test -.IP \(bu 2 -npm apihelp start -.IP \(bu 2 -npm apihelp restart -.IP \(bu 2 -npm apihelp stop - -.RE - diff --git a/deps/npm/man/man3/npm-search.3 b/deps/npm/man/man3/npm-search.3 deleted file mode 100644 index 85a9ede36c97c4..00000000000000 --- a/deps/npm/man/man3/npm-search.3 +++ /dev/null @@ -1,52 +0,0 @@ -.TH "NPM\-SEARCH" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-search\fR \- Search for packages -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.search(searchTerms, [silent,] [staleness,] callback) -.fi -.RE -.SH DESCRIPTION -.P -Search the registry for packages matching the search terms\. The available parameters are: -.RS 0 -.IP \(bu 2 -searchTerms: -Array of search terms\. These terms are case\-insensitive\. -.IP \(bu 2 -silent: -If true, npm will not log anything to the console\. -.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 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 -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: -.RS 0 -.IP \(bu 2 -name -.IP \(bu 2 -description -.IP \(bu 2 -maintainers -.IP \(bu 2 -url -.IP \(bu 2 -keywords - -.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 -like)\. - diff --git a/deps/npm/man/man3/npm-shrinkwrap.3 b/deps/npm/man/man3/npm-shrinkwrap.3 deleted file mode 100644 index 7211d969a67432..00000000000000 --- a/deps/npm/man/man3/npm-shrinkwrap.3 +++ /dev/null @@ -1,24 +0,0 @@ -.TH "NPM\-SHRINKWRAP" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-shrinkwrap\fR \- programmatically generate package shrinkwrap file -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.shrinkwrap(args, [silent,] callback) -.fi -.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\. -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, -but the shrinkwrap file will still be written\. -.P -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 deleted file mode 100644 index 7629bc9ee48094..00000000000000 --- a/deps/npm/man/man3/npm-start.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "NPM\-START" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-start\fR \- Start a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.start(packages, callback) -.fi -.RE -.SH DESCRIPTION -.P -This runs a package's "start" script, if one was provided\. -.P -npm can start multiple packages\. Just specify multiple packages in the -\fBpackages\fP parameter\. - diff --git a/deps/npm/man/man3/npm-stop.3 b/deps/npm/man/man3/npm-stop.3 deleted file mode 100644 index 95f6e61542a34c..00000000000000 --- a/deps/npm/man/man3/npm-stop.3 +++ /dev/null @@ -1,17 +0,0 @@ -.TH "NPM\-STOP" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-stop\fR \- Stop a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.stop(packages, callback) -.fi -.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\fP parameter\. - diff --git a/deps/npm/man/man3/npm-tag.3 b/deps/npm/man/man3/npm-tag.3 deleted file mode 100644 index 643c57c9687663..00000000000000 --- a/deps/npm/man/man3/npm-tag.3 +++ /dev/null @@ -1,27 +0,0 @@ -.TH "NPM\-TAG" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-tag\fR \- Tag a published version -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.tag(package@version, tag, callback) -.fi -.RE -.SH DESCRIPTION -.P -Tags the specified version of the package with the specified tag, or the -\fB\-\-tag\fP config if not specified\. -.P -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 from the config will be -used\. For more information about how to set this config, check -\fBman 3 npm\-config\fP for programmatic usage or \fBman npm\-config\fP for cli usage\. - diff --git a/deps/npm/man/man3/npm-test.3 b/deps/npm/man/man3/npm-test.3 deleted file mode 100644 index 5434f91e74af9d..00000000000000 --- a/deps/npm/man/man3/npm-test.3 +++ /dev/null @@ -1,20 +0,0 @@ -.TH "NPM\-TEST" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-test\fR \- Test a package -.SH SYNOPSIS -.P -.RS 2 -.nf - npm\.commands\.test(packages, callback) -.fi -.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\fP config to -true\. -.P -npm can run tests on multiple packages\. Just specify multiple packages -in the \fBpackages\fP parameter\. - diff --git a/deps/npm/man/man3/npm-uninstall.3 b/deps/npm/man/man3/npm-uninstall.3 deleted file mode 100644 index 168df5f0eb9870..00000000000000 --- a/deps/npm/man/man3/npm-uninstall.3 +++ /dev/null @@ -1,20 +0,0 @@ -.TH "NPM\-UNINSTALL" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-uninstall\fR \- uninstall a package programmatically -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.uninstall(packages, callback) -.fi -.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 name of a package to be uninstalled\. -.P -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 deleted file mode 100644 index 1d10b121f3a8f0..00000000000000 --- a/deps/npm/man/man3/npm-unpublish.3 +++ /dev/null @@ -1,24 +0,0 @@ -.TH "NPM\-UNPUBLISH" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-unpublish\fR \- Remove a package from the registry -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.unpublish(package, callback) -.fi -.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 deleted file mode 100644 index 2f67a13b9aa69c..00000000000000 --- a/deps/npm/man/man3/npm-update.3 +++ /dev/null @@ -1,26 +0,0 @@ -.TH "NPM\-UPDATE" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-update\fR \- Update a package -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.update(packages, callback) -.fi -.RE -.TH "DESCRIPTION" "" "October 2015" "" "" -.SH "NAME" -\fBDESCRIPTION\fR -.P -Updates a package, upgrading it to the latest version\. It also installs any -missing packages\. -.P -The \fBpackages\fP argument is an array of packages to update\. The \fBcallback\fP -parameter will be called when done or when an error occurs\. -.SH SEE ALSO -.RS 0 -.IP \(bu 2 -npm help update - -.RE - diff --git a/deps/npm/man/man3/npm-version.3 b/deps/npm/man/man3/npm-version.3 deleted file mode 100644 index 32d8ce6c8adaaa..00000000000000 --- a/deps/npm/man/man3/npm-version.3 +++ /dev/null @@ -1,22 +0,0 @@ -.TH "NPM\-VERSION" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-version\fR \- Bump a package version -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.version(newversion, callback) -.fi -.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 deleted file mode 100644 index 45ece20c3a4026..00000000000000 --- a/deps/npm/man/man3/npm-view.3 +++ /dev/null @@ -1,131 +0,0 @@ -.TH "NPM\-VIEW" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-view\fR \- View registry info -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.view(args, [silent,] callback) -.fi -.RE -.SH DESCRIPTION -.P -This command shows data about a package and prints it to the stream -referenced by the \fBoutfd\fP 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\fP package, -you can do this: -.P -.RS 2 -.nf -npm\.commands\.view(["connect"], callback) -.fi -.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\fP package at version -0\.3\.5, you could do the following: -.P -.RS 2 -.nf -npm\.commands\.view(["ronn@0\.3\.5", "dependencies"], callback) -.fi -.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: -.P -.RS 2 -.nf -npm\.commands\.view(["npm", "repository\.url"], callback) -.fi -.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: -.P -.RS 2 -.nf -npm\.commands\.view(["express", "contributors\.email"], callback) -.fi -.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: -.P -.RS 2 -.nf -npm\.commands\.view(["express", "contributors[0]\.email"], callback) -.fi -.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: -.P -.RS 2 -.nf -npm\.commands\.view(["express", "contributors\.name", "contributors\.email"], callback) -.fi -.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\fP for more on this\.) -.P -.RS 2 -.nf -npm\.commands\.view(["npm", "contributors"], callback) -.fi -.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: -.P -.RS 2 -.nf -npm\.commands\.view(["yui3@>0\.5\.4", "dependencies\.jsdom"], callback) -.fi -.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 -.P -The data returned will be an object in this formation: -.P -.RS 2 -.nf -{ : - { : - , \.\.\. } -, \.\.\. } -.fi -.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 deleted file mode 100644 index a580afe2e517b0..00000000000000 --- a/deps/npm/man/man3/npm-whoami.3 +++ /dev/null @@ -1,19 +0,0 @@ -.TH "NPM\-WHOAMI" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm-whoami\fR \- Display npm username -.SH SYNOPSIS -.P -.RS 2 -.nf -npm\.commands\.whoami(args, callback) -.fi -.RE -.SH DESCRIPTION -.P -Print the \fBusername\fP config to standard output\. -.P -\|'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 deleted file mode 100644 index 1cbe624eebfbea..00000000000000 --- a/deps/npm/man/man3/npm.3 +++ /dev/null @@ -1,124 +0,0 @@ -.TH "NPM" "3" "October 2015" "" "" -.SH "NAME" -\fBnpm\fR \- javascript package manager -.SH SYNOPSIS -.P -.RS 2 -.nf -var npm = require("npm") -npm\.load([configObject, ]function (er, npm) { - // 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 -.RE -.SH VERSION -.P -2.14.7 -.SH DESCRIPTION -.P -This is the API documentation for npm\. -To find documentation of the command line -client, see npm help \fBnpm\fP\|\. -.P -Prior to using npm's commands, \fBnpm\.load()\fP must be called\. If you provide -\fBconfigObject\fP as an object map 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\fP, npm help 7 \fBnpm\-config\fP, and npm help 5 \fBnpmrc\fP for more information\. -.P -After that, each of the functions are accessible in the -commands object: \fBnpm\.commands\.\fP\|\. See npm help 7 \fBnpm\-index\fP 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 -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\fP -command\. -.SH METHODS AND PROPERTIES -.RS 0 -.IP \(bu 2 -\fBnpm\.load(configs, cb)\fP - Load the configuration params, and call the \fBcb\fP 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\fP - An object for accessing npm configuration parameters\. -.RS 0 -.IP \(bu 2 -\fBnpm\.config\.get(key)\fP -.IP \(bu 2 -\fBnpm\.config\.set(key, val)\fP -.IP \(bu 2 -\fBnpm\.config\.del(key)\fP - -.RE -.IP \(bu 2 -\fBnpm\.dir\fP or \fBnpm\.root\fP - The \fBnode_modules\fP directory where npm will operate\. -.IP \(bu 2 -\fBnpm\.prefix\fP - The prefix where npm is operating\. (Most often the current working - directory\.) -.IP \(bu 2 -\fBnpm\.cache\fP - The place where npm keeps JSON and tarballs it fetches from the - registry (or uploads to the registry)\. -.IP \(bu 2 -\fBnpm\.tmp\fP - npm's temporary working directory\. -.IP \(bu 2 -\fBnpm\.deref\fP - 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\fP object, 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: -.P -.RS 2 -.nf -> npm = require("npm") -> npm\.load() // wait a sec\.\.\. -> npm\.install("dnode", "express") -.fi -.RE -.P -Note that that \fIwon't\fR work in a node program, since the \fBinstall\fP -method will get called before the configuration load is completed\. -.SH ABBREVS -.P -In order to support \fBnpm ins foo\fP instead of \fBnpm install foo\fP, the -\fBnpm\.commands\fP object has a set of abbreviations as well as the full -method names\. Use the \fBnpm\.deref\fP method to find the real name\. -.P -For example: -.P -.RS 2 -.nf -var cmd = npm\.deref("unp") // cmd === "unpublish" -.fi -.RE - diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5 index bdc08bb2db50f9..e52857ec548c45 100644 --- a/deps/npm/man/man5/npm-folders.5 +++ b/deps/npm/man/man5/npm-folders.5 @@ -1,4 +1,4 @@ -.TH "NPM\-FOLDERS" "5" "October 2015" "" "" +.TH "NPM\-FOLDERS" "5" "November 2015" "" "" .SH "NAME" \fBnpm-folders\fR \- Folder Structures Used by npm .SH DESCRIPTION diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5 index bdc08bb2db50f9..e52857ec548c45 100644 --- a/deps/npm/man/man5/npm-global.5 +++ b/deps/npm/man/man5/npm-global.5 @@ -1,4 +1,4 @@ -.TH "NPM\-FOLDERS" "5" "October 2015" "" "" +.TH "NPM\-FOLDERS" "5" "November 2015" "" "" .SH "NAME" \fBnpm-folders\fR \- Folder Structures Used by npm .SH DESCRIPTION diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5 index c41943c22da223..ed8bd82a9fdba8 100644 --- a/deps/npm/man/man5/npm-json.5 +++ b/deps/npm/man/man5/npm-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "October 2015" "" "" +.TH "PACKAGE\.JSON" "5" "November 2015" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION @@ -574,8 +574,8 @@ included\. For example: .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 saved using \fBnpm install \-\-save\fP, using any of -these forms: +package\. Local paths can be saved using \fBnpm install \-S\fP or +\fBnpm install \-\-save\fP, using any of these forms: .P .RS 2 .nf @@ -758,17 +758,10 @@ Note that, unless the user has set the \fBengine\-strict\fP config flag, this field is advisory only\. .SH engineStrict .P -\fBNOTE: This feature is deprecated and will be removed in npm 3\.0\.0\.\fR +\fBThis feature was deprecated with npm 3\.0\.0\fR .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\fP object, -then you can set \fB"engineStrict": true\fP in your package\.json file\. -This will override the user's \fBengine\-strict\fP config setting\. -.P -Please do not do this unless you are really very very sure\. If your -engines object 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\. +Prior to npm 3\.0\.0, this feature was used to treat this package as if the +user had set \fBengine\-strict\fP\|\. .SH os .P You can specify which operating systems your diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index 3c00980f3ac3a8..ed6ee372d33622 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "October 2015" "" "" +.TH "NPMRC" "5" "November 2015" "" "" .SH "NAME" \fBnpmrc\fR \- The npm config files .SH DESCRIPTION diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5 index c41943c22da223..ed8bd82a9fdba8 100644 --- a/deps/npm/man/man5/package.json.5 +++ b/deps/npm/man/man5/package.json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "October 2015" "" "" +.TH "PACKAGE\.JSON" "5" "November 2015" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION @@ -574,8 +574,8 @@ included\. For example: .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 saved using \fBnpm install \-\-save\fP, using any of -these forms: +package\. Local paths can be saved using \fBnpm install \-S\fP or +\fBnpm install \-\-save\fP, using any of these forms: .P .RS 2 .nf @@ -758,17 +758,10 @@ Note that, unless the user has set the \fBengine\-strict\fP config flag, this field is advisory only\. .SH engineStrict .P -\fBNOTE: This feature is deprecated and will be removed in npm 3\.0\.0\.\fR +\fBThis feature was deprecated with npm 3\.0\.0\fR .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\fP object, -then you can set \fB"engineStrict": true\fP in your package\.json file\. -This will override the user's \fBengine\-strict\fP config setting\. -.P -Please do not do this unless you are really very very sure\. If your -engines object 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\. +Prior to npm 3\.0\.0, this feature was used to treat this package as if the +user had set \fBengine\-strict\fP\|\. .SH os .P You can specify which operating systems your diff --git a/deps/npm/man/man7/npm-coding-style.7 b/deps/npm/man/man7/npm-coding-style.7 index afed87ce6ba4ca..839806a670a4e8 100644 --- a/deps/npm/man/man7/npm-coding-style.7 +++ b/deps/npm/man/man7/npm-coding-style.7 @@ -1,4 +1,4 @@ -.TH "NPM\-CODING\-STYLE" "7" "October 2015" "" "" +.TH "NPM\-CODING\-STYLE" "7" "November 2015" "" "" .SH "NAME" \fBnpm-coding-style\fR \- npm's "funny" coding style .SH DESCRIPTION @@ -76,7 +76,7 @@ Don't use them except in four situations: null loops like: \fBwhile (something) ;\fP (But you'd better have a good reason for doing that\.) .IP \(bu 2 -\fBcase "foo": doSomething(); break\fP +\fBcase 'foo': doSomething(); break\fP .IP \(bu 2 In front of a leading \fB(\fP or \fB[\fP at the start of the line\. This prevents the expression from being interpreted @@ -92,9 +92,9 @@ Some examples of good semicolon usage: ;[a, b, c]\.forEach(doSomething) for (var i = 0; i < 10; i ++) { switch (state) { - case "begin": start(); continue - case "end": finish(); break - default: throw new Error("unknown state") + case 'begin': start(); continue + case 'end': finish(); break + default: throw new Error('unknown state') } end() } @@ -112,19 +112,39 @@ final token in the list on a line by itself\. For example: .P .RS 2 .nf -var magicWords = [ "abracadabra" - , "gesundheit" - , "ventrilo" +var magicWords = [ 'abracadabra' + , 'gesundheit' + , 'ventrilo' ] - , spells = { "fireball" : function () { setOnFire() } - , "water" : function () { putOut() } + , spells = { 'fireball' : function () { setOnFire() } + , 'water' : function () { putOut() } } , a = 1 - , b = "abc" + , b = 'abc' , etc , somethingElse .fi .RE +.SH Quotes +.P +Use single quotes for strings except to avoid escaping\. +.P +Bad: +.P +.RS 2 +.nf +var notOk = "Just double quotes" +.fi +.RE +.P +Good: +.P +.RS 2 +.nf +var ok = 'String contains "double" quotes' +var alsoOk = "String contains 'single' quotes or apostrophe" +.fi +.RE .SH Whitespace .P Put a single space in front of ( for anything other than a function call\. diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7 index 6fa530413b75d1..c0d3b2c1373b61 100644 --- a/deps/npm/man/man7/npm-config.7 +++ b/deps/npm/man/man7/npm-config.7 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "7" "October 2015" "" "" +.TH "NPM\-CONFIG" "7" "November 2015" "" "" .SH "NAME" \fBnpm-config\fR \- More than you probably want to know about npm configuration .SH DESCRIPTION @@ -28,7 +28,7 @@ per\-project config file (/path/to/my/project/\.npmrc) .IP \(bu 2 per\-user config file (~/\.npmrc) .IP \(bu 2 -global config file ($PREFIX/npmrc) +global config file ($PREFIX/etc/npmrc) .IP \(bu 2 npm builtin config file (/path/to/npm/npmrc) @@ -37,8 +37,8 @@ npm builtin config file (/path/to/npm/npmrc) See npm help 5 npmrc for more details\. .SS Default Configs .P -A set of configuration parameters that are internal to npm, and are -defaults if nothing else is specified\. +Run \fBnpm config ls \-l\fP to see a set of configuration parameters that are +internal to npm, and are defaults if nothing else is specified\. .SH Shorthands and Other CLI Niceties .P The following shorthands are parsed on the command\-line: @@ -173,6 +173,17 @@ Type: Boolean .P Force npm to always require authentication when accessing the registry, even for \fBGET\fP requests\. +.SS also +.RS 0 +.IP \(bu 2 +Default: null +.IP \(bu 2 +Type: String + +.RE +.P +When "dev" or "development" and running local \fBnpm shrinkwrap\fP, +\fBnpm outdated\fP, or \fBnpm update\fP, is an alias for \fB\-\-dev\fP\|\. .SS bin\-links .RS 0 .IP \(bu 2 @@ -370,6 +381,20 @@ Install \fBdev\-dependencies\fP along with packages\. .P Note that \fBdev\-dependencies\fP are also installed if the \fBnpat\fP flag is set\. +.SS dry\-run +.RS 0 +.IP \(bu 2 +Default: false +.IP \(bu 2 +Type: Boolean + +.RE +.P +Indicates that you don't want npm to make any changes and that it should +only report what it would have done\. This can be passed into any of the +commands that modify your local installation, eg, \fBinstall\fP, \fBupdate\fP, +\fBdedupe\fP, \fBuninstall\fP\|\. This is NOT currently honored by network related +commands, eg \fBdist\-tags\fP, \fBowner\fP, \fBpublish\fP, etc\. .SS editor .RS 0 .IP \(bu 2 @@ -778,6 +803,27 @@ Type: path .P A node module to \fBrequire()\fP when npm loads\. Useful for programmatic usage\. +.SS only +.RS 0 +.IP \(bu 2 +Default: null +.IP \(bu 2 +Type: String + +.RE +.P +When "dev" or "development" and running local \fBnpm install\fP without any +arguments, only devDependencies (and their dependencies) are installed\. +.P +When "dev" or "development" and running local \fBnpm ls\fP, \fBnpm outdated\fP, or +\fBnpm update\fP, is an alias for \fB\-\-dev\fP\|\. +.P +When "prod" or "production" and running local \fBnpm install\fP without any +arguments, only non\-devDependencies (and their dependencies) are +installed\. +.P +When "prod" or "production" and running local \fBnpm ls\fP, \fBnpm outdated\fP, or +\fBnpm update\fP, is an alias for \fB\-\-production\fP\|\. .SS optional .RS 0 .IP \(bu 2 @@ -830,6 +876,19 @@ local \fBnpm install\fP without any arguments\. Set the NODE_ENV="production" for lifecycle scripts\. .RE +.SS progress +.RS 0 +.IP \(bu 2 +Default: true +.IP \(bu 2 +Type: Boolean + +.RE +.P +When set to \fBtrue\fP, npm will display a progress bar during time intensive +operations, if \fBprocess\.stderr\fP is a TTY\. +.P +Set to \fBfalse\fP to suppress the progress bar\. .SS proprietary\-attribs .RS 0 .IP \(bu 2 @@ -1060,20 +1119,6 @@ using \fB\-s\fP 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 -.RS 0 -.IP \(bu 2 -Default: true -.IP \(bu 2 -Type: Boolean or \fB"always"\fP - -.RE -.P -When set to \fBtrue\fP, npm will display an ascii spinner while it is doing -things, if \fBprocess\.stderr\fP is a TTY\. -.P -Set to \fBfalse\fP to suppress the spinner, or set to \fBalways\fP to output -the spinner even for non\-TTY outputs\. .SS strict\-ssl .RS 0 .IP \(bu 2 @@ -1131,7 +1176,7 @@ on success, but left behind on failure for forensic purposes\. .SS unicode .RS 0 .IP \(bu 2 -Default: true +Default: true on windows and mac/unix systems with a unicode locale .IP \(bu 2 Type: Boolean diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7 index 80c6e6e8aba370..703fac404cad66 100644 --- a/deps/npm/man/man7/npm-developers.7 +++ b/deps/npm/man/man7/npm-developers.7 @@ -1,4 +1,4 @@ -.TH "NPM\-DEVELOPERS" "7" "October 2015" "" "" +.TH "NPM\-DEVELOPERS" "7" "November 2015" "" "" .SH "NAME" \fBnpm-developers\fR \- Developer Guide .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-disputes.7 b/deps/npm/man/man7/npm-disputes.7 index 6deead895a42de..ae17206bcc6d12 100644 --- a/deps/npm/man/man7/npm-disputes.7 +++ b/deps/npm/man/man7/npm-disputes.7 @@ -1,4 +1,4 @@ -.TH "NPM\-DISPUTES" "7" "October 2015" "" "" +.TH "NPM\-DISPUTES" "7" "November 2015" "" "" .SH "NAME" \fBnpm-disputes\fR \- Handling Module Name Disputes .SH SYNOPSIS diff --git a/deps/npm/man/man7/npm-faq.7 b/deps/npm/man/man7/npm-faq.7 index ba392cd67e854c..98f7f0ac04517b 100644 --- a/deps/npm/man/man7/npm-faq.7 +++ b/deps/npm/man/man7/npm-faq.7 @@ -1,4 +1,4 @@ -.TH "NPM\-FAQ" "7" "October 2015" "" "" +.TH "NPM\-FAQ" "7" "November 2015" "" "" .SH "NAME" \fBnpm-faq\fR \- Frequently Asked Questions .SH Where can I find these docs in HTML? @@ -11,16 +11,17 @@ npm config set viewer browser .fi .RE .P -to open these documents in your default web browser rather than \fBman\fP\|\. +This command will set the npm docs to open in your default web browser rather than \fBman\fP\|\. .SH It didn't work\. .P -That's not really a question\. +Please provide a little more detail, search for the error via Google \fIhttps://google\.com\fR or StackOverflow npm \fIhttp://stackoverflow\.com/search?q=npm\fR to see if another developer has encountered a similar problem\. .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\. +Try reading the error output first, ensure this is a true npm issue and not a package issue\. If you are having an issue with a package dependency, please submit your error to that particular package maintainer\. +.P +For any npm issues, try following the instructions, or even retracing your steps\. If the issue continues to persist, submit a bug with the steps to reproduce, please include the operating system you are working on, along with the error you recieve\. .SH Where does npm put stuff? .P See npm help 5 \fBnpm\-folders\fP @@ -31,7 +32,7 @@ tl;dr: Use the \fBnpm root\fP command to see where modules go, and the \fBnpm bin\fP command to see where executables go .IP \(bu 2 -Global installs are different from local installs\. If you install +Global installs are different from local installs\. If you install something with the \fB\-g\fP flag, then its executables go in \fBnpm bin \-g\fP and its modules go in \fBnpm root \-g\fP\|\. diff --git a/deps/npm/man/man7/npm-index.7 b/deps/npm/man/man7/npm-index.7 index 4ab8ccd28afe77..c147e713235609 100644 --- a/deps/npm/man/man7/npm-index.7 +++ b/deps/npm/man/man7/npm-index.7 @@ -1,4 +1,4 @@ -.TH "NPM\-INDEX" "7" "October 2015" "" "" +.TH "NPM\-INDEX" "7" "November 2015" "" "" .SH "NAME" \fBnpm-index\fR \- Index of all npm documentation .SS npm help README @@ -106,9 +106,6 @@ Open package repository page in the browser .SS npm help restart .P Restart a package -.SS npm help rm -.P -Remove a package .SS npm help root .P Display npm root @@ -163,126 +160,6 @@ Display npm username .SH API Documentation .P Using npm in your Node programs -.SS npm apihelp npm -.P -javascript package manager -.SS npm apihelp bin -.P -Display npm bin folder -.SS npm apihelp bugs -.P -Bugs for a package in a web browser maybe -.SS npm apihelp cache -.P -manage the npm cache programmatically -.SS npm apihelp commands -.P -npm commands -.SS npm apihelp config -.P -Manage the npm configuration files -.SS npm apihelp deprecate -.P -Deprecate a version of a package -.SS npm apihelp docs -.P -Docs for a package in a web browser maybe -.SS npm apihelp edit -.P -Edit an installed package -.SS npm apihelp explore -.P -Browse an installed package -.SS npm apihelp help\-search -.P -Search the help pages -.SS npm apihelp init -.P -Interactively create a package\.json file -.SS npm apihelp install -.P -install a package programmatically -.SS npm apihelp link -.P -Symlink a package folder -.SS npm apihelp load -.P -Load config settings -.SS npm apihelp ls -.P -List installed packages -.SS npm apihelp outdated -.P -Check for outdated packages -.SS npm apihelp owner -.P -Manage package owners -.SS npm apihelp pack -.P -Create a tarball from a package -.SS npm apihelp ping -.P -Ping npm registry -.SS npm apihelp prefix -.P -Display prefix -.SS npm apihelp prune -.P -Remove extraneous packages -.SS npm apihelp publish -.P -Publish a package -.SS npm apihelp rebuild -.P -Rebuild a package -.SS npm apihelp repo -.P -Open package repository page in the browser -.SS npm apihelp restart -.P -Restart a package -.SS npm apihelp root -.P -Display npm root -.SS npm apihelp run\-script -.P -Run arbitrary package scripts -.SS npm apihelp search -.P -Search for packages -.SS npm apihelp shrinkwrap -.P -programmatically generate package shrinkwrap file -.SS npm apihelp start -.P -Start a package -.SS npm apihelp stop -.P -Stop a package -.SS npm apihelp tag -.P -Tag a published version -.SS npm apihelp test -.P -Test a package -.SS npm apihelp uninstall -.P -uninstall a package programmatically -.SS npm apihelp unpublish -.P -Remove a package from the registry -.SS npm apihelp update -.P -Update a package -.SS npm apihelp version -.P -Bump a package version -.SS npm apihelp view -.P -View registry info -.SS npm apihelp whoami -.P -Display npm username .SH Files .P File system structures npm uses diff --git a/deps/npm/man/man7/npm-orgs.7 b/deps/npm/man/man7/npm-orgs.7 index 1167bcdbed97d3..503a6f35b00753 100644 --- a/deps/npm/man/man7/npm-orgs.7 +++ b/deps/npm/man/man7/npm-orgs.7 @@ -1,4 +1,4 @@ -.TH "NPM\-ORGS" "7" "October 2015" "" "" +.TH "NPM\-ORGS" "7" "November 2015" "" "" .SH "NAME" \fBnpm-orgs\fR \- Working with Teams & Orgs .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-registry.7 b/deps/npm/man/man7/npm-registry.7 index 5cfd79c4a7b6de..3013d956234c77 100644 --- a/deps/npm/man/man7/npm-registry.7 +++ b/deps/npm/man/man7/npm-registry.7 @@ -1,4 +1,4 @@ -.TH "NPM\-REGISTRY" "7" "October 2015" "" "" +.TH "NPM\-REGISTRY" "7" "November 2015" "" "" .SH "NAME" \fBnpm-registry\fR \- The JavaScript Package Registry .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-scope.7 b/deps/npm/man/man7/npm-scope.7 index 2a166acdbacf49..deadca7ba3a212 100644 --- a/deps/npm/man/man7/npm-scope.7 +++ b/deps/npm/man/man7/npm-scope.7 @@ -1,4 +1,4 @@ -.TH "NPM\-SCOPE" "7" "October 2015" "" "" +.TH "NPM\-SCOPE" "7" "November 2015" "" "" .SH "NAME" \fBnpm-scope\fR \- Scoped packages .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-scripts.7 b/deps/npm/man/man7/npm-scripts.7 index 20ca80b0e2fa54..a2fe4b952d08d0 100644 --- a/deps/npm/man/man7/npm-scripts.7 +++ b/deps/npm/man/man7/npm-scripts.7 @@ -1,4 +1,4 @@ -.TH "NPM\-SCRIPTS" "7" "October 2015" "" "" +.TH "NPM\-SCRIPTS" "7" "November 2015" "" "" .SH "NAME" \fBnpm-scripts\fR \- How npm handles the "scripts" field .SH DESCRIPTION @@ -92,7 +92,7 @@ If there is a \fBserver\.js\fP file in the root of your package, then npm will default the \fBstart\fP command to \fBnode server\.js\fP\|\. .IP \(bu 2 \fB"install": "node\-gyp rebuild"\fP: -If there is a \fBbindings\.gyp\fP file in the root of your package, npm will +If there is a \fBbinding\.gyp\fP file in the root of your package, npm will default the \fBinstall\fP command to compile using node\-gyp\. .RE diff --git a/deps/npm/man/man7/removing-npm.7 b/deps/npm/man/man7/removing-npm.7 index f0324607cf2f84..e26cab123819cd 100644 --- a/deps/npm/man/man7/removing-npm.7 +++ b/deps/npm/man/man7/removing-npm.7 @@ -1,4 +1,4 @@ -.TH "NPM\-REMOVAL" "1" "October 2015" "" "" +.TH "NPM\-REMOVAL" "1" "November 2015" "" "" .SH "NAME" \fBnpm-removal\fR \- Cleaning the Slate .SH SYNOPSIS diff --git a/deps/npm/man/man7/semver.7 b/deps/npm/man/man7/semver.7 index db93d201df8c07..be2e6f0779c60e 100644 --- a/deps/npm/man/man7/semver.7 +++ b/deps/npm/man/man7/semver.7 @@ -1,4 +1,4 @@ -.TH "SEMVER" "7" "October 2015" "" "" +.TH "SEMVER" "7" "November 2015" "" "" .SH "NAME" \fBsemver\fR \- The semantic versioner for npm .SH Usage diff --git a/deps/npm/node_modules/abbrev/package.json b/deps/npm/node_modules/abbrev/package.json index 9b71f630b71ae1..d3e3a661edcd3c 100644 --- a/deps/npm/node_modules/abbrev/package.json +++ b/deps/npm/node_modules/abbrev/package.json @@ -18,30 +18,14 @@ "devDependencies": { "tap": "^1.2.0" }, - "gitHead": "821d09ce7da33627f91bbd8ed631497ed6f760c2", + "readme": "# abbrev-js\n\nJust like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).\n\nUsage:\n\n var abbrev = require(\"abbrev\");\n abbrev(\"foo\", \"fool\", \"folding\", \"flop\");\n \n // returns:\n { fl: 'flop'\n , flo: 'flop'\n , flop: 'flop'\n , fol: 'folding'\n , fold: 'folding'\n , foldi: 'folding'\n , foldin: 'folding'\n , folding: 'folding'\n , foo: 'foo'\n , fool: 'fool'\n }\n\nThis is handy for command-line scripts, or other cases where you want to be able to accept shorthands.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/abbrev-js/issues" }, "homepage": "https://github.com/isaacs/abbrev-js#readme", "_id": "abbrev@1.0.7", "_shasum": "5b6035b2ee9d4fb5cf859f08a9be81b208491843", - "_from": "abbrev@>=1.0.7 <1.1.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "5b6035b2ee9d4fb5cf859f08a9be81b208491843", - "tarball": "http://registry.npmjs.org/abbrev/-/abbrev-1.0.7.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.7.tgz" + "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.7.tgz", + "_from": "abbrev@>=1.0.7 <1.1.0" } diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js b/deps/npm/node_modules/ansi-regex/index.js similarity index 100% rename from deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js rename to deps/npm/node_modules/ansi-regex/index.js diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/license b/deps/npm/node_modules/ansi-regex/license similarity index 100% rename from deps/npm/node_modules/columnify/node_modules/strip-ansi/license rename to deps/npm/node_modules/ansi-regex/license diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/deps/npm/node_modules/ansi-regex/package.json similarity index 55% rename from deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json rename to deps/npm/node_modules/ansi-regex/package.json index 7fc07677a044ac..36b92255d4d2c5 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/package.json +++ b/deps/npm/node_modules/ansi-regex/package.json @@ -14,12 +14,14 @@ }, "maintainers": [ { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" }, { - "name": "jbnicolai", - "email": "jappelman@xebia.com" + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" } ], "engines": { @@ -62,25 +64,14 @@ "devDependencies": { "mocha": "*" }, - "gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f", + "readme": "# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex)\n\n> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\n## Install\n\n```\n$ npm install --save ansi-regex\n```\n\n\n## Usage\n\n```js\nvar ansiRegex = require('ansi-regex');\n\nansiRegex().test('\\u001b[4mcake\\u001b[0m');\n//=> true\n\nansiRegex().test('cake');\n//=> false\n\n'\\u001b[4mcake\\u001b[0m'.match(ansiRegex());\n//=> ['\\u001b[4m', '\\u001b[0m']\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", "bugs": { "url": "https://github.com/sindresorhus/ansi-regex/issues" }, - "homepage": "https://github.com/sindresorhus/ansi-regex", + "homepage": "https://github.com/sindresorhus/ansi-regex#readme", "_id": "ansi-regex@2.0.0", "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", - "_from": "ansi-regex@>=2.0.0 <3.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", - "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", - "readme": "ERROR: No README data found!" + "_from": "ansi-regex@2.0.0" } diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/readme.md b/deps/npm/node_modules/ansi-regex/readme.md similarity index 100% rename from deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/readme.md rename to deps/npm/node_modules/ansi-regex/readme.md diff --git a/deps/npm/node_modules/ansi/.jshintrc b/deps/npm/node_modules/ansi/.jshintrc deleted file mode 100644 index 248c5426ea63dc..00000000000000 --- a/deps/npm/node_modules/ansi/.jshintrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "laxcomma": true, - "asi": true -} diff --git a/deps/npm/node_modules/ansicolors/package.json b/deps/npm/node_modules/ansicolors/package.json index bca06da296aa24..6eef1fd18e95d4 100644 --- a/deps/npm/node_modules/ansicolors/package.json +++ b/deps/npm/node_modules/ansicolors/package.json @@ -28,7 +28,24 @@ "bugs": { "url": "https://github.com/thlorenz/ansicolors/issues" }, - "homepage": "https://github.com/thlorenz/ansicolors", "_id": "ansicolors@0.3.2", - "_from": "ansicolors@latest" + "dist": { + "shasum": "665597de86a9ffe3aa9bfbe6cae5c6ea426b4979", + "tarball": "http://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz" + }, + "_from": "ansicolors@>=0.3.2 <0.4.0", + "_npmVersion": "1.3.11", + "_npmUser": { + "name": "thlorenz", + "email": "thlorenz@gmx.de" + }, + "maintainers": [ + { + "name": "thlorenz", + "email": "thlorenz@gmx.de" + } + ], + "directories": {}, + "_shasum": "665597de86a9ffe3aa9bfbe6cae5c6ea426b4979", + "_resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz" } diff --git a/deps/npm/node_modules/ansistyles/package.json b/deps/npm/node_modules/ansistyles/package.json index dec9cd9e69a832..12ddf0d45ec56d 100644 --- a/deps/npm/node_modules/ansistyles/package.json +++ b/deps/npm/node_modules/ansistyles/package.json @@ -28,11 +28,24 @@ "bugs": { "url": "https://github.com/thlorenz/ansistyles/issues" }, - "homepage": "https://github.com/thlorenz/ansistyles", "_id": "ansistyles@0.1.3", "dist": { - "shasum": "b14f315fe763a2b3a88df9d3261a517e666c4615" + "shasum": "5de60415bda071bb37127854c864f41b23254539", + "tarball": "http://registry.npmjs.org/ansistyles/-/ansistyles-0.1.3.tgz" }, - "_from": "ansistyles@0.1.3", + "_from": "ansistyles@>=0.1.3 <0.2.0", + "_npmVersion": "1.3.11", + "_npmUser": { + "name": "thlorenz", + "email": "thlorenz@gmx.de" + }, + "maintainers": [ + { + "name": "thlorenz", + "email": "thlorenz@gmx.de" + } + ], + "directories": {}, + "_shasum": "5de60415bda071bb37127854c864f41b23254539", "_resolved": "https://registry.npmjs.org/ansistyles/-/ansistyles-0.1.3.tgz" } diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/aproba/.npmignore similarity index 65% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/.npmignore rename to deps/npm/node_modules/aproba/.npmignore index 249bc20eb5573c..24001896d6d0c9 100644 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ b/deps/npm/node_modules/aproba/.npmignore @@ -1,2 +1,3 @@ +*~ node_modules -*.sw* +.#* diff --git a/deps/npm/node_modules/aproba/LICENSE b/deps/npm/node_modules/aproba/LICENSE new file mode 100644 index 00000000000000..2a4982dc40cb69 --- /dev/null +++ b/deps/npm/node_modules/aproba/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2015, Rebecca Turner + +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/aproba/README.md b/deps/npm/node_modules/aproba/README.md new file mode 100644 index 00000000000000..e5c1f5595b8e2a --- /dev/null +++ b/deps/npm/node_modules/aproba/README.md @@ -0,0 +1,54 @@ +aproba +====== + +A rediculously light-weight function argument validator + +``` +var validate = require("aproba") + +function myfunc(a, b, c) { + // `a` must be a string, `b` a number, `c` a function + validate('SNF', arguments) // [a,b,c] is also valid +} + +myfunc('test', 23, function () {}) // ok +myfunc(123, 23, function () {}) // type error +myfunc('test', 23) // missing arg error +myfunc('test', 23, function () {}, true) // too many args error + +``` + +Valid types are: + +type | description +---- | ----------- +* | matches any type +A | instanceof Array OR an arguments object +S | typeof == string +N | typeof == number +F | typeof == function +O | typeof == object and not type A and not type E +B | typeof == boolean +E | instanceof Error OR null + +Validation failures throw one of three exception types, distinguished by a +`code` property of `EMISSINGARG`, `EINVALIDTYPE` or `ETOOMANYARGS`. + +If an error argument is found and is not null then the remaining arguments will not be validated. + +### Why this exists + +I wanted a very simple argument validator. It needed to do two things: + +1. Be more concise and easier to use than assertions + +2. Not encourage an infinite bikeshed of DSLs + +This is why types are specified by a single character and there's no such +thing as an optional argument. + +This is not intended to validate user data. This is specifically about +asserting the interface of your functions. + +If you need greater validation, I encourage you to write them by hand or +look elsewhere. diff --git a/deps/npm/node_modules/aproba/index.js b/deps/npm/node_modules/aproba/index.js new file mode 100644 index 00000000000000..7d8ff07f87a4c0 --- /dev/null +++ b/deps/npm/node_modules/aproba/index.js @@ -0,0 +1,53 @@ +"use strict" + +var types = { + "*": ["any", function () { return true }], + A: ["array", function (thingy) { return thingy instanceof Array || (typeof thingy === "object" && thingy.hasOwnProperty("callee")) }], + S: ["string", function (thingy) { return typeof thingy === "string" }], + N: ["number", function (thingy) { return typeof thingy === "number" }], + F: ["function", function (thingy) { return typeof thingy === "function" }], + O: ["object", function (thingy) { return typeof thingy === "object" && !types.A[1](thingy) && !types.E[1](thingy) }], + B: ["boolean", function (thingy) { return typeof thingy == "boolean" }], + E: ["error", function (thingy) { return thingy instanceof Error }] +} + +var validate = module.exports = function (schema, args) { + if (!schema) throw missingRequiredArg(0, "schema") + if (!args) throw missingRequiredArg(1, "args") + if (!types.S[1](schema)) throw invalidType(0, "string", schema) + if (!types.A[1](args)) throw invalidType(1, "array", args) + for (var ii = 0; ii < schema.length; ++ii) { + var type = schema[ii] + if (!types[type]) throw unknownType(ii, type) + var typeLabel = types[type][0] + var typeCheck = types[type][1] + if (type === "E" && args[ii] == null) continue + if (args[ii] == null) throw missingRequiredArg(ii) + if (!typeCheck(args[ii])) throw invalidType(ii, typeLabel, args[ii]) + if (type === "E") return + } + if (schema.length < args.length) throw tooManyArgs(schema.length, args.length) +} + +function missingRequiredArg(num) { + return newException("EMISSINGARG", "Missing required argument #"+(num+1)) +} + +function unknownType(num, type) { + return newException("EUNKNOWNTYPE", "Unknown type "+type+" in argument #"+(num+1)) +} + +function invalidType(num, type, value) { + return newException("EINVALIDTYPE", "Argument #"+(num+1)+": Expected "+type+" but got "+typeof value) +} + +function tooManyArgs(expected, got) { + return newException("ETOOMANYARGS", "Too many arguments, expected "+expected+" and got "+got) +} + +function newException(code, msg) { + var e = new Error(msg) + e.code = code + Error.captureStackTrace(e, validate) + return e +} diff --git a/deps/npm/node_modules/aproba/package.json b/deps/npm/node_modules/aproba/package.json new file mode 100644 index 00000000000000..b41acdf973396c --- /dev/null +++ b/deps/npm/node_modules/aproba/package.json @@ -0,0 +1,54 @@ +{ + "name": "aproba", + "version": "1.0.1", + "description": "A rediculously light-weight argument validator", + "main": "index.js", + "directories": { + "test": "test" + }, + "dependencies": {}, + "devDependencies": { + "tap": "^0.7.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/iarna/aproba" + }, + "keywords": [ + "argument", + "validate" + ], + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/iarna/aproba/issues" + }, + "homepage": "https://github.com/iarna/aproba", + "gitHead": "a2ea029793a14cddb9457afd0a83dc421889c7ad", + "_id": "aproba@1.0.1", + "_shasum": "c4ac2cc5becfb8b099de7ef9f02790e7d32d99ef", + "_from": "aproba@>=1.0.1 <1.1.0", + "_npmVersion": "2.7.5", + "_nodeVersion": "1.6.2", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "dist": { + "shasum": "c4ac2cc5becfb8b099de7ef9f02790e7d32d99ef", + "tarball": "http://registry.npmjs.org/aproba/-/aproba-1.0.1.tgz" + }, + "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.0.1.tgz" +} diff --git a/deps/npm/node_modules/aproba/test/index.js b/deps/npm/node_modules/aproba/test/index.js new file mode 100644 index 00000000000000..0574709c8f5d7d --- /dev/null +++ b/deps/npm/node_modules/aproba/test/index.js @@ -0,0 +1,85 @@ +"use strict" +var test = require("tap").test +var validate = require("../index.js") + +function thrown (t, code, msg, todo) { + validate("OSSF", arguments) + try { + todo() + t.fail(msg) + } + catch (e) { + t.is(e.code, code, msg + e.message) + } +} + +function notThrown (t, msg, todo) { + validate("OSF", arguments) + try { + todo() + t.pass(msg) + } + catch (e) { + t.fail(msg+"\n"+e.stack) + } +} + +test("general", function (t) { + t.plan(69) + var values = { + "A": [], + "S": "test", + "N": 123, + "F": function () {}, + "O": {}, + "B": false, + "E": new Error() + } + Object.keys(values).forEach(function (type) { + Object.keys(values).forEach(function (contraType) { + if (type === contraType) { + notThrown(t, type + " matches " + contraType, function () { + validate(type, [values[contraType]]) + }) + } + else { + thrown(t, "EINVALIDTYPE", type + " does not match " + contraType, function () { + validate(type, [values[contraType]]) + }) + } + }) + if (type === "E") { + notThrown(t, "null is ok for E", function () { + validate(type, [null]) + }) + } + else { + thrown(t, "EMISSINGARG", "null not ok for "+type, function () { + validate(type, [null]) + }) + } + }) + Object.keys(values).forEach(function (contraType) { + notThrown(t, "* matches " + contraType, function () { + validate("*", [values[contraType]]) + }) + }) + thrown(t, "EMISSINGARG", "not enough args", function () { + validate("SNF", ["abc", 123]) + }) + thrown(t, "ETOOMANYARGS", "too many args", function () { + validate("SNF", ["abc", 123, function () {}, true]) + }) + notThrown(t, "E matches null", function () { + validate("E", [null]) + }) + notThrown(t, "E matches undefined", function () { + validate("E", [undefined]) + }) + notThrown(t, "E w/ error requires nothing else", function () { + validate("ESN", [new Error(), "foo"]) + }) + thrown(t, "EMISSINGARG", "E w/o error works as usual", function () { + validate("ESN", [null, "foo"]) + }) +}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml b/deps/npm/node_modules/archy/.travis.yml similarity index 62% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml rename to deps/npm/node_modules/archy/.travis.yml index 6e5919de39a312..895dbd36234210 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.travis.yml +++ b/deps/npm/node_modules/archy/.travis.yml @@ -1,3 +1,4 @@ language: node_js node_js: - - "0.10" + - 0.6 + - 0.8 diff --git a/deps/npm/node_modules/archy/package.json b/deps/npm/node_modules/archy/package.json index 4b3da6637268ca..d49bc87768d96b 100644 --- a/deps/npm/node_modules/archy/package.json +++ b/deps/npm/node_modules/archy/package.json @@ -36,7 +36,7 @@ }, "repository": { "type": "git", - "url": "http://github.com/substack/node-archy.git" + "url": "git+ssh://git@github.com/substack/node-archy.git" }, "keywords": [ "hierarchy", @@ -58,7 +58,7 @@ "homepage": "https://github.com/substack/node-archy", "_id": "archy@1.0.0", "_shasum": "f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40", - "_from": "archy@>=1.0.0 <2.0.0", + "_from": "archy@>=1.0.0 <1.1.0", "_npmVersion": "1.4.25", "_npmUser": { "name": "substack", @@ -75,5 +75,6 @@ "tarball": "http://registry.npmjs.org/archy/-/archy-1.0.0.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz" + "_resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/char-spinner/README.md b/deps/npm/node_modules/char-spinner/README.md deleted file mode 100644 index b1290f5925b7d0..00000000000000 --- a/deps/npm/node_modules/char-spinner/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# char-spinner - -Put a little spinner on process.stderr, as unobtrusively as possible. - -## USAGE - -```javascript -var spinner = require("char-spinner") - -// All options are optional -// even the options argument itself is optional -spinner(options) -``` - -## OPTIONS - -Usually the defaults are what you want. Mostly they're just -configurable for testing purposes. - -* `stream` Output stream. Default=`process.stderr` -* `tty` Only show spinner if output stream has a truish `.isTTY`. Default=`true` -* `string` String of chars to spin. Default=`'/-\\|'` -* `interval` Number of ms between frames, bigger = slower. Default=`50` -* `cleanup` Print `'\r \r'` to stream on process exit. Default=`true` -* `unref` Unreference the spinner interval so that the process can - exit normally. Default=`true` -* `delay` Number of frames to "skip over" before printing the spinner. - Useful if you want to avoid showing the spinner for very fast - actions. Default=`2` - -Returns the generated interval, if one was created. diff --git a/deps/npm/node_modules/char-spinner/package.json b/deps/npm/node_modules/char-spinner/package.json deleted file mode 100644 index 91092d84bb4089..00000000000000 --- a/deps/npm/node_modules/char-spinner/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "char-spinner", - "version": "1.0.1", - "description": "Put a little spinner on process.stderr, as unobtrusively as possible.", - "main": "spin.js", - "directories": { - "test": "test" - }, - "dependencies": {}, - "devDependencies": { - "tap": "^0.4.10" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/char-spinner" - }, - "keywords": [ - "char", - "spinner" - ], - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "ISC", - "bugs": { - "url": "https://github.com/isaacs/char-spinner/issues" - }, - "homepage": "https://github.com/isaacs/char-spinner", - "gitHead": "091b2ff5960aa083f68a5619fa93999d072aa152", - "_id": "char-spinner@1.0.1", - "_shasum": "e6ea67bd247e107112983b7ab0479ed362800081", - "_from": "char-spinner@latest", - "_npmVersion": "1.4.13", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "e6ea67bd247e107112983b7ab0479ed362800081", - "tarball": "http://registry.npmjs.org/char-spinner/-/char-spinner-1.0.1.tgz" - }, - "_resolved": "https://registry.npmjs.org/char-spinner/-/char-spinner-1.0.1.tgz" -} diff --git a/deps/npm/node_modules/char-spinner/spin.js b/deps/npm/node_modules/char-spinner/spin.js deleted file mode 100644 index cae8540c6fa649..00000000000000 --- a/deps/npm/node_modules/char-spinner/spin.js +++ /dev/null @@ -1,51 +0,0 @@ -module.exports = spinner - -function spinner(opt) { - opt = opt || {} - var str = opt.stream || process.stderr - var tty = typeof opt.tty === 'boolean' ? opt.tty : true - var string = opt.string || '/-\\|' - var ms = typeof opt.interval === 'number' ? opt.interval : 50 - if (ms < 0) ms = 0 - if (tty && !str.isTTY) return false - var CR = str.isTTY ? '\u001b[0G' : '\u000d'; - var CLEAR = str.isTTY ? '\u001b[2K' : '\u000d \u000d'; - - var s = 0 - var sprite = string.split('') - var wrote = false - - var delay = typeof opt.delay === 'number' ? opt.delay : 2 - - var interval = setInterval(function() { - if (--delay >= 0) return - s = ++s % sprite.length - var c = sprite[s] - str.write(c + CR) - wrote = true - }, ms) - - var unref = typeof opt.unref === 'boolean' ? opt.unref : true - if (unref && typeof interval.unref === 'function') { - interval.unref() - } - - var cleanup = typeof opt.cleanup === 'boolean' ? opt.cleanup : true - if (cleanup) { - process.on('exit', function() { - if (wrote) { - str.write(CLEAR); - } - }) - } - - module.exports.clear = function () { - str.write(CLEAR); - }; - - return interval -} - -module.exports.clear = function () {}; - - diff --git a/deps/npm/node_modules/char-spinner/test/basic.js b/deps/npm/node_modules/char-spinner/test/basic.js deleted file mode 100644 index ed91b984f70b20..00000000000000 --- a/deps/npm/node_modules/char-spinner/test/basic.js +++ /dev/null @@ -1,35 +0,0 @@ -var test = require('tap').test -var spinner = require('../spin.js') - -test('does nothing when not a tty', function(t) { - var int = spinner({ - stream: { write: function(c) { - throw new Error('wrote something: ' + JSON.stringify(c)) - }, isTTY: false }, - }) - t.notOk(int) - t.end() -}) - -test('write spinny stuff', function(t) { - var output = '' - var written = 0 - var expect = "b\u001b[0Gc\u001b[0Gd\u001b[0Ge\u001b[0Gf\u001b[0Gg\u001b[0Gh\u001b[0Gi\u001b[0Gj\u001b[0Gk\u001b[0Gl\u001b[0Gm\u001b[0Gn\u001b[0Go\u001b[0Gp\u001b[0Ga\u001b[0Gb\u001b[0Gc\u001b[0Gd\u001b[0Ge\u001b[0Gf\u001b[0Gg\u001b[0Gh\u001b[0Gi\u001b[0Gj\u001b[0Gk\u001b[0Gl\u001b[0Gm\u001b[0Gn\u001b[0Go\u001b[0Gp\u001b[0Ga\u001b[0Gb\u001b[0Gc\u001b[0Gd\u001b[0Ge\u001b[0Gf\u001b[0Gg\u001b[0Gh\u001b[0Gi\u001b[0Gj\u001b[0Gk\u001b[0Gl\u001b[0Gm\u001b[0Gn\u001b[0Go\u001b[0Gp\u001b[0Ga\u001b[0Gb\u001b[0Gc\u001b[0G" - - var int = spinner({ - interval: 0, - string: 'abcdefghijklmnop', - stream: { - write: function(c) { - output += c - if (++written == 50) { - t.equal(output, expect) - clearInterval(int) - t.end() - } - }, - isTTY: true - }, - cleanup: false - }) -}) diff --git a/deps/npm/node_modules/chmodr/README.md b/deps/npm/node_modules/chmodr/README.md deleted file mode 100644 index e3e9313c1c3091..00000000000000 --- a/deps/npm/node_modules/chmodr/README.md +++ /dev/null @@ -1,3 +0,0 @@ -Like `chmod -R`. - -Takes the same arguments as `fs.chmod()` diff --git a/deps/npm/node_modules/chmodr/chmodr.js b/deps/npm/node_modules/chmodr/chmodr.js deleted file mode 100644 index 1e167da21bfcb6..00000000000000 --- a/deps/npm/node_modules/chmodr/chmodr.js +++ /dev/null @@ -1,65 +0,0 @@ -module.exports = chmodr -chmodr.sync = chmodrSync - -var fs = require("fs") -, path = require("path") - -function chmodr (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) - var isDir = !er - var m = isDir ? dirMode(mode) : mode - if (er || !children.length) - return fs.chmod(p, m, cb) - - var len = children.length - var errState = null - children.forEach(function (child) { - var pathChild = path.resolve(p, child); - fs.lstat(pathChild, function(er, stats) { - if (er) - return cb(er) - if (!stats.isSymbolicLink()) - chmodr(pathChild, mode, then) - else - then() - }) - }) - function then (er) { - if (errState) return - if (er) return cb(errState = er) - if (-- len === 0) return fs.chmod(p, dirMode(mode), cb) - } - }) -} - -function chmodrSync (p, mode) { - var children - try { - children = fs.readdirSync(p) - } catch (er) { - if (er && er.code === "ENOTDIR") return fs.chmodSync(p, mode) - throw er - } - if (!children.length) return fs.chmodSync(p, dirMode(mode)) - - children.forEach(function (child) { - var pathChild = path.resolve(p, child) - var stats = fs.lstatSync(pathChild) - if (!stats.isSymbolicLink()) - chmodrSync(pathChild, mode) - }) - return fs.chmodSync(p, dirMode(mode)) -} - -// If a party has r, add x -// so that dirs are listable -function dirMode(mode) { - if (mode & 0400) mode |= 0100 - if (mode & 040) mode |= 010 - if (mode & 04) mode |= 01 - return mode -} diff --git a/deps/npm/node_modules/chmodr/package.json b/deps/npm/node_modules/chmodr/package.json deleted file mode 100644 index 54febed62cb8c9..00000000000000 --- a/deps/npm/node_modules/chmodr/package.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "chmodr", - "description": "like `chmod -R`", - "version": "1.0.1", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/chmodr.git" - }, - "main": "chmodr.js", - "devDependencies": { - "mkdirp": "0.3", - "rimraf": "", - "tap": "^1.3.2" - }, - "scripts": { - "test": "tap test/*.js" - }, - "license": "ISC", - "files": [ - "chmodr.js" - ], - "gitHead": "a1ffe57f50c7d1a32e342ed1a03772d37bb4d00e", - "bugs": { - "url": "https://github.com/isaacs/chmodr/issues" - }, - "homepage": "https://github.com/isaacs/chmodr#readme", - "_id": "chmodr@1.0.1", - "_shasum": "858e07efd75b6633ae6121ffaa33b2900bcfe18d", - "_from": "chmodr@>=1.0.1 <1.1.0", - "_npmVersion": "3.2.1", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "858e07efd75b6633ae6121ffaa33b2900bcfe18d", - "tarball": "http://registry.npmjs.org/chmodr/-/chmodr-1.0.1.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/chmodr/-/chmodr-1.0.1.tgz" -} diff --git a/deps/npm/node_modules/chownr/package.json b/deps/npm/node_modules/chownr/package.json index fdd1dd23083e77..700666e4deba20 100644 --- a/deps/npm/node_modules/chownr/package.json +++ b/deps/npm/node_modules/chownr/package.json @@ -31,7 +31,7 @@ "homepage": "https://github.com/isaacs/chownr#readme", "_id": "chownr@1.0.1", "_shasum": "e2a75042a9551908bebd25b8523d5f9769d79181", - "_from": "chownr@1.0.1", + "_from": "chownr@>=1.0.1 <1.1.0", "_npmVersion": "3.2.2", "_nodeVersion": "2.2.1", "_npmUser": { diff --git a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/package.json b/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/package.json index dc3ce5501994a8..3cf87fb43a6565 100644 --- a/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/package.json +++ b/deps/npm/node_modules/cmd-shim/node_modules/graceful-fs/package.json @@ -1,96 +1,56 @@ { - "_args": [ - [ - "graceful-fs@>3.0.1 <4.0.0-0", - "/Users/isaacs/dev/npm/npm/node_modules/cmd-shim" - ] - ], - "_from": "graceful-fs@>3.0.1 <4.0.0-0", - "_id": "graceful-fs@3.0.8", - "_inCache": true, - "_location": "/cmd-shim/graceful-fs", - "_nodeVersion": "2.0.1", - "_npmUser": { - "email": "isaacs@npmjs.com", - "name": "isaacs" - }, - "_npmVersion": "2.10.1", - "_phantomChildren": {}, - "_requested": { - "name": "graceful-fs", - "raw": "graceful-fs@>3.0.1 <4.0.0-0", - "rawSpec": ">3.0.1 <4.0.0-0", - "scope": null, - "spec": ">3.0.1 <4.0.0-0", - "type": "range" - }, - "_requiredBy": [ - "/cmd-shim" - ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz", - "_shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "_shrinkwrap": null, - "_spec": "graceful-fs@>3.0.1 <4.0.0-0", - "_where": "/Users/isaacs/dev/npm/npm/node_modules/cmd-shim", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me" }, - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "dependencies": {}, + "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", - "devDependencies": { - "mkdirp": "^0.5.0", - "rimraf": "^2.2.8", - "tap": "^1.2.0" + "version": "3.0.8", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-graceful-fs.git" + }, + "main": "graceful-fs.js", + "engines": { + "node": ">=0.4.0" }, "directories": { "test": "test" }, - "dist": { - "shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz" - }, - "engines": { - "node": ">=0.4.0" + "scripts": { + "test": "tap test/*.js" }, - "gitHead": "45c57aa5e323c35a985a525de6f0c9a6ef59e1f8", - "homepage": "https://github.com/isaacs/node-graceful-fs#readme", "keywords": [ - "EACCESS", - "EAGAIN", - "EINVAL", - "EMFILE", - "EPERM", - "error", - "errors", "fs", - "handling", "module", - "queue", "reading", + "retry", "retries", - "retry" + "queue", + "error", + "errors", + "handling", + "EMFILE", + "EAGAIN", + "EINVAL", + "EPERM", + "EACCESS" ], "license": "ISC", - "main": "graceful-fs.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "graceful-fs", - "optionalDependencies": {}, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.2.8", + "tap": "^1.2.0" }, - "scripts": { - "test": "tap test/*.js" + "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over [fs module](http://api.nodejs.org/fs.html)\n\ngraceful-fs:\n\n* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n\n## USAGE\n\n```javascript\n// use just like fs\nvar fs = require('graceful-fs')\n\n// now go and do stuff with it...\nfs.readFileSync('some-file-or-whatever')\n```\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-graceful-fs/issues" }, - "version": "3.0.8" + "homepage": "https://github.com/isaacs/node-graceful-fs#readme", + "_id": "graceful-fs@3.0.8", + "_shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz", + "_from": "graceful-fs@>3.0.1 <4.0.0-0" } diff --git a/deps/npm/node_modules/cmd-shim/package.json b/deps/npm/node_modules/cmd-shim/package.json index e1f4f543ea708c..3833cf976c4b9c 100644 --- a/deps/npm/node_modules/cmd-shim/package.json +++ b/deps/npm/node_modules/cmd-shim/package.json @@ -25,7 +25,7 @@ "homepage": "https://github.com/ForbesLindesay/cmd-shim", "_id": "cmd-shim@2.0.1", "_shasum": "4512a373d2391679aec51ad1d4733559e9b85d4a", - "_from": "cmd-shim@>=2.0.1-0 <3.0.0-0", + "_from": "cmd-shim@>=2.0.1 <2.1.0", "_npmVersion": "1.5.0-alpha-4", "_npmUser": { "name": "forbeslindesay", 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 deleted file mode 100644 index 7fc07677a044ac..00000000000000 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "ansi-regex", - "version": "2.0.0", - "description": "Regular expression for matching ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/ansi-regex.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha test/test.js", - "view-supported": "node test/viewCodes.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "devDependencies": { - "mocha": "*" - }, - "gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f", - "bugs": { - "url": "https://github.com/sindresorhus/ansi-regex/issues" - }, - "homepage": "https://github.com/sindresorhus/ansi-regex", - "_id": "ansi-regex@2.0.0", - "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", - "_from": "ansi-regex@>=2.0.0 <3.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", - "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", - "readme": "ERROR: No README data found!" -} 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 deleted file mode 100644 index 2871d037908d62..00000000000000 --- a/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name": "strip-ansi", - "version": "3.0.0", - "description": "Strip ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/strip-ansi.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "devDependencies": { - "ava": "0.0.4" - }, - "gitHead": "3f05b9810e1438f946e2eb84ee854cc00b972e9e", - "bugs": { - "url": "https://github.com/sindresorhus/strip-ansi/issues" - }, - "homepage": "https://github.com/sindresorhus/strip-ansi", - "_id": "strip-ansi@3.0.0", - "_shasum": "7510b665567ca914ccb5d7e072763ac968be3724", - "_from": "strip-ansi@>=3.0.0 <4.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "7510b665567ca914ccb5d7e072763ac968be3724", - "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE b/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE index 313ef1e888e41b..14deaf94b8162d 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE @@ -27,4 +27,3 @@ 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/columnify/node_modules/wcwidth/docs/index.md b/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md index 5c5126d03287b4..64c1f3f7cd8a8a 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md @@ -60,6 +60,3 @@ for any purpose and without fee is hereby granted. The author disclaims all warranties with regard to this software. Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c - - - diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml index 58f23716aefb94..20fd86b6a5bee3 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml @@ -1,5 +1,3 @@ language: node_js node_js: - - 0.6 - - 0.8 - 0.10 diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE index fc808cce89d4a4..cc3c87bc3bfd85 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE @@ -1,4 +1,4 @@ -Copyright © 2011-2014 Paul Vorbach +Copyright © 2011-2015 Paul Vorbach 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 diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md index d7231cfca7daa7..0b6cecae29b52d 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md @@ -2,16 +2,16 @@ [![build status](https://secure.travis-ci.org/pvorb/node-clone.png)](http://travis-ci.org/pvorb/node-clone) -offers foolproof _deep cloning_ of variables in JavaScript. +[![info badge](https://nodei.co/npm/clone.png?downloads=true&downloadRank=true&stars=true)](http://npm-stat.com/charts.html?package=clone) + +offers foolproof _deep cloning_ of objects, arrays, numbers, strings etc. in JavaScript. ## Installation npm install clone -or - - ender build clone +(It also works with browserify, ender or standalone.) ## Example @@ -105,7 +105,7 @@ github](https://github.com/pvorb/node-clone/issues) or send me an email to ## License -Copyright © 2011-2014 [Paul Vorbach](http://paul.vorba.ch/) and +Copyright © 2011-2015 [Paul Vorbach](http://paul.vorba.ch/) and [contributors](https://github.com/pvorb/node-clone/graphs/contributors). Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js index f8fa3159a7c4ee..6263759203bd5d 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js @@ -1,34 +1,6 @@ +var clone = (function() { 'use strict'; -function objectToString(o) { - return Object.prototype.toString.call(o); -} - -// shim for Node's 'util' package -// DO NOT REMOVE THIS! It is required for compatibility with EnderJS (http://enderjs.com/). -var util = { - isArray: function (ar) { - return Array.isArray(ar) || (typeof ar === 'object' && objectToString(ar) === '[object Array]'); - }, - isDate: function (d) { - return typeof d === 'object' && objectToString(d) === '[object Date]'; - }, - isRegExp: function (re) { - return typeof re === 'object' && objectToString(re) === '[object RegExp]'; - }, - getRegExpFlags: function (re) { - var flags = ''; - re.global && (flags += 'g'); - re.ignoreCase && (flags += 'i'); - re.multiline && (flags += 'm'); - return flags; - } -}; - - -if (typeof module === 'object') - module.exports = clone; - /** * Clones (copies) an Object using deep copying. * @@ -47,8 +19,14 @@ if (typeof module === 'object') * @param `prototype` - sets the prototype to be used when cloning an object. * (optional - defaults to parent prototype). */ - function clone(parent, circular, depth, prototype) { + var filter; + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + filter = circular.filter; + circular = circular.circular + } // maintain two arrays for circular references, where corresponding parents // and children have the same index var allParents = []; @@ -77,12 +55,12 @@ function clone(parent, circular, depth, prototype) { return parent; } - if (util.isArray(parent)) { + if (clone.__isArray(parent)) { child = []; - } else if (util.isRegExp(parent)) { - child = new RegExp(parent.source, util.getRegExpFlags(parent)); + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); if (parent.lastIndex) child.lastIndex = parent.lastIndex; - } else if (util.isDate(parent)) { + } else if (clone.__isDate(parent)) { child = new Date(parent.getTime()); } else if (useBuffer && Buffer.isBuffer(parent)) { child = new Buffer(parent.length); @@ -114,7 +92,7 @@ function clone(parent, circular, depth, prototype) { if (proto) { attrs = Object.getOwnPropertyDescriptor(proto, i); } - + if (attrs && attrs.set == null) { continue; } @@ -134,7 +112,7 @@ function clone(parent, circular, depth, prototype) { * USE WITH CAUTION! This may not behave as you wish if you do not know how this * works. */ -clone.clonePrototype = function(parent) { +clone.clonePrototype = function clonePrototype(parent) { if (parent === null) return null; @@ -142,3 +120,41 @@ clone.clonePrototype = function(parent) { c.prototype = parent; return new c(); }; + +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); +}; +clone.__objToStr = __objToStr; + +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +}; +clone.__isDate = __isDate; + +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +}; +clone.__isArray = __isArray; + +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +}; +clone.__isRegExp = __isRegExp; + +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +}; +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if (typeof module === 'object' && module.exports) { + module.exports = clone; +} 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 bc8e878a54c34b..d401747f6d5b33 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 @@ -8,7 +8,7 @@ "function", "date" ], - "version": "0.1.19", + "version": "1.0.2", "repository": { "type": "git", "url": "git://github.com/pvorb/node-clone.git" @@ -86,41 +86,33 @@ "name": "Róbert Oroszi", "email": "robert+gh@oroszi.net", "url": "https://github.com/oroce" + }, + { + "name": "Aurélio A. Heckert", + "url": "http://softwarelivre.org/aurium" + }, + { + "name": "Guy Ellis", + "url": "http://www.guyellisrocks.com/" } ], "license": "MIT", "engines": { - "node": "*" + "node": ">=0.8" }, "dependencies": {}, "devDependencies": { - "underscore": "*", - "nodeunit": "*" + "nodeunit": "~0.9.0" }, "optionalDependencies": {}, "scripts": { "test": "nodeunit test.js" }, - "gitHead": "bb11a43363a0f69e8ac014cb5376ce215ea1f8fd", - "homepage": "https://github.com/pvorb/node-clone", - "_id": "clone@0.1.19", - "_shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85", - "_from": "clone@>=0.1.5 <0.2.0", - "_npmVersion": "1.4.14", - "_npmUser": { - "name": "pvorb", - "email": "paul@vorba.ch" - }, - "maintainers": [ - { - "name": "pvorb", - "email": "paul@vorb.de" - } - ], - "dist": { - "shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85", - "tarball": "http://registry.npmjs.org/clone/-/clone-0.1.19.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.19.tgz" + "readme": "# clone\n\n[![build status](https://secure.travis-ci.org/pvorb/node-clone.png)](http://travis-ci.org/pvorb/node-clone)\n\n[![info badge](https://nodei.co/npm/clone.png?downloads=true&downloadRank=true&stars=true)](http://npm-stat.com/charts.html?package=clone)\n\noffers foolproof _deep cloning_ of objects, arrays, numbers, strings etc. in JavaScript.\n\n\n## Installation\n\n npm install clone\n\n(It also works with browserify, ender or standalone.)\n\n\n## Example\n\n~~~ javascript\nvar clone = require('clone');\n\nvar a, b;\n\na = { foo: { bar: 'baz' } }; // initial value of a\n\nb = clone(a); // clone a -> b\na.foo.bar = 'foo'; // change a\n\nconsole.log(a); // show a\nconsole.log(b); // show b\n~~~\n\nThis will print:\n\n~~~ javascript\n{ foo: { bar: 'foo' } }\n{ foo: { bar: 'baz' } }\n~~~\n\n**clone** masters cloning simple objects (even with custom prototype), arrays,\nDate objects, and RegExp objects. Everything is cloned recursively, so that you\ncan clone dates in arrays in objects, for example.\n\n\n## API\n\n`clone(val, circular, depth)`\n\n * `val` -- the value that you want to clone, any type allowed\n * `circular` -- boolean\n\n Call `clone` with `circular` set to `false` if you are certain that `obj`\n contains no circular references. This will give better performance if needed.\n There is no error if `undefined` or `null` is passed as `obj`.\n * `depth` -- depth to which the object is to be cloned (optional,\n defaults to infinity)\n\n`clone.clonePrototype(obj)`\n\n * `obj` -- the object that you want to clone\n\nDoes a prototype clone as\n[described by Oran Looney](http://oranlooney.com/functional-javascript/).\n\n\n## Circular References\n\n~~~ javascript\nvar a, b;\n\na = { hello: 'world' };\n\na.myself = a;\nb = clone(a);\n\nconsole.log(b);\n~~~\n\nThis will print:\n\n~~~ javascript\n{ hello: \"world\", myself: [Circular] }\n~~~\n\nSo, `b.myself` points to `b`, not `a`. Neat!\n\n\n## Test\n\n npm test\n\n\n## Caveat\n\nSome special objects like a socket or `process.stdout`/`stderr` are known to not\nbe cloneable. If you find other objects that cannot be cloned, please [open an\nissue](https://github.com/pvorb/node-clone/issues/new).\n\n\n## Bugs and Issues\n\nIf you encounter any bugs or issues, feel free to [open an issue at\ngithub](https://github.com/pvorb/node-clone/issues) or send me an email to\n. I also always like to hear from you, if you’re using my code.\n\n## License\n\nCopyright © 2011-2015 [Paul Vorbach](http://paul.vorba.ch/) and\n[contributors](https://github.com/pvorb/node-clone/graphs/contributors).\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the “Software”), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", + "readmeFilename": "README.md", + "homepage": "https://github.com/pvorb/node-clone#readme", + "_id": "clone@1.0.2", + "_shasum": "260b7a99ebb1edfe247538175f783243cb19d149", + "_resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz", + "_from": "clone@>=1.0.2 <2.0.0" } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html new file mode 100644 index 00000000000000..4d532bb7175192 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html @@ -0,0 +1,22 @@ + + + + Clone Test-Suite (Browser) + + + + + diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html new file mode 100644 index 00000000000000..a955702516dfb3 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html @@ -0,0 +1,148 @@ + + + + + Clone Test-Suite (Browser) + + + + + +

    Clone Test-Suite (Browser)

    + Tests started: ; + Tests finished: . +
      + + + diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js index cb3d16631ab87f..e8b65b3fed93c5 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js @@ -1,16 +1,50 @@ -if(module.parent === null) { - console.log('Run this test file with nodeunit:'); - console.log('$ nodeunit test.js'); -} +var clone = require('./'); +function inspect(obj) { + seen = []; + return JSON.stringify(obj, function (key, val) { + if (val != null && typeof val == "object") { + if (seen.indexOf(val) >= 0) { + return '[cyclic]'; + } -var clone = require('./'); -var util = require('util'); -var _ = require('underscore'); + seen.push(val); + } + return val; + }); +} + +// Creates a new VM in node, or an iframe in a browser in order to run the +// script +function apartContext(context, script, callback) { + var vm = require('vm'); + if (vm) { + var ctx = vm.createContext({ ctx: context }); + callback(vm.runInContext(script, ctx)); + } else if (document && document.createElement) { + var iframe = document.createElement('iframe'); + iframe.style.display = 'none'; + document.body.appendChild(iframe); + + var myCtxId = 'tmpCtx' + Math.random(); + + window[myCtxId] = context; + iframe.src = 'test-apart-ctx.html?' + myCtxId + '&' + encodeURIComponent(script); + iframe.onload = function() { + try { + callback(iframe.contentWindow.results); + } catch (e) { + throw e; + } + }; + } else { + console.log('WARNING: cannot create an apart context.'); + } +} -exports["clone string"] = function(test) { +exports["clone string"] = function (test) { test.expect(2); // how many tests? var a = "foo"; @@ -21,9 +55,7 @@ exports["clone string"] = function(test) { test.done(); }; - - -exports["clone number"] = function(test) { +exports["clone number"] = function (test) { test.expect(5); // how many tests? var a = 0; @@ -40,37 +72,30 @@ exports["clone number"] = function(test) { test.done(); }; - - -exports["clone date"] = function(test) { +exports["clone date"] = function (test) { test.expect(3); // how many tests? var a = new Date; var c = clone(a); - test.ok(a instanceof Date); - test.ok(c instanceof Date); - test.equal(c.getTime(), a.getTime()); + test.ok(!!a.getUTCDate && !!a.toUTCString); + test.ok(!!c.getUTCDate && !!c.toUTCString); + test.equal(a.getTime(), c.getTime()); test.done(); }; - - -exports["clone object"] = function(test) { - test.expect(2); // how many tests? +exports["clone object"] = function (test) { + test.expect(1); // how many tests? var a = { foo: { bar: "baz" } }; var b = clone(a); - test.ok(_(a).isEqual(b), "underscore equal"); test.deepEqual(b, a); test.done(); }; - - -exports["clone array"] = function(test) { +exports["clone array"] = function (test) { test.expect(2); // how many tests? var a = [ @@ -79,13 +104,17 @@ exports["clone array"] = function(test) { ]; var b = clone(a); - test.ok(_(a).isEqual(b), "underscore equal"); + test.ok(b instanceof Array); test.deepEqual(b, a); test.done(); }; -exports["clone buffer"] = function(test) { +exports["clone buffer"] = function (test) { + if (typeof Buffer == 'undefined') { + return test.done(); + } + test.expect(1); var a = new Buffer("this is a test buffer"); @@ -96,14 +125,11 @@ exports["clone buffer"] = function(test) { test.done(); }; - - -exports["clone regexp"] = function(test) { +exports["clone regexp"] = function (test) { test.expect(5); var a = /abc123/gi; var b = clone(a); - test.deepEqual(b, a); var c = /a/g; @@ -119,63 +145,54 @@ exports["clone regexp"] = function(test) { test.done(); }; - -exports["clone object containing array"] = function(test) { - test.expect(2); // how many tests? +exports["clone object containing array"] = function (test) { + test.expect(1); // how many tests? var a = { arr1: [ { a: '1234', b: '2345' } ], arr2: [ { c: '345', d: '456' } ] }; + var b = clone(a); - test.ok(_(a).isEqual(b), "underscore equal"); test.deepEqual(b, a); test.done(); }; - - -exports["clone object with circular reference"] = function(test) { +exports["clone object with circular reference"] = function (test) { test.expect(8); // how many tests? - var _ = test.ok; - var c = [1, "foo", {'hello': 'bar'}, function() {}, false, [2]]; + var c = [1, "foo", {'hello': 'bar'}, function () {}, false, [2]]; var b = [c, 2, 3, 4]; + var a = {'b': b, 'c': c}; a.loop = a; a.loop2 = a; c.loop = c; c.aloop = a; + var aCopy = clone(a); - _(a != aCopy); - _(a.c != aCopy.c); - _(aCopy.c == aCopy.b[0]); - _(aCopy.c.loop.loop.aloop == aCopy); - _(aCopy.c[0] == a.c[0]); - - //console.log(util.inspect(aCopy, true, null) ); - //console.log("------------------------------------------------------------"); - //console.log(util.inspect(a, true, null) ); - _(eq(a, aCopy)); + test.ok(a != aCopy); + test.ok(a.c != aCopy.c); + test.ok(aCopy.c == aCopy.b[0]); + test.ok(aCopy.c.loop.loop.aloop == aCopy); + test.ok(aCopy.c[0] == a.c[0]); + + test.ok(eq(a, aCopy)); aCopy.c[0] = 2; - _(!eq(a, aCopy)); + test.ok(!eq(a, aCopy)); aCopy.c = "2"; - _(!eq(a, aCopy)); - //console.log("------------------------------------------------------------"); - //console.log(util.inspect(aCopy, true, null) ); + test.ok(!eq(a, aCopy)); function eq(x, y) { - return util.inspect(x, true, null) === util.inspect(y, true, null); + return inspect(x) === inspect(y); } test.done(); }; - - -exports['clonePrototype'] = function(test) { +exports['clone prototype'] = function (test) { test.expect(3); // how many tests? var a = { @@ -190,34 +207,38 @@ exports['clonePrototype'] = function(test) { test.strictEqual(b.y, a.y); test.done(); -} +}; -exports['cloneWithinNewVMContext'] = function(test) { - test.expect(3); - var vm = require('vm'); - var ctx = vm.createContext({ clone: clone }); - var script = "clone( {array: [1, 2, 3], date: new Date(), regex: /^foo$/ig} );"; - var results = vm.runInContext(script, ctx); - test.ok(results.array instanceof Array); - test.ok(results.date instanceof Date); - test.ok(results.regex instanceof RegExp); - test.done(); -} +exports['clone within an apart context'] = function (test) { + var results = apartContext({ clone: clone }, + "results = ctx.clone({ a: [1, 2, 3], d: new Date(), r: /^foo$/ig })", + function (results) { + test.ok(results.a.constructor.toString() === Array.toString()); + test.ok(results.d.constructor.toString() === Date.toString()); + test.ok(results.r.constructor.toString() === RegExp.toString()); + test.done(); + }); +}; -exports['cloneObjectWithNoConstructor'] = function(test) { +exports['clone object with no constructor'] = function (test) { test.expect(3); + var n = null; + var a = { foo: 'bar' }; a.__proto__ = n; test.ok(typeof a === 'object'); test.ok(typeof a !== null); + var b = clone(a); test.ok(a.foo, b.foo); + test.done(); -} +}; exports['clone object with depth argument'] = function (test) { test.expect(6); + var a = { foo: { bar : { @@ -225,6 +246,7 @@ exports['clone object with depth argument'] = function (test) { } } }; + var b = clone(a, false, 1); test.deepEqual(b, a); test.notEqual(b, a); @@ -234,28 +256,35 @@ exports['clone object with depth argument'] = function (test) { test.deepEqual(b, a); test.notEqual(b.foo, a.foo); test.strictEqual(b.foo.bar, a.foo.bar); + test.done(); -} +}; exports['maintain prototype chain in clones'] = function (test) { test.expect(1); - function Constructor() {} - var a = new Constructor(); + + function T() {} + + var a = new T(); var b = clone(a); test.strictEqual(Object.getPrototypeOf(a), Object.getPrototypeOf(b)); + test.done(); -} +}; exports['parent prototype is overriden with prototype provided'] = function (test) { test.expect(1); - function Constructor() {} - var a = new Constructor(); + + function T() {} + + var a = new T(); var b = clone(a, true, Infinity, null); test.strictEqual(b.__defineSetter__, undefined); + test.done(); -} +}; -exports['clone object with null children'] = function(test) { +exports['clone object with null children'] = function (test) { test.expect(1); var a = { foo: { @@ -265,12 +294,14 @@ exports['clone object with null children'] = function(test) { } } }; + var b = clone(a); + test.deepEqual(b, a); test.done(); -} +}; -exports['clone instance with getter'] = function(test) { +exports['clone instance with getter'] = function (test) { test.expect(1); function Ctor() {}; Object.defineProperty(Ctor.prototype, 'prop', { @@ -286,4 +317,56 @@ exports['clone instance with getter'] = function(test) { test.strictEqual(b.prop, 'value'); test.done(); -}; \ No newline at end of file +}; + +exports['get RegExp flags'] = function (test) { + test.strictEqual(clone.__getRegExpFlags(/a/), '' ); + test.strictEqual(clone.__getRegExpFlags(/a/i), 'i' ); + test.strictEqual(clone.__getRegExpFlags(/a/g), 'g' ); + test.strictEqual(clone.__getRegExpFlags(/a/gi), 'gi'); + test.strictEqual(clone.__getRegExpFlags(/a/m), 'm' ); + + test.done(); +}; + +exports["recognize Array object"] = function (test) { + var results = apartContext(null, "results = [1, 2, 3]", function(alien) { + var local = [4, 5, 6]; + test.ok(clone.__isArray(alien)); // recognize in other context. + test.ok(clone.__isArray(local)); // recognize in local context. + test.ok(!clone.__isDate(alien)); + test.ok(!clone.__isDate(local)); + test.ok(!clone.__isRegExp(alien)); + test.ok(!clone.__isRegExp(local)); + test.done(); + }); +}; + +exports["recognize Date object"] = function (test) { + var results = apartContext(null, "results = new Date()", function(alien) { + var local = new Date(); + + test.ok(clone.__isDate(alien)); // recognize in other context. + test.ok(clone.__isDate(local)); // recognize in local context. + test.ok(!clone.__isArray(alien)); + test.ok(!clone.__isArray(local)); + test.ok(!clone.__isRegExp(alien)); + test.ok(!clone.__isRegExp(local)); + + test.done(); + }); +}; + +exports["recognize RegExp object"] = function (test) { + var results = apartContext(null, "results = /foo/", function(alien) { + var local = /bar/; + + test.ok(clone.__isRegExp(alien)); // recognize in other context. + test.ok(clone.__isRegExp(local)); // recognize in local context. + test.ok(!clone.__isArray(alien)); + test.ok(!clone.__isArray(local)); + test.ok(!clone.__isDate(alien)); + test.ok(!clone.__isDate(local)); + test.done(); + }); +}; 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 fdd074d0f4afbb..ef5197861a276e 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 @@ -1,6 +1,6 @@ { "name": "defaults", - "version": "1.0.2", + "version": "1.0.3", "description": "merge single level defaults over a config object", "main": "index.js", "scripts": { @@ -20,34 +20,35 @@ }, "license": "MIT", "dependencies": { - "clone": "~0.1.5" + "clone": "^1.0.2" }, "devDependencies": { - "tap": "~0.4.0" + "tap": "^2.0.0" }, - "gitHead": "22c57d1f87a2f03c1f9d21bd39c67db8553a0064", + "gitHead": "8831ec32a5f999bfae1a8c9bf32880971ed7c6f2", "bugs": { "url": "https://github.com/tmpvar/defaults/issues" }, - "homepage": "https://github.com/tmpvar/defaults", - "_id": "defaults@1.0.2", - "_shasum": "6902e25aa047649a501e19ef9e98f3e8365c109a", + "homepage": "https://github.com/tmpvar/defaults#readme", + "_id": "defaults@1.0.3", + "_shasum": "c656051e9817d9ff08ed881477f3fe4019f3ef7d", "_from": "defaults@>=1.0.0 <2.0.0", - "_npmVersion": "1.4.23", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.1", "_npmUser": { "name": "tmpvar", "email": "tmpvar@gmail.com" }, + "dist": { + "shasum": "c656051e9817d9ff08ed881477f3fe4019f3ef7d", + "tarball": "http://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz" + }, "maintainers": [ { "name": "tmpvar", "email": "tmpvar@gmail.com" } ], - "dist": { - "shasum": "6902e25aa047649a501e19ef9e98f3e8365c109a", - "tarball": "http://registry.npmjs.org/defaults/-/defaults-1.0.2.tgz" - }, "directories": {}, - "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.2.tgz" + "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz" } diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js index 60e0ffba8b4aab..eab79ff71f1498 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js @@ -31,4 +31,3 @@ test("ensure defaults clone nested objects", function(t) { t.ok(result.b !== d.b, 'objects should be clones'); t.end(); }); - 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 4744d9dc3f7f7b..49fc6f0408a7a5 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/package.json @@ -56,5 +56,6 @@ "shasum": "02d059ff7a8fc741e0f6b5da1e69b2b40daeca6f", "tarball": "http://registry.npmjs.org/wcwidth/-/wcwidth-1.0.0.tgz" }, - "_resolved": "https://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!" } diff --git a/deps/npm/node_modules/columnify/package.json b/deps/npm/node_modules/columnify/package.json index 1dc803973c6900..c4345001f31339 100644 --- a/deps/npm/node_modules/columnify/package.json +++ b/deps/npm/node_modules/columnify/package.json @@ -46,7 +46,7 @@ "gitHead": "e7417b78091844ff2f3ba62551a4817c7ae217bd", "_id": "columnify@1.5.2", "_shasum": "6937930d47c22a9bfa20732a7fd619d47eaba65a", - "_from": "columnify@1.5.2", + "_from": "columnify@>=1.5.2 <1.6.0", "_npmVersion": "2.9.0", "_nodeVersion": "2.0.1", "_npmUser": { @@ -63,5 +63,6 @@ "shasum": "6937930d47c22a9bfa20732a7fd619d47eaba65a", "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.5.2.tgz" }, - "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.2.tgz" + "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.2.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/config-chain/node_modules/proto-list/package.json b/deps/npm/node_modules/config-chain/node_modules/proto-list/package.json index 458621ad892adf..1a0d0a8ce24262 100644 --- a/deps/npm/node_modules/config-chain/node_modules/proto-list/package.json +++ b/deps/npm/node_modules/config-chain/node_modules/proto-list/package.json @@ -19,30 +19,14 @@ "devDependencies": { "tap": "0" }, - "gitHead": "9e4af12d4dddee2fd531f0fe0c21c9cfacb78ac0", + "readme": "A list of objects, bound by their prototype chain.\n\nUsed in npm's config stuff.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/proto-list/issues" }, "homepage": "https://github.com/isaacs/proto-list#readme", "_id": "proto-list@1.2.4", "_shasum": "212d5bfe1318306a420f6402b8e26ff39647a849", - "_from": "proto-list@>=1.2.1 <1.3.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "212d5bfe1318306a420f6402b8e26ff39647a849", - "tarball": "http://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz" + "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "_from": "proto-list@>=1.2.1 <1.3.0" } diff --git a/deps/npm/node_modules/config-chain/package.json b/deps/npm/node_modules/config-chain/package.json index b25913cab0143b..a8b63880e9ebc2 100644 --- a/deps/npm/node_modules/config-chain/package.json +++ b/deps/npm/node_modules/config-chain/package.json @@ -11,7 +11,7 @@ "homepage": "http://github.com/dominictarr/config-chain", "repository": { "type": "git", - "url": "https://github.com/dominictarr/config-chain.git" + "url": "git+https://github.com/dominictarr/config-chain.git" }, "dependencies": { "proto-list": "~1.2.1", @@ -28,33 +28,13 @@ "scripts": { "test": "tap test/" }, - "gitHead": "832609897082a0a887c59dadb105f4db6de1ab4c", + "readme": "#config-chain\n\nUSE THIS MODULE TO LOAD ALL YOUR CONFIGURATIONS\n\n``` js\n\n //npm install config-chain\n\n var cc = require('config-chain')\n , opts = require('optimist').argv //ALWAYS USE OPTIMIST FOR COMMAND LINE OPTIONS.\n , env = opts.env || process.env.YOUR_APP_ENV || 'dev' //SET YOUR ENV LIKE THIS.\n\n // EACH ARG TO CONFIGURATOR IS LOADED INTO CONFIGURATION CHAIN\n // EARLIER ITEMS OVERIDE LATER ITEMS\n // PUTS COMMAND LINE OPTS FIRST, AND DEFAULTS LAST!\n\n //strings are interpereted as filenames.\n //will be loaded synchronously\n\n var conf =\n cc(\n //OVERRIDE SETTINGS WITH COMMAND LINE OPTS\n opts,\n\n //ENV VARS IF PREFIXED WITH 'myApp_'\n\n cc.env('myApp_'), //myApp_foo = 'like this'\n\n //FILE NAMED BY ENV\n path.join(__dirname, 'config.' + env + '.json'),\n\n //IF `env` is PRODUCTION\n env === 'prod'\n ? path.join(__dirname, 'special.json') //load a special file\n : null //NULL IS IGNORED!\n\n //SUBDIR FOR ENV CONFIG\n path.join(__dirname, 'config', env, 'config.json'),\n\n //SEARCH PARENT DIRECTORIES FROM CURRENT DIR FOR FILE\n cc.find('config.json'),\n\n //PUT DEFAULTS LAST\n {\n host: 'localhost'\n port: 8000\n })\n\n var host = conf.get('host')\n\n // or\n\n var host = conf.store.host\n\n```\n\nFINALLY, EASY FLEXIBLE CONFIGURATIONS!\n\n##see also: [proto-list](https://github.com/isaacs/proto-list/)\n\nWHATS THAT YOU SAY?\n\nYOU WANT A \"CLASS\" SO THAT YOU CAN DO CRAYCRAY JQUERY CRAPS?\n\nEXTEND WITH YOUR OWN FUNCTIONALTY!?\n\n## CONFIGCHAIN LIVES TO SERVE ONLY YOU!\n\n```javascript\nvar cc = require('config-chain')\n\n// all the stuff you did before\nvar config = cc({\n some: 'object'\n },\n cc.find('config.json'),\n cc.env('myApp_')\n )\n // CONFIGS AS A SERVICE, aka \"CaaS\", aka EVERY DEVOPS DREAM OMG!\n .addUrl('http://configurator:1234/my-configs')\n // ASYNC FTW!\n .addFile('/path/to/file.json')\n\n // OBJECTS ARE OK TOO, they're SYNC but they still ORDER RIGHT\n // BECAUSE PROMISES ARE USED BUT NO, NOT *THOSE* PROMISES, JUST\n // ACTUAL PROMISES LIKE YOU MAKE TO YOUR MOM, KEPT OUT OF LOVE\n .add({ another: 'object' })\n\n // DIE A THOUSAND DEATHS IF THIS EVER HAPPENS!!\n .on('error', function (er) {\n // IF ONLY THERE WAS SOMETHIGN HARDER THAN THROW\n // MY SORROW COULD BE ADEQUATELY EXPRESSED. /o\\\n throw er\n })\n\n // THROW A PARTY IN YOUR FACE WHEN ITS ALL LOADED!!\n .on('load', function (config) {\n console.awesome('HOLY SHIT!')\n })\n```\n\n# BORING API DOCS\n\n## cc(...args)\n\nMAKE A CHAIN AND ADD ALL THE ARGS.\n\nIf the arg is a STRING, then it shall be a JSON FILENAME.\n\nSYNC I/O!\n\nRETURN THE CHAIN!\n\n## cc.json(...args)\n\nJoin the args INTO A JSON FILENAME!\n\nSYNC I/O!\n\n## cc.find(relativePath)\n\nSEEK the RELATIVE PATH by climbing the TREE OF DIRECTORIES.\n\nRETURN THE FOUND PATH!\n\nSYNC I/O!\n\n## cc.parse(content, file, type)\n\nParse the content string, and guess the type from either the\nspecified type or the filename.\n\nRETURN THE RESULTING OBJECT!\n\nNO I/O!\n\n## cc.env(prefix, env=process.env)\n\nGet all the keys on the provided env object (or process.env) which are\nprefixed by the specified prefix, and put the values on a new object.\n\nRETURN THE RESULTING OBJECT!\n\nNO I/O!\n\n## cc.ConfigChain()\n\nThe ConfigChain class for CRAY CRAY JQUERY STYLE METHOD CHAINING!\n\nOne of these is returned by the main exported function, as well.\n\nIt inherits (prototypically) from\n[ProtoList](https://github.com/isaacs/proto-list/), and also inherits\n(parasitically) from\n[EventEmitter](http://nodejs.org/api/events.html#events_class_events_eventemitter)\n\nIt has all the methods from both, and except where noted, they are\nunchanged.\n\n### LET IT BE KNOWN THAT chain IS AN INSTANCE OF ConfigChain.\n\n## chain.sources\n\nA list of all the places where it got stuff. The keys are the names\npassed to addFile or addUrl etc, and the value is an object with some\ninfo about the data source.\n\n## chain.addFile(filename, type, [name=filename])\n\nFilename is the name of the file. Name is an arbitrary string to be\nused later if you desire. Type is either 'ini' or 'json', and will\ntry to guess intelligently if omitted.\n\nLoaded files can be saved later.\n\n## chain.addUrl(url, type, [name=url])\n\nSame as the filename thing, but with a url.\n\nCan't be saved later.\n\n## chain.addEnv(prefix, env, [name='env'])\n\nAdd all the keys from the env object that start with the prefix.\n\n## chain.addString(data, file, type, [name])\n\nParse the string and add it to the set. (Mainly used internally.)\n\n## chain.add(object, [name])\n\nAdd the object to the set.\n\n## chain.root {Object}\n\nThe root from which all the other config objects in the set descend\nprototypically.\n\nPut your defaults here.\n\n## chain.set(key, value, name)\n\nSet the key to the value on the named config object. If name is\nunset, then set it on the first config object in the set. (That is,\nthe one with the highest priority, which was added first.)\n\n## chain.get(key, [name])\n\nGet the key from the named config object explicitly, or from the\nresolved configs if not specified.\n\n## chain.save(name, type)\n\nWrite the named config object back to its origin.\n\nCurrently only supported for env and file config types.\n\nFor files, encode the data according to the type.\n\n## chain.on('save', function () {})\n\nWhen one or more files are saved, emits `save` event when they're all\nsaved.\n\n## chain.on('load', function (chain) {})\n\nWhen the config chain has loaded all the specified files and urls and\nsuch, the 'load' event fires.\n", + "readmeFilename": "readme.markdown", "bugs": { "url": "https://github.com/dominictarr/config-chain/issues" }, "_id": "config-chain@1.1.9", "_shasum": "39ac7d4dca84faad926124c54cff25a53aa8bf6e", - "_from": "config-chain@>=1.1.9 <1.2.0", - "_npmVersion": "2.11.0", - "_nodeVersion": "0.12.4", - "_npmUser": { - "name": "dominictarr", - "email": "dominic.tarr@gmail.com" - }, - "maintainers": [ - { - "name": "dominictarr", - "email": "dominic.tarr@gmail.com" - }, - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "39ac7d4dca84faad926124c54cff25a53aa8bf6e", - "tarball": "http://registry.npmjs.org/config-chain/-/config-chain-1.1.9.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.9.tgz" + "_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.9.tgz", + "_from": "config-chain@>=1.1.9 <1.2.0" } diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/LICENSE b/deps/npm/node_modules/debuglog/LICENSE similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/debuglog/LICENSE rename to deps/npm/node_modules/debuglog/LICENSE diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/README.md b/deps/npm/node_modules/debuglog/README.md similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/debuglog/README.md rename to deps/npm/node_modules/debuglog/README.md diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/debuglog.js b/deps/npm/node_modules/debuglog/debuglog.js similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/debuglog/debuglog.js rename to deps/npm/node_modules/debuglog/debuglog.js diff --git a/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json b/deps/npm/node_modules/debuglog/package.json similarity index 87% rename from deps/npm/node_modules/read-installed/node_modules/debuglog/package.json rename to deps/npm/node_modules/debuglog/package.json index 39fac076703ce0..b192d407f7e062 100644 --- a/deps/npm/node_modules/read-installed/node_modules/debuglog/package.json +++ b/deps/npm/node_modules/debuglog/package.json @@ -6,7 +6,7 @@ "main": "debuglog.js", "repository": { "type": "git", - "url": "https://github.com/sam-github/node-debuglog.git" + "url": "git+https://github.com/sam-github/node-debuglog.git" }, "author": { "name": "Sam Roberts", @@ -27,7 +27,7 @@ "shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", "tarball": "http://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" }, - "_from": "debuglog@>=1.0.1 <2.0.0", + "_from": "debuglog@1.0.1", "_npmVersion": "1.4.3", "_npmUser": { "name": "octet", @@ -41,5 +41,6 @@ ], "directories": {}, "_shasum": "aa24ffb9ac3df9a2351837cfb2d279360cd78492", - "_resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz" + "_resolved": "https://registry.npmjs.org/debuglog/-/debuglog-1.0.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md b/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md index ba18c61390db9a..0d82d695f7a242 100644 --- a/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/LICENSE.md @@ -18,4 +18,3 @@ 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 index 452fd8c2037099..d60a08a044d9c2 100644 --- a/deps/npm/node_modules/dezalgo/node_modules/asap/README.md +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/README.md @@ -234,4 +234,3 @@ browser-only implementation. Copyright 2009-2014 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 index f04fcd58fc0b22..3a27c8cee7a597 100644 --- a/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/asap.js @@ -62,4 +62,3 @@ RawTask.prototype.call = function () { freeTasks.push(this); } }; - diff --git a/deps/npm/node_modules/dezalgo/node_modules/asap/package.json b/deps/npm/node_modules/dezalgo/node_modules/asap/package.json index e01b3f06de9ed2..ba54d711f849cd 100644 --- a/deps/npm/node_modules/dezalgo/node_modules/asap/package.json +++ b/deps/npm/node_modules/dezalgo/node_modules/asap/package.json @@ -51,35 +51,14 @@ "wd": "^0.2.21", "weak-map": "^1.0.5" }, - "gitHead": "ccbf94d4e4a0c3afc2df13331044020a46a74ab6", + "readme": "# ASAP\n\n[![Build Status](https://travis-ci.org/kriskowal/asap.png?branch=master)](https://travis-ci.org/kriskowal/asap)\n\nPromise and asynchronous observer libraries, as well as hand-rolled callback\nprograms and libraries, often need a mechanism to postpone the execution of a\ncallback until the next available event.\n(See [Designing API’s for Asynchrony][Zalgo].)\nThe `asap` function executes a task **as soon as possible** but not before it\nreturns, waiting only for the completion of the current event and previously\nscheduled tasks.\n\n```javascript\nasap(function () {\n // ...\n});\n```\n\n[Zalgo]: http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony\n\nThis CommonJS package provides an `asap` module that exports a function that\nexecutes a task function *as soon as possible*.\n\nASAP strives to schedule events to occur before yielding for IO, reflow,\nor redrawing.\nEach event receives an independent stack, with only platform code in parent\nframes and the events run in the order they are scheduled.\n\nASAP provides a fast event queue that will execute tasks until it is\nempty before yielding to the JavaScript engine's underlying event-loop.\nWhen a task gets added to a previously empty event queue, ASAP schedules a flush\nevent, preferring for that event to occur before the JavaScript engine has an\nopportunity to perform IO tasks or rendering, thus making the first task and\nsubsequent tasks semantically indistinguishable.\nASAP uses a variety of techniques to preserve this invariant on different\nversions of browsers and Node.js.\n\nBy design, ASAP prevents input events from being handled until the task\nqueue is empty.\nIf the process is busy enough, this may cause incoming connection requests to be\ndropped, and may cause existing connections to inform the sender to reduce the\ntransmission rate or stall.\nASAP allows this on the theory that, if there is enough work to do, there is no\nsense in looking for trouble.\nAs a consequence, ASAP can interfere with smooth animation.\nIf your task should be tied to the rendering loop, consider using\n`requestAnimationFrame` instead.\nA long sequence of tasks can also effect the long running script dialog.\nIf this is a problem, you may be able to use ASAP’s cousin `setImmediate` to\nbreak long processes into shorter intervals and periodically allow the browser\nto breathe.\n`setImmediate` will yield for IO, reflow, and repaint events.\nIt also returns a handler and can be canceled.\nFor a `setImmediate` shim, consider [YuzuJS setImmediate][setImmediate].\n\n[setImmediate]: https://github.com/YuzuJS/setImmediate\n\nTake care.\nASAP can sustain infinite recursive calls without warning.\nIt will not halt from a stack overflow, and it will not consume unbounded\nmemory.\nThis is behaviorally equivalent to an infinite loop.\nJust as with infinite loops, you can monitor a Node.js process for this behavior\nwith a heart-beat signal.\nAs with infinite loops, a very small amount of caution goes a long way to\navoiding problems.\n\n```javascript\nfunction loop() {\n asap(loop);\n}\nloop();\n```\n\nIn browsers, if a task throws an exception, it will not interrupt the flushing\nof high-priority tasks.\nThe exception will be postponed to a later, low-priority event to avoid\nslow-downs.\nIn Node.js, if a task throws an exception, ASAP will resume flushing only if—and\nonly after—the error is handled by `domain.on(\"error\")` or\n`process.on(\"uncaughtException\")`.\n\n## Raw ASAP\n\nChecking for exceptions comes at a cost.\nThe package also provides an `asap/raw` module that exports the underlying\nimplementation which is faster but stalls if a task throws an exception.\nThis internal version of the ASAP function does not check for errors.\nIf a task does throw an error, it will stall the event queue unless you manually\ncall `rawAsap.requestFlush()` before throwing the error, or any time after.\n\nIn Node.js, `asap/raw` also runs all tasks outside any domain.\nIf you need a task to be bound to your domain, you will have to do it manually.\n\n```js\nif (process.domain) {\n task = process.domain.bind(task);\n}\nrawAsap(task);\n```\n\n## Tasks\n\nA task may be any object that implements `call()`.\nA function will suffice, but closures tend not to be reusable and can cause\ngarbage collector churn.\nBoth `asap` and `rawAsap` accept task objects to give you the option of\nrecycling task objects or using higher callable object abstractions.\nSee the `asap` source for an illustration.\n\n\n## Compatibility\n\nASAP is tested on Node.js v0.10 and in a broad spectrum of web browsers.\nThe following charts capture the browser test results for the most recent\nrelease.\nThe first chart shows test results for ASAP running in the main window context.\nThe second chart shows test results for ASAP running in a web worker context.\nTest results are inconclusive (grey) on browsers that do not support web\nworkers.\nThese data are captured automatically by [Continuous\nIntegration][].\n\n[Continuous Integration]: https://github.com/kriskowal/asap/blob/master/CONTRIBUTING.md\n\n![Browser Compatibility](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-results-matrix.svg)\n\n![Compatibility in Web Workers](http://kriskowal-asap.s3-website-us-west-2.amazonaws.com/train/integration-2/saucelabs-worker-results-matrix.svg)\n\n## Caveats\n\nWhen a task is added to an empty event queue, it is not always possible to\nguarantee that the task queue will begin flushing immediately after the current\nevent.\nHowever, once the task queue begins flushing, it will not yield until the queue\nis empty, even if the queue grows while executing tasks.\n\nThe following browsers allow the use of [DOM mutation observers][] to access\nthe HTML [microtask queue][], and thus begin flushing ASAP's task queue\nimmediately at the end of the current event loop turn, before any rendering or\nIO:\n\n[microtask queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#microtask-queue\n[DOM mutation observers]: http://dom.spec.whatwg.org/#mutation-observers\n\n- Android 4–4.3\n- Chrome 26–34\n- Firefox 14–29\n- Internet Explorer 11\n- iPad Safari 6–7.1\n- iPhone Safari 7–7.1\n- Safari 6–7\n\nIn the absense of mutation observers, there are a few browsers, and situations\nlike web workers in some of the above browsers, where [message channels][]\nwould be a useful way to avoid falling back to timers.\nMessage channels give direct access to the HTML [task queue][], so the ASAP\ntask queue would flush after any already queued rendering and IO tasks, but\nwithout having the minimum delay imposed by timers.\nHowever, among these browsers, Internet Explorer 10 and Safari do not reliably\ndispatch messages, so they are not worth the trouble to implement.\n\n[message channels]: http://www.whatwg.org/specs/web-apps/current-work/multipage/web-messaging.html#message-channels\n[task queue]: http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task\n\n- Internet Explorer 10\n- Safair 5.0-1\n- Opera 11-12\n\nIn the absense of mutation observers, these browsers and the following browsers\nall fall back to using `setTimeout` and `setInterval` to ensure that a `flush`\noccurs.\nThe implementation uses both and cancels whatever handler loses the race, since\n`setTimeout` tends to occasionally skip tasks in unisolated circumstances.\nTimers generally delay the flushing of ASAP's task queue for four milliseconds.\n\n- Firefox 3–13\n- Internet Explorer 6–10\n- iPad Safari 4.3\n- Lynx 2.8.7\n\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 Katić began contributing to Q by measuring the performance of\nthe internal implementation of `asap`, paying particular attention to\nerror recovery.\nDomenic, Robert, and Kris Kowal collectively settled on the current strategy of\nunrolling the high-priority event queue internally regardless of what strategy\nwe used to dispatch the potentially lower-priority flush event.\nDomenic went on to make ASAP cooperate with Node.js 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\nEmber’s RSVP promise implementation later [adopted][RSVP ASAP] the name ASAP but\nfurther developed the implentation.\nParticularly, The `MessagePort` implementation was abandoned due to interaction\n[problems with Mobile Internet Explorer][IE Problems] in favor of an\nimplementation backed on the newer and more reliable DOM `MutationObserver`\ninterface.\nThese changes were back-ported into this library.\n\n[IE Problems]: https://github.com/cujojs/when/issues/197\n[RSVP ASAP]: https://github.com/tildeio/rsvp.js/blob/cddf7232546a9cf858524b75cde6f9edf72620a7/lib/rsvp/asap.js\n\nIn addition, ASAP factored into `asap` and `asap/raw`, such that `asap` remained\nexception-safe, but `asap/raw` provided a tight kernel that could be used for\ntasks that guaranteed that they would not throw exceptions.\nThis core is useful for promise implementations that capture thrown errors in\nrejected promises and do not need a second safety net.\nAt the same time, the exception handling in `asap` was factored into separate\nimplementations for Node.js and browsers, using the the [Browserify][Browser\nConfig] `browser` property in `package.json` to instruct browser module loaders\nand bundlers, including [Browserify][], [Mr][], and [Mop][], to use the\nbrowser-only implementation.\n\n[Browser Config]: https://gist.github.com/defunctzombie/4339901\n[Browserify]: https://github.com/substack/node-browserify\n[Mr]: https://github.com/montagejs/mr\n[Mop]: https://github.com/montagejs/mop\n\n## License\n\nCopyright 2009-2014 by Contributors\nMIT License (enclosed)\n\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/kriskowal/asap/issues" }, "homepage": "https://github.com/kriskowal/asap#readme", "_id": "asap@2.0.3", "_shasum": "1fc1d1564ee11620dfca6d67029850913f9f4679", - "_from": "asap@>=2.0.0 <3.0.0", - "_npmVersion": "2.8.3", - "_nodeVersion": "1.8.1", - "_npmUser": { - "name": "kriskowal", - "email": "kris.kowal@cixar.com" - }, - "maintainers": [ - { - "name": "kriskowal", - "email": "kris.kowal@cixar.com" - }, - { - "name": "forbeslindesay", - "email": "forbes@lindesay.co.uk" - } - ], - "dist": { - "shasum": "1fc1d1564ee11620dfca6d67029850913f9f4679", - "tarball": "http://registry.npmjs.org/asap/-/asap-2.0.3.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/asap/-/asap-2.0.3.tgz", - "readme": "ERROR: No README data found!" + "_from": "asap@>=2.0.0 <3.0.0" } diff --git a/deps/npm/node_modules/editor/package.json b/deps/npm/node_modules/editor/package.json index 0e5abd3bfb2607..48c09bff305707 100644 --- a/deps/npm/node_modules/editor/package.json +++ b/deps/npm/node_modules/editor/package.json @@ -56,5 +56,6 @@ "email": "mail@substack.net" } ], - "_resolved": "https://registry.npmjs.org/editor/-/editor-1.0.0.tgz" + "_resolved": "https://registry.npmjs.org/editor/-/editor-1.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/fs-vacuum/package.json b/deps/npm/node_modules/fs-vacuum/package.json index c7d9895a924d72..a1eb3f128684da 100644 --- a/deps/npm/node_modules/fs-vacuum/package.json +++ b/deps/npm/node_modules/fs-vacuum/package.json @@ -34,10 +34,30 @@ "path-is-inside": "^1.0.1", "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": "498a44d987ee11bc355fe1ec479d55a689fc37ef", "_id": "fs-vacuum@1.2.7", "_shasum": "75e501f9d2889ba2fe9fe12f936ba5dad50ca35a", - "_from": "fs-vacuum@1.2.7" + "_from": "fs-vacuum@>=1.2.7 <1.3.0", + "_npmVersion": "2.14.3", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "75e501f9d2889ba2fe9fe12f936ba5dad50ca35a", + "tarball": "http://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.7.tgz" + }, + "maintainers": [ + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/fs-vacuum/-/fs-vacuum-1.2.7.tgz" } diff --git a/deps/npm/node_modules/fs-write-stream-atomic/package.json b/deps/npm/node_modules/fs-write-stream-atomic/package.json index a94785682a9f91..a226dbe48dfa68 100644 --- a/deps/npm/node_modules/fs-write-stream-atomic/package.json +++ b/deps/npm/node_modules/fs-write-stream-atomic/package.json @@ -29,10 +29,33 @@ "url": "https://github.com/npm/fs-write-stream-atomic/issues" }, "homepage": "https://github.com/npm/fs-write-stream-atomic", - "readme": "# fs-write-stream-atomic\n\nLike `fs.createWriteStream(...)`, but atomic.\n\nWrites to a tmp file and does an atomic `fs.rename` to move it into\nplace when it's done.\n\nFirst rule of debugging: **It's always a race condition.**\n\n## USAGE\n\n```javascript\nvar fsWriteStreamAtomic = require('fs-write-stream-atomic')\n// options are optional.\nvar write = fsWriteStreamAtomic('output.txt', options)\nvar read = fs.createReadStream('input.txt')\nread.pipe(write)\n\n// When the write stream emits a 'finish' or 'close' event,\n// you can be sure that it is moved into place, and contains\n// all the bytes that were written to it, even if something else\n// was writing to `output.txt` at the same time.\n```\n\n### `fsWriteStreamAtomic(filename, [options])`\n\n* `filename` {String} The file we want to write to\n* `options` {Object}\n * `chown` {Object} User and group to set ownership after write\n * `uid` {Number}\n * `gid` {Number}\n * `encoding` {String} default = 'utf8'\n * `mode` {Number} default = `0666`\n * `flags` {String} default = `'w'`\n\n", - "readmeFilename": "README.md", "gitHead": "6ca2651b913149543c5390c6c4f7d370bdca42b5", "_id": "fs-write-stream-atomic@1.0.4", "_shasum": "c1ea55889f036ceebdead7d1055edbad998fe5e9", - "_from": "fs-write-stream-atomic@1.0.4" + "_from": "fs-write-stream-atomic@>=1.0.4 <1.1.0", + "_npmVersion": "2.14.3", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "c1ea55889f036ceebdead7d1055edbad998fe5e9", + "tarball": "http://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.4.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.4.tgz" } diff --git a/deps/npm/node_modules/block-stream/LICENSE b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/LICENSE similarity index 100% rename from deps/npm/node_modules/block-stream/LICENSE rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/LICENSE diff --git a/deps/npm/node_modules/minimatch/README.md b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/README.md similarity index 100% rename from deps/npm/node_modules/minimatch/README.md rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/README.md diff --git a/deps/npm/node_modules/minimatch/browser.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/browser.js similarity index 100% rename from deps/npm/node_modules/minimatch/browser.js rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/browser.js diff --git a/deps/npm/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js similarity index 100% rename from deps/npm/node_modules/minimatch/minimatch.js rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.npmignore new file mode 100644 index 00000000000000..353546af2368e1 --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.npmignore @@ -0,0 +1,3 @@ +test +.gitignore +.travis.yml diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md similarity index 96% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/README.md rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md index 62bc7bae3fed28..b0d793ed5d9016 100644 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/README.md +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -1,9 +1,10 @@ # brace-expansion -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) [![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js similarity index 99% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/example.js rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js index 60ecfc74d41618..36cde4de5c114b 100644 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/example.js +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js @@ -5,4 +5,3 @@ console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); console.log(expand('http://www.letters.com/file{a..z..2}.txt')); console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js similarity index 99% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/index.js rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js index a23104e9550173..f8d40f79acde0a 100644 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/index.js +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -188,4 +188,3 @@ function expand(str, isTop) { return expansions; } - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile similarity index 98% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile index fa5da71a6d0d34..dd2730cfde0cab 100644 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile @@ -3,4 +3,3 @@ test: @node_modules/.bin/tape test/*.js .PHONY: test - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js similarity index 99% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js index c02ad348e69aec..9ce76f480a4321 100644 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js @@ -2,4 +2,3 @@ var balanced = require('./'); console.log(balanced('{', '}', 'pre{in{nested}}post')); console.log(balanced('{', '}', 'pre{first}between{second}post')); - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json new file mode 100644 index 00000000000000..35332a3c4eb366 --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -0,0 +1,56 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "0.2.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "main": "index.js", + "scripts": { + "test": "make test" + }, + "dependencies": {}, + "devDependencies": { + "tape": "~1.1.1" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "readme": "# balanced-match\n\nMatch balanced string pairs, like `{` and `}` or `` and ``.\n\n[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match)\n[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)\n\n[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match)\n\n## Example\n\nGet the first matching pair of braces:\n\n```js\nvar balanced = require('balanced-match');\n\nconsole.log(balanced('{', '}', 'pre{in{nested}}post'));\nconsole.log(balanced('{', '}', 'pre{first}between{second}post'));\n```\n\nThe matches are:\n\n```bash\n$ node example.js\n{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }\n{ start: 3,\n end: 9,\n pre: 'pre',\n body: 'first',\n post: 'between{second}post' }\n```\n\n## API\n\n### var m = balanced(a, b, str)\n\nFor the first non-nested matching pair of `a` and `b` in `str`, return an\nobject with those keys:\n\n* **start** the index of the first match of `a`\n* **end** the index of the matching `b`\n* **pre** the preamble, `a` and `b` not included\n* **body** the match, `a` and `b` not included\n* **post** the postscript, `a` and `b` not included\n\nIf there's no match, `undefined` will be returned.\n\nIf the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`.\n\n## Installation\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install balanced-match\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "_id": "balanced-match@0.2.0", + "_shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz", + "_from": "balanced-match@>=0.2.0 <0.3.0" +} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json similarity index 90% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json index 2f1bd3d5d241b8..b516138098fba9 100644 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json @@ -63,7 +63,7 @@ "_id": "concat-map@0.0.1", "dist": { "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "tarball": "https://registrytwo.npmjs.com/concat-map/-/concat-map-0.0.1.tgz" + "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" }, "_from": "concat-map@0.0.1", "_npmVersion": "1.3.21", @@ -78,6 +78,6 @@ } ], "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "_resolved": "https://registrytwo.npmjs.com/concat-map/-/concat-map-0.0.1.tgz", + "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js similarity index 100% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json similarity index 83% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/package.json rename to deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json index 5f1866c8b5a29e..4cb3e05d7ceb6c 100644 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -1,7 +1,7 @@ { "name": "brace-expansion", "description": "Brace expansion as known from sh/bash", - "version": "1.1.0", + "version": "1.1.1", "repository": { "type": "git", "url": "git://github.com/juliangruber/brace-expansion.git" @@ -42,15 +42,15 @@ "android-browser/4.2..latest" ] }, - "gitHead": "b5fa3b1c74e5e2dba2d0efa19b28335641bc1164", + "gitHead": "f50da498166d76ea570cf3b30179f01f0f119612", "bugs": { "url": "https://github.com/juliangruber/brace-expansion/issues" }, - "_id": "brace-expansion@1.1.0", - "_shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", + "_id": "brace-expansion@1.1.1", + "_shasum": "da5fb78aef4c44c9e4acf525064fb3208ebab045", "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.10", - "_nodeVersion": "0.10.32", + "_npmVersion": "2.6.1", + "_nodeVersion": "0.10.36", "_npmUser": { "name": "juliangruber", "email": "julian@juliangruber.com" @@ -66,10 +66,10 @@ } ], "dist": { - "shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz" + "shasum": "da5fb78aef4c44c9e4acf525064fb3208ebab045", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz", + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json new file mode 100644 index 00000000000000..e9256630aa3819 --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json @@ -0,0 +1,46 @@ +{ + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me" + }, + "name": "minimatch", + "description": "a glob matcher in javascript", + "version": "2.0.10", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "main": "minimatch.js", + "scripts": { + "posttest": "standard minimatch.js test/*.js", + "test": "tap test/*.js", + "prepublish": "browserify -o browser.js -e minimatch.js -s minimatch --bare" + }, + "engines": { + "node": "*" + }, + "dependencies": { + "brace-expansion": "^1.0.0" + }, + "devDependencies": { + "browserify": "^9.0.3", + "standard": "^3.7.2", + "tap": "^1.2.0" + }, + "license": "ISC", + "files": [ + "minimatch.js", + "browser.js" + ], + "readme": "# minimatch\n\nA minimal matching utility.\n\n[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\nminimatch(\"bar.foo\", \"*.+(bar|foo)\", { debug: true }) // true, and noisy!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself if this option is set. When not set, an empty list\nis returned if there are no matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" + }, + "homepage": "https://github.com/isaacs/minimatch#readme", + "_id": "minimatch@2.0.10", + "_shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", + "_from": "minimatch@>=2.0.1 <3.0.0" +} diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/test/00-setup.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/test/00-setup.js index 7d7e4a1b784c23..351bcd10f15782 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/test/00-setup.js +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/test/00-setup.js @@ -68,4 +68,3 @@ tap.test("create fixtures", function (t) { }) t.end() }) - diff --git a/deps/npm/node_modules/fstream/package.json b/deps/npm/node_modules/fstream/package.json index 8c008195442823..dd1f45fc99faf6 100644 --- a/deps/npm/node_modules/fstream/package.json +++ b/deps/npm/node_modules/fstream/package.json @@ -29,8 +29,6 @@ "test": "standard && tap examples/*.js" }, "license": "ISC", - "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": "d9f81146c50e687f1df04c1a0e7e4c173eb3dae2", "bugs": { "url": "https://github.com/isaacs/fstream/issues" @@ -38,5 +36,36 @@ "homepage": "https://github.com/isaacs/fstream#readme", "_id": "fstream@1.0.8", "_shasum": "7e8d7a73abb3647ef36e4b8a15ca801dba03d038", - "_from": "fstream@1.0.8" + "_from": "fstream@>=1.0.8 <1.1.0", + "_npmVersion": "2.14.3", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "7e8d7a73abb3647ef36e4b8a15ca801dba03d038", + "tarball": "http://registry.npmjs.org/fstream/-/fstream-1.0.8.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.8.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/github-url-from-git/Makefile b/deps/npm/node_modules/github-url-from-git/Makefile deleted file mode 100644 index 37f330e81b98c1..00000000000000 --- a/deps/npm/node_modules/github-url-from-git/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @./node_modules/.bin/mocha test.js --reporter spec --require should - -.PHONY: test diff --git a/deps/npm/node_modules/github-url-from-git/Readme.md b/deps/npm/node_modules/github-url-from-git/Readme.md deleted file mode 100644 index 9dccaa8db696fa..00000000000000 --- a/deps/npm/node_modules/github-url-from-git/Readme.md +++ /dev/null @@ -1,92 +0,0 @@ - -# github-url-from-git - -```js -describe('parse(url)', function(){ - it('should support git://*', function(){ - var url = 'git://github.com/jamesor/mongoose-versioner'; - parse(url).should.equal('https://github.com/jamesor/mongoose-versioner'); - }) - - it('should support git://*.git', function(){ - var url = 'git://github.com/treygriffith/cellar.git'; - parse(url).should.equal('https://github.com/treygriffith/cellar'); - }) - - it('should support https://*', function(){ - var url = 'https://github.com/Empeeric/i18n-node'; - parse(url).should.equal('https://github.com/Empeeric/i18n-node'); - }) - - it('should support https://*.git', function(){ - var url = 'https://jpillora@github.com/banchee/tranquil.git'; - parse(url).should.equal('https://github.com/banchee/tranquil'); - }) - - it('should return undefined on failure', function(){ - var url = 'git://github.com/justgord/.git'; - assert(null == parse(url)); - }) - - it('should parse git@github.com:bcoe/thumbd.git', function() { - var url = 'git@github.com:bcoe/thumbd.git'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse git@github.com:bcoe/thumbd.git#2.7.0', function() { - var url = 'git@github.com:bcoe/thumbd.git#2.7.0'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse git+https://github.com/bcoe/thumbd.git', function() { - var url = 'git+https://github.com/bcoe/thumbd.git'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse git+ssh://github.com/bcoe/thumbd.git', function() { - var url = 'git+ssh://github.com/bcoe/thumbd.git'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse https://EastCloud@github.com/EastCloud/node-websockets.git', function() { - var url = 'https://EastCloud@github.com/EastCloud/node-websockets.git'; - parse(url).should.eql('https://github.com/EastCloud/node-websockets'); - }) - - // gist urls. - - it('should parse git@gist urls', function() { - var url = 'git@gist.github.com:3135914.git'; - parse(url).should.equal('https://gist.github.com/3135914') - }) - - it('should parse https://gist urls', function() { - var url = 'https://gist.github.com/3135914.git'; - parse(url).should.equal('https://gist.github.com/3135914') - }) - - // Handle arbitrary GitHub Enterprise domains. - - it('should parse parse extra GHE urls provided', function() { - var url = 'git://github.example.com/treygriffith/cellar.git'; - parse( - url, {extraBaseUrls: ['github.example.com']} - ).should.equal('https://github.example.com/treygriffith/cellar'); - }); - - it('should parse GHE urls with multiple subdomains', function() { - var url = 'git://github.internal.example.com/treygriffith/cellar.git'; - parse( - url, {extraBaseUrls: ['github.internal.example.com']} - ).should.equal('https://github.internal.example.com/treygriffith/cellar'); - }); -}) - -describe('re', function() { - it('should expose GitHub url parsing regex', function() { - parse.re.source.should.equal( - /^(?:https?:\/\/|git:\/\/)?(?:[^@]+@)?(gist.github.com|github.com)[:\/]([^\/]+\/[^\/]+?|[0-9]+)$/.source - ) - }); -}) -``` diff --git a/deps/npm/node_modules/github-url-from-git/index.js b/deps/npm/node_modules/github-url-from-git/index.js deleted file mode 100644 index 44872e8c10c2f8..00000000000000 --- a/deps/npm/node_modules/github-url-from-git/index.js +++ /dev/null @@ -1,32 +0,0 @@ -// convert git:// form url to github URL, e.g., -// git://github.com/bcoe/foo.git -// https://github.com/bcoe/foo. -function githubUrlFromGit(url, opts){ - try { - var m = re(opts).exec(url.replace(/\.git(#.*)?$/, '')); - var host = m[1]; - var path = m[2]; - return 'https://' + host + '/' + path; - } catch (err) { - // ignore - } -}; - -// generate the git:// parsing regex -// with options, e.g., the ability -// to specify multiple GHE domains. -function re(opts) { - opts = opts || {}; - // whitelist of URLs that should be treated as GitHub repos. - var baseUrls = ['gist.github.com', 'github.com'].concat(opts.extraBaseUrls || []); - // build regex from whitelist. - return new RegExp( - /^(?:https?:\/\/|git:\/\/|git\+ssh:\/\/|git\+https:\/\/)?(?:[^@]+@)?/.source + - '(' + baseUrls.join('|') + ')' + - /[:\/]([^\/]+\/[^\/]+?|[0-9]+)$/.source - ); -} - -githubUrlFromGit.re = re(); - -module.exports = githubUrlFromGit; diff --git a/deps/npm/node_modules/github-url-from-git/package.json b/deps/npm/node_modules/github-url-from-git/package.json deleted file mode 100644 index 229af333ca4146..00000000000000 --- a/deps/npm/node_modules/github-url-from-git/package.json +++ /dev/null @@ -1,57 +0,0 @@ -{ - "name": "github-url-from-git", - "version": "1.4.0", - "description": "Parse a github git url and return the github repo url", - "main": "index.js", - "scripts": { - "test": "mocha test.js --reporter spec --require should" - }, - "repository": { - "type": "git", - "url": "https://github.com/visionmedia/node-github-url-from-git.git" - }, - "keywords": [ - "github", - "git", - "url", - "parser" - ], - "author": { - "name": "TJ Holowaychuk" - }, - "license": "MIT", - "devDependencies": { - "better-assert": "~1.0.0", - "mocha": "~1.9.0", - "should": "~1.2.2" - }, - "gitHead": "154df00b0b590c29be5d2a5822e7b2e160b75345", - "bugs": { - "url": "https://github.com/visionmedia/node-github-url-from-git/issues" - }, - "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-0 <2.0.0-0", - "_npmVersion": "2.0.0-alpha.7", - "_npmUser": { - "name": "bcoe", - "email": "bencoe@gmail.com" - }, - "maintainers": [ - { - "name": "tjholowaychuk", - "email": "tj@vision-media.ca" - }, - { - "name": "bcoe", - "email": "bencoe@gmail.com" - } - ], - "dist": { - "shasum": "285e6b520819001bde128674704379e4ff03e0de", - "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" -} diff --git a/deps/npm/node_modules/github-url-from-git/test.js b/deps/npm/node_modules/github-url-from-git/test.js deleted file mode 100644 index 93aa38bb1f9f9f..00000000000000 --- a/deps/npm/node_modules/github-url-from-git/test.js +++ /dev/null @@ -1,90 +0,0 @@ -var parse = require('./'); -var assert = require('better-assert'); - -describe('parse(url)', function(){ - it('should support git://*', function(){ - var url = 'git://github.com/jamesor/mongoose-versioner'; - parse(url).should.equal('https://github.com/jamesor/mongoose-versioner'); - }) - - it('should support git://*.git', function(){ - var url = 'git://github.com/treygriffith/cellar.git'; - parse(url).should.equal('https://github.com/treygriffith/cellar'); - }) - - it('should support https://*', function(){ - var url = 'https://github.com/Empeeric/i18n-node'; - parse(url).should.equal('https://github.com/Empeeric/i18n-node'); - }) - - it('should support https://*.git', function(){ - var url = 'https://jpillora@github.com/banchee/tranquil.git'; - parse(url).should.equal('https://github.com/banchee/tranquil'); - }) - - it('should return undefined on failure', function(){ - var url = 'git://github.com/justgord/.git'; - assert(null == parse(url)); - }) - - it('should parse git@github.com:bcoe/thumbd.git', function() { - var url = 'git@github.com:bcoe/thumbd.git'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse git@github.com:bcoe/thumbd.git#2.7.0', function() { - var url = 'git@github.com:bcoe/thumbd.git#2.7.0'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse git+https://github.com/bcoe/thumbd.git', function() { - var url = 'git+https://github.com/bcoe/thumbd.git'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse git+ssh://github.com/bcoe/thumbd.git', function() { - var url = 'git+ssh://github.com/bcoe/thumbd.git'; - parse(url).should.eql('https://github.com/bcoe/thumbd'); - }) - - it('should parse https://EastCloud@github.com/EastCloud/node-websockets.git', function() { - var url = 'https://EastCloud@github.com/EastCloud/node-websockets.git'; - parse(url).should.eql('https://github.com/EastCloud/node-websockets'); - }) - - // gist urls. - - it('should parse git@gist urls', function() { - var url = 'git@gist.github.com:3135914.git'; - parse(url).should.equal('https://gist.github.com/3135914') - }) - - it('should parse https://gist urls', function() { - var url = 'https://gist.github.com/3135914.git'; - parse(url).should.equal('https://gist.github.com/3135914') - }) - - // Handle arbitrary GitHub Enterprise domains. - - it('should parse parse extra GHE urls provided', function() { - var url = 'git://github.example.com/treygriffith/cellar.git'; - parse( - url, {extraBaseUrls: ['github.example.com']} - ).should.equal('https://github.example.com/treygriffith/cellar'); - }); - - it('should parse GHE urls with multiple subdomains', function() { - var url = 'git://github.internal.example.com/treygriffith/cellar.git'; - parse( - url, {extraBaseUrls: ['github.internal.example.com']} - ).should.equal('https://github.internal.example.com/treygriffith/cellar'); - }); -}) - -describe('re', function() { - it('should expose GitHub url parsing regex', function() { - parse.re.source.should.equal( - /^(?:https?:\/\/|git:\/\/|git\+ssh:\/\/|git\+https:\/\/)?(?:[^@]+@)?(gist.github.com|github.com)[:\/]([^\/]+\/[^\/]+?|[0-9]+)$/.source - ) - }); -}) diff --git a/deps/npm/node_modules/github-url-from-username-repo/.npmignore b/deps/npm/node_modules/github-url-from-username-repo/.npmignore deleted file mode 100644 index 39747c08b4dc95..00000000000000 --- a/deps/npm/node_modules/github-url-from-username-repo/.npmignore +++ /dev/null @@ -1,13 +0,0 @@ -*.swp -.*.swp - -.DS_Store -*~ -.project -.settings -npm-debug.log -coverage.html -.idea -lib-cov - -node_modules \ No newline at end of file diff --git a/deps/npm/node_modules/github-url-from-username-repo/README.md b/deps/npm/node_modules/github-url-from-username-repo/README.md deleted file mode 100644 index 9adbee0ea38635..00000000000000 --- a/deps/npm/node_modules/github-url-from-username-repo/README.md +++ /dev/null @@ -1,21 +0,0 @@ -[![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) -[![Dependency Status](https://gemnasium.com/robertkowalski/github-url-from-username-repo.png)](https://gemnasium.com/robertkowalski/github-url-from-username-repo) - - -# github-url-from-username-repo - -## API - -### getUrl(url, [forBrowser]) - -Get's the url normalized for npm. -If `forBrowser` is true, return a GitHub url that is usable in a webbrowser. - -## Usage - -```javascript - -var getUrl = require("github-url-from-username-repo") -getUrl("visionmedia/express") // https://github.com/visionmedia/express - -``` 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 deleted file mode 100644 index f9d77f952f59fa..00000000000000 --- a/deps/npm/node_modules/github-url-from-username-repo/index.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = getUrl - -function getUrl (r, forBrowser) { - if (!r) return null - // 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 - } - - return null -} 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 deleted file mode 100644 index f8aa80d5b6fb0b..00000000000000 --- a/deps/npm/node_modules/github-url-from-username-repo/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "github-url-from-username-repo", - "version": "1.0.2", - "description": "Create urls from username/repo", - "main": "index.js", - "scripts": { - "test": "mocha -R spec" - }, - "devDependencies": { - "mocha": "~1.13.0" - }, - "repository": { - "type": "git", - "url": "git@github.com:robertkowalski/github-url-from-username-repo.git" - }, - "author": { - "name": "Robert Kowalski", - "email": "rok@kowalski.gd" - }, - "license": "BSD-2-Clause", - "bugs": { - "url": "https://github.com/robertkowalski/github-url-from-username-repo/issues" - }, - "keywords": [ - "git", - "github", - "repo" - ], - "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.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 deleted file mode 100644 index 10fe3a34cc37c3..00000000000000 --- a/deps/npm/node_modules/github-url-from-username-repo/test/index.js +++ /dev/null @@ -1,70 +0,0 @@ -var assert = require("assert") -var getUrl = require("../") - -describe("github url from username/repo", function () { - it("returns a github url for the username/repo", function () { - var url = getUrl("visionmedia/express") - assert.equal("https://github.com/visionmedia/express", url) - }) - - it("returns null if it does not match", function () { - var url = getUrl("package") - assert.deepEqual(null, url) - }) - - it("returns null if no repo/user was given", function () { - var url = getUrl() - 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) - }) - - it("works with . in the beginning", function () { - var url = getUrl("component/.downloader.js") - assert.equal("https://github.com/component/.downloader.js", url) - }) - - it("works with -", function () { - var url = getUrl("component/-dow-nloader.j-s") - assert.equal("https://github.com/component/-dow-nloader.j-s", url) - }) - - it("can handle branches with #", function () { - var url = getUrl( - "component/entejs#1c3e1fe71640b4b477f04d947bd53c473799b277") - - assert.equal("https://github.com/component/entejs#1c3e1fe71640b" + - "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( - "component/entejs#1c3e1fe71640b4b477f04d947bd53c473799b277", true) - - assert.equal("https://github.com/component/entejs/tree/1c3e1fe71640b" + - "4b477f04d947bd53c473799b277", url) - }) - it("is able to return urls without a branch for the browser", function () { - var url = getUrl( - "component/entejs", true) - - assert.equal("https://github.com/component/entejs", url) - }) - }) -}) diff --git a/deps/npm/node_modules/chmodr/LICENSE b/deps/npm/node_modules/glob/node_modules/minimatch/LICENSE similarity index 100% rename from deps/npm/node_modules/chmodr/LICENSE rename to deps/npm/node_modules/glob/node_modules/minimatch/LICENSE diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/glob/node_modules/minimatch/README.md new file mode 100644 index 00000000000000..d458bc2e0a6b03 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/README.md @@ -0,0 +1,216 @@ +# minimatch + +A minimal matching utility. + +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) + + +This is the matching library used internally by npm. + +It works by converting glob expressions into JavaScript `RegExp` +objects. + +## Usage + +```javascript +var minimatch = require("minimatch") + +minimatch("bar.foo", "*.foo") // true! +minimatch("bar.foo", "*.bar") // false! +minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! +``` + +## Features + +Supports these glob features: + +* Brace Expansion +* Extended glob matching +* "Globstar" `**` matching + +See: + +* `man sh` +* `man bash` +* `man 3 fnmatch` +* `man 5 gitignore` + +## Minimatch Class + +Create a minimatch object by instanting the `minimatch.Minimatch` class. + +```javascript +var Minimatch = require("minimatch").Minimatch +var mm = new Minimatch(pattern, options) +``` + +### Properties + +* `pattern` The original pattern the minimatch object represents. +* `options` The options supplied to the constructor. +* `set` A 2-dimensional array of regexp or string expressions. + Each row in the + array corresponds to a brace-expanded pattern. Each item in the row + corresponds to a single path-part. For example, the pattern + `{a,b/c}/d` would expand to a set of patterns like: + + [ [ a, d ] + , [ b, c, d ] ] + + If a portion of the pattern doesn't have any "magic" in it + (that is, it's something like `"foo"` rather than `fo*o?`), then it + will be left as a string rather than converted to a regular + expression. + +* `regexp` Created by the `makeRe` method. A single regular expression + expressing the entire pattern. This is useful in cases where you wish + to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. +* `negate` True if the pattern is negated. +* `comment` True if the pattern is a comment. +* `empty` True if the pattern is `""`. + +### Methods + +* `makeRe` Generate the `regexp` member if necessary, and return it. + Will return `false` if the pattern is invalid. +* `match(fname)` Return true if the filename matches the pattern, or + false otherwise. +* `matchOne(fileArray, patternArray, partial)` Take a `/`-split + filename, and match it against a single row in the `regExpSet`. This + method is mainly for internal use, but is exposed so that it can be + used by a glob-walker that needs to avoid excessive filesystem calls. + +All other methods are internal, and will be called as necessary. + +## Functions + +The top-level exported function has a `cache` property, which is an LRU +cache set to store 100 items. So, calling these methods repeatedly +with the same pattern and options will use the same Minimatch object, +saving the cost of parsing it multiple times. + +### minimatch(path, pattern, options) + +Main export. Tests a path against the pattern using the options. + +```javascript +var isJS = minimatch(file, "*.js", { matchBase: true }) +``` + +### minimatch.filter(pattern, options) + +Returns a function that tests its +supplied argument, suitable for use with `Array.filter`. Example: + +```javascript +var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) +``` + +### minimatch.match(list, pattern, options) + +Match against the list of +files, in the style of fnmatch or glob. If nothing is matched, and +options.nonull is set, then return a list containing the pattern itself. + +```javascript +var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) +``` + +### minimatch.makeRe(pattern, options) + +Make a regular expression object from the pattern. + +## Options + +All options are `false` by default. + +### debug + +Dump a ton of stuff to stderr. + +### nobrace + +Do not expand `{a,b}` and `{1..3}` brace sets. + +### noglobstar + +Disable `**` matching against multiple folder names. + +### dot + +Allow patterns to match filenames starting with a period, even if +the pattern does not explicitly have a period in that spot. + +Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` +is set. + +### noext + +Disable "extglob" style patterns like `+(a|b)`. + +### nocase + +Perform a case-insensitive match. + +### nonull + +When a match is not found by `minimatch.match`, return a list containing +the pattern itself if this option is set. When not set, an empty list +is returned if there are no matches. + +### matchBase + +If set, then patterns without slashes will be matched +against the basename of the path if it contains slashes. For example, +`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. + +### nocomment + +Suppress the behavior of treating `#` at the start of a pattern as a +comment. + +### nonegate + +Suppress the behavior of treating a leading `!` character as negation. + +### flipNegate + +Returns from negate expressions the same as if they were not negated. +(Ie, true on a hit, false on a miss.) + + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between minimatch and other +implementations, and are intentional. + +If the pattern starts with a `!` character, then it is negated. Set the +`nonegate` flag to suppress this behavior, and treat leading `!` +characters normally. This is perhaps relevant if you wish to start the +pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` +characters at the start of a pattern will negate the pattern multiple +times. + +If a pattern starts with `#`, then it is treated as a comment, and +will not match anything. Use `\#` to match a literal `#` at the +start of a line, or set the `nocomment` flag to suppress this behavior. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.1, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then minimatch.match returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js new file mode 100644 index 00000000000000..ec4c05c570c52e --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js @@ -0,0 +1,912 @@ +module.exports = minimatch +minimatch.Minimatch = Minimatch + +var path = { sep: '/' } +try { + path = require('path') +} catch (er) {} + +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') + +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' + +// * => any number of characters +var star = qmark + '*?' + +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' + +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' + +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') + +// "abc" -> { a:true, b:true, c:true } +function charSet (s) { + return s.split('').reduce(function (set, c) { + set[c] = true + return set + }, {}) +} + +// normalizes slashes. +var slashSplit = /\/+/ + +minimatch.filter = filter +function filter (pattern, options) { + options = options || {} + return function (p, i, list) { + return minimatch(p, pattern, options) + } +} + +function ext (a, b) { + a = a || {} + b = b || {} + var t = {} + Object.keys(b).forEach(function (k) { + t[k] = b[k] + }) + Object.keys(a).forEach(function (k) { + t[k] = a[k] + }) + return t +} + +minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return minimatch + + var orig = minimatch + + var m = function minimatch (p, pattern, options) { + return orig.minimatch(p, pattern, ext(def, options)) + } + + m.Minimatch = function Minimatch (pattern, options) { + return new orig.Minimatch(pattern, ext(def, options)) + } + + return m +} + +Minimatch.defaults = function (def) { + if (!def || !Object.keys(def).length) return Minimatch + return minimatch.defaults(def).Minimatch +} + +function minimatch (p, pattern, options) { + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false + } + + // "" only matches "" + if (pattern.trim() === '') return p === '' + + return new Minimatch(pattern, options).match(p) +} + +function Minimatch (pattern, options) { + if (!(this instanceof Minimatch)) { + return new Minimatch(pattern, options) + } + + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') + } + + if (!options) options = {} + pattern = pattern.trim() + + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') + } + + this.options = options + this.set = [] + this.pattern = pattern + this.regexp = null + this.negate = false + this.comment = false + this.empty = false + + // make the set of regexps etc. + this.make() +} + +Minimatch.prototype.debug = function () {} + +Minimatch.prototype.make = make +function make () { + // don't do it more than once. + if (this._made) return + + var pattern = this.pattern + var options = this.options + + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true + return + } + if (!pattern) { + this.empty = true + return + } + + // step 1: figure out negation, etc. + this.parseNegate() + + // step 2: expand braces + var set = this.globSet = this.braceExpand() + + if (options.debug) this.debug = console.error + + this.debug(this.pattern, set) + + // step 3: now we have a set, so turn each one into a series of path-portion + // matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + set = this.globParts = set.map(function (s) { + return s.split(slashSplit) + }) + + this.debug(this.pattern, set) + + // glob --> regexps + set = set.map(function (s, si, set) { + return s.map(this.parse, this) + }, this) + + this.debug(this.pattern, set) + + // filter out everything that didn't compile properly. + set = set.filter(function (s) { + return s.indexOf(false) === -1 + }) + + this.debug(this.pattern, set) + + this.set = set +} + +Minimatch.prototype.parseNegate = parseNegate +function parseNegate () { + var pattern = this.pattern + var negate = false + var options = this.options + var negateOffset = 0 + + if (options.nonegate) return + + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { + negate = !negate + negateOffset++ + } + + if (negateOffset) this.pattern = pattern.substr(negateOffset) + this.negate = negate +} + +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +minimatch.braceExpand = function (pattern, options) { + return braceExpand(pattern, options) +} + +Minimatch.prototype.braceExpand = braceExpand + +function braceExpand (pattern, options) { + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' + ? this.pattern : pattern + + if (typeof pattern === 'undefined') { + throw new Error('undefined pattern') + } + + if (options.nobrace || + !pattern.match(/\{.*\}/)) { + // shortcut. no need to expand. + return [pattern] + } + + return expand(pattern) +} + +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +Minimatch.prototype.parse = parse +var SUBPARSE = {} +function parse (pattern, isSub) { + var options = this.options + + // shortcuts + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var plType + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this + + function clearStateChar () { + if (stateChar) { + // we had some state-tracking character + // that wasn't consumed by this pass. + switch (stateChar) { + case '*': + re += star + hasMagic = true + break + case '?': + re += qmark + hasMagic = true + break + default: + re += '\\' + stateChar + break + } + self.debug('clearStateChar %j %j', stateChar, re) + stateChar = false + } + } + + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) + + // skip over any that are escaped. + if (escaping && reSpecials[c]) { + re += '\\' + c + escaping = false + continue + } + + switch (c) { + case '/': + // completely not allowed, even escaped. + // Should already be path-split by now. + return false + + case '\\': + clearStateChar() + escaping = true + continue + + // the various stateChar values + // for the "extglob" stuff. + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) + + // all of those are literals inside a class, except that + // the glob [!a] means [^a] in regexp + if (inClass) { + this.debug(' in class') + if (c === '!' && i === classStart + 1) c = '^' + re += c + continue + } + + // if we already have a stateChar, then it means + // that there was something like ** or +? in there. + // Handle the stateChar, then proceed with this one. + self.debug('call clearStateChar %j', stateChar) + clearStateChar() + stateChar = c + // if extglob is disabled, then +(asdf|foo) isn't a thing. + // just clear the statechar *now*, rather than even diving into + // the patternList stuff. + if (options.noext) clearStateChar() + continue + + case '(': + if (inClass) { + re += '(' + continue + } + + if (!stateChar) { + re += '\\(' + continue + } + + plType = stateChar + patternListStack.push({ + type: plType, + start: i - 1, + reStart: re.length + }) + // negation is (?:(?!js)[^/]*) + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' + this.debug('plType %j %j', stateChar, re) + stateChar = false + continue + + case ')': + if (inClass || !patternListStack.length) { + re += '\\)' + continue + } + + clearStateChar() + hasMagic = true + re += ')' + var pl = patternListStack.pop() + plType = pl.type + // negation is (?:(?!js)[^/]*) + // The others are (?:) + switch (plType) { + case '!': + negativeLists.push(pl) + re += ')[^/]*?)' + pl.reEnd = re.length + break + case '?': + case '+': + case '*': + re += plType + break + case '@': break // the default anyway + } + continue + + case '|': + if (inClass || !patternListStack.length || escaping) { + re += '\\|' + escaping = false + continue + } + + clearStateChar() + re += '|' + continue + + // these are mostly the same in regexp and glob + case '[': + // swallow any state-tracking char before the [ + clearStateChar() + + if (inClass) { + re += '\\' + c + continue + } + + inClass = true + classStart = i + reClassStart = re.length + re += c + continue + + case ']': + // a right bracket shall lose its special + // meaning and represent itself in + // a bracket expression if it occurs + // first in the list. -- POSIX.2 2.8.3.2 + if (i === classStart + 1 || !inClass) { + re += '\\' + c + escaping = false + continue + } + + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + + // finish up the class. + hasMagic = true + inClass = false + re += c + continue + + default: + // swallow any state char that wasn't consumed + clearStateChar() + + if (escaping) { + // no need + escaping = false + } else if (reSpecials[c] + && !(c === '^' && inClass)) { + re += '\\' + } + + re += c + + } // switch + } // for + + // handle the case where we left a class open. + // "[abc" is valid, equivalent to "\[abc" + if (inClass) { + // split where the last [ was, and escape it + // this is a huge pita. We now have to re-walk + // the contents of the would-be class to re-translate + // any characters that were passed through as-is + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + hasMagic = hasMagic || sp[1] + } + + // handle the case where we had a +( thing at the *end* + // of the pattern. + // each pattern list stack adds 3 chars, and we need to go through + // and escape any | chars that were passed through as-is for the regexp. + // Go through and escape them, taking care not to double-escape any + // | chars that were already escaped. + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + 3) + // maybe some even number of \, then maybe 1 \, followed by a | + tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + if (!$2) { + // the | isn't already escaped, so escape it. + $2 = '\\' + } + + // need to escape all those slashes *again*, without escaping the + // one that we need for escaping the | character. As it works out, + // escaping an even number of slashes can be done by simply repeating + // it exactly after itself. That's why this trick works. + // + // I am sorry that you have to see this. + return $1 + $1 + $2 + '|' + }) + + this.debug('tail=%j\n %s', tail, tail) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type + + hasMagic = true + re = re.slice(0, pl.reStart) + t + '\\(' + tail + } + + // handle trailing things that only matter at the very end. + clearStateChar() + if (escaping) { + // trailing \\ + re += '\\\\' + } + + // only need to apply the nodot start if the re starts with + // something that could conceivably capture a dot + var addPatternStart = false + switch (re.charAt(0)) { + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe + } + + // if the re is not "" at this point, then we need to make sure + // it doesn't match against an empty path part. + // Otherwise a/* will match a/, which it should not. + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } + + if (addPatternStart) { + re = patternStart + re + } + + // parsing just a piece of a larger pattern. + if (isSub === SUBPARSE) { + return [re, hasMagic] + } + + // skip the regexp for non-magical patterns + // unescape anything in it, though, so that it'll be + // an exact match against a file etc. + if (!hasMagic) { + return globUnescape(pattern) + } + + var flags = options.nocase ? 'i' : '' + var regExp = new RegExp('^' + re + '$', flags) + + regExp._glob = pattern + regExp._src = re + + return regExp +} + +minimatch.makeRe = function (pattern, options) { + return new Minimatch(pattern, options || {}).makeRe() +} + +Minimatch.prototype.makeRe = makeRe +function makeRe () { + if (this.regexp || this.regexp === false) return this.regexp + + // at this point, this.set is a 2d array of partial + // pattern strings, or "**". + // + // It's better to use .match(). This function shouldn't + // be used, really, but it's pretty convenient sometimes, + // when you just want to work with a regex. + var set = this.set + + if (!set.length) { + this.regexp = false + return this.regexp + } + var options = this.options + + var twoStar = options.noglobstar ? star + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' + + var re = set.map(function (pattern) { + return pattern.map(function (p) { + return (p === GLOBSTAR) ? twoStar + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') + + // must match entire pattern + // ending in a * or ** will make it less strict. + re = '^(?:' + re + ')$' + + // can match anything, as long as it's not this. + if (this.negate) re = '^(?!' + re + ').*$' + + try { + this.regexp = new RegExp(re, flags) + } catch (ex) { + this.regexp = false + } + return this.regexp +} + +minimatch.match = function (list, pattern, options) { + options = options || {} + var mm = new Minimatch(pattern, options) + list = list.filter(function (f) { + return mm.match(f) + }) + if (mm.options.nonull && !list.length) { + list.push(pattern) + } + return list +} + +Minimatch.prototype.match = match +function match (f, partial) { + this.debug('match', f, this.pattern) + // short-circuit in the case of busted things. + // comments, etc. + if (this.comment) return false + if (this.empty) return f === '' + + if (f === '/' && partial) return true + + var options = this.options + + // windows: need to use /, not \ + if (path.sep !== '/') { + f = f.split(path.sep).join('/') + } + + // treat the test path as a set of pathparts. + f = f.split(slashSplit) + this.debug(this.pattern, 'split', f) + + // just ONE of the pattern sets in this.set needs to match + // in order for it to be valid. If negating, then just one + // match means that we have failed. + // Either way, return on the first hit. + + var set = this.set + this.debug(this.pattern, 'set', set) + + // Find the basename of the path by looking for the last non-empty segment + var filename + var i + for (i = f.length - 1; i >= 0; i--) { + filename = f[i] + if (filename) break + } + + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f + if (options.matchBase && pattern.length === 1) { + file = [filename] + } + var hit = this.matchOne(file, pattern, partial) + if (hit) { + if (options.flipNegate) return true + return !this.negate + } + } + + // didn't get any hits. this is success if it's a negative + // pattern, failure otherwise. + if (options.flipNegate) return false + return this.negate +} + +// set partial to true to test if, for example, +// "/a/b" matches the start of "/*/b/*/d" +// Partial means, if you run out of file before you run +// out of pattern, then that's fine, as long as all +// the parts match. +Minimatch.prototype.matchOne = function (file, pattern, partial) { + var options = this.options + + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) + + this.debug('matchOne', file.length, pattern.length) + + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length + ; (fi < fl) && (pi < pl) + ; fi++, pi++) { + this.debug('matchOne loop') + var p = pattern[pi] + var f = file[fi] + + this.debug(pattern, p, f) + + // should be impossible. + // some invalid regexp stuff in the set. + if (p === false) return false + + if (p === GLOBSTAR) { + this.debug('GLOBSTAR', [pattern, p, f]) + + // "**" + // a/**/b/**/c would match the following: + // a/b/x/y/z/c + // a/x/y/z/b/c + // a/b/x/b/x/c + // a/b/c + // To do this, take the rest of the pattern after + // the **, and see if it would match the file remainder. + // If so, return success. + // If not, the ** "swallows" a segment, and try again. + // This is recursively awful. + // + // a/**/b/**/c matching a/b/x/y/z/c + // - a matches a + // - doublestar + // - matchOne(b/x/y/z/c, b/**/c) + // - b matches b + // - doublestar + // - matchOne(x/y/z/c, c) -> no + // - matchOne(y/z/c, c) -> no + // - matchOne(z/c, c) -> no + // - matchOne(c, c) yes, hit + var fr = fi + var pr = pi + 1 + if (pr === pl) { + this.debug('** at the end') + // a ** at the end will just swallow the rest. + // We have found a match. + // however, it will not swallow /.x, unless + // options.dot is set. + // . and .. are *never* matched by **, for explosively + // exponential reasons. + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false + } + return true + } + + // ok, let's see if we can swallow whatever we can. + while (fr < fl) { + var swallowee = file[fr] + + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) + + // XXX remove this slice. Just pass the start index. + if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { + this.debug('globstar found match!', fr, fl, swallowee) + // found a match. + return true + } else { + // can't swallow "." or ".." ever. + // can only swallow ".foo" when explicitly asked. + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break + } + + // ** swallows a segment, and continue. + this.debug('globstar swallow a segment, and continue') + fr++ + } + } + + // no match was found. + // However, in partial mode, we can't say this is necessarily over. + // If there's more *pattern* left, then + if (partial) { + // ran out of file + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) + if (fr === fl) return true + } + return false + } + + // something other than ** + // non-magic patterns just have to match exactly + // patterns with magic have been turned into regexps. + var hit + if (typeof p === 'string') { + if (options.nocase) { + hit = f.toLowerCase() === p.toLowerCase() + } else { + hit = f === p + } + this.debug('string match', p, f, hit) + } else { + hit = f.match(p) + this.debug('pattern match', p, f, hit) + } + + if (!hit) return false + } + + // Note: ending in / means that we'll get a final "" + // at the end of the pattern. This can only match a + // corresponding "" at the end of the file. + // If the file ends in /, then it can only match a + // a pattern that ends in /, unless the pattern just + // doesn't have any more for it. But, a/b/ should *not* + // match "a/b/*", even though "" matches against the + // [^/]*? pattern, except in partial mode, where it might + // simply not be reached yet. + // However, a/b/ should still satisfy a/* + + // now either we fell off the end of the pattern, or we're done. + if (fi === fl && pi === pl) { + // ran out of pattern and filename at the same time. + // an exact hit! + return true + } else if (fi === fl) { + // ran out of file, but still had pattern left. + // this is ok if we're doing the match as part of + // a glob fs traversal. + return partial + } else if (pi === pl) { + // ran out of pattern, still have file left. + // this is only acceptable if we're on the very last + // empty segment of a file with a trailing slash. + // a/* should match a/b/ + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') + return emptyFileEnd + } + + // should be unreachable. + throw new Error('wtf?') +} + +// replace stuff like \* with * +function globUnescape (s) { + return s.replace(/\\(.)/g, '$1') +} + +function regExpEscape (s) { + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') +} diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore new file mode 100644 index 00000000000000..353546af2368e1 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore @@ -0,0 +1,3 @@ +test +.gitignore +.travis.yml diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md new file mode 100644 index 00000000000000..b0d793ed5d9016 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -0,0 +1,122 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js new file mode 100644 index 00000000000000..36cde4de5c114b --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js @@ -0,0 +1,7 @@ +var expand = require('./'); + +console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); +console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); +console.log(expand('http://www.letters.com/file{a..z..2}.txt')); +console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); +console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js new file mode 100644 index 00000000000000..f8d40f79acde0a --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -0,0 +1,190 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = /^(.*,)+(.+)?$/.test(m.body); + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore new file mode 100644 index 00000000000000..fd4f2b066b339e --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore @@ -0,0 +1,2 @@ +node_modules +.DS_Store diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.travis.yml b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml similarity index 79% rename from deps/npm/node_modules/minimatch/node_modules/brace-expansion/.travis.yml rename to deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml index 6e5919de39a312..cc4dba29d959a2 100644 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/.travis.yml +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml @@ -1,3 +1,4 @@ language: node_js node_js: + - "0.8" - "0.10" diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile new file mode 100644 index 00000000000000..dd2730cfde0cab --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile @@ -0,0 +1,5 @@ + +test: + @node_modules/.bin/tape test/*.js + +.PHONY: test diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md new file mode 100644 index 00000000000000..2aff0ebff4403e --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -0,0 +1,80 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js new file mode 100644 index 00000000000000..9ce76f480a4321 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js @@ -0,0 +1,4 @@ +var balanced = require('./'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js new file mode 100644 index 00000000000000..d165ae8174ca82 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -0,0 +1,38 @@ +module.exports = balanced; +function balanced(a, b, str) { + var bal = 0; + var m = {}; + var ended = false; + + for (var i = 0; i < str.length; i++) { + if (a == str.substr(i, a.length)) { + if (!('start' in m)) m.start = i; + bal++; + } + else if (b == str.substr(i, b.length) && 'start' in m) { + ended = true; + bal--; + if (!bal) { + m.end = i; + m.pre = str.substr(0, m.start); + m.body = (m.end - m.start > 1) + ? str.substring(m.start + a.length, m.end) + : ''; + m.post = str.slice(m.end + b.length); + return m; + } + } + } + + // if we opened more than we closed, find the one we closed + if (bal && ended) { + var start = m.start + a.length; + m = balanced(a, b, str.substr(start)); + if (m) { + m.start += start; + m.end += start; + m.pre = str.slice(0, start) + m.pre; + } + return m; + } +} diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json new file mode 100644 index 00000000000000..35332a3c4eb366 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -0,0 +1,56 @@ +{ + "name": "balanced-match", + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "version": "0.2.0", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "homepage": "https://github.com/juliangruber/balanced-match", + "main": "index.js", + "scripts": { + "test": "make test" + }, + "dependencies": {}, + "devDependencies": { + "tape": "~1.1.1" + }, + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "readme": "# balanced-match\n\nMatch balanced string pairs, like `{` and `}` or `` and ``.\n\n[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match)\n[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)\n\n[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match)\n\n## Example\n\nGet the first matching pair of braces:\n\n```js\nvar balanced = require('balanced-match');\n\nconsole.log(balanced('{', '}', 'pre{in{nested}}post'));\nconsole.log(balanced('{', '}', 'pre{first}between{second}post'));\n```\n\nThe matches are:\n\n```bash\n$ node example.js\n{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }\n{ start: 3,\n end: 9,\n pre: 'pre',\n body: 'first',\n post: 'between{second}post' }\n```\n\n## API\n\n### var m = balanced(a, b, str)\n\nFor the first non-nested matching pair of `a` and `b` in `str`, return an\nobject with those keys:\n\n* **start** the index of the first match of `a`\n* **end** the index of the matching `b`\n* **pre** the preamble, `a` and `b` not included\n* **body** the match, `a` and `b` not included\n* **post** the postscript, `a` and `b` not included\n\nIf there's no match, `undefined` will be returned.\n\nIf the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`.\n\n## Installation\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install balanced-match\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "_id": "balanced-match@0.2.0", + "_shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz", + "_from": "balanced-match@>=0.2.0 <0.3.0" +} diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js new file mode 100644 index 00000000000000..36bfd39954850d --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js @@ -0,0 +1,56 @@ +var test = require('tape'); +var balanced = require('..'); + +test('balanced', function(t) { + t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { + start: 3, + end: 12, + pre: 'pre', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { + start: 8, + end: 11, + pre: '{{{{{{{{', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { + start: 8, + end: 11, + pre: 'pre{body', + body: 'in', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { + start: 4, + end: 13, + pre: 'pre}', + body: 'in{nest}', + post: 'post' + }); + t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { + start: 3, + end: 8, + pre: 'pre', + body: 'body', + post: 'between{body2}post' + }); + t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 3, + end: 19, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.deepEqual(balanced('', '', 'preinnestpost'), { + start: 7, + end: 23, + pre: 'pre', + body: 'innest', + post: 'post' + }); + t.end(); +}); diff --git a/deps/npm/node_modules/github-url-from-username-repo/.travis.yml b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml similarity index 57% rename from deps/npm/node_modules/github-url-from-username-repo/.travis.yml rename to deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml index a12e3f0fdebc13..f1d0f13c8a54d0 100644 --- a/deps/npm/node_modules/github-url-from-username-repo/.travis.yml +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml @@ -1,4 +1,4 @@ language: node_js node_js: - - "0.8" - - "0.10" \ No newline at end of file + - 0.4 + - 0.6 diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE new file mode 100644 index 00000000000000..ee27ba4b4412b0 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE @@ -0,0 +1,18 @@ +This software is released under the MIT license: + +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/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown new file mode 100644 index 00000000000000..408f70a1be473c --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown @@ -0,0 +1,62 @@ +concat-map +========== + +Concatenative mapdashery. + +[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) + +[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) + +example +======= + +``` js +var concatMap = require('concat-map'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); +``` + +*** + +``` +[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] +``` + +methods +======= + +``` js +var concatMap = require('concat-map') +``` + +concatMap(xs, fn) +----------------- + +Return an array of concatenated elements by calling `fn(x, i)` for each element +`x` and each index `i` in the array `xs`. + +When `fn(x, i)` returns an array, its result will be concatenated with the +result array. If `fn(x, i)` returns anything else, that value will be pushed +onto the end of the result array. + +install +======= + +With [npm](http://npmjs.org) do: + +``` +npm install concat-map +``` + +license +======= + +MIT + +notes +===== + +This module was written while sitting high above the ground in a tree. diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js new file mode 100644 index 00000000000000..33656217b61d8f --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js @@ -0,0 +1,6 @@ +var concatMap = require('../'); +var xs = [ 1, 2, 3, 4, 5, 6 ]; +var ys = concatMap(xs, function (x) { + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; +}); +console.dir(ys); diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js new file mode 100644 index 00000000000000..b29a7812e5055a --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js @@ -0,0 +1,13 @@ +module.exports = function (xs, fn) { + var res = []; + for (var i = 0; i < xs.length; i++) { + var x = fn(xs[i], i); + if (isArray(x)) res.push.apply(res, x); + else res.push(x); + } + return res; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json new file mode 100644 index 00000000000000..386ed516010565 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json @@ -0,0 +1,82 @@ +{ + "name": "concat-map", + "description": "concatenative mapdashery", + "version": "0.0.1", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-concat-map.git" + }, + "main": "index.js", + "keywords": [ + "concat", + "concatMap", + "map", + "functional", + "higher-order" + ], + "directories": { + "example": "example", + "test": "test" + }, + "scripts": { + "test": "tape test/*.js" + }, + "devDependencies": { + "tape": "~2.4.0" + }, + "license": "MIT", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + 6, + 7, + 8, + 9 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 + ], + "safari": [ + 5.1 + ], + "opera": [ + 12 + ] + } + }, + "bugs": { + "url": "https://github.com/substack/node-concat-map/issues" + }, + "homepage": "https://github.com/substack/node-concat-map", + "_id": "concat-map@0.0.1", + "dist": { + "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + }, + "_from": "concat-map@0.0.1", + "_npmVersion": "1.3.21", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" +} diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js new file mode 100644 index 00000000000000..fdbd7022f6da17 --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js @@ -0,0 +1,39 @@ +var concatMap = require('../'); +var test = require('tape'); + +test('empty or not', function (t) { + var xs = [ 1, 2, 3, 4, 5, 6 ]; + var ixes = []; + var ys = concatMap(xs, function (x, ix) { + ixes.push(ix); + return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; + }); + t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); + t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); + t.end(); +}); + +test('always something', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('scalars', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function (x) { + return x === 'b' ? [ 'B', 'B', 'B' ] : x; + }); + t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); + t.end(); +}); + +test('undefs', function (t) { + var xs = [ 'a', 'b', 'c', 'd' ]; + var ys = concatMap(xs, function () {}); + t.same(ys, [ undefined, undefined, undefined, undefined ]); + t.end(); +}); diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json new file mode 100644 index 00000000000000..4cb3e05d7ceb6c --- /dev/null +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -0,0 +1,75 @@ +{ + "name": "brace-expansion", + "description": "Brace expansion as known from sh/bash", + "version": "1.1.1", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "homepage": "https://github.com/juliangruber/brace-expansion", + "main": "index.js", + "scripts": { + "test": "tape test/*.js", + "gentest": "bash test/generate.sh" + }, + "dependencies": { + "balanced-match": "^0.2.0", + "concat-map": "0.0.1" + }, + "devDependencies": { + "tape": "^3.0.3" + }, + "keywords": [], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "gitHead": "f50da498166d76ea570cf3b30179f01f0f119612", + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" + }, + "_id": "brace-expansion@1.1.1", + "_shasum": "da5fb78aef4c44c9e4acf525064fb3208ebab045", + "_from": "brace-expansion@>=1.0.0 <2.0.0", + "_npmVersion": "2.6.1", + "_nodeVersion": "0.10.36", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + } + ], + "dist": { + "shasum": "da5fb78aef4c44c9e4acf525064fb3208ebab045", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/minimatch/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/package.json similarity index 67% rename from deps/npm/node_modules/minimatch/package.json rename to deps/npm/node_modules/glob/node_modules/minimatch/package.json index c7c9a089ceb430..4944eb0bccfada 100644 --- a/deps/npm/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/glob/node_modules/minimatch/package.json @@ -6,7 +6,7 @@ }, "name": "minimatch", "description": "a glob matcher in javascript", - "version": "2.0.10", + "version": "3.0.0", "repository": { "type": "git", "url": "git://github.com/isaacs/minimatch.git" @@ -14,8 +14,7 @@ "main": "minimatch.js", "scripts": { "posttest": "standard minimatch.js test/*.js", - "test": "tap test/*.js", - "prepublish": "browserify -o browser.js -e minimatch.js -s minimatch --bare" + "test": "tap test/*.js" }, "engines": { "node": "*" @@ -24,32 +23,30 @@ "brace-expansion": "^1.0.0" }, "devDependencies": { - "browserify": "^9.0.3", "standard": "^3.7.2", "tap": "^1.2.0" }, "license": "ISC", "files": [ - "minimatch.js", - "browser.js" + "minimatch.js" ], - "gitHead": "6afb85f0c324b321f76a38df81891e562693e257", + "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", "bugs": { "url": "https://github.com/isaacs/minimatch/issues" }, "homepage": "https://github.com/isaacs/minimatch#readme", - "_id": "minimatch@2.0.10", - "_shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", - "_from": "minimatch@2.0.10", - "_npmVersion": "3.1.0", - "_nodeVersion": "2.2.1", + "_id": "minimatch@3.0.0", + "_shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", + "_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "_npmVersion": "3.3.2", + "_nodeVersion": "4.0.0", "_npmUser": { "name": "isaacs", "email": "isaacs@npmjs.com" }, "dist": { - "shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz" + "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", + "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" }, "maintainers": [ { @@ -58,5 +55,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz" + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/glob/node_modules/path-is-absolute/package.json b/deps/npm/node_modules/glob/node_modules/path-is-absolute/package.json index 39372636f3fb4f..bf60d74dbd3297 100644 --- a/deps/npm/node_modules/glob/node_modules/path-is-absolute/package.json +++ b/deps/npm/node_modules/glob/node_modules/path-is-absolute/package.json @@ -40,31 +40,14 @@ "detect", "check" ], - "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", + "readme": "# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)\n\n> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill\n\n> Ponyfill: A polyfill that doesn't overwrite the native method\n\n\n## Install\n\n```\n$ npm install --save path-is-absolute\n```\n\n\n## Usage\n\n```js\nvar pathIsAbsolute = require('path-is-absolute');\n\n// Linux\npathIsAbsolute('/home/foo');\n//=> true\n\n// Windows\npathIsAbsolute('C:/Users/');\n//=> true\n\n// Any OS\npathIsAbsolute.posix('/home/foo');\n//=> true\n```\n\n\n## API\n\nSee the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).\n\n### pathIsAbsolute(path)\n\n### pathIsAbsolute.posix(path)\n\nThe Posix specific version.\n\n### pathIsAbsolute.win32(path)\n\nThe Windows specific version.\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", "bugs": { "url": "https://github.com/sindresorhus/path-is-absolute/issues" }, - "homepage": "https://github.com/sindresorhus/path-is-absolute", + "homepage": "https://github.com/sindresorhus/path-is-absolute#readme", "_id": "path-is-absolute@1.0.0", "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", - "_from": "path-is-absolute@>=1.0.0 <2.0.0", - "_npmVersion": "2.5.1", - "_nodeVersion": "0.12.0", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "dist": { - "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", - "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "_from": "path-is-absolute@>=1.0.0 <2.0.0" } diff --git a/deps/npm/node_modules/glob/package.json b/deps/npm/node_modules/glob/package.json index 2949b83be0637f..21725064f52f42 100644 --- a/deps/npm/node_modules/glob/package.json +++ b/deps/npm/node_modules/glob/package.json @@ -50,7 +50,7 @@ "homepage": "https://github.com/isaacs/node-glob#readme", "_id": "glob@5.0.15", "_shasum": "1bc936b9e02f4a603fcc222ecf7633d30b8b93b1", - "_from": "glob@5.0.15", + "_from": "glob@>=5.0.15 <5.1.0", "_npmVersion": "3.3.2", "_nodeVersion": "4.0.0", "_npmUser": { diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json index f9e1598a6545ea..629ec7f8d28983 100644 --- a/deps/npm/node_modules/graceful-fs/package.json +++ b/deps/npm/node_modules/graceful-fs/package.json @@ -1,45 +1,10 @@ { - "_args": [ - [ - "graceful-fs@latest", - "/Users/isaacs/dev/npm/npm" - ] - ], - "_from": "graceful-fs@latest", - "_id": "graceful-fs@4.1.2", - "_inCache": true, - "_location": "/graceful-fs", - "_nodeVersion": "2.2.1", - "_npmUser": { - "email": "isaacs@npmjs.com", - "name": "isaacs" - }, - "_npmVersion": "3.0.0", - "_phantomChildren": {}, - "_requested": { - "name": "graceful-fs", - "raw": "graceful-fs@latest", - "rawSpec": "latest", - "scope": null, - "spec": "latest", - "type": "tag" - }, - "_requiredBy": [ - "/" - ], - "_shasum": "fe2239b7574972e67e41f808823f9bfa4a991e37", - "_shrinkwrap": null, - "_spec": "graceful-fs@latest", - "_where": "/Users/isaacs/dev/npm/npm", - "bugs": { - "url": "https://github.com/isaacs/node-graceful-fs/issues" - }, - "dependencies": {}, + "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", - "version": "3.0.8", + "version": "4.1.2", "repository": { "type": "git", - "url": "git://github.com/isaacs/node-graceful-fs.git" + "url": "git+https://github.com/isaacs/node-graceful-fs.git" }, "main": "graceful-fs.js", "engines": { @@ -48,21 +13,9 @@ "directories": { "test": "test" }, - "dist": { - "shasum": "fe2239b7574972e67e41f808823f9bfa4a991e37", - "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.2.tgz" - }, - "engines": { - "node": ">=0.4.0" + "scripts": { + "test": "node test.js | tap -" }, - "files": [ - "fs.js", - "graceful-fs.js", - "legacy-streams.js", - "polyfills.js" - ], - "gitHead": "c286080071b6be9aa9ba108b0bb9b44ff122926d", - "homepage": "https://github.com/isaacs/node-graceful-fs#readme", "keywords": [ "fs", "module", @@ -85,38 +38,20 @@ "rimraf": "^2.2.8", "tap": "^1.2.0" }, - "gitHead": "45c57aa5e323c35a985a525de6f0c9a6ef59e1f8", + "files": [ + "fs.js", + "graceful-fs.js", + "legacy-streams.js", + "polyfills.js" + ], + "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over [fs module](http://api.nodejs.org/fs.html)\n\ngraceful-fs:\n\n* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n\n## USAGE\n\n```javascript\n// use just like fs\nvar fs = require('graceful-fs')\n\n// now go and do stuff with it...\nfs.readFileSync('some-file-or-whatever')\n```\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/node-graceful-fs/issues" }, "homepage": "https://github.com/isaacs/node-graceful-fs#readme", - "_id": "graceful-fs@3.0.8", - "_shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "_from": "graceful-fs@>=3.0.8 <3.1.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "ce813e725fa82f7e6147d51c9a5ca68270551c22", - "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.8.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "graceful-fs", - "optionalDependencies": {}, - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/node-graceful-fs.git" - }, - "scripts": { - "test": "node test.js | tap -" - }, - "version": "4.1.2" + "_id": "graceful-fs@4.1.2", + "_shasum": "fe2239b7574972e67e41f808823f9bfa4a991e37", + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.2.tgz", + "_from": "graceful-fs@>=4.1.2 <4.2.0" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/.npmignore b/deps/npm/node_modules/has-unicode/.npmignore similarity index 100% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/.npmignore rename to deps/npm/node_modules/has-unicode/.npmignore diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/LICENSE b/deps/npm/node_modules/has-unicode/LICENSE similarity index 99% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/LICENSE rename to deps/npm/node_modules/has-unicode/LICENSE index d42e25e95655bb..e756052969b780 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/LICENSE +++ b/deps/npm/node_modules/has-unicode/LICENSE @@ -11,4 +11,3 @@ 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/npmlog/node_modules/gauge/node_modules/has-unicode/README.md b/deps/npm/node_modules/has-unicode/README.md similarity index 98% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md rename to deps/npm/node_modules/has-unicode/README.md index e9d3cc326c144a..4393106fda3a0a 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md +++ b/deps/npm/node_modules/has-unicode/README.md @@ -33,8 +33,7 @@ As such, we report any Windows installation as unicode capable. ### Unix Like Operating Systems We look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in -that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. +that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. For `LC_CTYPE` it looks to see if the value is `UTF-8`. This is sufficient for most POSIX systems. While locale data can be put in `/etc/locale.conf` as well, AFAIK it's always copied into the environment. - diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js b/deps/npm/node_modules/has-unicode/index.js similarity index 90% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js rename to deps/npm/node_modules/has-unicode/index.js index edceb703094082..e0907b510a8b9a 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js +++ b/deps/npm/node_modules/has-unicode/index.js @@ -1,6 +1,5 @@ "use strict" var os = require("os") -var child_process = require("child_process") var hasUnicode = module.exports = function () { // Supported Win32 platforms (>XP) support unicode in the console, though diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json b/deps/npm/node_modules/has-unicode/package.json similarity index 73% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json rename to deps/npm/node_modules/has-unicode/package.json index fd552a9e4096ee..3f0aa0581830c5 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json +++ b/deps/npm/node_modules/has-unicode/package.json @@ -1,6 +1,6 @@ { "name": "has-unicode", - "version": "1.0.0", + "version": "1.0.1", "description": "Try to guess if your terminal supports unicode", "main": "index.js", "scripts": { @@ -27,27 +27,27 @@ "require-inject": "^1.1.1", "tap": "^0.4.13" }, - "gitHead": "a8c3dcf3be5f0c8f8e26a3e7ffea7da24344a006", - "_id": "has-unicode@1.0.0", - "_shasum": "bac5c44e064c2ffc3b8fcbd8c71afe08f9afc8cc", - "_from": "has-unicode@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.11", - "_nodeVersion": "0.10.33", + "gitHead": "d4ad300c67b25c197582e42e936ea928f7935d01", + "_id": "has-unicode@1.0.1", + "_shasum": "c46fceea053eb8ec789bffbba25fca52dfdcf38e", + "_from": "has-unicode@>=1.0.1 <1.1.0", + "_npmVersion": "3.3.6", + "_nodeVersion": "4.1.1", "_npmUser": { "name": "iarna", "email": "me@re-becca.org" }, + "dist": { + "shasum": "c46fceea053eb8ec789bffbba25fca52dfdcf38e", + "tarball": "http://registry.npmjs.org/has-unicode/-/has-unicode-1.0.1.tgz" + }, "maintainers": [ { "name": "iarna", "email": "me@re-becca.org" } ], - "dist": { - "shasum": "bac5c44e064c2ffc3b8fcbd8c71afe08f9afc8cc", - "tarball": "http://registry.npmjs.org/has-unicode/-/has-unicode-1.0.0.tgz" - }, "directories": {}, - "_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-1.0.0.tgz", + "_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-1.0.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js b/deps/npm/node_modules/has-unicode/test/index.js similarity index 100% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js rename to deps/npm/node_modules/has-unicode/test/index.js diff --git a/deps/npm/node_modules/hosted-git-info/package.json b/deps/npm/node_modules/hosted-git-info/package.json index 8d34aca2d72223..1f78066ca45c1d 100644 --- a/deps/npm/node_modules/hosted-git-info/package.json +++ b/deps/npm/node_modules/hosted-git-info/package.json @@ -30,30 +30,10 @@ "standard": "^3.3.2", "tap": "^0.4.13" }, + "readme": "# hosted-git-info\n\nThis will let you identify and transform various git hosts URLs between\nprotocols. It also can tell you what the URL is for the raw path for\nparticular file for direct access without git.\n\n## Usage\n\n```javascript\nvar hostedGitInfo = require(\"hosted-git-info\")\nvar info = hostedGitInfo.fromUrl(\"git@github.com:npm/hosted-git-info.git\")\n/* info looks like:\n{\n type: \"github\",\n domain: \"github.com\",\n user: \"npm\",\n project: \"hosted-git-info\"\n}\n*/\n```\n\nIf the URL can't be matched with a git host, `null` will be returned. We\ncan match git, ssh and https urls. Additionally, we can match ssh connect\nstrings (`git@github.com:npm/hosted-git-info`) and shortcuts (eg,\n`github:npm/hosted-git-info`). Github specifically, is detected in the case\nof a third, unprefixed, form: `npm/hosted-git-info`.\n\nIf it does match, the returned object has properties of:\n\n* info.type -- The short name of the service\n* info.domain -- The domain for git protocol use\n* info.user -- The name of the user/org on the git host\n* info.project -- The name of the project on the git host\n\nAnd methods of:\n\n* info.file(path)\n\nGiven the path of a file relative to the repository, returns a URL for\ndirectly fetching it from the githost. If no committish was set then\n`master` will be used as the default.\n\nFor example `hostedGitInfo.fromUrl(\"git@github.com:npm/hosted-git-info.git#v1.0.0\").file(\"package.json\")`\nwould return `https://raw.githubusercontent.com/npm/hosted-git-info/v1.0.0/package.json`\n\n* info.shortcut()\n\neg, `github:npm/hosted-git-info`\n\n* info.browse()\n\neg, `https://github.com/npm/hosted-git-info/tree/v1.2.0`\n\n* info.bugs()\n\neg, `https://github.com/npm/hosted-git-info/issues`\n\n* info.docs()\n\neg, `https://github.com/npm/hosted-git-info/tree/v1.2.0#readme`\n\n* info.https()\n\neg, `git+https://github.com/npm/hosted-git-info.git`\n\n* info.sshurl()\n\neg, `git+ssh://git@github.com/npm/hosted-git-info.git`\n\n* info.ssh()\n\neg, `git@github.com:npm/hosted-git-info.git`\n\n* info.path()\n\neg, `npm/hosted-git-info`\n\n* info.getDefaultRepresentation()\n\nReturns the default output type. The default output type is based on the\nstring you passed in to be parsed\n\n* info.toString()\n\nUses the getDefaultRepresentation to call one of the other methods to get a URL for\nthis resource. As such `hostedGitInfo.fromUrl(url).toString()` will give\nyou a normalized version of the URL that still uses the same protocol.\n\nShortcuts will still be returned as shortcuts, but the special case github\nform of `org/project` will be normalized to `github:org/project`.\n\nSSH connect strings will be normalized into `git+ssh` URLs.\n\n\n## Supported hosts\n\nCurrently this supports Github, Bitbucket and Gitlab. Pull requests for\nadditional hosts welcome.\n\n", + "readmeFilename": "README.md", "gitHead": "9e1a36df8eb050a663713c79e56d89dadba2bd8d", "_id": "hosted-git-info@2.1.4", "_shasum": "d9e953b26988be88096c46e926494d9604c300f8", - "_from": "hosted-git-info@>=2.1.2 <2.2.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.2", - "_npmUser": { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - "dist": { - "shasum": "d9e953b26988be88096c46e926494d9604c300f8", - "tarball": "http://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.4.tgz" - }, - "maintainers": [ - { - "name": "iarna", - "email": "me@re-becca.org" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.1.4.tgz" + "_from": "hosted-git-info@>=2.1.4 <2.2.0" } diff --git a/deps/npm/node_modules/ansi/.npmignore b/deps/npm/node_modules/iferr/.npmignore similarity index 100% rename from deps/npm/node_modules/ansi/.npmignore rename to deps/npm/node_modules/iferr/.npmignore diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license b/deps/npm/node_modules/iferr/LICENSE similarity index 85% rename from deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license rename to deps/npm/node_modules/iferr/LICENSE index 654d0bfe943437..19d5f4bce547ba 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/license +++ b/deps/npm/node_modules/iferr/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) Sindre Sorhus (sindresorhus.com) +Copyright (c) 2014 Nadav Ivgi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -9,13 +9,13 @@ 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 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. +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/deps/npm/node_modules/iferr/README.md b/deps/npm/node_modules/iferr/README.md new file mode 100644 index 00000000000000..0940763fa94137 --- /dev/null +++ b/deps/npm/node_modules/iferr/README.md @@ -0,0 +1,40 @@ +# iferr + +Higher-order functions for easier error handling. + +`if (err) return cb(err);` be gone! + +## Install +```bash +npm install iferr +``` + +## Use + +### JavaScript example +```js +var iferr = require('iferr'); + +function get_friends_count(id, cb) { + User.load_user(id, iferr(cb, function(user) { + user.load_friends(iferr(cb, function(friends) { + cb(null, friends.length); + })); + })); +} +``` + +### CoffeeScript example +```coffee +iferr = require 'iferr' + +get_friends_count = (id, cb) -> + User.load_user id, iferr cb, (user) -> + user.load_friends iferr cb, (friends) -> + cb null, friends.length +``` + +(TODO: document tiferr, throwerr and printerr) + +## License +MIT diff --git a/deps/npm/node_modules/iferr/index.coffee b/deps/npm/node_modules/iferr/index.coffee new file mode 100644 index 00000000000000..da6d00719f10c4 --- /dev/null +++ b/deps/npm/node_modules/iferr/index.coffee @@ -0,0 +1,24 @@ +# Delegates to `succ` on sucecss or to `fail` on error +# ex: Thing.load 123, iferr cb, (thing) -> ... +iferr = (fail, succ) -> (err, a...) -> + if err? then fail err + else succ? a... + +# Like iferr, but also catches errors thrown from `succ` and passes to `fail` +tiferr = (fail, succ) -> iferr fail, (a...) -> + try succ a... + catch err then fail err + +# Delegate to the success function on success, or throw the error otherwise +# ex: Thing.load 123, throwerr (thing) -> ... +throwerr = iferr.bind null, (err) -> throw err + +# Prints errors when one is passed, or does nothing otherwise +# ex: thing.save printerr +printerr = iferr (err) -> console.error err.stack or err + +module.exports = exports = iferr +exports.iferr = iferr +exports.tiferr = tiferr +exports.throwerr = throwerr +exports.printerr = printerr diff --git a/deps/npm/node_modules/iferr/index.js b/deps/npm/node_modules/iferr/index.js new file mode 100644 index 00000000000000..78fce3d2b0965a --- /dev/null +++ b/deps/npm/node_modules/iferr/index.js @@ -0,0 +1,49 @@ +// Generated by CoffeeScript 1.7.1 +(function() { + var exports, iferr, printerr, throwerr, tiferr, + __slice = [].slice; + + iferr = function(fail, succ) { + return function() { + var a, err; + err = arguments[0], a = 2 <= arguments.length ? __slice.call(arguments, 1) : []; + if (err != null) { + return fail(err); + } else { + return typeof succ === "function" ? succ.apply(null, a) : void 0; + } + }; + }; + + tiferr = function(fail, succ) { + return iferr(fail, function() { + var a, err; + a = 1 <= arguments.length ? __slice.call(arguments, 0) : []; + try { + return succ.apply(null, a); + } catch (_error) { + err = _error; + return fail(err); + } + }); + }; + + throwerr = iferr.bind(null, function(err) { + throw err; + }); + + printerr = iferr(function(err) { + return console.error(err.stack || err); + }); + + module.exports = exports = iferr; + + exports.iferr = iferr; + + exports.tiferr = tiferr; + + exports.throwerr = throwerr; + + exports.printerr = printerr; + +}).call(this); diff --git a/deps/npm/node_modules/iferr/package.json b/deps/npm/node_modules/iferr/package.json new file mode 100644 index 00000000000000..9017857c56ddbc --- /dev/null +++ b/deps/npm/node_modules/iferr/package.json @@ -0,0 +1,50 @@ +{ + "name": "iferr", + "version": "0.1.5", + "description": "Higher-order functions for easier error handling", + "main": "index.js", + "scripts": { + "test": "mocha", + "prepublish": "coffee -c index.coffee" + }, + "repository": { + "type": "git", + "url": "https://github.com/shesek/iferr" + }, + "keywords": [ + "error", + "errors" + ], + "author": { + "name": "Nadav Ivgi" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/shesek/iferr/issues" + }, + "homepage": "https://github.com/shesek/iferr", + "devDependencies": { + "coffee-script": "^1.7.1", + "mocha": "^1.18.2" + }, + "_id": "iferr@0.1.5", + "dist": { + "shasum": "c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501", + "tarball": "http://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz" + }, + "_from": "iferr@>=0.1.5 <0.2.0", + "_npmVersion": "1.4.4", + "_npmUser": { + "name": "nadav", + "email": "npm@shesek.info" + }, + "maintainers": [ + { + "name": "nadav", + "email": "npm@shesek.info" + } + ], + "directories": {}, + "_shasum": "c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501", + "_resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz" +} diff --git a/deps/npm/node_modules/iferr/test/index.coffee b/deps/npm/node_modules/iferr/test/index.coffee new file mode 100644 index 00000000000000..be0bc56fdf1b96 --- /dev/null +++ b/deps/npm/node_modules/iferr/test/index.coffee @@ -0,0 +1,42 @@ +{ iferr, tiferr, throwerr } = require '../index.coffee' +{ equal: eq, throws } = require 'assert' + +invoke_fail = (cb) -> cb new Error 'callback error' +invoke_succ = (cb) -> cb null +throw_error = -> throw new Error 'thrown' + +describe 'iferr', -> + it 'calls the error callback on errors', (done) -> + invoke_fail iferr( + (err) -> + eq err.message, 'callback error' + do done + -> + done new Error 'shouldn\'t call the success callback' + ) + + it 'calls the success callback on success', (done) -> + invoke_succ iferr( + -> done new Error 'shouldn\'t call the error callback' + done + ) + +describe 'tiferr', -> + it 'catches errors in the success callback', (done) -> + invoke_succ tiferr( + (err) -> + eq err.message, 'thrown' + do done + throw_error + ) + +describe 'throwerr', -> + it 'throws errors passed to the callback', (done)-> + try invoke_fail throwerr -> + done 'shouldn\'t call the success callback' + catch err + eq err.message, 'callback error' + do done + + it 'delegates to the success callback otherwise', (done) -> + invoke_succ throwerr done diff --git a/deps/npm/node_modules/iferr/test/mocha.opts b/deps/npm/node_modules/iferr/test/mocha.opts new file mode 100644 index 00000000000000..019defcf152a84 --- /dev/null +++ b/deps/npm/node_modules/iferr/test/mocha.opts @@ -0,0 +1,2 @@ +--compilers coffee:coffee-script/register +--reporter spec diff --git a/deps/npm/node_modules/inflight/package.json b/deps/npm/node_modules/inflight/package.json index e0b63729cc6dc8..48b4c0e1605a36 100644 --- a/deps/npm/node_modules/inflight/package.json +++ b/deps/npm/node_modules/inflight/package.json @@ -15,7 +15,7 @@ }, "repository": { "type": "git", - "url": "git://github.com/isaacs/inflight" + "url": "git://github.com/isaacs/inflight.git" }, "author": { "name": "Isaac Z. Schlueter", @@ -29,8 +29,8 @@ "license": "ISC", "readme": "# inflight\n\nAdd callbacks to requests in flight to avoid async duplication\n\n## USAGE\n\n```javascript\nvar inflight = require('inflight')\n\n// some request that does some stuff\nfunction req(key, callback) {\n // key is any random string. like a url or filename or whatever.\n //\n // will return either a falsey value, indicating that the\n // request for this key is already in flight, or a new callback\n // which when called will call all callbacks passed to inflightk\n // with the same key\n callback = inflight(key, callback)\n\n // If we got a falsey value back, then there's already a req going\n if (!callback) return\n\n // this is where you'd fetch the url or whatever\n // callback is also once()-ified, so it can safely be assigned\n // to multiple events etc. First call wins.\n setTimeout(function() {\n callback(null, key)\n }, 100)\n}\n\n// only assigns a single setTimeout\n// when it dings, all cbs get called\nreq('foo', cb1)\nreq('foo', cb2)\nreq('foo', cb3)\nreq('foo', cb4)\n```\n", "readmeFilename": "README.md", - "gitHead": "c7b5531d572a867064d4a1da9e013e8910b7d1ba", "_id": "inflight@1.0.4", "_shasum": "6cbb4521ebd51ce0ec0a936bfd7657ef7e9b172a", + "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", "_from": "inflight@>=1.0.4 <1.1.0" } diff --git a/deps/npm/node_modules/inherits/package.json b/deps/npm/node_modules/inherits/package.json index a0cd42683614fd..933382a7f44bac 100644 --- a/deps/npm/node_modules/inherits/package.json +++ b/deps/npm/node_modules/inherits/package.json @@ -16,7 +16,7 @@ "browser": "./inherits_browser.js", "repository": { "type": "git", - "url": "git://github.com/isaacs/inherits" + "url": "git://github.com/isaacs/inherits.git" }, "license": "ISC", "scripts": { @@ -27,25 +27,9 @@ "bugs": { "url": "https://github.com/isaacs/inherits/issues" }, + "homepage": "https://github.com/isaacs/inherits#readme", "_id": "inherits@2.0.1", - "dist": { - "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", - "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" - }, - "_from": "inherits@latest", - "_npmVersion": "1.3.8", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "homepage": "https://github.com/isaacs/inherits" + "_from": "inherits@>=2.0.1 <2.1.0" } diff --git a/deps/npm/node_modules/ini/package.json b/deps/npm/node_modules/ini/package.json index e9b9d5396c0e09..7ea6710a9ae381 100644 --- a/deps/npm/node_modules/ini/package.json +++ b/deps/npm/node_modules/ini/package.json @@ -26,31 +26,14 @@ "files": [ "ini.js" ], - "gitHead": "4a3001abc4c608e51add9f1d2b2cadf02b8e6dea", + "readme": "An ini format parser and serializer for node.\n\nSections are treated as nested objects. Items before the first\nheading are saved on the object directly.\n\n## Usage\n\nConsider an ini-file `config.ini` that looks like this:\n\n ; this comment is being ignored\n scope = global\n\n [database]\n user = dbuser\n password = dbpassword\n database = use_this_database\n\n [paths.default]\n datadir = /var/lib/data\n array[] = first value\n array[] = second value\n array[] = third value\n\nYou can read, manipulate and write the ini-file like so:\n\n var fs = require('fs')\n , ini = require('ini')\n\n var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'))\n\n config.scope = 'local'\n config.database.database = 'use_another_database'\n config.paths.default.tmpdir = '/tmp'\n delete config.paths.default.datadir\n config.paths.default.array.push('fourth value')\n\n fs.writeFileSync('./config_modified.ini', ini.stringify(config, { section: 'section' }))\n\nThis will result in a file called `config_modified.ini` being written\nto the filesystem with the following content:\n\n [section]\n scope=local\n [section.database]\n user=dbuser\n password=dbpassword\n database=use_another_database\n [section.paths.default]\n tmpdir=/tmp\n array[]=first value\n array[]=second value\n array[]=third value\n array[]=fourth value\n\n\n## API\n\n### decode(inistring)\n\nDecode the ini-style formatted `inistring` into a nested object.\n\n### parse(inistring)\n\nAlias for `decode(inistring)`\n\n### encode(object, [options])\n\nEncode the object `object` into an ini-style formatted string. If the\noptional parameter `section` is given, then all top-level properties\nof the object are put into this section and the `section`-string is\nprepended to all sub-sections, see the usage example above.\n\nThe `options` object may contain the following:\n\n* `section` A string which will be the first `section` in the encoded\n ini data. Defaults to none.\n* `whitespace` Boolean to specify whether to put whitespace around the\n `=` character. By default, whitespace is omitted, to be friendly to\n some persnickety old parsers that don't tolerate it well. But some\n find that it's more human-readable and pretty with the whitespace.\n\nFor backwards compatibility reasons, if a `string` options is passed\nin, then it is assumed to be the `section` value.\n\n### stringify(object, [options])\n\nAlias for `encode(object, [options])`\n\n### safe(val)\n\nEscapes the string `val` such that it is safe to be used as a key or\nvalue in an ini-file. Basically escapes quotes. For example\n\n ini.safe('\"unsafe string\"')\n\nwould result in\n\n \"\\\"unsafe string\\\"\"\n\n### unsafe(val)\n\nUnescapes the string `val`\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/ini/issues" }, "homepage": "https://github.com/isaacs/ini#readme", "_id": "ini@1.3.4", "_shasum": "0537cb79daf59b59a1a517dff706c86ec039162e", - "_from": "ini@latest", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "0537cb79daf59b59a1a517dff706c86ec039162e", - "tarball": "http://registry.npmjs.org/ini/-/ini-1.3.4.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, "_resolved": "https://registry.npmjs.org/ini/-/ini-1.3.4.tgz", - "readme": "ERROR: No README data found!" + "_from": "ini@>=1.3.4 <1.4.0" } diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js b/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js index bf7aedb82d41fd..c049c20f9a2736 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js @@ -17,7 +17,7 @@ module.exports = { ; } catch (e) {} - + return prompt('description', value); })(), "main" : prompt('entry point', 'index.js'), diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js b/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js index da1abca9535e4f..424152a802eb02 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js @@ -235,4 +235,3 @@ PromZard.prototype.prompt = function (pdt, cb) { read({ prompt: prompt + ':' , default: def }, cb) } - diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js b/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js index 034a86475afbd5..bcf8791113ead7 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js @@ -3,7 +3,7 @@ var promzard = require('../'); test('simple', function (t) { t.plan(1); - + var ctx = { tmpdir : '/tmp' } var file = __dirname + '/simple.input'; promzard(file, ctx, function (err, output) { @@ -19,11 +19,11 @@ test('simple', function (t) { output ); }); - + setTimeout(function () { process.stdin.emit('data', '\n'); }, 100); - + setTimeout(function () { process.stdin.emit('data', '55\n'); }, 200); diff --git a/deps/npm/node_modules/init-package-json/package.json b/deps/npm/node_modules/init-package-json/package.json index 0cc543ece404f1..102bdb8c96e2a9 100644 --- a/deps/npm/node_modules/init-package-json/package.json +++ b/deps/npm/node_modules/init-package-json/package.json @@ -48,7 +48,7 @@ "homepage": "https://github.com/isaacs/init-package-json#readme", "_id": "init-package-json@1.9.1", "_shasum": "a28e05b5baeb3363cd473df68d30d3a80523a31c", - "_from": "init-package-json@1.9.1", + "_from": "init-package-json@>=1.9.1 <1.10.0", "_npmVersion": "2.14.1", "_nodeVersion": "2.2.2", "_npmUser": { @@ -78,5 +78,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.1.tgz" + "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/lockfile/package.json b/deps/npm/node_modules/lockfile/package.json index cd18aa2ed520fe..dcb230e26165a1 100644 --- a/deps/npm/node_modules/lockfile/package.json +++ b/deps/npm/node_modules/lockfile/package.json @@ -38,7 +38,7 @@ "homepage": "https://github.com/isaacs/lockfile#readme", "_id": "lockfile@1.0.1", "_shasum": "9d353ecfe3f54d150bb57f89d51746935a39c4f5", - "_from": "lockfile@>=1.0.0 <1.1.0", + "_from": "lockfile@>=1.0.1 <1.1.0", "_npmVersion": "2.10.0", "_nodeVersion": "2.0.1", "_npmUser": { @@ -59,5 +59,6 @@ "email": "i@izs.me" } ], - "_resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.1.tgz" + "_resolved": "https://registry.npmjs.org/lockfile/-/lockfile-1.0.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE.txt b/deps/npm/node_modules/lodash._baseindexof/LICENSE.txt similarity index 100% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE.txt rename to deps/npm/node_modules/lodash._baseindexof/LICENSE.txt diff --git a/deps/npm/node_modules/lodash._baseindexof/README.md b/deps/npm/node_modules/lodash._baseindexof/README.md new file mode 100644 index 00000000000000..ddcc79d5d66aee --- /dev/null +++ b/deps/npm/node_modules/lodash._baseindexof/README.md @@ -0,0 +1,20 @@ +# lodash._baseindexof v3.1.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseIndexOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._baseindexof +``` + +In Node.js/io.js: + +```js +var baseIndexOf = require('lodash._baseindexof'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._baseindexof) for more details. diff --git a/deps/npm/node_modules/lodash._baseindexof/index.js b/deps/npm/node_modules/lodash._baseindexof/index.js new file mode 100644 index 00000000000000..e5da79147894ae --- /dev/null +++ b/deps/npm/node_modules/lodash._baseindexof/index.js @@ -0,0 +1,57 @@ +/** + * lodash 3.1.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.2 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * The base implementation of `_.indexOf` without support for binary searches. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return indexOfNaN(array, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * Gets the index at which the first occurrence of `NaN` is found in `array`. + * If `fromRight` is provided elements of `array` are iterated from right to left. + * + * @private + * @param {Array} array The array to search. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched `NaN`, else `-1`. + */ +function indexOfNaN(array, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 0 : -1); + + while ((fromRight ? index-- : ++index < length)) { + var other = array[index]; + if (other !== other) { + return index; + } + } + return -1; +} + +module.exports = baseIndexOf; diff --git a/deps/npm/node_modules/lodash._baseindexof/package.json b/deps/npm/node_modules/lodash._baseindexof/package.json new file mode 100644 index 00000000000000..e95728db128a6b --- /dev/null +++ b/deps/npm/node_modules/lodash._baseindexof/package.json @@ -0,0 +1,56 @@ +{ + "name": "lodash._baseindexof", + "version": "3.1.0", + "description": "The modern build of lodash’s internal `baseIndexOf` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash._baseindexof v3.1.0\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseIndexOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._baseindexof\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseIndexOf = require('lodash._baseindexof');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash._baseindexof) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._baseindexof@3.1.0", + "_shasum": "fe52b53a1c6761e42618d654e4a25789ed61822c", + "_resolved": "https://registry.npmjs.org/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz", + "_from": "lodash._baseindexof@3.1.0" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/LICENSE.txt b/deps/npm/node_modules/lodash._baseuniq/LICENSE similarity index 100% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/LICENSE.txt rename to deps/npm/node_modules/lodash._baseuniq/LICENSE diff --git a/deps/npm/node_modules/lodash._baseuniq/README.md b/deps/npm/node_modules/lodash._baseuniq/README.md new file mode 100644 index 00000000000000..ad71873dc90346 --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/README.md @@ -0,0 +1,20 @@ +# lodash._baseuniq v3.0.3 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseUniq` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._baseuniq +``` + +In Node.js/io.js: + +```js +var baseUniq = require('lodash._baseuniq'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash._baseuniq) for more details. diff --git a/deps/npm/node_modules/lodash._baseuniq/index.js b/deps/npm/node_modules/lodash._baseuniq/index.js new file mode 100644 index 00000000000000..bb7d433f8d6d34 --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/index.js @@ -0,0 +1,68 @@ +/** + * lodash 3.0.3 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseIndexOf = require('lodash._baseindexof'), + cacheIndexOf = require('lodash._cacheindexof'), + createCache = require('lodash._createcache'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of `_.uniq` without support for callback shorthands + * and `this` binding. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The function invoked per iteration. + * @returns {Array} Returns the new duplicate-value-free array. + */ +function baseUniq(array, iteratee) { + var index = -1, + indexOf = baseIndexOf, + length = array.length, + isCommon = true, + isLarge = isCommon && length >= LARGE_ARRAY_SIZE, + seen = isLarge ? createCache() : null, + result = []; + + if (seen) { + indexOf = cacheIndexOf; + isCommon = false; + } else { + isLarge = false; + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value, index, array) : value; + + if (isCommon && value === value) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (indexOf(seen, computed, 0) < 0) { + if (iteratee || isLarge) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +module.exports = baseUniq; diff --git a/deps/npm/node_modules/lodash._baseuniq/package.json b/deps/npm/node_modules/lodash._baseuniq/package.json new file mode 100644 index 00000000000000..b08778532a3e25 --- /dev/null +++ b/deps/npm/node_modules/lodash._baseuniq/package.json @@ -0,0 +1,93 @@ +{ + "name": "lodash._baseuniq", + "version": "3.0.3", + "description": "The modern build of lodash’s internal `baseUniq` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._baseindexof": "^3.0.0", + "lodash._cacheindexof": "^3.0.0", + "lodash._createcache": "^3.0.0" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._baseuniq@3.0.3", + "_shasum": "2123fa0db2d69c28d5beb1c1f36d61522a740234", + "_from": "lodash._baseuniq@3.0.3", + "_npmVersion": "2.12.0", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + }, + { + "name": "d10", + "email": "demoneaux@gmail.com" + } + ], + "dist": { + "shasum": "2123fa0db2d69c28d5beb1c1f36d61522a740234", + "tarball": "http://registry.npmjs.org/lodash._baseuniq/-/lodash._baseuniq-3.0.3.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/lodash._baseuniq/-/lodash._baseuniq-3.0.3.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE.txt b/deps/npm/node_modules/lodash._bindcallback/LICENSE.txt similarity index 100% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE.txt rename to deps/npm/node_modules/lodash._bindcallback/LICENSE.txt diff --git a/deps/npm/node_modules/lodash._bindcallback/README.md b/deps/npm/node_modules/lodash._bindcallback/README.md new file mode 100644 index 00000000000000..d287f26d81bc3c --- /dev/null +++ b/deps/npm/node_modules/lodash._bindcallback/README.md @@ -0,0 +1,20 @@ +# lodash._bindcallback v3.0.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `bindCallback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._bindcallback +``` + +In Node.js/io.js: + +```js +var bindCallback = require('lodash._bindcallback'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._bindcallback) for more details. diff --git a/deps/npm/node_modules/lodash._bindcallback/index.js b/deps/npm/node_modules/lodash._bindcallback/index.js new file mode 100644 index 00000000000000..ef6811d1a5ebf3 --- /dev/null +++ b/deps/npm/node_modules/lodash._bindcallback/index.js @@ -0,0 +1,65 @@ +/** + * lodash 3.0.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * A specialized version of `baseCallback` which only supports `this` binding + * and specifying the number of arguments to provide to `func`. + * + * @private + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ +function bindCallback(func, thisArg, argCount) { + if (typeof func != 'function') { + return identity; + } + if (thisArg === undefined) { + return func; + } + switch (argCount) { + case 1: return function(value) { + return func.call(thisArg, value); + }; + case 3: return function(value, index, collection) { + return func.call(thisArg, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(thisArg, accumulator, value, index, collection); + }; + case 5: return function(value, other, key, object, source) { + return func.call(thisArg, value, other, key, object, source); + }; + } + return function() { + return func.apply(thisArg, arguments); + }; +} + +/** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utility + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; +} + +module.exports = bindCallback; diff --git a/deps/npm/node_modules/lodash._bindcallback/package.json b/deps/npm/node_modules/lodash._bindcallback/package.json new file mode 100644 index 00000000000000..551b321e44136e --- /dev/null +++ b/deps/npm/node_modules/lodash._bindcallback/package.json @@ -0,0 +1,56 @@ +{ + "name": "lodash._bindcallback", + "version": "3.0.1", + "description": "The modern build of lodash’s internal `bindCallback` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash._bindcallback v3.0.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `bindCallback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._bindcallback\n```\n\nIn Node.js/io.js:\n\n```js\nvar bindCallback = require('lodash._bindcallback');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._bindcallback) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._bindcallback@3.0.1", + "_shasum": "e531c27644cf8b57a99e17ed95b35c748789392e", + "_resolved": "https://registry.npmjs.org/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz", + "_from": "lodash._bindcallback@3.0.1" +} diff --git a/deps/npm/node_modules/lodash._cacheindexof/LICENSE.txt b/deps/npm/node_modules/lodash._cacheindexof/LICENSE.txt new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash._cacheindexof/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash._cacheindexof/README.md b/deps/npm/node_modules/lodash._cacheindexof/README.md new file mode 100644 index 00000000000000..69d2b62bf5dbed --- /dev/null +++ b/deps/npm/node_modules/lodash._cacheindexof/README.md @@ -0,0 +1,20 @@ +# lodash._cacheindexof v3.0.2 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `cacheIndexOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._cacheindexof +``` + +In Node.js/io.js: + +```js +var cacheIndexOf = require('lodash._cacheindexof'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash._cacheindexof) for more details. diff --git a/deps/npm/node_modules/lodash._cacheindexof/index.js b/deps/npm/node_modules/lodash._cacheindexof/index.js new file mode 100644 index 00000000000000..bc1d5afcfd5778 --- /dev/null +++ b/deps/npm/node_modules/lodash._cacheindexof/index.js @@ -0,0 +1,53 @@ +/** + * lodash 3.0.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Checks if `value` is in `cache` mimicking the return signature of + * `_.indexOf` by returning `0` if the value is found, else `-1`. + * + * @private + * @param {Object} cache The cache to search. + * @param {*} value The value to search for. + * @returns {number} Returns `0` if `value` is found, else `-1`. + */ +function cacheIndexOf(cache, value) { + var data = cache.data, + result = (typeof value == 'string' || isObject(value)) ? data.set.has(value) : data.hash[value]; + + return result ? 0 : -1; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +module.exports = cacheIndexOf; diff --git a/deps/npm/node_modules/lodash._cacheindexof/package.json b/deps/npm/node_modules/lodash._cacheindexof/package.json new file mode 100644 index 00000000000000..c46ba3bd3fad64 --- /dev/null +++ b/deps/npm/node_modules/lodash._cacheindexof/package.json @@ -0,0 +1,56 @@ +{ + "name": "lodash._cacheindexof", + "version": "3.0.2", + "description": "The modern build of lodash’s internal `cacheIndexOf` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash._cacheindexof v3.0.2\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `cacheIndexOf` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._cacheindexof\n```\n\nIn Node.js/io.js:\n\n```js\nvar cacheIndexOf = require('lodash._cacheindexof');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash._cacheindexof) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._cacheindexof@3.0.2", + "_shasum": "3dc69ac82498d2ee5e3ce56091bafd2adc7bde92", + "_resolved": "https://registry.npmjs.org/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz", + "_from": "lodash._cacheindexof@3.0.2" +} diff --git a/deps/npm/node_modules/lodash._createcache/LICENSE b/deps/npm/node_modules/lodash._createcache/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash._createcache/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash._createcache/README.md b/deps/npm/node_modules/lodash._createcache/README.md new file mode 100644 index 00000000000000..0ee4834d086a5b --- /dev/null +++ b/deps/npm/node_modules/lodash._createcache/README.md @@ -0,0 +1,20 @@ +# lodash._createcache v3.1.2 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createCache` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._createcache +``` + +In Node.js/io.js: + +```js +var createCache = require('lodash._createcache'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash._createcache) for more details. diff --git a/deps/npm/node_modules/lodash._createcache/index.js b/deps/npm/node_modules/lodash._createcache/index.js new file mode 100644 index 00000000000000..6cf391c1497a4c --- /dev/null +++ b/deps/npm/node_modules/lodash._createcache/index.js @@ -0,0 +1,91 @@ +/** + * lodash 3.1.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var getNative = require('lodash._getnative'); + +/** Native method references. */ +var Set = getNative(global, 'Set'); + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeCreate = getNative(Object, 'create'); + +/** + * + * Creates a cache object to store unique values. + * + * @private + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var length = values ? values.length : 0; + + this.data = { 'hash': nativeCreate(null), 'set': new Set }; + while (length--) { + this.push(values[length]); + } +} + +/** + * Adds `value` to the cache. + * + * @private + * @name push + * @memberOf SetCache + * @param {*} value The value to cache. + */ +function cachePush(value) { + var data = this.data; + if (typeof value == 'string' || isObject(value)) { + data.set.add(value); + } else { + data.hash[value] = true; + } +} + +/** + * Creates a `Set` cache object to optimize linear searches of large arrays. + * + * @private + * @param {Array} [values] The values to cache. + * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`. + */ +function createCache(values) { + return (nativeCreate && Set) ? new SetCache(values) : null; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +// Add functions to the `Set` cache. +SetCache.prototype.push = cachePush; + +module.exports = createCache; diff --git a/deps/npm/node_modules/lodash._createcache/package.json b/deps/npm/node_modules/lodash._createcache/package.json new file mode 100644 index 00000000000000..844c9c04a6b066 --- /dev/null +++ b/deps/npm/node_modules/lodash._createcache/package.json @@ -0,0 +1,59 @@ +{ + "name": "lodash._createcache", + "version": "3.1.2", + "description": "The modern build of lodash’s internal `createCache` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._getnative": "^3.0.0" + }, + "readme": "# lodash._createcache v3.1.2\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createCache` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._createcache\n```\n\nIn Node.js/io.js:\n\n```js\nvar createCache = require('lodash._createcache');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash._createcache) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._createcache@3.1.2", + "_shasum": "56d6a064017625e79ebca6b8018e17440bdcf093", + "_resolved": "https://registry.npmjs.org/lodash._createcache/-/lodash._createcache-3.1.2.tgz", + "_from": "lodash._createcache@3.1.2" +} diff --git a/deps/npm/node_modules/lodash._getnative/LICENSE b/deps/npm/node_modules/lodash._getnative/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash._getnative/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash._getnative/README.md b/deps/npm/node_modules/lodash._getnative/README.md new file mode 100644 index 00000000000000..7835cec0ab1c02 --- /dev/null +++ b/deps/npm/node_modules/lodash._getnative/README.md @@ -0,0 +1,20 @@ +# lodash._getnative v3.9.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `getNative` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._getnative +``` + +In Node.js/io.js: + +```js +var getNative = require('lodash._getnative'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.9.1-npm-packages/lodash._getnative) for more details. diff --git a/deps/npm/node_modules/lodash._getnative/index.js b/deps/npm/node_modules/lodash._getnative/index.js new file mode 100644 index 00000000000000..a32063d27b9e74 --- /dev/null +++ b/deps/npm/node_modules/lodash._getnative/index.js @@ -0,0 +1,137 @@ +/** + * lodash 3.9.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** `Object#toString` result references. */ +var funcTag = '[object Function]'; + +/** Used to detect host constructors (Safari > 5). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var fnToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 equivalents which return 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); +} + +module.exports = getNative; diff --git a/deps/npm/node_modules/lodash._getnative/package.json b/deps/npm/node_modules/lodash._getnative/package.json new file mode 100644 index 00000000000000..455383d29fce10 --- /dev/null +++ b/deps/npm/node_modules/lodash._getnative/package.json @@ -0,0 +1,56 @@ +{ + "name": "lodash._getnative", + "version": "3.9.1", + "description": "The modern build of lodash’s internal `getNative` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash._getnative v3.9.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `getNative` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._getnative\n```\n\nIn Node.js/io.js:\n\n```js\nvar getNative = require('lodash._getnative');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.9.1-npm-packages/lodash._getnative) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._getnative@3.9.1", + "_shasum": "570bc7dede46d61cdcde687d65d3eecbaa3aaff5", + "_resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", + "_from": "lodash._getnative@3.9.1" +} diff --git a/deps/npm/node_modules/lodash.clonedeep/LICENSE b/deps/npm/node_modules/lodash.clonedeep/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.clonedeep/README.md b/deps/npm/node_modules/lodash.clonedeep/README.md new file mode 100644 index 00000000000000..7be9a82e463cb2 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/README.md @@ -0,0 +1,20 @@ +# lodash.clonedeep v3.0.2 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.cloneDeep` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.clonedeep +``` + +In Node.js/io.js: + +```js +var cloneDeep = require('lodash.clonedeep'); +``` + +See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.clonedeep) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/index.js b/deps/npm/node_modules/lodash.clonedeep/index.js new file mode 100644 index 00000000000000..f486c2246be0dd --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/index.js @@ -0,0 +1,63 @@ +/** + * lodash 3.0.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseClone = require('lodash._baseclone'), + bindCallback = require('lodash._bindcallback'); + +/** + * Creates a deep clone of `value`. If `customizer` is provided it's invoked + * to produce the cloned values. If `customizer` returns `undefined` cloning + * is handled by the method instead. The `customizer` is bound to `thisArg` + * and invoked with up to three argument; (value [, index|key, object]). + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm). + * The enumerable properties of `arguments` objects and objects created by + * constructors other than `Object` are cloned to plain `Object` objects. An + * empty object is returned for uncloneable values such as functions, DOM nodes, + * Maps, Sets, and WeakMaps. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to deep clone. + * @param {Function} [customizer] The function to customize cloning values. + * @param {*} [thisArg] The `this` binding of `customizer`. + * @returns {*} Returns the deep cloned value. + * @example + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * var deep = _.cloneDeep(users); + * deep[0] === users[0]; + * // => false + * + * // using a customizer callback + * var el = _.cloneDeep(document.body, function(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * }); + * + * el === document.body + * // => false + * el.nodeName + * // => BODY + * el.childNodes.length; + * // => 20 + */ +function cloneDeep(value, customizer, thisArg) { + return typeof customizer == 'function' + ? baseClone(value, true, bindCallback(customizer, thisArg, 3)) + : baseClone(value, true); +} + +module.exports = cloneDeep; diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.clonedeep/node_modules/lodash._baseclone/README.md b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md new file mode 100644 index 00000000000000..883a43c3a48435 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md @@ -0,0 +1,20 @@ +# lodash._baseclone v3.3.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseClone` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._baseclone +``` + +In Node.js/io.js: + +```js +var baseClone = require('lodash._baseclone'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.3.0-npm-packages/lodash._baseclone) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js new file mode 100644 index 00000000000000..4024d58ad339cb --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js @@ -0,0 +1,271 @@ +/** + * lodash 3.3.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var arrayCopy = require('lodash._arraycopy'), + arrayEach = require('lodash._arrayeach'), + baseAssign = require('lodash._baseassign'), + baseFor = require('lodash._basefor'), + isArray = require('lodash.isarray'), + keys = require('lodash.keys'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = +cloneableTags[dateTag] = cloneableTags[float32Tag] = +cloneableTags[float64Tag] = cloneableTags[int8Tag] = +cloneableTags[int16Tag] = cloneableTags[int32Tag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[stringTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[mapTag] = cloneableTags[setTag] = +cloneableTags[weakMapTag] = false; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** Native method references. */ +var ArrayBuffer = global.ArrayBuffer, + Uint8Array = global.Uint8Array; + +/** + * The base implementation of `_.clone` without support for argument juggling + * and `this` binding `customizer` functions. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {Function} [customizer] The function to customize cloning values. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The object `value` belongs to. + * @param {Array} [stackA=[]] Tracks traversed source objects. + * @param {Array} [stackB=[]] Associates clones with source counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, isDeep, customizer, key, object, stackA, stackB) { + var result; + if (customizer) { + result = object ? customizer(value, key, object) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return arrayCopy(value, result); + } + } else { + var tag = objToString.call(value), + isFunc = tag == funcTag; + + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return baseAssign(result, value); + } + } else { + return cloneableTags[tag] + ? initCloneByTag(value, tag, isDeep) + : (object ? value : {}); + } + } + // Check for circular references and return its corresponding clone. + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == value) { + return stackB[length]; + } + } + // Add the source value to the stack of traversed objects and associate it with its clone. + stackA.push(value); + stackB.push(result); + + // Recursively populate clone (susceptible to call stack limits). + (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { + result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB); + }); + return result; +} + +/** + * The base implementation of `_.forOwn` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ +function baseForOwn(object, iteratee) { + return baseFor(object, iteratee, keys); +} + +/** + * Creates a clone of the given array buffer. + * + * @private + * @param {ArrayBuffer} buffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function bufferClone(buffer) { + var result = new ArrayBuffer(buffer.byteLength), + view = new Uint8Array(result); + + view.set(new Uint8Array(buffer)); + return result; +} + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = new array.constructor(length); + + // Add array properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + var Ctor = object.constructor; + if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) { + Ctor = Object; + } + return new Ctor; +} + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return bufferClone(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + var buffer = object.buffer; + return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + var result = new Ctor(object.source, reFlags.exec(object)); + result.lastIndex = object.lastIndex; + } + return result; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +module.exports = baseClone; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE.txt b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/LICENSE.txt similarity index 100% rename from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE.txt rename to deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/LICENSE.txt diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/README.md b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/README.md new file mode 100644 index 00000000000000..16ee6fd242807c --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/README.md @@ -0,0 +1,20 @@ +# lodash._arraycopy v3.0.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `arrayCopy` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._arraycopy +``` + +In Node.js/io.js: + +```js +var arrayCopy = require('lodash._arraycopy'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._arraycopy) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/index.js b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/index.js new file mode 100644 index 00000000000000..b9abb2253a1f57 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/index.js @@ -0,0 +1,29 @@ +/** + * lodash 3.0.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function arrayCopy(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +module.exports = arrayCopy; diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/package.json b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/package.json new file mode 100644 index 00000000000000..f99b36cfeca9c9 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arraycopy/package.json @@ -0,0 +1,56 @@ +{ + "name": "lodash._arraycopy", + "version": "3.0.0", + "description": "The modern build of lodash’s internal `arrayCopy` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash._arraycopy v3.0.0\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `arrayCopy` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._arraycopy\n```\n\nIn Node.js/io.js:\n\n```js\nvar arrayCopy = require('lodash._arraycopy');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._arraycopy) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._arraycopy@3.0.0", + "_shasum": "76e7b7c1f1fb92547374878a562ed06a3e50f6e1", + "_resolved": "https://registry.npmjs.org/lodash._arraycopy/-/lodash._arraycopy-3.0.0.tgz", + "_from": "lodash._arraycopy@>=3.0.0 <4.0.0" +} diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/LICENSE.txt b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/LICENSE.txt new file mode 100644 index 00000000000000..17764328c826b5 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js 1.7.0, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/README.md b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/README.md new file mode 100644 index 00000000000000..1f3236ba0338f9 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/README.md @@ -0,0 +1,20 @@ +# lodash._arrayeach v3.0.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `arrayEach` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._arrayeach +``` + +In Node.js/io.js: + +```js +var arrayEach = require('lodash._arrayeach'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._arrayeach) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/index.js b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/index.js new file mode 100644 index 00000000000000..7b31bcdb2534ef --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/index.js @@ -0,0 +1,31 @@ +/** + * lodash 3.0.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.7.0 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * A specialized version of `_.forEach` for arrays without support for callback + * shorthands or `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEach; diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/package.json b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/package.json new file mode 100644 index 00000000000000..63072607e9a869 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._arrayeach/package.json @@ -0,0 +1,56 @@ +{ + "name": "lodash._arrayeach", + "version": "3.0.0", + "description": "The modern build of lodash’s internal `arrayEach` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash._arrayeach v3.0.0\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `arrayEach` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._arrayeach\n```\n\nIn Node.js/io.js:\n\n```js\nvar arrayEach = require('lodash._arrayeach');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._arrayeach) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._arrayeach@3.0.0", + "_shasum": "bab156b2a90d3f1bbd5c653403349e5e5933ef9e", + "_resolved": "https://registry.npmjs.org/lodash._arrayeach/-/lodash._arrayeach-3.0.0.tgz", + "_from": "lodash._arrayeach@>=3.0.0 <4.0.0" +} diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/LICENSE.txt b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/LICENSE.txt new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/README.md b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/README.md new file mode 100644 index 00000000000000..0aa23093730de6 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/README.md @@ -0,0 +1,20 @@ +# lodash._baseassign v3.2.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseAssign` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._baseassign +``` + +In Node.js/io.js: + +```js +var baseAssign = require('lodash._baseassign'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.2.0-npm-packages/lodash._baseassign) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/index.js b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/index.js new file mode 100644 index 00000000000000..f5612c85081563 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/index.js @@ -0,0 +1,27 @@ +/** + * lodash 3.2.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseCopy = require('lodash._basecopy'), + keys = require('lodash.keys'); + +/** + * The base implementation of `_.assign` without support for argument juggling, + * multiple sources, and `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return source == null + ? object + : baseCopy(source, keys(source), object); +} + +module.exports = baseAssign; diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/LICENSE.txt b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/LICENSE.txt new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/README.md b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/README.md new file mode 100644 index 00000000000000..acdfa29d3d210a --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/README.md @@ -0,0 +1,20 @@ +# lodash._basecopy v3.0.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseCopy` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._basecopy +``` + +In Node.js/io.js: + +```js +var baseCopy = require('lodash._basecopy'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basecopy) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js new file mode 100644 index 00000000000000..b586d31d9d4345 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/index.js @@ -0,0 +1,32 @@ +/** + * lodash 3.0.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property names to copy. + * @param {Object} [object={}] The object to copy properties to. + * @returns {Object} Returns `object`. + */ +function baseCopy(source, props, object) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + object[key] = source[key]; + } + return object; +} + +module.exports = baseCopy; diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/package.json b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/package.json new file mode 100644 index 00000000000000..a704063e0ae4a1 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/node_modules/lodash._basecopy/package.json @@ -0,0 +1,56 @@ +{ + "name": "lodash._basecopy", + "version": "3.0.1", + "description": "The modern build of lodash’s internal `baseCopy` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash._basecopy v3.0.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseCopy` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._basecopy\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseCopy = require('lodash._basecopy');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basecopy) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._basecopy@3.0.1", + "_shasum": "8da0e6a876cf344c0ad8a54882111dd3c5c7ca36", + "_resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", + "_from": "lodash._basecopy@>=3.0.0 <4.0.0" +} diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/package.json b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/package.json new file mode 100644 index 00000000000000..65386d8bd02aba --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._baseassign/package.json @@ -0,0 +1,60 @@ +{ + "name": "lodash._baseassign", + "version": "3.2.0", + "description": "The modern build of lodash’s internal `baseAssign` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._basecopy": "^3.0.0", + "lodash.keys": "^3.0.0" + }, + "readme": "# lodash._baseassign v3.2.0\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseAssign` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._baseassign\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseAssign = require('lodash._baseassign');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.2.0-npm-packages/lodash._baseassign) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._baseassign@3.2.0", + "_shasum": "8c38a099500f215ad09e59f1722fd0c52bfe0a4e", + "_resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", + "_from": "lodash._baseassign@>=3.0.0 <4.0.0" +} diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/LICENSE.txt b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/LICENSE.txt new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/README.md b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/README.md new file mode 100644 index 00000000000000..d9e33731b2fc90 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/README.md @@ -0,0 +1,20 @@ +# lodash._basefor v3.0.2 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseFor` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._basefor +``` + +In Node.js/io.js: + +```js +var baseFor = require('lodash._basefor'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash._basefor) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/index.js b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/index.js new file mode 100644 index 00000000000000..a3d7dcd1014da0 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/index.js @@ -0,0 +1,86 @@ +/** + * lodash 3.0.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * The base implementation of `baseForIn` and `baseForOwn` which iterates + * over `object` properties returned by `keysFunc` invoking `iteratee` for + * each property. Iteratee functions may exit iteration early by explicitly + * returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ +var baseFor = createBaseFor(); + +/** + * Creates a base function for `_.forIn` or `_.forInRight`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ +function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var iterable = toObject(object), + props = keysFunc(object), + length = props.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length)) { + var key = props[index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; +} + +/** + * Converts `value` to an object if it's not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ +function toObject(value) { + return isObject(value) ? value : Object(value); +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +module.exports = baseFor; diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/package.json b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/package.json new file mode 100644 index 00000000000000..85421f441af04b --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/node_modules/lodash._basefor/package.json @@ -0,0 +1,56 @@ +{ + "name": "lodash._basefor", + "version": "3.0.2", + "description": "The modern build of lodash’s internal `baseFor` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash._basefor v3.0.2\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseFor` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._basefor\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseFor = require('lodash._basefor');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash._basefor) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._basefor@3.0.2", + "_shasum": "3a4cece5b7031eae78a441c5416b90878eeee5a1", + "_resolved": "https://registry.npmjs.org/lodash._basefor/-/lodash._basefor-3.0.2.tgz", + "_from": "lodash._basefor@>=3.0.0 <4.0.0" +} diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json new file mode 100644 index 00000000000000..1aca59200aefd9 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json @@ -0,0 +1,64 @@ +{ + "name": "lodash._baseclone", + "version": "3.3.0", + "description": "The modern build of lodash’s internal `baseClone` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._arraycopy": "^3.0.0", + "lodash._arrayeach": "^3.0.0", + "lodash._baseassign": "^3.0.0", + "lodash._basefor": "^3.0.0", + "lodash.isarray": "^3.0.0", + "lodash.keys": "^3.0.0" + }, + "readme": "# lodash._baseclone v3.3.0\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseClone` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._baseclone\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseClone = require('lodash._baseclone');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.3.0-npm-packages/lodash._baseclone) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._baseclone@3.3.0", + "_shasum": "303519bf6393fe7e42f34d8b630ef7794e3542b7", + "_resolved": "https://registry.npmjs.org/lodash._baseclone/-/lodash._baseclone-3.3.0.tgz", + "_from": "lodash._baseclone@>=3.0.0 <4.0.0" +} diff --git a/deps/npm/node_modules/lodash.clonedeep/package.json b/deps/npm/node_modules/lodash.clonedeep/package.json new file mode 100644 index 00000000000000..05fe4afe9c8539 --- /dev/null +++ b/deps/npm/node_modules/lodash.clonedeep/package.json @@ -0,0 +1,66 @@ +{ + "name": "lodash.clonedeep", + "version": "3.0.2", + "description": "The modern build of lodash’s `_.cloneDeep` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._baseclone": "^3.0.0", + "lodash._bindcallback": "^3.0.0" + }, + "readme": "# lodash.clonedeep v3.0.2\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.cloneDeep` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.clonedeep\n```\n\nIn Node.js/io.js:\n\n```js\nvar cloneDeep = require('lodash.clonedeep');\n```\n\nSee the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.clonedeep) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.clonedeep@3.0.2", + "_shasum": "a0a1e40d82a5ea89ff5b147b8444ed63d92827db", + "_resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-3.0.2.tgz", + "_from": "lodash.clonedeep@>=3.0.2 <3.1.0" +} diff --git a/deps/npm/node_modules/lodash.isarguments/LICENSE b/deps/npm/node_modules/lodash.isarguments/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.isarguments/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.isarguments/README.md b/deps/npm/node_modules/lodash.isarguments/README.md new file mode 100644 index 00000000000000..2e94f790f6e4e4 --- /dev/null +++ b/deps/npm/node_modules/lodash.isarguments/README.md @@ -0,0 +1,20 @@ +# lodash.isarguments v3.0.4 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isArguments` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.isarguments +``` + +In Node.js/io.js: + +```js +var isArguments = require('lodash.isarguments'); +``` + +See the [documentation](https://lodash.com/docs#isArguments) or [package source](https://github.com/lodash/lodash/blob/3.0.4-npm-packages/lodash.isarguments) for more details. diff --git a/deps/npm/node_modules/lodash.isarguments/index.js b/deps/npm/node_modules/lodash.isarguments/index.js new file mode 100644 index 00000000000000..b947b47dffdca8 --- /dev/null +++ b/deps/npm/node_modules/lodash.isarguments/index.js @@ -0,0 +1,106 @@ +/** + * lodash 3.0.4 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** Native method references. */ +var propertyIsEnumerable = objectProto.propertyIsEnumerable; + +/** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)); +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is classified as an `arguments` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + return isObjectLike(value) && isArrayLike(value) && + hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); +} + +module.exports = isArguments; diff --git a/deps/npm/node_modules/lodash.isarguments/package.json b/deps/npm/node_modules/lodash.isarguments/package.json new file mode 100644 index 00000000000000..2c7c609ed147cf --- /dev/null +++ b/deps/npm/node_modules/lodash.isarguments/package.json @@ -0,0 +1,62 @@ +{ + "name": "lodash.isarguments", + "version": "3.0.4", + "description": "The modern build of lodash’s `_.isArguments` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash.isarguments v3.0.4\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isArguments` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.isarguments\n```\n\nIn Node.js/io.js:\n\n```js\nvar isArguments = require('lodash.isarguments');\n```\n\nSee the [documentation](https://lodash.com/docs#isArguments) or [package source](https://github.com/lodash/lodash/blob/3.0.4-npm-packages/lodash.isarguments) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.isarguments@3.0.4", + "_shasum": "ebbb884c48d27366a44ea6fee57ed7b5a32a81e0", + "_resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.0.4.tgz", + "_from": "lodash.isarguments@3.0.4" +} diff --git a/deps/npm/node_modules/lodash.isarray/LICENSE b/deps/npm/node_modules/lodash.isarray/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.isarray/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.isarray/README.md b/deps/npm/node_modules/lodash.isarray/README.md new file mode 100644 index 00000000000000..ea274aae1be395 --- /dev/null +++ b/deps/npm/node_modules/lodash.isarray/README.md @@ -0,0 +1,20 @@ +# lodash.isarray v3.0.4 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isArray` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.isarray +``` + +In Node.js/io.js: + +```js +var isArray = require('lodash.isarray'); +``` + +See the [documentation](https://lodash.com/docs#isArray) or [package source](https://github.com/lodash/lodash/blob/3.0.4-npm-packages/lodash.isarray) for more details. diff --git a/deps/npm/node_modules/lodash.isarray/index.js b/deps/npm/node_modules/lodash.isarray/index.js new file mode 100644 index 00000000000000..dd246584489df6 --- /dev/null +++ b/deps/npm/node_modules/lodash.isarray/index.js @@ -0,0 +1,180 @@ +/** + * lodash 3.0.4 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** `Object#toString` result references. */ +var arrayTag = '[object Array]', + funcTag = '[object Function]'; + +/** Used to detect host constructors (Safari > 5). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to resolve the decompiled source of functions. */ +var fnToString = Function.prototype.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeIsArray = getNative(Array, 'isArray'); + +/** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = object == null ? undefined : object[key]; + return isNative(value) ? value : undefined; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(function() { return arguments; }()); + * // => false + */ +var isArray = nativeIsArray || function(value) { + return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag; +}; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in older versions of Chrome and Safari which return 'function' for regexes + // and Safari 8 equivalents which return 'object' for typed array constructors. + return isObject(value) && objToString.call(value) == funcTag; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ +function isNative(value) { + if (value == null) { + return false; + } + if (isFunction(value)) { + return reIsNative.test(fnToString.call(value)); + } + return isObjectLike(value) && reIsHostCtor.test(value); +} + +module.exports = isArray; diff --git a/deps/npm/node_modules/lodash.isarray/package.json b/deps/npm/node_modules/lodash.isarray/package.json new file mode 100644 index 00000000000000..0d8a02c800e787 --- /dev/null +++ b/deps/npm/node_modules/lodash.isarray/package.json @@ -0,0 +1,62 @@ +{ + "name": "lodash.isarray", + "version": "3.0.4", + "description": "The modern build of lodash’s `_.isArray` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash.isarray v3.0.4\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isArray` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.isarray\n```\n\nIn Node.js/io.js:\n\n```js\nvar isArray = require('lodash.isarray');\n```\n\nSee the [documentation](https://lodash.com/docs#isArray) or [package source](https://github.com/lodash/lodash/blob/3.0.4-npm-packages/lodash.isarray) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.isarray@3.0.4", + "_shasum": "79e4eb88c36a8122af86f844aa9bcd851b5fbb55", + "_resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", + "_from": "lodash.isarray@3.0.4" +} diff --git a/deps/npm/node_modules/lodash.keys/LICENSE b/deps/npm/node_modules/lodash.keys/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.keys/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.keys/README.md b/deps/npm/node_modules/lodash.keys/README.md new file mode 100644 index 00000000000000..5f69a1826f90e2 --- /dev/null +++ b/deps/npm/node_modules/lodash.keys/README.md @@ -0,0 +1,20 @@ +# lodash.keys v3.1.2 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.keys` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.keys +``` + +In Node.js/io.js: + +```js +var keys = require('lodash.keys'); +``` + +See the [documentation](https://lodash.com/docs#keys) or [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash.keys) for more details. diff --git a/deps/npm/node_modules/lodash.keys/index.js b/deps/npm/node_modules/lodash.keys/index.js new file mode 100644 index 00000000000000..f4c17749a17ae7 --- /dev/null +++ b/deps/npm/node_modules/lodash.keys/index.js @@ -0,0 +1,236 @@ +/** + * lodash 3.1.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var getNative = require('lodash._getnative'), + isArguments = require('lodash.isarguments'), + isArray = require('lodash.isarray'); + +/** Used to detect unsigned integer values. */ +var reIsUint = /^\d+$/; + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeKeys = getNative(Object, 'keys'); + +/** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * A fallback implementation of `Object.keys` which creates an array of the + * own enumerable property names of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function shimKeys(object) { + var props = keysIn(object), + propsLength = props.length, + length = propsLength && object.length; + + var allowIndexes = !!length && isLength(length) && + (isArray(object) || isArguments(object)); + + var index = -1, + result = []; + + while (++index < propsLength) { + var key = props[index]; + if ((allowIndexes && isIndex(key, length)) || hasOwnProperty.call(object, key)) { + result.push(key); + } + } + return result; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +var keys = !nativeKeys ? shimKeys : function(object) { + var Ctor = object == null ? undefined : object.constructor; + if ((typeof Ctor == 'function' && Ctor.prototype === object) || + (typeof object != 'function' && isArrayLike(object))) { + return shimKeys(object); + } + return isObject(object) ? nativeKeys(object) : []; +}; + +/** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ +function keysIn(object) { + if (object == null) { + return []; + } + if (!isObject(object)) { + object = Object(object); + } + var length = object.length; + length = (length && isLength(length) && + (isArray(object) || isArguments(object)) && length) || 0; + + var Ctor = object.constructor, + index = -1, + isProto = typeof Ctor == 'function' && Ctor.prototype === object, + result = Array(length), + skipIndexes = length > 0; + + while (++index < length) { + result[index] = (index + ''); + } + for (var key in object) { + if (!(skipIndexes && isIndex(key, length)) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; +} + +module.exports = keys; diff --git a/deps/npm/node_modules/lodash.keys/package.json b/deps/npm/node_modules/lodash.keys/package.json new file mode 100644 index 00000000000000..588c63e9ea0e41 --- /dev/null +++ b/deps/npm/node_modules/lodash.keys/package.json @@ -0,0 +1,67 @@ +{ + "name": "lodash.keys", + "version": "3.1.2", + "description": "The modern build of lodash’s `_.keys` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._getnative": "^3.0.0", + "lodash.isarguments": "^3.0.0", + "lodash.isarray": "^3.0.0" + }, + "readme": "# lodash.keys v3.1.2\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.keys` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.keys\n```\n\nIn Node.js/io.js:\n\n```js\nvar keys = require('lodash.keys');\n```\n\nSee the [documentation](https://lodash.com/docs#keys) or [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash.keys) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.keys@3.1.2", + "_shasum": "4dbc0472b156be50a0b286855d1bd0b0c656098a", + "_resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", + "_from": "lodash.keys@3.1.2" +} diff --git a/deps/npm/node_modules/lodash.restparam/LICENSE.txt b/deps/npm/node_modules/lodash.restparam/LICENSE.txt new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.restparam/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.restparam/README.md b/deps/npm/node_modules/lodash.restparam/README.md new file mode 100644 index 00000000000000..80e47a4f9b2093 --- /dev/null +++ b/deps/npm/node_modules/lodash.restparam/README.md @@ -0,0 +1,20 @@ +# lodash.restparam v3.6.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.restParam` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.restparam +``` + +In Node.js/io.js: + +```js +var restParam = require('lodash.restparam'); +``` + +See the [documentation](https://lodash.com/docs#restParam) or [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash.restparam) for more details. diff --git a/deps/npm/node_modules/lodash.restparam/index.js b/deps/npm/node_modules/lodash.restparam/index.js new file mode 100644 index 00000000000000..932f47ac743461 --- /dev/null +++ b/deps/npm/node_modules/lodash.restparam/index.js @@ -0,0 +1,67 @@ +/** + * lodash 3.6.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used as the `TypeError` message for "Functions" methods. */ +var FUNC_ERROR_TEXT = 'Expected a function'; + +/* Native method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as an array. + * + * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/rest_parameters). + * + * @static + * @memberOf _ + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.restParam(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ +function restParam(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = nativeMax(start === undefined ? (func.length - 1) : (+start || 0), 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + rest = Array(length); + + while (++index < length) { + rest[index] = args[start + index]; + } + switch (start) { + case 0: return func.call(this, rest); + case 1: return func.call(this, args[0], rest); + case 2: return func.call(this, args[0], args[1], rest); + } + var otherArgs = Array(start + 1); + index = -1; + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = rest; + return func.apply(this, otherArgs); + }; +} + +module.exports = restParam; diff --git a/deps/npm/node_modules/lodash.restparam/package.json b/deps/npm/node_modules/lodash.restparam/package.json new file mode 100644 index 00000000000000..f3a9247f460609 --- /dev/null +++ b/deps/npm/node_modules/lodash.restparam/package.json @@ -0,0 +1,62 @@ +{ + "name": "lodash.restparam", + "version": "3.6.1", + "description": "The modern build of lodash’s `_.restParam` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash.restparam v3.6.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.restParam` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.restparam\n```\n\nIn Node.js/io.js:\n\n```js\nvar restParam = require('lodash.restparam');\n```\n\nSee the [documentation](https://lodash.com/docs#restParam) or [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash.restparam) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.restparam@3.6.1", + "_shasum": "936a4e309ef330a7645ed4145986c85ae5b20805", + "_resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", + "_from": "lodash.restparam@3.6.1" +} diff --git a/deps/npm/node_modules/lodash.union/LICENSE.txt b/deps/npm/node_modules/lodash.union/LICENSE.txt new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.union/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.union/README.md b/deps/npm/node_modules/lodash.union/README.md new file mode 100644 index 00000000000000..62f67e410f1e15 --- /dev/null +++ b/deps/npm/node_modules/lodash.union/README.md @@ -0,0 +1,20 @@ +# lodash.union v3.1.0 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.union` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.union +``` + +In Node.js/io.js: + +```js +var union = require('lodash.union'); +``` + +See the [documentation](https://lodash.com/docs#union) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.union) for more details. diff --git a/deps/npm/node_modules/lodash.union/index.js b/deps/npm/node_modules/lodash.union/index.js new file mode 100644 index 00000000000000..b26b28c89cda4c --- /dev/null +++ b/deps/npm/node_modules/lodash.union/index.js @@ -0,0 +1,35 @@ +/** + * lodash 3.1.0 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.2 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseFlatten = require('lodash._baseflatten'), + baseUniq = require('lodash._baseuniq'), + restParam = require('lodash.restparam'); + +/** + * Creates an array of unique values, in order, of the provided arrays using + * `SameValueZero` for equality comparisons. + * + * **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) + * comparisons are like strict equality comparisons, e.g. `===`, except that + * `NaN` matches `NaN`. + * + * @static + * @memberOf _ + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([1, 2], [4, 2], [2, 1]); + * // => [1, 2, 4] + */ +var union = restParam(function(arrays) { + return baseUniq(baseFlatten(arrays, false, true)); +}); + +module.exports = union; diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/LICENSE b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.union/node_modules/lodash._baseflatten/README.md b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/README.md new file mode 100644 index 00000000000000..f3e227779c4f89 --- /dev/null +++ b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/README.md @@ -0,0 +1,20 @@ +# lodash._baseflatten v3.1.4 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseFlatten` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._baseflatten +``` + +In Node.js/io.js: + +```js +var baseFlatten = require('lodash._baseflatten'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.1.4-npm-packages/lodash._baseflatten) for more details. diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/index.js b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/index.js new file mode 100644 index 00000000000000..c43acfa729179c --- /dev/null +++ b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/index.js @@ -0,0 +1,131 @@ +/** + * lodash 3.1.4 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var isArguments = require('lodash.isarguments'), + isArray = require('lodash.isarray'); + +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * The base implementation of `_.flatten` with added support for restricting + * flattening and specifying the start index. + * + * @private + * @param {Array} array The array to flatten. + * @param {boolean} [isDeep] Specify a deep flatten. + * @param {boolean} [isStrict] Restrict flattening to arrays-like objects. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, isDeep, isStrict, result) { + result || (result = []); + + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index]; + if (isObjectLike(value) && isArrayLike(value) && + (isStrict || isArray(value) || isArguments(value))) { + if (isDeep) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, isDeep, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)); +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +module.exports = baseFlatten; diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/package.json b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/package.json new file mode 100644 index 00000000000000..6d142e1cbaaa4f --- /dev/null +++ b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/package.json @@ -0,0 +1,60 @@ +{ + "name": "lodash._baseflatten", + "version": "3.1.4", + "description": "The modern build of lodash’s internal `baseFlatten` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash.isarguments": "^3.0.0", + "lodash.isarray": "^3.0.0" + }, + "readme": "# lodash._baseflatten v3.1.4\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseFlatten` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._baseflatten\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseFlatten = require('lodash._baseflatten');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.1.4-npm-packages/lodash._baseflatten) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._baseflatten@3.1.4", + "_shasum": "0770ff80131af6e34f3b511796a7ba5214e65ff7", + "_resolved": "https://registry.npmjs.org/lodash._baseflatten/-/lodash._baseflatten-3.1.4.tgz", + "_from": "lodash._baseflatten@>=3.0.0 <4.0.0" +} diff --git a/deps/npm/node_modules/lodash.union/package.json b/deps/npm/node_modules/lodash.union/package.json new file mode 100644 index 00000000000000..7c82a1ef4b536b --- /dev/null +++ b/deps/npm/node_modules/lodash.union/package.json @@ -0,0 +1,98 @@ +{ + "name": "lodash.union", + "version": "3.1.0", + "description": "The modern build of lodash’s `_.union` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "https://github.com/lodash/lodash" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._baseflatten": "^3.0.0", + "lodash._baseuniq": "^3.0.0", + "lodash.restparam": "^3.0.0" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.union@3.1.0", + "_shasum": "a4a3066fc15d6a7f8151cce9bdfe63dce7f5bcff", + "_from": "lodash.union@>=3.1.0 <3.2.0", + "_npmVersion": "2.7.3", + "_nodeVersion": "0.12.0", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + }, + { + "name": "d10", + "email": "demoneaux@gmail.com" + } + ], + "dist": { + "shasum": "a4a3066fc15d6a7f8151cce9bdfe63dce7f5bcff", + "tarball": "http://registry.npmjs.org/lodash.union/-/lodash.union-3.1.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-3.1.0.tgz" +} diff --git a/deps/npm/node_modules/lodash.uniq/LICENSE b/deps/npm/node_modules/lodash.uniq/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.uniq/README.md b/deps/npm/node_modules/lodash.uniq/README.md new file mode 100644 index 00000000000000..7ec935c7aa7fbe --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/README.md @@ -0,0 +1,20 @@ +# lodash.uniq v3.2.2 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.uniq` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.uniq +``` + +In Node.js/io.js: + +```js +var uniq = require('lodash.uniq'); +``` + +See the [documentation](https://lodash.com/docs#uniq) or [package source](https://github.com/lodash/lodash/blob/3.2.2-npm-packages/lodash.uniq) for more details. diff --git a/deps/npm/node_modules/lodash.uniq/index.js b/deps/npm/node_modules/lodash.uniq/index.js new file mode 100644 index 00000000000000..7c9a845e6a491f --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/index.js @@ -0,0 +1,106 @@ +/** + * lodash 3.2.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseCallback = require('lodash._basecallback'), + baseUniq = require('lodash._baseuniq'), + isIterateeCall = require('lodash._isiterateecall'); + +/** + * An implementation of `_.uniq` optimized for sorted arrays without support + * for callback shorthands and `this` binding. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The function invoked per iteration. + * @returns {Array} Returns the new duplicate-value-free array. + */ +function sortedUniq(array, iteratee) { + var seen, + index = -1, + length = array.length, + resIndex = -1, + result = []; + + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value, index, array) : value; + + if (!index || seen !== computed) { + seen = computed; + result[++resIndex] = value; + } + } + return result; +} + +/** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurence of each element + * is kept. Providing `true` for `isSorted` performs a faster search algorithm + * for sorted arrays. If an iteratee function is provided it is invoked for + * each element in the array to generate the criterion by which uniqueness + * is computed. The `iteratee` is bound to `thisArg` and invoked with three + * arguments: (value, index, array). + * + * If a property name is provided for `iteratee` the created `_.property` + * style callback returns the property value of the given element. + * + * If a value is also provided for `thisArg` the created `_.matchesProperty` + * style callback returns `true` for elements that have a matching property + * value, else `false`. + * + * If an object is provided for `iteratee` the created `_.matches` style + * callback returns `true` for elements that have the properties of the given + * object, else `false`. + * + * @static + * @memberOf _ + * @alias unique + * @category Array + * @param {Array} array The array to inspect. + * @param {boolean} [isSorted] Specify the array is sorted. + * @param {Function|Object|string} [iteratee] The function invoked per iteration. + * @param {*} [thisArg] The `this` binding of `iteratee`. + * @returns {Array} Returns the new duplicate-value-free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + * + * // using `isSorted` + * _.uniq([1, 1, 2], true); + * // => [1, 2] + * + * // using an iteratee function + * _.uniq([1, 2.5, 1.5, 2], function(n) { + * return this.floor(n); + * }, Math); + * // => [1, 2.5] + * + * // using the `_.property` callback shorthand + * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ +function uniq(array, isSorted, iteratee, thisArg) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (isSorted != null && typeof isSorted != 'boolean') { + thisArg = iteratee; + iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted; + isSorted = false; + } + iteratee = iteratee == null ? iteratee : baseCallback(iteratee, thisArg, 3); + return (isSorted) + ? sortedUniq(array, iteratee) + : baseUniq(array, iteratee); +} + +module.exports = uniq; diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/LICENSE b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.uniq/node_modules/lodash._basecallback/README.md b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/README.md new file mode 100644 index 00000000000000..11f1a64b71187a --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/README.md @@ -0,0 +1,20 @@ +# lodash._basecallback v3.3.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseCallback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._basecallback +``` + +In Node.js/io.js: + +```js +var baseCallback = require('lodash._basecallback'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.3.1-npm-packages/lodash._basecallback) for more details. diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/index.js b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/index.js new file mode 100644 index 00000000000000..cd44f79ee883ae --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/index.js @@ -0,0 +1,422 @@ +/** + * lodash 3.3.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseIsEqual = require('lodash._baseisequal'), + bindCallback = require('lodash._bindcallback'), + isArray = require('lodash.isarray'), + pairs = require('lodash.pairs'); + +/** Used to match property names within property paths. */ +var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g; + +/** Used to match backslashes in property paths. */ +var reEscapeChar = /\\(\\)?/g; + +/** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` or `undefined` values. + * + * @private + * @param {*} value The value to process. + * @returns {string} Returns the string. + */ +function baseToString(value) { + return value == null ? '' : (value + ''); +} + +/** + * The base implementation of `_.callback` which supports specifying the + * number of arguments to provide to `func`. + * + * @private + * @param {*} [func=_.identity] The value to convert to a callback. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {number} [argCount] The number of arguments to provide to `func`. + * @returns {Function} Returns the callback. + */ +function baseCallback(func, thisArg, argCount) { + var type = typeof func; + if (type == 'function') { + return thisArg === undefined + ? func + : bindCallback(func, thisArg, argCount); + } + if (func == null) { + return identity; + } + if (type == 'object') { + return baseMatches(func); + } + return thisArg === undefined + ? property(func) + : baseMatchesProperty(func, thisArg); +} + +/** + * The base implementation of `get` without support for string paths + * and default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path of the property to get. + * @param {string} [pathKey] The key representation of path. + * @returns {*} Returns the resolved value. + */ +function baseGet(object, path, pathKey) { + if (object == null) { + return; + } + if (pathKey !== undefined && pathKey in toObject(object)) { + path = [pathKey]; + } + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[path[index++]]; + } + return (index && index == length) ? object : undefined; +} + +/** + * The base implementation of `_.isMatch` without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} matchData The propery names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparing objects. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ +function baseIsMatch(object, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = toObject(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var result = customizer ? customizer(objValue, srcValue, key) : undefined; + if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) { + return false; + } + } + } + return true; +} + +/** + * The base implementation of `_.matches` which does not clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + */ +function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + var key = matchData[0][0], + value = matchData[0][1]; + + return function(object) { + if (object == null) { + return false; + } + return object[key] === value && (value !== undefined || (key in toObject(object))); + }; + } + return function(object) { + return baseIsMatch(object, matchData); + }; +} + +/** + * The base implementation of `_.matchesProperty` which does not clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to compare. + * @returns {Function} Returns the new function. + */ +function baseMatchesProperty(path, srcValue) { + var isArr = isArray(path), + isCommon = isKey(path) && isStrictComparable(srcValue), + pathKey = (path + ''); + + path = toPath(path); + return function(object) { + if (object == null) { + return false; + } + var key = pathKey; + object = toObject(object); + if ((isArr || !isCommon) && !(key in object)) { + object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); + if (object == null) { + return false; + } + key = last(path); + object = toObject(object); + } + return object[key] === srcValue + ? (srcValue !== undefined || (key in object)) + : baseIsEqual(srcValue, object[key], undefined, true); + }; +} + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + */ +function basePropertyDeep(path) { + var pathKey = (path + ''); + path = toPath(path); + return function(object) { + return baseGet(object, path, pathKey); + }; +} + +/** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ +function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + start = start == null ? 0 : (+start || 0); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : (+end || 0); + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; +} + +/** + * Gets the propery names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ +function getMatchData(object) { + var result = pairs(object), + length = result.length; + + while (length--) { + result[length][2] = isStrictComparable(result[length][1]); + } + return result; +} + +/** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ +function isKey(value, object) { + var type = typeof value; + if ((type == 'string' && reIsPlainProp.test(value)) || type == 'number') { + return true; + } + if (isArray(value)) { + return false; + } + var result = !reIsDeepProp.test(value); + return result || (object != null && value in toObject(object)); +} + +/** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ +function isStrictComparable(value) { + return value === value && !isObject(value); +} + +/** + * Converts `value` to an object if it's not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ +function toObject(value) { + return isObject(value) ? value : Object(value); +} + +/** + * Converts `value` to property path array if it's not one. + * + * @private + * @param {*} value The value to process. + * @returns {Array} Returns the property path array. + */ +function toPath(value) { + if (isArray(value)) { + return value; + } + var result = []; + baseToString(value).replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; +} + +/** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ +function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * This method returns the first argument provided to it. + * + * @static + * @memberOf _ + * @category Utility + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'user': 'fred' }; + * + * _.identity(object) === object; + * // => true + */ +function identity(value) { + return value; +} + +/** + * Creates a function that returns the property value at `path` on a + * given object. + * + * @static + * @memberOf _ + * @category Utility + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + * @example + * + * var objects = [ + * { 'a': { 'b': { 'c': 2 } } }, + * { 'a': { 'b': { 'c': 1 } } } + * ]; + * + * _.map(objects, _.property('a.b.c')); + * // => [2, 1] + * + * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c'); + * // => [1, 2] + */ +function property(path) { + return isKey(path) ? baseProperty(path) : basePropertyDeep(path); +} + +module.exports = baseCallback; diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/LICENSE.txt b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/LICENSE.txt new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/README.md b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/README.md new file mode 100644 index 00000000000000..7261bf341cd90e --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/README.md @@ -0,0 +1,20 @@ +# lodash._baseisequal v3.0.7 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseIsEqual` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._baseisequal +``` + +In Node.js/io.js: + +```js +var baseIsEqual = require('lodash._baseisequal'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.7-npm-packages/lodash._baseisequal) for more details. diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/index.js b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/index.js new file mode 100644 index 00000000000000..76aebe4a3998df --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/index.js @@ -0,0 +1,342 @@ +/** + * lodash 3.0.7 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var isArray = require('lodash.isarray'), + isTypedArray = require('lodash.istypedarray'), + keys = require('lodash.keys'); + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + stringTag = '[object String]'; + +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** + * A specialized version of `_.some` for arrays without support for callback + * shorthands and `this` binding. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ +function arraySome(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.isEqual` without support for `this` binding + * `customizer` functions. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparing values. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ +function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB); +} + +/** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing objects. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA=[]] Tracks traversed `value` objects. + * @param {Array} [stackB=[]] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = objToString.call(object); + if (objTag == argsTag) { + objTag = objectTag; + } else if (objTag != objectTag) { + objIsArr = isTypedArray(object); + } + } + if (!othIsArr) { + othTag = objToString.call(other); + if (othTag == argsTag) { + othTag = objectTag; + } else if (othTag != objectTag) { + othIsArr = isTypedArray(other); + } + } + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; + + if (isSameTag && !(objIsArr || objIsObj)) { + return equalByTag(object, other, objTag); + } + if (!isLoose) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB); + } + } + if (!isSameTag) { + return false; + } + // Assume cyclic values are equal. + // For more information on detecting circular references see https://es5.github.io/#JO. + stackA || (stackA = []); + stackB || (stackB = []); + + var length = stackA.length; + while (length--) { + if (stackA[length] == object) { + return stackB[length] == other; + } + } + // Add `object` and `other` to the stack of traversed objects. + stackA.push(object); + stackB.push(other); + + var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB); + + stackA.pop(); + stackB.pop(); + + return result; +} + +/** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing arrays. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ +function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) { + var index = -1, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isLoose && othLength > arrLength)) { + return false; + } + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index], + result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined; + + if (result !== undefined) { + if (result) { + continue; + } + return false; + } + // Recursively compare arrays (susceptible to call stack limits). + if (isLoose) { + if (!arraySome(other, function(othValue) { + return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB); + })) { + return false; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) { + return false; + } + } + return true; +} + +/** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} value The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalByTag(object, other, tag) { + switch (tag) { + case boolTag: + case dateTag: + // Coerce dates and booleans to numbers, dates to milliseconds and booleans + // to `1` or `0` treating invalid dates coerced to `NaN` as not equal. + return +object == +other; + + case errorTag: + return object.name == other.name && object.message == other.message; + + case numberTag: + // Treat `NaN` vs. `NaN` as equal. + return (object != +object) + ? other != +other + : object == +other; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings primitives and string + // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details. + return object == (other + ''); + } + return false; +} + +/** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparing values. + * @param {boolean} [isLoose] Specify performing partial comparisons. + * @param {Array} [stackA] Tracks traversed `value` objects. + * @param {Array} [stackB] Tracks traversed `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ +function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) { + var objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isLoose) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) { + return false; + } + } + var skipCtor = isLoose; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key], + result = customizer ? customizer(isLoose ? othValue : objValue, isLoose? objValue : othValue, key) : undefined; + + // Recursively compare objects (susceptible to call stack limits). + if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) { + return false; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (!skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + return false; + } + } + return true; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +module.exports = baseIsEqual; diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/LICENSE.txt b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/LICENSE.txt new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/README.md b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/README.md new file mode 100644 index 00000000000000..b1779ccf7fcd17 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/README.md @@ -0,0 +1,20 @@ +# lodash.istypedarray v3.0.2 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isTypedArray` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.istypedarray +``` + +In Node.js/io.js: + +```js +var isTypedArray = require('lodash.istypedarray'); +``` + +See the [documentation](https://lodash.com/docs#isTypedArray) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.istypedarray) for more details. diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/index.js b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/index.js new file mode 100644 index 00000000000000..829a2d77a78ec7 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/index.js @@ -0,0 +1,110 @@ +/** + * lodash 3.0.2 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** Used to identify `toStringTag` values of typed arrays. */ +var typedArrayTags = {}; +typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = +typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = +typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = +typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = +typedArrayTags[uint32Tag] = true; +typedArrayTags[argsTag] = typedArrayTags[arrayTag] = +typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = +typedArrayTags[dateTag] = typedArrayTags[errorTag] = +typedArrayTags[funcTag] = typedArrayTags[mapTag] = +typedArrayTags[numberTag] = typedArrayTags[objectTag] = +typedArrayTags[regexpTag] = typedArrayTags[setTag] = +typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + +/** + * Checks if `value` is object-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** Used for native method references. */ +var objectProto = Object.prototype; + +/** + * Used to resolve the [`toStringTag`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.prototype.tostring) + * of values. + */ +var objToString = objectProto.toString; + +/** + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ +function isTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)]; +} + +module.exports = isTypedArray; diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/package.json b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/package.json new file mode 100644 index 00000000000000..1de8c845f39558 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/node_modules/lodash.istypedarray/package.json @@ -0,0 +1,62 @@ +{ + "name": "lodash.istypedarray", + "version": "3.0.2", + "description": "The modern build of lodash’s `_.isTypedArray` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash.istypedarray v3.0.2\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.isTypedArray` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.istypedarray\n```\n\nIn Node.js/io.js:\n\n```js\nvar isTypedArray = require('lodash.istypedarray');\n```\n\nSee the [documentation](https://lodash.com/docs#isTypedArray) or [package source](https://github.com/lodash/lodash/blob/3.0.2-npm-packages/lodash.istypedarray) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.istypedarray@3.0.2", + "_shasum": "9397b113c15f424f320af06caa59cc495e2093ce", + "_resolved": "https://registry.npmjs.org/lodash.istypedarray/-/lodash.istypedarray-3.0.2.tgz", + "_from": "lodash.istypedarray@>=3.0.0 <4.0.0" +} diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/package.json b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/package.json new file mode 100644 index 00000000000000..33b1d56dc75614 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash._baseisequal/package.json @@ -0,0 +1,61 @@ +{ + "name": "lodash._baseisequal", + "version": "3.0.7", + "description": "The modern build of lodash’s internal `baseIsEqual` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash.isarray": "^3.0.0", + "lodash.istypedarray": "^3.0.0", + "lodash.keys": "^3.0.0" + }, + "readme": "# lodash._baseisequal v3.0.7\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseIsEqual` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._baseisequal\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseIsEqual = require('lodash._baseisequal');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.7-npm-packages/lodash._baseisequal) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._baseisequal@3.0.7", + "_shasum": "d8025f76339d29342767dcc887ce5cb95a5b51f1", + "_resolved": "https://registry.npmjs.org/lodash._baseisequal/-/lodash._baseisequal-3.0.7.tgz", + "_from": "lodash._baseisequal@>=3.0.0 <4.0.0" +} diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash.pairs/LICENSE.txt b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash.pairs/LICENSE.txt new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash.pairs/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash.pairs/README.md b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash.pairs/README.md new file mode 100644 index 00000000000000..9edbbac4b155f1 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash.pairs/README.md @@ -0,0 +1,20 @@ +# lodash.pairs v3.0.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.pairs` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.pairs +``` + +In Node.js/io.js: + +```js +var pairs = require('lodash.pairs'); +``` + +See the [documentation](https://lodash.com/docs#pairs) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.pairs) for more details. diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash.pairs/index.js b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash.pairs/index.js new file mode 100644 index 00000000000000..c0c1877553b7b0 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash.pairs/index.js @@ -0,0 +1,78 @@ +/** + * lodash 3.0.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var keys = require('lodash.keys'); + +/** + * Converts `value` to an object if it's not one. + * + * @private + * @param {*} value The value to process. + * @returns {Object} Returns the object. + */ +function toObject(value) { + return isObject(value) ? value : Object(value); +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Creates a two dimensional array of the key-value pairs for `object`, + * e.g. `[[key1, value1], [key2, value2]]`. + * + * @static + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the new array of key-value pairs. + * @example + * + * _.pairs({ 'barney': 36, 'fred': 40 }); + * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed) + */ +function pairs(object) { + object = toObject(object); + + var index = -1, + props = keys(object), + length = props.length, + result = Array(length); + + while (++index < length) { + var key = props[index]; + result[index] = [key, object[key]]; + } + return result; +} + +module.exports = pairs; diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash.pairs/package.json b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash.pairs/package.json new file mode 100644 index 00000000000000..49df669149c7b0 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/node_modules/lodash.pairs/package.json @@ -0,0 +1,65 @@ +{ + "name": "lodash.pairs", + "version": "3.0.1", + "description": "The modern build of lodash’s `_.pairs` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash.keys": "^3.0.0" + }, + "readme": "# lodash.pairs v3.0.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.pairs` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash.pairs\n```\n\nIn Node.js/io.js:\n\n```js\nvar pairs = require('lodash.pairs');\n```\n\nSee the [documentation](https://lodash.com/docs#pairs) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.pairs) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.pairs@3.0.1", + "_shasum": "bbe08d5786eeeaa09a15c91ebf0dcb7d2be326a9", + "_resolved": "https://registry.npmjs.org/lodash.pairs/-/lodash.pairs-3.0.1.tgz", + "_from": "lodash.pairs@>=3.0.0 <4.0.0" +} diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/package.json b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/package.json new file mode 100644 index 00000000000000..3a13a7f014288c --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._basecallback/package.json @@ -0,0 +1,62 @@ +{ + "name": "lodash._basecallback", + "version": "3.3.1", + "description": "The modern build of lodash’s internal `baseCallback` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._baseisequal": "^3.0.0", + "lodash._bindcallback": "^3.0.0", + "lodash.isarray": "^3.0.0", + "lodash.pairs": "^3.0.0" + }, + "readme": "# lodash._basecallback v3.3.1\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseCallback` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._basecallback\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseCallback = require('lodash._basecallback');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.3.1-npm-packages/lodash._basecallback) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._basecallback@3.3.1", + "_shasum": "b7b2bb43dc2160424a21ccf26c57e443772a8e27", + "_resolved": "https://registry.npmjs.org/lodash._basecallback/-/lodash._basecallback-3.3.1.tgz", + "_from": "lodash._basecallback@>=3.0.0 <4.0.0" +} diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._isiterateecall/LICENSE.txt b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._isiterateecall/LICENSE.txt new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._isiterateecall/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.uniq/node_modules/lodash._isiterateecall/README.md b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._isiterateecall/README.md new file mode 100644 index 00000000000000..0c5c701db23f43 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._isiterateecall/README.md @@ -0,0 +1,20 @@ +# lodash._isiterateecall v3.0.9 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `isIterateeCall` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._isiterateecall +``` + +In Node.js/io.js: + +```js +var isIterateeCall = require('lodash._isiterateecall'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.9-npm-packages/lodash._isiterateecall) for more details. diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._isiterateecall/index.js b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._isiterateecall/index.js new file mode 100644 index 00000000000000..ea3761b6c41ca2 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._isiterateecall/index.js @@ -0,0 +1,132 @@ +/** + * lodash 3.0.9 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ + +/** Used to detect unsigned integer values. */ +var reIsUint = /^\d+$/; + +/** + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)); +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; +} + +/** + * Checks if the provided arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`. + */ +function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object)) { + var other = object[index]; + return value === value ? (value === other) : (other !== other); + } + return false; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. + * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(1); + * // => false + */ +function isObject(value) { + // Avoid a V8 JIT bug in Chrome 19-20. + // See https://code.google.com/p/v8/issues/detail?id=2291 for more details. + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +module.exports = isIterateeCall; diff --git a/deps/npm/node_modules/lodash.uniq/node_modules/lodash._isiterateecall/package.json b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._isiterateecall/package.json new file mode 100644 index 00000000000000..233f1f94305f24 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/node_modules/lodash._isiterateecall/package.json @@ -0,0 +1,56 @@ +{ + "name": "lodash._isiterateecall", + "version": "3.0.9", + "description": "The modern build of lodash’s internal `isIterateeCall` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "readme": "# lodash._isiterateecall v3.0.9\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `isIterateeCall` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._isiterateecall\n```\n\nIn Node.js/io.js:\n\n```js\nvar isIterateeCall = require('lodash._isiterateecall');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.9-npm-packages/lodash._isiterateecall) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._isiterateecall@3.0.9", + "_shasum": "5203ad7ba425fae842460e696db9cf3e6aac057c", + "_resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", + "_from": "lodash._isiterateecall@>=3.0.0 <4.0.0" +} diff --git a/deps/npm/node_modules/lodash.uniq/package.json b/deps/npm/node_modules/lodash.uniq/package.json new file mode 100644 index 00000000000000..e29a590d959696 --- /dev/null +++ b/deps/npm/node_modules/lodash.uniq/package.json @@ -0,0 +1,101 @@ +{ + "name": "lodash.uniq", + "version": "3.2.2", + "description": "The modern build of lodash’s `_.uniq` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._basecallback": "^3.0.0", + "lodash._baseuniq": "^3.0.0", + "lodash._getnative": "^3.0.0", + "lodash._isiterateecall": "^3.0.0", + "lodash.isarray": "^3.0.0" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.uniq@3.2.2", + "_shasum": "146c36f25e75d19501ba402e88ba14937f63cd8b", + "_from": "lodash.uniq@>=3.2.2 <3.3.0", + "_npmVersion": "2.12.0", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + }, + { + "name": "d10", + "email": "demoneaux@gmail.com" + } + ], + "dist": { + "shasum": "146c36f25e75d19501ba402e88ba14937f63cd8b", + "tarball": "http://registry.npmjs.org/lodash.uniq/-/lodash.uniq-3.2.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-3.2.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/lodash.without/LICENSE.txt b/deps/npm/node_modules/lodash.without/LICENSE.txt new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.without/README.md b/deps/npm/node_modules/lodash.without/README.md new file mode 100644 index 00000000000000..5414eed6d39c0c --- /dev/null +++ b/deps/npm/node_modules/lodash.without/README.md @@ -0,0 +1,20 @@ +# lodash.without v3.2.1 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.without` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash.without +``` + +In Node.js/io.js: + +```js +var without = require('lodash.without'); +``` + +See the [documentation](https://lodash.com/docs#without) or [package source](https://github.com/lodash/lodash/blob/3.2.1-npm-packages/lodash.without) for more details. diff --git a/deps/npm/node_modules/lodash.without/index.js b/deps/npm/node_modules/lodash.without/index.js new file mode 100644 index 00000000000000..2febcd416bcd2f --- /dev/null +++ b/deps/npm/node_modules/lodash.without/index.js @@ -0,0 +1,89 @@ +/** + * lodash 3.2.1 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseDifference = require('lodash._basedifference'), + restParam = require('lodash.restparam'); + +/** + * Used as the [maximum length](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.max_safe_integer) + * of an array-like value. + */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ +function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; +} + +/** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) + * that affects Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ +var getLength = baseProperty('length'); + +/** + * Checks if `value` is array-like. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + */ +function isArrayLike(value) { + return value != null && isLength(getLength(value)); +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is based on [`ToLength`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength). + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + */ +function isLength(value) { + return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Creates an array excluding all provided values using + * [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @category Array + * @param {Array} array The array to filter. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.without([1, 2, 1, 3], 1, 2); + * // => [3] + */ +var without = restParam(function(array, values) { + return isArrayLike(array) + ? baseDifference(array, values) + : []; +}); + +module.exports = without; diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/LICENSE b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/lodash.without/node_modules/lodash._basedifference/README.md b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/README.md new file mode 100644 index 00000000000000..d9b809cfd2a277 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/README.md @@ -0,0 +1,20 @@ +# lodash._basedifference v3.0.3 + +The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseDifference` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. + +## Installation + +Using npm: + +```bash +$ {sudo -H} npm i -g npm +$ npm i --save lodash._basedifference +``` + +In Node.js/io.js: + +```js +var baseDifference = require('lodash._basedifference'); +``` + +See the [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash._basedifference) for more details. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/index.js b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/index.js new file mode 100644 index 00000000000000..43c6460fd1e17f --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/index.js @@ -0,0 +1,63 @@ +/** + * lodash 3.0.3 (Custom Build) + * Build: `lodash modern modularize exports="npm" -o ./` + * Copyright 2012-2015 The Dojo Foundation + * Based on Underscore.js 1.8.3 + * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + * Available under MIT license + */ +var baseIndexOf = require('lodash._baseindexof'), + cacheIndexOf = require('lodash._cacheindexof'), + createCache = require('lodash._createcache'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** + * The base implementation of `_.difference` which accepts a single array + * of values to exclude. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @returns {Array} Returns the new array of filtered values. + */ +function baseDifference(array, values) { + var length = array ? array.length : 0, + result = []; + + if (!length) { + return result; + } + var index = -1, + indexOf = baseIndexOf, + isCommon = true, + cache = (isCommon && values.length >= LARGE_ARRAY_SIZE) ? createCache(values) : null, + valuesLength = values.length; + + if (cache) { + indexOf = cacheIndexOf; + isCommon = false; + values = cache; + } + outer: + while (++index < length) { + var value = array[index]; + + if (isCommon && value === value) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === value) { + continue outer; + } + } + result.push(value); + } + else if (indexOf(values, value, 0) < 0) { + result.push(value); + } + } + return result; +} + +module.exports = baseDifference; diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/package.json b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/package.json new file mode 100644 index 00000000000000..380d53b289b4e4 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/package.json @@ -0,0 +1,61 @@ +{ + "name": "lodash._basedifference", + "version": "3.0.3", + "description": "The modern build of lodash’s internal `baseDifference` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._baseindexof": "^3.0.0", + "lodash._cacheindexof": "^3.0.0", + "lodash._createcache": "^3.0.0" + }, + "readme": "# lodash._basedifference v3.0.3\n\nThe [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseDifference` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.\n\n## Installation\n\nUsing npm:\n\n```bash\n$ {sudo -H} npm i -g npm\n$ npm i --save lodash._basedifference\n```\n\nIn Node.js/io.js:\n\n```js\nvar baseDifference = require('lodash._basedifference');\n```\n\nSee the [package source](https://github.com/lodash/lodash/blob/3.0.3-npm-packages/lodash._basedifference) for more details.\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash._basedifference@3.0.3", + "_shasum": "f2c204296c2a78e02b389081b6edcac933cf629c", + "_resolved": "https://registry.npmjs.org/lodash._basedifference/-/lodash._basedifference-3.0.3.tgz", + "_from": "lodash._basedifference@>=3.0.0 <4.0.0" +} diff --git a/deps/npm/node_modules/lodash.without/package.json b/deps/npm/node_modules/lodash.without/package.json new file mode 100644 index 00000000000000..9e15bfac021dd0 --- /dev/null +++ b/deps/npm/node_modules/lodash.without/package.json @@ -0,0 +1,97 @@ +{ + "name": "lodash.without", + "version": "3.2.1", + "description": "The modern build of lodash’s `_.without` as a module.", + "homepage": "https://lodash.com/", + "icon": "https://lodash.com/icon.svg", + "license": "MIT", + "keywords": [ + "lodash", + "lodash-modularized", + "stdlib", + "util" + ], + "author": { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + "contributors": [ + { + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "name": "Benjamin Tan", + "email": "demoneaux@gmail.com", + "url": "https://d10.github.io/" + }, + { + "name": "Blaine Bublitz", + "email": "blaine@iceddev.com", + "url": "http://www.iceddev.com/" + }, + { + "name": "Kit Cambridge", + "email": "github@kitcambridge.be", + "url": "http://kitcambridge.be/" + }, + { + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "repository": { + "type": "git", + "url": "git+https://github.com/lodash/lodash.git" + }, + "scripts": { + "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" + }, + "dependencies": { + "lodash._basedifference": "^3.0.0", + "lodash.restparam": "^3.0.0" + }, + "bugs": { + "url": "https://github.com/lodash/lodash/issues" + }, + "_id": "lodash.without@3.2.1", + "_shasum": "d69614b3512e52294b6abab782e7ca96538ce816", + "_from": "lodash.without@>=3.2.1 <3.3.0", + "_npmVersion": "2.10.0", + "_nodeVersion": "0.12.3", + "_npmUser": { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + "maintainers": [ + { + "name": "jdalton", + "email": "john.david.dalton@gmail.com" + }, + { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" + }, + { + "name": "d10", + "email": "demoneaux@gmail.com" + } + ], + "dist": { + "shasum": "d69614b3512e52294b6abab782e7ca96538ce816", + "tarball": "http://registry.npmjs.org/lodash.without/-/lodash.without-3.2.1.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/lodash.without/-/lodash.without-3.2.1.tgz" +} diff --git a/deps/npm/node_modules/lru-cache/package.json b/deps/npm/node_modules/lru-cache/package.json deleted file mode 100644 index 5a9d76a1d5f455..00000000000000 --- a/deps/npm/node_modules/lru-cache/package.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "name": "lru-cache", - "description": "A cache object that deletes the least-recently-used items.", - "version": "2.7.0", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me" - }, - "keywords": [ - "mru", - "lru", - "cache" - ], - "scripts": { - "test": "tap test --gc" - }, - "main": "lib/lru-cache.js", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, - "devDependencies": { - "tap": "^1.2.0", - "weak": "" - }, - "license": "ISC", - "gitHead": "fc6ee93093f4e463e5946736d4c48adc013724d1", - "bugs": { - "url": "https://github.com/isaacs/node-lru-cache/issues" - }, - "homepage": "https://github.com/isaacs/node-lru-cache#readme", - "_id": "lru-cache@2.7.0", - "_shasum": "aaa376a4cd970f9cebf5ec1909566ec034f07ee6", - "_from": "lru-cache@2.7.0", - "_npmVersion": "3.3.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "aaa376a4cd970f9cebf5ec1909566ec034f07ee6", - "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.0.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json deleted file mode 100644 index ede6efefa07883..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "balanced-match", - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "version": "0.2.0", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "homepage": "https://github.com/juliangruber/balanced-match", - "main": "index.js", - "scripts": { - "test": "make test" - }, - "dependencies": {}, - "devDependencies": { - "tape": "~1.1.1" - }, - "keywords": [ - "match", - "regexp", - "test", - "balanced", - "parse" - ], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT", - "testling": { - "files": "test/*.js", - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "gitHead": "ba40ed78e7114a4a67c51da768a100184dead39c", - "bugs": { - "url": "https://github.com/juliangruber/balanced-match/issues" - }, - "_id": "balanced-match@0.2.0", - "_shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", - "_from": "balanced-match@>=0.2.0 <0.3.0", - "_npmVersion": "2.1.8", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "dist": { - "shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", - "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js deleted file mode 100644 index 5fe2b8ad48cc1c..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +++ /dev/null @@ -1,32 +0,0 @@ -var test = require('tape'); -var expand = require('..'); -var fs = require('fs'); -var resfile = __dirname + '/bash-results.txt'; -var cases = fs.readFileSync(resfile, 'utf8').split('><><><><'); - -// throw away the EOF marker -cases.pop() - -test('matches bash expansions', function(t) { - cases.forEach(function(testcase) { - var set = testcase.split('\n'); - var pattern = set.shift(); - var actual = expand(pattern); - - // If it expands to the empty string, then it's actually - // just nothing, but Bash is a singly typed language, so - // "nothing" is the same as "". - if (set.length === 1 && set[0] === '') { - set = [] - } else { - // otherwise, strip off the [] that were added so that - // "" expansions would be preserved properly. - set = set.map(function (s) { - return s.replace(/^\[|\]$/g, '') - }) - } - - t.same(actual, set, pattern); - }); - t.end(); -}) diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt deleted file mode 100644 index 958148d26aacb9..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +++ /dev/null @@ -1,1075 +0,0 @@ -A{b,{d,e},{f,g}}Z -[AbZ] -[AdZ] -[AeZ] -[AfZ] -[AgZ]><><><><><><><\{a,b}{{a,b},a,b} -[{a,b}a] -[{a,b}b] -[{a,b}a] -[{a,b}b]><><><><{{a,b} -[{a] -[{b]><><><><{a,b}} -[a}] -[b}]><><><><{,} -><><><><><><><{,}b -[b] -[b]><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><{-01..5} -[-01] -[000] -[001] -[002] -[003] -[004] -[005]><><><><{-05..100..5} -[-05] -[000] -[005] -[010] -[015] -[020] -[025] -[030] -[035] -[040] -[045] -[050] -[055] -[060] -[065] -[070] -[075] -[080] -[085] -[090] -[095] -[100]><><><><{-05..100} -[-05] -[-04] -[-03] -[-02] -[-01] -[000] -[001] -[002] -[003] -[004] -[005] -[006] -[007] -[008] -[009] -[010] -[011] -[012] -[013] -[014] -[015] -[016] -[017] -[018] -[019] -[020] -[021] -[022] -[023] -[024] -[025] -[026] -[027] -[028] -[029] -[030] -[031] -[032] -[033] -[034] -[035] -[036] -[037] -[038] -[039] -[040] -[041] -[042] -[043] -[044] -[045] -[046] -[047] -[048] -[049] -[050] -[051] -[052] -[053] -[054] -[055] -[056] -[057] -[058] -[059] -[060] -[061] -[062] -[063] -[064] -[065] -[066] -[067] -[068] -[069] -[070] -[071] -[072] -[073] -[074] -[075] -[076] -[077] -[078] -[079] -[080] -[081] -[082] -[083] -[084] -[085] -[086] -[087] -[088] -[089] -[090] -[091] -[092] -[093] -[094] -[095] -[096] -[097] -[098] -[099] -[100]><><><><{0..5..2} -[0] -[2] -[4]><><><><{0001..05..2} -[0001] -[0003] -[0005]><><><><{0001..-5..2} -[0001] -[-001] -[-003] -[-005]><><><><{0001..-5..-2} -[0001] -[-001] -[-003] -[-005]><><><><{0001..5..-2} -[0001] -[0003] -[0005]><><><><{01..5} -[01] -[02] -[03] -[04] -[05]><><><><{1..05} -[01] -[02] -[03] -[04] -[05]><><><><{1..05..3} -[01] -[04]><><><><{05..100} -[005] -[006] -[007] -[008] -[009] -[010] -[011] -[012] -[013] -[014] -[015] -[016] -[017] -[018] -[019] -[020] -[021] -[022] -[023] -[024] -[025] -[026] -[027] -[028] -[029] -[030] -[031] -[032] -[033] -[034] -[035] -[036] -[037] -[038] -[039] -[040] -[041] -[042] -[043] -[044] -[045] -[046] -[047] -[048] -[049] -[050] -[051] -[052] -[053] -[054] -[055] -[056] -[057] -[058] -[059] -[060] -[061] -[062] -[063] -[064] -[065] -[066] -[067] -[068] -[069] -[070] -[071] -[072] -[073] -[074] -[075] -[076] -[077] -[078] -[079] -[080] -[081] -[082] -[083] -[084] -[085] -[086] -[087] -[088] -[089] -[090] -[091] -[092] -[093] -[094] -[095] -[096] -[097] -[098] -[099] -[100]><><><><{0a..0z} -[{0a..0z}]><><><><{a,b\}c,d} -[a] -[b}c] -[d]><><><><{a,b{c,d} -[{a,bc] -[{a,bd]><><><><{a,b}c,d} -[ac,d}] -[bc,d}]><><><><{a..F} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F]><><><><{A..f} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a] -[b] -[c] -[d] -[e] -[f]><><><><{a..Z} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z]><><><><{A..z} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a] -[b] -[c] -[d] -[e] -[f] -[g] -[h] -[i] -[j] -[k] -[l] -[m] -[n] -[o] -[p] -[q] -[r] -[s] -[t] -[u] -[v] -[w] -[x] -[y] -[z]><><><><{z..A} -[z] -[y] -[x] -[w] -[v] -[u] -[t] -[s] -[r] -[q] -[p] -[o] -[n] -[m] -[l] -[k] -[j] -[i] -[h] -[g] -[f] -[e] -[d] -[c] -[b] -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F] -[E] -[D] -[C] -[B] -[A]><><><><{Z..a} -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a]><><><><{a..F..2} -[a] -[_] -[]] -[[] -[Y] -[W] -[U] -[S] -[Q] -[O] -[M] -[K] -[I] -[G]><><><><{A..f..02} -[A] -[C] -[E] -[G] -[I] -[K] -[M] -[O] -[Q] -[S] -[U] -[W] -[Y] -[[] -[]] -[_] -[a] -[c] -[e]><><><><{a..Z..5} -[a] -[]><><><><><><><{A..z..10} -[A] -[K] -[U] -[_] -[i] -[s]><><><><{z..A..-2} -[z] -[x] -[v] -[t] -[r] -[p] -[n] -[l] -[j] -[h] -[f] -[d] -[b] -[`] -[^] -[] -[Z] -[X] -[V] -[T] -[R] -[P] -[N] -[L] -[J] -[H] -[F] -[D] -[B]><><><><{Z..a..20} -[Z]><><><><{a{,b} -[{a] -[{ab]><><><><{a},b} -[a}] -[b]><><><><{x,y{,}g} -[x] -[yg] -[yg]><><><><{x,y{}g} -[x] -[y{}g]><><><><{{a,b} -[{a] -[{b]><><><><{{a,b},c} -[a] -[b] -[c]><><><><{{a,b}c} -[{ac}] -[{bc}]><><><><{{a,b},} -[a] -[b]><><><><><><><{{a,b},}c -[ac] -[bc] -[c]><><><><{{a,b}.} -[{a.}] -[{b.}]><><><><{{a,b}} -[{a}] -[{b}]><><><><><><>< -><><><><{-10..00} -[-10] -[-09] -[-08] -[-07] -[-06] -[-05] -[-04] -[-03] -[-02] -[-01] -[000]><><><><{a,\\{a,b}c} -[a] -[\ac] -[\bc]><><><><{a,\{a,b}c} -[ac}] -[{ac}] -[bc}]><><><><><><><{-10.\.00} -[{-10..00}]><><><><><><><><><><{l,n,m}xyz -[lxyz] -[nxyz] -[mxyz]><><><><{abc\,def} -[{abc,def}]><><><><{abc} -[{abc}]><><><><{x\,y,\{abc\},trie} -[x,y] -[{abc}] -[trie]><><><><{} -[{}]><><><><} -[}]><><><><{ -[{]><><><><><><><{1..10} -[1] -[2] -[3] -[4] -[5] -[6] -[7] -[8] -[9] -[10]><><><><{0..10,braces} -[0..10] -[braces]><><><><{{0..10},braces} -[0] -[1] -[2] -[3] -[4] -[5] -[6] -[7] -[8] -[9] -[10] -[braces]><><><><><><><{3..3} -[3]><><><><><><><{10..1} -[10] -[9] -[8] -[7] -[6] -[5] -[4] -[3] -[2] -[1]><><><><{10..1}y -[10y] -[9y] -[8y] -[7y] -[6y] -[5y] -[4y] -[3y] -[2y] -[1y]><><><><><><><{a..f} -[a] -[b] -[c] -[d] -[e] -[f]><><><><{f..a} -[f] -[e] -[d] -[c] -[b] -[a]><><><><{a..A} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F] -[E] -[D] -[C] -[B] -[A]><><><><{A..a} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a]><><><><{f..f} -[f]><><><><{1..f} -[{1..f}]><><><><{f..1} -[{f..1}]><><><><{-1..-10} -[-1] -[-2] -[-3] -[-4] -[-5] -[-6] -[-7] -[-8] -[-9] -[-10]><><><><{-20..0} -[-20] -[-19] -[-18] -[-17] -[-16] -[-15] -[-14] -[-13] -[-12] -[-11] -[-10] -[-9] -[-8] -[-7] -[-6] -[-5] -[-4] -[-3] -[-2] -[-1] -[0]><><><><><><><><><><{klklkl}{1,2,3} -[{klklkl}1] -[{klklkl}2] -[{klklkl}3]><><><><{1..10..2} -[1] -[3] -[5] -[7] -[9]><><><><{-1..-10..2} -[-1] -[-3] -[-5] -[-7] -[-9]><><><><{-1..-10..-2} -[-1] -[-3] -[-5] -[-7] -[-9]><><><><{10..1..-2} -[10] -[8] -[6] -[4] -[2]><><><><{10..1..2} -[10] -[8] -[6] -[4] -[2]><><><><{1..20..2} -[1] -[3] -[5] -[7] -[9] -[11] -[13] -[15] -[17] -[19]><><><><{1..20..20} -[1]><><><><{100..0..5} -[100] -[95] -[90] -[85] -[80] -[75] -[70] -[65] -[60] -[55] -[50] -[45] -[40] -[35] -[30] -[25] -[20] -[15] -[10] -[5] -[0]><><><><{100..0..-5} -[100] -[95] -[90] -[85] -[80] -[75] -[70] -[65] -[60] -[55] -[50] -[45] -[40] -[35] -[30] -[25] -[20] -[15] -[10] -[5] -[0]><><><><{a..z} -[a] -[b] -[c] -[d] -[e] -[f] -[g] -[h] -[i] -[j] -[k] -[l] -[m] -[n] -[o] -[p] -[q] -[r] -[s] -[t] -[u] -[v] -[w] -[x] -[y] -[z]><><><><{a..z..2} -[a] -[c] -[e] -[g] -[i] -[k] -[m] -[o] -[q] -[s] -[u] -[w] -[y]><><><><{z..a..-2} -[z] -[x] -[v] -[t] -[r] -[p] -[n] -[l] -[j] -[h] -[f] -[d] -[b]><><><><{2147483645..2147483649} -[2147483645] -[2147483646] -[2147483647] -[2147483648] -[2147483649]><><><><{10..0..2} -[10] -[8] -[6] -[4] -[2] -[0]><><><><{10..0..-2} -[10] -[8] -[6] -[4] -[2] -[0]><><><><{-50..-0..5} -[-50] -[-45] -[-40] -[-35] -[-30] -[-25] -[-20] -[-15] -[-10] -[-5] -[0]><><><><{1..10.f} -[{1..10.f}]><><><><{1..ff} -[{1..ff}]><><><><{1..10..ff} -[{1..10..ff}]><><><><{1.20..2} -[{1.20..2}]><><><><{1..20..f2} -[{1..20..f2}]><><><><{1..20..2f} -[{1..20..2f}]><><><><{1..2f..2} -[{1..2f..2}]><><><><{1..ff..2} -[{1..ff..2}]><><><><{1..ff} -[{1..ff}]><><><><{1..f} -[{1..f}]><><><><{1..0f} -[{1..0f}]><><><><{1..10f} -[{1..10f}]><><><><{1..10.f} -[{1..10.f}]><><><><{1..10.f} -[{1..10.f}]><><><>< \ No newline at end of file diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt deleted file mode 100644 index e5161c3da869f3..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +++ /dev/null @@ -1,182 +0,0 @@ -# skip quotes for now -# "{x,x}" -# {"x,x"} -# {x","x} -# '{a,b}{{a,b},a,b}' -A{b,{d,e},{f,g}}Z -PRE-{a,b}{{a,b},a,b}-POST -\\{a,b}{{a,b},a,b} -{{a,b} -{a,b}} -{,} -a{,} -{,}b -a{,}b -a{b}c -a{1..5}b -a{01..5}b -a{-01..5}b -a{-01..5..3}b -a{001..9}b -a{b,c{d,e},{f,g}h}x{y,z -a{b,c{d,e},{f,g}h}x{y,z\\} -a{b,c{d,e},{f,g}h}x{y,z} -a{b{c{d,e}f{x,y{{g}h -a{b{c{d,e}f{x,y{}g}h -a{b{c{d,e}f{x,y}}g}h -a{b{c{d,e}f}g}h -a{{x,y},z}b -f{x,y{g,z}}h -f{x,y{{g,z}}h -f{x,y{{g,z}}h} -f{x,y{{g}h -f{x,y{{g}}h -f{x,y{}g}h -z{a,b{,c}d -z{a,b},c}d -{-01..5} -{-05..100..5} -{-05..100} -{0..5..2} -{0001..05..2} -{0001..-5..2} -{0001..-5..-2} -{0001..5..-2} -{01..5} -{1..05} -{1..05..3} -{05..100} -{0a..0z} -{a,b\\}c,d} -{a,b{c,d} -{a,b}c,d} -{a..F} -{A..f} -{a..Z} -{A..z} -{z..A} -{Z..a} -{a..F..2} -{A..f..02} -{a..Z..5} -d{a..Z..5}b -{A..z..10} -{z..A..-2} -{Z..a..20} -{a{,b} -{a},b} -{x,y{,}g} -{x,y{}g} -{{a,b} -{{a,b},c} -{{a,b}c} -{{a,b},} -X{{a,b},}X -{{a,b},}c -{{a,b}.} -{{a,b}} -X{a..#}X -# this next one is an empty string - -{-10..00} -# Need to escape slashes in here for reasons i guess. -{a,\\\\{a,b}c} -{a,\\{a,b}c} -a,\\{b,c} -{-10.\\.00} -#### bash tests/braces.tests -# Note that some tests are edited out because some features of -# bash are intentionally not supported in this brace expander. -ff{c,b,a} -f{d,e,f}g -{l,n,m}xyz -{abc\\,def} -{abc} -{x\\,y,\\{abc\\},trie} -# not impementing back-ticks obviously -# XXXX\\{`echo a b c | tr ' ' ','`\\} -{} -# We only ever have to worry about parsing a single argument, -# not a command line, so spaces have a different meaning than bash. -# { } -} -{ -abcd{efgh -# spaces -# foo {1,2} bar -# not impementing back-ticks obviously -# `zecho foo {1,2} bar` -# $(zecho foo {1,2} bar) -# ${var} is not a variable here, like it is in bash. omit. -# foo{bar,${var}.} -# foo{bar,${var}} -# isaacs: skip quotes for now -# "${var}"{x,y} -# $var{x,y} -# ${var}{x,y} -# new sequence brace operators -{1..10} -# this doesn't work yet -{0..10,braces} -# but this does -{{0..10},braces} -x{{0..10},braces}y -{3..3} -x{3..3}y -{10..1} -{10..1}y -x{10..1}y -{a..f} -{f..a} -{a..A} -{A..a} -{f..f} -# mixes are incorrectly-formed brace expansions -{1..f} -{f..1} -# spaces -# 0{1..9} {10..20} -# do negative numbers work? -{-1..-10} -{-20..0} -# weirdly-formed brace expansions -- fixed in post-bash-3.1 -a-{b{d,e}}-c -a-{bdef-{g,i}-c -# isaacs: skip quotes for now -# {"klklkl"}{1,2,3} -# isaacs: this is a valid test, though -{klklkl}{1,2,3} -# {"x,x"} -{1..10..2} -{-1..-10..2} -{-1..-10..-2} -{10..1..-2} -{10..1..2} -{1..20..2} -{1..20..20} -{100..0..5} -{100..0..-5} -{a..z} -{a..z..2} -{z..a..-2} -# make sure brace expansion handles ints > 2**31 - 1 using intmax_t -{2147483645..2147483649} -# unwanted zero-padding -- fixed post-bash-4.0 -{10..0..2} -{10..0..-2} -{-50..-0..5} -# bad -{1..10.f} -{1..ff} -{1..10..ff} -{1.20..2} -{1..20..f2} -{1..20..2f} -{1..2f..2} -{1..ff..2} -{1..ff} -{1..f} -{1..0f} -{1..10f} -{1..10.f} -{1..10.f} diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js deleted file mode 100644 index 3fcc185a7d6dcc..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('ignores ${', function(t) { - t.deepEqual(expand('${1..3}'), ['${1..3}']); - t.deepEqual(expand('${a,b}${c,d}'), ['${a,b}${c,d}']); - t.deepEqual(expand('x${a,b}x${c,d}x'), ['x${a,b}x${c,d}x']); - t.end(); -}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js deleted file mode 100644 index e429121eab8059..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +++ /dev/null @@ -1,10 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('empty option', function(t) { - t.deepEqual(expand('-v{,,,,}'), [ - '-v', '-v', '-v', '-v', '-v' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh deleted file mode 100644 index e040e664d9f881..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Bash 4.3 because of arbitrary need to pick a single standard. - -if [ "${BASH_VERSINFO[0]}" != "4" ] || [ "${BASH_VERSINFO[1]}" != "3" ]; then - echo "this script requires bash 4.3" >&2 - exit 1 -fi - -CDPATH= cd "$(dirname "$0")" - -js='require("./")(process.argv[1]).join(" ")' - -cat cases.txt | \ - while read case; do - if [ "${case:0:1}" = "#" ]; then - continue; - fi; - b="$($BASH -c 'for c in '"$case"'; do echo ["$c"]; done')" - echo "$case" - echo -n "$b><><><><"; - done > bash-results.txt diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js deleted file mode 100644 index 8d434c23d4514d..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('negative increment', function(t) { - t.deepEqual(expand('{3..1}'), ['3', '2', '1']); - t.deepEqual(expand('{10..8}'), ['10', '9', '8']); - t.deepEqual(expand('{10..08}'), ['10', '09', '08']); - t.deepEqual(expand('{c..a}'), ['c', 'b', 'a']); - - t.deepEqual(expand('{4..0..2}'), ['4', '2', '0']); - t.deepEqual(expand('{4..0..-2}'), ['4', '2', '0']); - t.deepEqual(expand('{e..a..2}'), ['e', 'c', 'a']); - - t.end(); -}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/nested.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/nested.js deleted file mode 100644 index 0862dc51f90aee..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('nested', function(t) { - t.deepEqual(expand('{a,b{1..3},c}'), [ - 'a', 'b1', 'b2', 'b3', 'c' - ]); - t.deepEqual(expand('{{A..Z},{a..z}}'), - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('') - ); - t.deepEqual(expand('ppp{,config,oe{,conf}}'), [ - 'ppp', 'pppconfig', 'pppoe', 'pppoeconf' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/order.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/order.js deleted file mode 100644 index c00ad155fe6760..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/order.js +++ /dev/null @@ -1,10 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('order', function(t) { - t.deepEqual(expand('a{d,c,b}e'), [ - 'ade', 'ace', 'abe' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/pad.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/pad.js deleted file mode 100644 index e4158775f1bd06..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +++ /dev/null @@ -1,13 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('pad', function(t) { - t.deepEqual(expand('{9..11}'), [ - '9', '10', '11' - ]); - t.deepEqual(expand('{09..11}'), [ - '09', '10', '11' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js deleted file mode 100644 index 3038fba7416b3a..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +++ /dev/null @@ -1,7 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('x and y of same type', function(t) { - t.deepEqual(expand('{a..9}'), ['{a..9}']); - t.end(); -}); diff --git a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js b/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js deleted file mode 100644 index f73a9579ab398b..00000000000000 --- a/deps/npm/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +++ /dev/null @@ -1,50 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('numeric sequences', function(t) { - t.deepEqual(expand('a{1..2}b{2..3}c'), [ - 'a1b2c', 'a1b3c', 'a2b2c', 'a2b3c' - ]); - t.deepEqual(expand('{1..2}{2..3}'), [ - '12', '13', '22', '23' - ]); - t.end(); -}); - -test('numeric sequences with step count', function(t) { - t.deepEqual(expand('{0..8..2}'), [ - '0', '2', '4', '6', '8' - ]); - t.deepEqual(expand('{1..8..2}'), [ - '1', '3', '5', '7' - ]); - t.end(); -}); - -test('numeric sequence with negative x / y', function(t) { - t.deepEqual(expand('{3..-2}'), [ - '3', '2', '1', '0', '-1', '-2' - ]); - t.end(); -}); - -test('alphabetic sequences', function(t) { - t.deepEqual(expand('1{a..b}2{b..c}3'), [ - '1a2b3', '1a2c3', '1b2b3', '1b2c3' - ]); - t.deepEqual(expand('{a..b}{b..c}'), [ - 'ab', 'ac', 'bb', 'bc' - ]); - t.end(); -}); - -test('alphabetic sequences with step count', function(t) { - t.deepEqual(expand('{a..k..2}'), [ - 'a', 'c', 'e', 'g', 'i', 'k' - ]); - t.deepEqual(expand('{b..k..2}'), [ - 'b', 'd', 'f', 'h', 'j' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js index 584f551a6da734..a5793ceccec488 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js @@ -1,16 +1,16 @@ module.exports = function (args, opts) { if (!opts) opts = {}; - + var flags = { bools : {}, strings : {} }; - + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { flags.bools[key] = true; }); - + [].concat(opts.string).filter(Boolean).forEach(function (key) { flags.strings[key] = true; }); - + var aliases = {}; Object.keys(opts.alias || {}).forEach(function (key) { aliases[key] = [].concat(opts.alias[key]); @@ -20,14 +20,14 @@ module.exports = function (args, opts) { })); }); }); - + var defaults = opts['default'] || {}; - + var argv = { _ : [] }; Object.keys(flags.bools).forEach(function (key) { setArg(key, defaults[key] === undefined ? false : defaults[key]); }); - + var notFlags = []; if (args.indexOf('--') !== -1) { @@ -40,15 +40,15 @@ module.exports = function (args, opts) { ? Number(val) : val ; setKey(argv, key.split('.'), value); - + (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), value); }); } - + for (var i = 0; i < args.length; i++) { var arg = args[i]; - + if (/^--.+=/.test(arg)) { // Using [\s\S] instead of . because js doesn't support the // 'dotall' regex modifier. See: @@ -79,23 +79,23 @@ module.exports = function (args, opts) { } else if (/^-[^-]+/.test(arg)) { var letters = arg.slice(1,-1).split(''); - + var broken = false; for (var j = 0; j < letters.length; j++) { var next = arg.slice(j+2); - + if (next === '-') { setArg(letters[j], next) continue; } - + if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { setArg(letters[j], next); broken = true; break; } - + if (letters[j+1] && letters[j+1].match(/\W/)) { setArg(letters[j], arg.slice(j+2)); broken = true; @@ -105,7 +105,7 @@ module.exports = function (args, opts) { setArg(letters[j], flags.strings[letters[j]] ? '' : true); } } - + var key = arg.slice(-1)[0]; if (!broken && key !== '-') { if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) @@ -129,17 +129,17 @@ module.exports = function (args, opts) { ); } } - + Object.keys(defaults).forEach(function (key) { if (!hasKey(argv, key.split('.'))) { setKey(argv, key.split('.'), defaults[key]); - + (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), defaults[key]); }); } }); - + notFlags.forEach(function(key) { argv._.push(key); }); @@ -163,7 +163,7 @@ function setKey (obj, keys, value) { if (o[key] === undefined) o[key] = {}; o = o[key]; }); - + var key = keys[keys.length - 1]; if (o[key] === undefined || typeof o[key] === 'boolean') { o[key] = value; diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/package.json b/deps/npm/node_modules/mkdirp/node_modules/minimist/package.json index 7cd80f4f41ac5a..ca6e58da3020e6 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/package.json +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/package.json @@ -40,27 +40,13 @@ "url": "http://substack.net" }, "license": "MIT", + "readme": "# minimist\n\nparse argument options\n\nThis module is the guts of optimist's argument parser without all the\nfanciful decoration.\n\n[![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist)\n\n[![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist)\n\n# example\n\n``` js\nvar argv = require('minimist')(process.argv.slice(2));\nconsole.dir(argv);\n```\n\n```\n$ node example/parse.js -a beep -b boop\n{ _: [], a: 'beep', b: 'boop' }\n```\n\n```\n$ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz\n{ _: [ 'foo', 'bar', 'baz' ],\n x: 3,\n y: 4,\n n: 5,\n a: true,\n b: true,\n c: true,\n beep: 'boop' }\n```\n\n# methods\n\n``` js\nvar parseArgs = require('minimist')\n```\n\n## var argv = parseArgs(args, opts={})\n\nReturn an argument object `argv` populated with the array arguments from `args`.\n\n`argv._` contains all the arguments that didn't have an option associated with\nthem.\n\nNumeric-looking arguments will be returned as numbers unless `opts.string` or\n`opts.boolean` is set for that argument name.\n\nAny arguments after `'--'` will not be parsed and will end up in `argv._`.\n\noptions can be:\n\n* `opts.string` - a string or array of strings argument names to always treat as\nstrings\n* `opts.boolean` - a string or array of strings to always treat as booleans\n* `opts.alias` - an object mapping string names to strings or arrays of string\nargument names to use as aliases\n* `opts.default` - an object mapping string argument names to default values\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install minimist\n```\n\n# license\n\nMIT\n", + "readmeFilename": "readme.markdown", "bugs": { "url": "https://github.com/substack/minimist/issues" }, "_id": "minimist@0.0.8", - "dist": { - "shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", - "tarball": "http://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" - }, - "_from": "minimist@0.0.8", - "_npmVersion": "1.4.3", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, "_shasum": "857fcabfc3397d2625b8228262e86aa7a011b05d", - "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz" + "_resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "_from": "minimist@0.0.8" } diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js index 8a90646696628e..47e92237fb0bbc 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js @@ -14,7 +14,7 @@ test('parse args', function (t) { ); t.end(); }); - + test('comprehensive', function (t) { t.deepEqual( parse([ @@ -80,13 +80,13 @@ test('flag boolean value', function (t) { boolean: [ 't', 'verbose' ], default: { verbose: true } }); - + t.deepEqual(argv, { verbose: false, t: true, _: ['moo'] }); - + t.deepEqual(typeof argv.verbose, 'boolean'); t.deepEqual(typeof argv.t, 'boolean'); t.end(); @@ -97,13 +97,13 @@ test('flag boolean default false', function (t) { boolean: ['t', 'verbose'], default: { verbose: false, t: false } }); - + t.deepEqual(argv, { verbose: false, t: false, _: ['moo'] }); - + t.deepEqual(typeof argv.verbose, 'boolean'); t.deepEqual(typeof argv.t, 'boolean'); t.end(); @@ -114,14 +114,14 @@ test('boolean groups', function (t) { var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { boolean: ['x','y','z'] }); - + t.deepEqual(argv, { x : true, y : false, z : true, _ : [ 'one', 'two', 'three' ] }); - + t.deepEqual(typeof argv.x, 'boolean'); t.deepEqual(typeof argv.y, 'boolean'); t.deepEqual(typeof argv.z, 'boolean'); @@ -131,7 +131,7 @@ test('boolean groups', function (t) { test('newlines in params' , function (t) { var args = parse([ '-s', "X\nX" ]) t.deepEqual(args, { _ : [], s : "X\nX" }); - + // reproduce in bash: // VALUE="new // line" @@ -145,7 +145,7 @@ test('strings' , function (t) { var s = parse([ '-s', '0001234' ], { string: 's' }).s; t.equal(s, '0001234'); t.equal(typeof s, 'string'); - + var x = parse([ '-x', '56' ], { string: 'x' }).x; t.equal(x, '56'); t.equal(typeof x, 'string'); @@ -222,7 +222,7 @@ test('nested dotted objects', function (t) { '--foo.quux.quibble', '5', '--foo.quux.o_O', '--beep.boop' ]); - + t.same(argv.foo, { bar : 3, baz : 4, @@ -254,9 +254,9 @@ test('boolean and alias with chainable api', function (t) { h: true, '_': [ 'derp' ] }; - + t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); + t.same(propertyArgv, expected); t.end(); }); @@ -295,7 +295,7 @@ test('boolean and alias using explicit true', function (t) { }; t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); + t.same(propertyArgv, expected); t.end(); }); @@ -311,7 +311,7 @@ test('boolean and --x=true', function(t) { parsed = parse(['--boool', '--other=false'], { boolean: 'boool' }); - + t.same(parsed.boool, true); t.same(parsed.other, 'false'); t.end(); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js index 21851b036ee6d9..7c4c2abe397797 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js @@ -3,7 +3,7 @@ var test = require('tape'); test('parse with modifier functions' , function (t) { t.plan(1); - + var argv = parse([ '-b', '123' ], { boolean: 'b' }); t.deepEqual(argv, { b: true, _: ['123'] }); }); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js index d513a1c2529095..ac18880f1eb50c 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js @@ -43,7 +43,7 @@ test('short', function (t) { ); t.end(); }); - + test('mixed short bool and capture', function (t) { t.same( parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), @@ -54,7 +54,7 @@ test('mixed short bool and capture', function (t) { ); t.end(); }); - + test('short and long', function (t) { t.deepEqual( parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), diff --git a/deps/npm/node_modules/mkdirp/package.json b/deps/npm/node_modules/mkdirp/package.json index 24411034800529..8f46140d7fc5d3 100644 --- a/deps/npm/node_modules/mkdirp/package.json +++ b/deps/npm/node_modules/mkdirp/package.json @@ -30,30 +30,14 @@ "mkdirp": "bin/cmd.js" }, "license": "MIT", - "gitHead": "d4eff0f06093aed4f387e88e9fc301cb76beedc7", + "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, opts, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `opts.mode`. If `opts` is a non-object, it will be treated as\nthe `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdir(path, mode, cb)` and\n`opts.fs.stat(path, cb)`.\n\n## mkdirp.sync(dir, opts)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `opts.mode`. If `opts` is a non-object, it will be\ntreated as the `opts.mode`.\n\nIf `opts.mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\nYou can optionally pass in an alternate `fs` implementation by passing in\n`opts.fs`. Your implementation should have `opts.fs.mkdirSync(path, mode)` and\n`opts.fs.statSync(path)`.\n\n# usage\n\nThis package also ships with a `mkdirp` command.\n\n```\nusage: mkdirp [DIR1,DIR2..] {OPTIONS}\n\n Create each supplied directory including any necessary parent directories that\n don't yet exist.\n \n If the directory already exists, do nothing.\n\nOPTIONS are:\n\n -m, --mode If a directory needs to be created, set the mode as an octal\n permission string.\n\n```\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\nto get the library, or\n\n```\nnpm install -g mkdirp\n```\n\nto get the command.\n\n# license\n\nMIT\n", + "readmeFilename": "readme.markdown", "bugs": { "url": "https://github.com/substack/node-mkdirp/issues" }, "homepage": "https://github.com/substack/node-mkdirp#readme", "_id": "mkdirp@0.5.1", "_shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", - "_from": "mkdirp@>=0.5.1 <0.6.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.0.0", - "_npmUser": { - "name": "substack", - "email": "substack@gmail.com" - }, - "dist": { - "shasum": "30057438eac6cf7f8c4767f38648d6697d75c903", - "tarball": "http://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz" + "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "_from": "mkdirp@>=0.5.1 <0.6.0" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore index 249bc20eb5573c..353546af2368e1 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore @@ -1,2 +1,3 @@ -node_modules -*.sw* +test +.gitignore +.travis.yml diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md index 62bc7bae3fed28..b0d793ed5d9016 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -1,9 +1,10 @@ # brace-expansion -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) [![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js index 60ecfc74d41618..36cde4de5c114b 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js @@ -5,4 +5,3 @@ console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); console.log(expand('http://www.letters.com/file{a..z..2}.txt')); console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js index a23104e9550173..f8d40f79acde0a 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -188,4 +188,3 @@ function expand(str, isTop) { return expansions; } - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile index fa5da71a6d0d34..dd2730cfde0cab 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile @@ -3,4 +3,3 @@ test: @node_modules/.bin/tape test/*.js .PHONY: test - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js index c02ad348e69aec..9ce76f480a4321 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js @@ -2,4 +2,3 @@ var balanced = require('./'); console.log(balanced('{', '}', 'pre{in{nested}}post')); console.log(balanced('{', '}', 'pre{first}between{second}post')); - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json index ede6efefa07883..35332a3c4eb366 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -44,30 +44,13 @@ "android-browser/4.2..latest" ] }, - "gitHead": "ba40ed78e7114a4a67c51da768a100184dead39c", + "readme": "# balanced-match\n\nMatch balanced string pairs, like `{` and `}` or `` and ``.\n\n[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match)\n[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)\n\n[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match)\n\n## Example\n\nGet the first matching pair of braces:\n\n```js\nvar balanced = require('balanced-match');\n\nconsole.log(balanced('{', '}', 'pre{in{nested}}post'));\nconsole.log(balanced('{', '}', 'pre{first}between{second}post'));\n```\n\nThe matches are:\n\n```bash\n$ node example.js\n{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }\n{ start: 3,\n end: 9,\n pre: 'pre',\n body: 'first',\n post: 'between{second}post' }\n```\n\n## API\n\n### var m = balanced(a, b, str)\n\nFor the first non-nested matching pair of `a` and `b` in `str`, return an\nobject with those keys:\n\n* **start** the index of the first match of `a`\n* **end** the index of the matching `b`\n* **pre** the preamble, `a` and `b` not included\n* **body** the match, `a` and `b` not included\n* **post** the postscript, `a` and `b` not included\n\nIf there's no match, `undefined` will be returned.\n\nIf the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`.\n\n## Installation\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install balanced-match\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/juliangruber/balanced-match/issues" }, "_id": "balanced-match@0.2.0", "_shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", - "_from": "balanced-match@>=0.2.0 <0.3.0", - "_npmVersion": "2.1.8", - "_nodeVersion": "0.10.32", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "dist": { - "shasum": "38f6730c03aab6d5edbb52bd934885e756d71674", - "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.0.tgz", - "readme": "ERROR: No README data found!" + "_from": "balanced-match@>=0.2.0 <0.3.0" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json index 5f1866c8b5a29e..4cb3e05d7ceb6c 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -1,7 +1,7 @@ { "name": "brace-expansion", "description": "Brace expansion as known from sh/bash", - "version": "1.1.0", + "version": "1.1.1", "repository": { "type": "git", "url": "git://github.com/juliangruber/brace-expansion.git" @@ -42,15 +42,15 @@ "android-browser/4.2..latest" ] }, - "gitHead": "b5fa3b1c74e5e2dba2d0efa19b28335641bc1164", + "gitHead": "f50da498166d76ea570cf3b30179f01f0f119612", "bugs": { "url": "https://github.com/juliangruber/brace-expansion/issues" }, - "_id": "brace-expansion@1.1.0", - "_shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", + "_id": "brace-expansion@1.1.1", + "_shasum": "da5fb78aef4c44c9e4acf525064fb3208ebab045", "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_npmVersion": "2.1.10", - "_nodeVersion": "0.10.32", + "_npmVersion": "2.6.1", + "_nodeVersion": "0.10.36", "_npmUser": { "name": "juliangruber", "email": "julian@juliangruber.com" @@ -66,10 +66,10 @@ } ], "dist": { - "shasum": "c9b7d03c03f37bc704be100e522b40db8f6cfcd9", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz" + "shasum": "da5fb78aef4c44c9e4acf525064fb3208ebab045", + "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.0.tgz", + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js deleted file mode 100644 index 5fe2b8ad48cc1c..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-comparison.js +++ /dev/null @@ -1,32 +0,0 @@ -var test = require('tape'); -var expand = require('..'); -var fs = require('fs'); -var resfile = __dirname + '/bash-results.txt'; -var cases = fs.readFileSync(resfile, 'utf8').split('><><><><'); - -// throw away the EOF marker -cases.pop() - -test('matches bash expansions', function(t) { - cases.forEach(function(testcase) { - var set = testcase.split('\n'); - var pattern = set.shift(); - var actual = expand(pattern); - - // If it expands to the empty string, then it's actually - // just nothing, but Bash is a singly typed language, so - // "nothing" is the same as "". - if (set.length === 1 && set[0] === '') { - set = [] - } else { - // otherwise, strip off the [] that were added so that - // "" expansions would be preserved properly. - set = set.map(function (s) { - return s.replace(/^\[|\]$/g, '') - }) - } - - t.same(actual, set, pattern); - }); - t.end(); -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt deleted file mode 100644 index 958148d26aacb9..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/bash-results.txt +++ /dev/null @@ -1,1075 +0,0 @@ -A{b,{d,e},{f,g}}Z -[AbZ] -[AdZ] -[AeZ] -[AfZ] -[AgZ]><><><><><><><\{a,b}{{a,b},a,b} -[{a,b}a] -[{a,b}b] -[{a,b}a] -[{a,b}b]><><><><{{a,b} -[{a] -[{b]><><><><{a,b}} -[a}] -[b}]><><><><{,} -><><><><><><><{,}b -[b] -[b]><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><{-01..5} -[-01] -[000] -[001] -[002] -[003] -[004] -[005]><><><><{-05..100..5} -[-05] -[000] -[005] -[010] -[015] -[020] -[025] -[030] -[035] -[040] -[045] -[050] -[055] -[060] -[065] -[070] -[075] -[080] -[085] -[090] -[095] -[100]><><><><{-05..100} -[-05] -[-04] -[-03] -[-02] -[-01] -[000] -[001] -[002] -[003] -[004] -[005] -[006] -[007] -[008] -[009] -[010] -[011] -[012] -[013] -[014] -[015] -[016] -[017] -[018] -[019] -[020] -[021] -[022] -[023] -[024] -[025] -[026] -[027] -[028] -[029] -[030] -[031] -[032] -[033] -[034] -[035] -[036] -[037] -[038] -[039] -[040] -[041] -[042] -[043] -[044] -[045] -[046] -[047] -[048] -[049] -[050] -[051] -[052] -[053] -[054] -[055] -[056] -[057] -[058] -[059] -[060] -[061] -[062] -[063] -[064] -[065] -[066] -[067] -[068] -[069] -[070] -[071] -[072] -[073] -[074] -[075] -[076] -[077] -[078] -[079] -[080] -[081] -[082] -[083] -[084] -[085] -[086] -[087] -[088] -[089] -[090] -[091] -[092] -[093] -[094] -[095] -[096] -[097] -[098] -[099] -[100]><><><><{0..5..2} -[0] -[2] -[4]><><><><{0001..05..2} -[0001] -[0003] -[0005]><><><><{0001..-5..2} -[0001] -[-001] -[-003] -[-005]><><><><{0001..-5..-2} -[0001] -[-001] -[-003] -[-005]><><><><{0001..5..-2} -[0001] -[0003] -[0005]><><><><{01..5} -[01] -[02] -[03] -[04] -[05]><><><><{1..05} -[01] -[02] -[03] -[04] -[05]><><><><{1..05..3} -[01] -[04]><><><><{05..100} -[005] -[006] -[007] -[008] -[009] -[010] -[011] -[012] -[013] -[014] -[015] -[016] -[017] -[018] -[019] -[020] -[021] -[022] -[023] -[024] -[025] -[026] -[027] -[028] -[029] -[030] -[031] -[032] -[033] -[034] -[035] -[036] -[037] -[038] -[039] -[040] -[041] -[042] -[043] -[044] -[045] -[046] -[047] -[048] -[049] -[050] -[051] -[052] -[053] -[054] -[055] -[056] -[057] -[058] -[059] -[060] -[061] -[062] -[063] -[064] -[065] -[066] -[067] -[068] -[069] -[070] -[071] -[072] -[073] -[074] -[075] -[076] -[077] -[078] -[079] -[080] -[081] -[082] -[083] -[084] -[085] -[086] -[087] -[088] -[089] -[090] -[091] -[092] -[093] -[094] -[095] -[096] -[097] -[098] -[099] -[100]><><><><{0a..0z} -[{0a..0z}]><><><><{a,b\}c,d} -[a] -[b}c] -[d]><><><><{a,b{c,d} -[{a,bc] -[{a,bd]><><><><{a,b}c,d} -[ac,d}] -[bc,d}]><><><><{a..F} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F]><><><><{A..f} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a] -[b] -[c] -[d] -[e] -[f]><><><><{a..Z} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z]><><><><{A..z} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a] -[b] -[c] -[d] -[e] -[f] -[g] -[h] -[i] -[j] -[k] -[l] -[m] -[n] -[o] -[p] -[q] -[r] -[s] -[t] -[u] -[v] -[w] -[x] -[y] -[z]><><><><{z..A} -[z] -[y] -[x] -[w] -[v] -[u] -[t] -[s] -[r] -[q] -[p] -[o] -[n] -[m] -[l] -[k] -[j] -[i] -[h] -[g] -[f] -[e] -[d] -[c] -[b] -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F] -[E] -[D] -[C] -[B] -[A]><><><><{Z..a} -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a]><><><><{a..F..2} -[a] -[_] -[]] -[[] -[Y] -[W] -[U] -[S] -[Q] -[O] -[M] -[K] -[I] -[G]><><><><{A..f..02} -[A] -[C] -[E] -[G] -[I] -[K] -[M] -[O] -[Q] -[S] -[U] -[W] -[Y] -[[] -[]] -[_] -[a] -[c] -[e]><><><><{a..Z..5} -[a] -[]><><><><><><><{A..z..10} -[A] -[K] -[U] -[_] -[i] -[s]><><><><{z..A..-2} -[z] -[x] -[v] -[t] -[r] -[p] -[n] -[l] -[j] -[h] -[f] -[d] -[b] -[`] -[^] -[] -[Z] -[X] -[V] -[T] -[R] -[P] -[N] -[L] -[J] -[H] -[F] -[D] -[B]><><><><{Z..a..20} -[Z]><><><><{a{,b} -[{a] -[{ab]><><><><{a},b} -[a}] -[b]><><><><{x,y{,}g} -[x] -[yg] -[yg]><><><><{x,y{}g} -[x] -[y{}g]><><><><{{a,b} -[{a] -[{b]><><><><{{a,b},c} -[a] -[b] -[c]><><><><{{a,b}c} -[{ac}] -[{bc}]><><><><{{a,b},} -[a] -[b]><><><><><><><{{a,b},}c -[ac] -[bc] -[c]><><><><{{a,b}.} -[{a.}] -[{b.}]><><><><{{a,b}} -[{a}] -[{b}]><><><><><><>< -><><><><{-10..00} -[-10] -[-09] -[-08] -[-07] -[-06] -[-05] -[-04] -[-03] -[-02] -[-01] -[000]><><><><{a,\\{a,b}c} -[a] -[\ac] -[\bc]><><><><{a,\{a,b}c} -[ac}] -[{ac}] -[bc}]><><><><><><><{-10.\.00} -[{-10..00}]><><><><><><><><><><{l,n,m}xyz -[lxyz] -[nxyz] -[mxyz]><><><><{abc\,def} -[{abc,def}]><><><><{abc} -[{abc}]><><><><{x\,y,\{abc\},trie} -[x,y] -[{abc}] -[trie]><><><><{} -[{}]><><><><} -[}]><><><><{ -[{]><><><><><><><{1..10} -[1] -[2] -[3] -[4] -[5] -[6] -[7] -[8] -[9] -[10]><><><><{0..10,braces} -[0..10] -[braces]><><><><{{0..10},braces} -[0] -[1] -[2] -[3] -[4] -[5] -[6] -[7] -[8] -[9] -[10] -[braces]><><><><><><><{3..3} -[3]><><><><><><><{10..1} -[10] -[9] -[8] -[7] -[6] -[5] -[4] -[3] -[2] -[1]><><><><{10..1}y -[10y] -[9y] -[8y] -[7y] -[6y] -[5y] -[4y] -[3y] -[2y] -[1y]><><><><><><><{a..f} -[a] -[b] -[c] -[d] -[e] -[f]><><><><{f..a} -[f] -[e] -[d] -[c] -[b] -[a]><><><><{a..A} -[a] -[`] -[_] -[^] -[]] -[] -[[] -[Z] -[Y] -[X] -[W] -[V] -[U] -[T] -[S] -[R] -[Q] -[P] -[O] -[N] -[M] -[L] -[K] -[J] -[I] -[H] -[G] -[F] -[E] -[D] -[C] -[B] -[A]><><><><{A..a} -[A] -[B] -[C] -[D] -[E] -[F] -[G] -[H] -[I] -[J] -[K] -[L] -[M] -[N] -[O] -[P] -[Q] -[R] -[S] -[T] -[U] -[V] -[W] -[X] -[Y] -[Z] -[[] -[] -[]] -[^] -[_] -[`] -[a]><><><><{f..f} -[f]><><><><{1..f} -[{1..f}]><><><><{f..1} -[{f..1}]><><><><{-1..-10} -[-1] -[-2] -[-3] -[-4] -[-5] -[-6] -[-7] -[-8] -[-9] -[-10]><><><><{-20..0} -[-20] -[-19] -[-18] -[-17] -[-16] -[-15] -[-14] -[-13] -[-12] -[-11] -[-10] -[-9] -[-8] -[-7] -[-6] -[-5] -[-4] -[-3] -[-2] -[-1] -[0]><><><><><><><><><><{klklkl}{1,2,3} -[{klklkl}1] -[{klklkl}2] -[{klklkl}3]><><><><{1..10..2} -[1] -[3] -[5] -[7] -[9]><><><><{-1..-10..2} -[-1] -[-3] -[-5] -[-7] -[-9]><><><><{-1..-10..-2} -[-1] -[-3] -[-5] -[-7] -[-9]><><><><{10..1..-2} -[10] -[8] -[6] -[4] -[2]><><><><{10..1..2} -[10] -[8] -[6] -[4] -[2]><><><><{1..20..2} -[1] -[3] -[5] -[7] -[9] -[11] -[13] -[15] -[17] -[19]><><><><{1..20..20} -[1]><><><><{100..0..5} -[100] -[95] -[90] -[85] -[80] -[75] -[70] -[65] -[60] -[55] -[50] -[45] -[40] -[35] -[30] -[25] -[20] -[15] -[10] -[5] -[0]><><><><{100..0..-5} -[100] -[95] -[90] -[85] -[80] -[75] -[70] -[65] -[60] -[55] -[50] -[45] -[40] -[35] -[30] -[25] -[20] -[15] -[10] -[5] -[0]><><><><{a..z} -[a] -[b] -[c] -[d] -[e] -[f] -[g] -[h] -[i] -[j] -[k] -[l] -[m] -[n] -[o] -[p] -[q] -[r] -[s] -[t] -[u] -[v] -[w] -[x] -[y] -[z]><><><><{a..z..2} -[a] -[c] -[e] -[g] -[i] -[k] -[m] -[o] -[q] -[s] -[u] -[w] -[y]><><><><{z..a..-2} -[z] -[x] -[v] -[t] -[r] -[p] -[n] -[l] -[j] -[h] -[f] -[d] -[b]><><><><{2147483645..2147483649} -[2147483645] -[2147483646] -[2147483647] -[2147483648] -[2147483649]><><><><{10..0..2} -[10] -[8] -[6] -[4] -[2] -[0]><><><><{10..0..-2} -[10] -[8] -[6] -[4] -[2] -[0]><><><><{-50..-0..5} -[-50] -[-45] -[-40] -[-35] -[-30] -[-25] -[-20] -[-15] -[-10] -[-5] -[0]><><><><{1..10.f} -[{1..10.f}]><><><><{1..ff} -[{1..ff}]><><><><{1..10..ff} -[{1..10..ff}]><><><><{1.20..2} -[{1.20..2}]><><><><{1..20..f2} -[{1..20..f2}]><><><><{1..20..2f} -[{1..20..2f}]><><><><{1..2f..2} -[{1..2f..2}]><><><><{1..ff..2} -[{1..ff..2}]><><><><{1..ff} -[{1..ff}]><><><><{1..f} -[{1..f}]><><><><{1..0f} -[{1..0f}]><><><><{1..10f} -[{1..10f}]><><><><{1..10.f} -[{1..10.f}]><><><><{1..10.f} -[{1..10.f}]><><><>< \ No newline at end of file diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt deleted file mode 100644 index e5161c3da869f3..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/cases.txt +++ /dev/null @@ -1,182 +0,0 @@ -# skip quotes for now -# "{x,x}" -# {"x,x"} -# {x","x} -# '{a,b}{{a,b},a,b}' -A{b,{d,e},{f,g}}Z -PRE-{a,b}{{a,b},a,b}-POST -\\{a,b}{{a,b},a,b} -{{a,b} -{a,b}} -{,} -a{,} -{,}b -a{,}b -a{b}c -a{1..5}b -a{01..5}b -a{-01..5}b -a{-01..5..3}b -a{001..9}b -a{b,c{d,e},{f,g}h}x{y,z -a{b,c{d,e},{f,g}h}x{y,z\\} -a{b,c{d,e},{f,g}h}x{y,z} -a{b{c{d,e}f{x,y{{g}h -a{b{c{d,e}f{x,y{}g}h -a{b{c{d,e}f{x,y}}g}h -a{b{c{d,e}f}g}h -a{{x,y},z}b -f{x,y{g,z}}h -f{x,y{{g,z}}h -f{x,y{{g,z}}h} -f{x,y{{g}h -f{x,y{{g}}h -f{x,y{}g}h -z{a,b{,c}d -z{a,b},c}d -{-01..5} -{-05..100..5} -{-05..100} -{0..5..2} -{0001..05..2} -{0001..-5..2} -{0001..-5..-2} -{0001..5..-2} -{01..5} -{1..05} -{1..05..3} -{05..100} -{0a..0z} -{a,b\\}c,d} -{a,b{c,d} -{a,b}c,d} -{a..F} -{A..f} -{a..Z} -{A..z} -{z..A} -{Z..a} -{a..F..2} -{A..f..02} -{a..Z..5} -d{a..Z..5}b -{A..z..10} -{z..A..-2} -{Z..a..20} -{a{,b} -{a},b} -{x,y{,}g} -{x,y{}g} -{{a,b} -{{a,b},c} -{{a,b}c} -{{a,b},} -X{{a,b},}X -{{a,b},}c -{{a,b}.} -{{a,b}} -X{a..#}X -# this next one is an empty string - -{-10..00} -# Need to escape slashes in here for reasons i guess. -{a,\\\\{a,b}c} -{a,\\{a,b}c} -a,\\{b,c} -{-10.\\.00} -#### bash tests/braces.tests -# Note that some tests are edited out because some features of -# bash are intentionally not supported in this brace expander. -ff{c,b,a} -f{d,e,f}g -{l,n,m}xyz -{abc\\,def} -{abc} -{x\\,y,\\{abc\\},trie} -# not impementing back-ticks obviously -# XXXX\\{`echo a b c | tr ' ' ','`\\} -{} -# We only ever have to worry about parsing a single argument, -# not a command line, so spaces have a different meaning than bash. -# { } -} -{ -abcd{efgh -# spaces -# foo {1,2} bar -# not impementing back-ticks obviously -# `zecho foo {1,2} bar` -# $(zecho foo {1,2} bar) -# ${var} is not a variable here, like it is in bash. omit. -# foo{bar,${var}.} -# foo{bar,${var}} -# isaacs: skip quotes for now -# "${var}"{x,y} -# $var{x,y} -# ${var}{x,y} -# new sequence brace operators -{1..10} -# this doesn't work yet -{0..10,braces} -# but this does -{{0..10},braces} -x{{0..10},braces}y -{3..3} -x{3..3}y -{10..1} -{10..1}y -x{10..1}y -{a..f} -{f..a} -{a..A} -{A..a} -{f..f} -# mixes are incorrectly-formed brace expansions -{1..f} -{f..1} -# spaces -# 0{1..9} {10..20} -# do negative numbers work? -{-1..-10} -{-20..0} -# weirdly-formed brace expansions -- fixed in post-bash-3.1 -a-{b{d,e}}-c -a-{bdef-{g,i}-c -# isaacs: skip quotes for now -# {"klklkl"}{1,2,3} -# isaacs: this is a valid test, though -{klklkl}{1,2,3} -# {"x,x"} -{1..10..2} -{-1..-10..2} -{-1..-10..-2} -{10..1..-2} -{10..1..2} -{1..20..2} -{1..20..20} -{100..0..5} -{100..0..-5} -{a..z} -{a..z..2} -{z..a..-2} -# make sure brace expansion handles ints > 2**31 - 1 using intmax_t -{2147483645..2147483649} -# unwanted zero-padding -- fixed post-bash-4.0 -{10..0..2} -{10..0..-2} -{-50..-0..5} -# bad -{1..10.f} -{1..ff} -{1..10..ff} -{1.20..2} -{1..20..f2} -{1..20..2f} -{1..2f..2} -{1..ff..2} -{1..ff} -{1..f} -{1..0f} -{1..10f} -{1..10.f} -{1..10.f} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js deleted file mode 100644 index 3fcc185a7d6dcc..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/dollar.js +++ /dev/null @@ -1,9 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('ignores ${', function(t) { - t.deepEqual(expand('${1..3}'), ['${1..3}']); - t.deepEqual(expand('${a,b}${c,d}'), ['${a,b}${c,d}']); - t.deepEqual(expand('x${a,b}x${c,d}x'), ['x${a,b}x${c,d}x']); - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js deleted file mode 100644 index e429121eab8059..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/empty-option.js +++ /dev/null @@ -1,10 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('empty option', function(t) { - t.deepEqual(expand('-v{,,,,}'), [ - '-v', '-v', '-v', '-v', '-v' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh deleted file mode 100644 index e040e664d9f881..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/generate.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# Bash 4.3 because of arbitrary need to pick a single standard. - -if [ "${BASH_VERSINFO[0]}" != "4" ] || [ "${BASH_VERSINFO[1]}" != "3" ]; then - echo "this script requires bash 4.3" >&2 - exit 1 -fi - -CDPATH= cd "$(dirname "$0")" - -js='require("./")(process.argv[1]).join(" ")' - -cat cases.txt | \ - while read case; do - if [ "${case:0:1}" = "#" ]; then - continue; - fi; - b="$($BASH -c 'for c in '"$case"'; do echo ["$c"]; done')" - echo "$case" - echo -n "$b><><><><"; - done > bash-results.txt diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js deleted file mode 100644 index 8d434c23d4514d..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/negative-increment.js +++ /dev/null @@ -1,15 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('negative increment', function(t) { - t.deepEqual(expand('{3..1}'), ['3', '2', '1']); - t.deepEqual(expand('{10..8}'), ['10', '9', '8']); - t.deepEqual(expand('{10..08}'), ['10', '09', '08']); - t.deepEqual(expand('{c..a}'), ['c', 'b', 'a']); - - t.deepEqual(expand('{4..0..2}'), ['4', '2', '0']); - t.deepEqual(expand('{4..0..-2}'), ['4', '2', '0']); - t.deepEqual(expand('{e..a..2}'), ['e', 'c', 'a']); - - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js deleted file mode 100644 index 0862dc51f90aee..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/nested.js +++ /dev/null @@ -1,16 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('nested', function(t) { - t.deepEqual(expand('{a,b{1..3},c}'), [ - 'a', 'b1', 'b2', 'b3', 'c' - ]); - t.deepEqual(expand('{{A..Z},{a..z}}'), - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('') - ); - t.deepEqual(expand('ppp{,config,oe{,conf}}'), [ - 'ppp', 'pppconfig', 'pppoe', 'pppoeconf' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js deleted file mode 100644 index c00ad155fe6760..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/order.js +++ /dev/null @@ -1,10 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('order', function(t) { - t.deepEqual(expand('a{d,c,b}e'), [ - 'ade', 'ace', 'abe' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js deleted file mode 100644 index e4158775f1bd06..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/pad.js +++ /dev/null @@ -1,13 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('pad', function(t) { - t.deepEqual(expand('{9..11}'), [ - '9', '10', '11' - ]); - t.deepEqual(expand('{09..11}'), [ - '09', '10', '11' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js deleted file mode 100644 index 3038fba7416b3a..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/same-type.js +++ /dev/null @@ -1,7 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('x and y of same type', function(t) { - t.deepEqual(expand('{a..9}'), ['{a..9}']); - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js deleted file mode 100644 index f73a9579ab398b..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/test/sequence.js +++ /dev/null @@ -1,50 +0,0 @@ -var test = require('tape'); -var expand = require('..'); - -test('numeric sequences', function(t) { - t.deepEqual(expand('a{1..2}b{2..3}c'), [ - 'a1b2c', 'a1b3c', 'a2b2c', 'a2b3c' - ]); - t.deepEqual(expand('{1..2}{2..3}'), [ - '12', '13', '22', '23' - ]); - t.end(); -}); - -test('numeric sequences with step count', function(t) { - t.deepEqual(expand('{0..8..2}'), [ - '0', '2', '4', '6', '8' - ]); - t.deepEqual(expand('{1..8..2}'), [ - '1', '3', '5', '7' - ]); - t.end(); -}); - -test('numeric sequence with negative x / y', function(t) { - t.deepEqual(expand('{3..-2}'), [ - '3', '2', '1', '0', '-1', '-2' - ]); - t.end(); -}); - -test('alphabetic sequences', function(t) { - t.deepEqual(expand('1{a..b}2{b..c}3'), [ - '1a2b3', '1a2c3', '1b2b3', '1b2c3' - ]); - t.deepEqual(expand('{a..b}{b..c}'), [ - 'ab', 'ac', 'bb', 'bc' - ]); - t.end(); -}); - -test('alphabetic sequences with step count', function(t) { - t.deepEqual(expand('{a..k..2}'), [ - 'a', 'c', 'e', 'g', 'i', 'k' - ]); - t.deepEqual(expand('{b..k..2}'), [ - 'b', 'd', 'f', 'h', 'j' - ]); - t.end(); -}); - diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json index 3dc6beb49f684a..e9256630aa3819 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json @@ -33,31 +33,14 @@ "minimatch.js", "browser.js" ], - "gitHead": "6afb85f0c324b321f76a38df81891e562693e257", + "readme": "# minimatch\n\nA minimal matching utility.\n\n[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)\n\n\nThis is the matching library used internally by npm.\n\nIt works by converting glob expressions into JavaScript `RegExp`\nobjects.\n\n## Usage\n\n```javascript\nvar minimatch = require(\"minimatch\")\n\nminimatch(\"bar.foo\", \"*.foo\") // true!\nminimatch(\"bar.foo\", \"*.bar\") // false!\nminimatch(\"bar.foo\", \"*.+(bar|foo)\", { debug: true }) // true, and noisy!\n```\n\n## Features\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n\n## Minimatch Class\n\nCreate a minimatch object by instanting the `minimatch.Minimatch` class.\n\n```javascript\nvar Minimatch = require(\"minimatch\").Minimatch\nvar mm = new Minimatch(pattern, options)\n```\n\n### Properties\n\n* `pattern` The original pattern the minimatch object represents.\n* `options` The options supplied to the constructor.\n* `set` A 2-dimensional array of regexp or string expressions.\n Each row in the\n array corresponds to a brace-expanded pattern. Each item in the row\n corresponds to a single path-part. For example, the pattern\n `{a,b/c}/d` would expand to a set of patterns like:\n\n [ [ a, d ]\n , [ b, c, d ] ]\n\n If a portion of the pattern doesn't have any \"magic\" in it\n (that is, it's something like `\"foo\"` rather than `fo*o?`), then it\n will be left as a string rather than converted to a regular\n expression.\n\n* `regexp` Created by the `makeRe` method. A single regular expression\n expressing the entire pattern. This is useful in cases where you wish\n to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.\n* `negate` True if the pattern is negated.\n* `comment` True if the pattern is a comment.\n* `empty` True if the pattern is `\"\"`.\n\n### Methods\n\n* `makeRe` Generate the `regexp` member if necessary, and return it.\n Will return `false` if the pattern is invalid.\n* `match(fname)` Return true if the filename matches the pattern, or\n false otherwise.\n* `matchOne(fileArray, patternArray, partial)` Take a `/`-split\n filename, and match it against a single row in the `regExpSet`. This\n method is mainly for internal use, but is exposed so that it can be\n used by a glob-walker that needs to avoid excessive filesystem calls.\n\nAll other methods are internal, and will be called as necessary.\n\n## Functions\n\nThe top-level exported function has a `cache` property, which is an LRU\ncache set to store 100 items. So, calling these methods repeatedly\nwith the same pattern and options will use the same Minimatch object,\nsaving the cost of parsing it multiple times.\n\n### minimatch(path, pattern, options)\n\nMain export. Tests a path against the pattern using the options.\n\n```javascript\nvar isJS = minimatch(file, \"*.js\", { matchBase: true })\n```\n\n### minimatch.filter(pattern, options)\n\nReturns a function that tests its\nsupplied argument, suitable for use with `Array.filter`. Example:\n\n```javascript\nvar javascripts = fileList.filter(minimatch.filter(\"*.js\", {matchBase: true}))\n```\n\n### minimatch.match(list, pattern, options)\n\nMatch against the list of\nfiles, in the style of fnmatch or glob. If nothing is matched, and\noptions.nonull is set, then return a list containing the pattern itself.\n\n```javascript\nvar javascripts = minimatch.match(fileList, \"*.js\", {matchBase: true}))\n```\n\n### minimatch.makeRe(pattern, options)\n\nMake a regular expression object from the pattern.\n\n## Options\n\nAll options are `false` by default.\n\n### debug\n\nDump a ton of stuff to stderr.\n\n### nobrace\n\nDo not expand `{a,b}` and `{1..3}` brace sets.\n\n### noglobstar\n\nDisable `**` matching against multiple folder names.\n\n### dot\n\nAllow patterns to match filenames starting with a period, even if\nthe pattern does not explicitly have a period in that spot.\n\nNote that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`\nis set.\n\n### noext\n\nDisable \"extglob\" style patterns like `+(a|b)`.\n\n### nocase\n\nPerform a case-insensitive match.\n\n### nonull\n\nWhen a match is not found by `minimatch.match`, return a list containing\nthe pattern itself if this option is set. When not set, an empty list\nis returned if there are no matches.\n\n### matchBase\n\nIf set, then patterns without slashes will be matched\nagainst the basename of the path if it contains slashes. For example,\n`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.\n\n### nocomment\n\nSuppress the behavior of treating `#` at the start of a pattern as a\ncomment.\n\n### nonegate\n\nSuppress the behavior of treating a leading `!` character as negation.\n\n### flipNegate\n\nReturns from negate expressions the same as if they were not negated.\n(Ie, true on a hit, false on a miss.)\n\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between minimatch and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen minimatch.match returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`minimatch.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/minimatch/issues" }, "homepage": "https://github.com/isaacs/minimatch#readme", "_id": "minimatch@2.0.10", "_shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", - "_from": "minimatch@>=2.0.1 <3.0.0", - "_npmVersion": "3.1.0", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "readme": "ERROR: No README data found!" + "_from": "minimatch@>=2.0.1 <3.0.0" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/package.json index 434e4696f8fb15..84b72480f8925d 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/glob/package.json @@ -42,31 +42,14 @@ "benchclean": "bash benchclean.sh" }, "license": "ISC", - "gitHead": "a4e461ab59a837eee80a4d8dbdbf5ae1054a646f", + "readme": "[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Dependency Status](https://david-dm.org/isaacs/node-glob.svg)](https://david-dm.org/isaacs/node-glob) [![devDependency Status](https://david-dm.org/isaacs/node-glob/dev-status.svg)](https://david-dm.org/isaacs/node-glob#info=devDependencies) [![optionalDependency Status](https://david-dm.org/isaacs/node-glob/optional-status.svg)](https://david-dm.org/isaacs/node-glob#info=optionalDependencies)\n\n# Glob\n\nMatch files using the patterns the shell uses, like stars and stuff.\n\nThis is a glob implementation in JavaScript. It uses the `minimatch`\nlibrary to do its matching.\n\n![](oh-my-glob.gif)\n\n## Usage\n\n```javascript\nvar glob = require(\"glob\")\n\n// options is optional\nglob(\"**/*.js\", options, function (er, files) {\n // files is an array of filenames.\n // If the `nonull` option is set, and nothing\n // was found, then files is [\"**/*.js\"]\n // er is an error object or null.\n})\n```\n\n## Glob Primer\n\n\"Globs\" are the patterns you type when you do stuff like `ls *.js` on\nthe command line, or put `build/*` in a `.gitignore` file.\n\nBefore parsing the path part patterns, braced sections are expanded\ninto a set. Braced sections start with `{` and end with `}`, with any\nnumber of comma-delimited sections within. Braced sections may contain\nslash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.\n\nThe following characters have special magic meaning when used in a\npath portion:\n\n* `*` Matches 0 or more characters in a single path portion\n* `?` Matches 1 character\n* `[...]` Matches a range of characters, similar to a RegExp range.\n If the first character of the range is `!` or `^` then it matches\n any character not in the range.\n* `!(pattern|pattern|pattern)` Matches anything that does not match\n any of the patterns provided.\n* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the\n patterns provided.\n* `+(pattern|pattern|pattern)` Matches one or more occurrences of the\n patterns provided.\n* `*(a|b|c)` Matches zero or more occurrences of the patterns provided\n* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns\n provided\n* `**` If a \"globstar\" is alone in a path portion, then it matches\n zero or more directories and subdirectories searching for matches.\n It does not crawl symlinked directories.\n\n### Dots\n\nIf a file or directory path portion has a `.` as the first character,\nthen it will not match any glob pattern unless that pattern's\ncorresponding path part also has a `.` as its first character.\n\nFor example, the pattern `a/.*/c` would match the file at `a/.b/c`.\nHowever the pattern `a/*/c` would not, because `*` does not start with\na dot character.\n\nYou can make glob treat dots as normal characters by setting\n`dot:true` in the options.\n\n### Basename Matching\n\nIf you set `matchBase:true` in the options, and the pattern has no\nslashes in it, then it will seek for any file anywhere in the tree\nwith a matching basename. For example, `*.js` would match\n`test/simple/basic.js`.\n\n### Negation\n\nThe intent for negation would be for a pattern starting with `!` to\nmatch everything that *doesn't* match the supplied pattern. However,\nthe implementation is weird, and for the time being, this should be\navoided. The behavior will change or be deprecated in version 5.\n\n### Empty Sets\n\nIf no matching files are found, then an empty array is returned. This\ndiffers from the shell, where the pattern itself is returned. For\nexample:\n\n $ echo a*s*d*f\n a*s*d*f\n\nTo get the bash-style behavior, set the `nonull:true` in the options.\n\n### See Also:\n\n* `man sh`\n* `man bash` (Search for \"Pattern Matching\")\n* `man 3 fnmatch`\n* `man 5 gitignore`\n* [minimatch documentation](https://github.com/isaacs/minimatch)\n\n## glob.hasMagic(pattern, [options])\n\nReturns `true` if there are any special characters in the pattern, and\n`false` otherwise.\n\nNote that the options affect the results. If `noext:true` is set in\nthe options object, then `+(a|b)` will not be considered a magic\npattern. If the pattern has a brace expansion, like `a/{b/c,x/y}`\nthen that is considered magical, unless `nobrace:true` is set in the\noptions.\n\n## glob(pattern, [options], cb)\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* `cb` {Function}\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nPerform an asynchronous glob search.\n\n## glob.sync(pattern, [options])\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* return: {Array} filenames found matching the pattern\n\nPerform a synchronous glob search.\n\n## Class: glob.Glob\n\nCreate a Glob object by instantiating the `glob.Glob` class.\n\n```javascript\nvar Glob = require(\"glob\").Glob\nvar mg = new Glob(pattern, options, cb)\n```\n\nIt's an EventEmitter, and starts walking the filesystem to find matches\nimmediately.\n\n### new glob.Glob(pattern, [options], [cb])\n\n* `pattern` {String} pattern to search for\n* `options` {Object}\n* `cb` {Function} Called when an error occurs, or matches are found\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nNote that if the `sync` flag is set in the options, then matches will\nbe immediately available on the `g.found` member.\n\n### Properties\n\n* `minimatch` The minimatch object that the glob uses.\n* `options` The options object passed in.\n* `aborted` Boolean which is set to true when calling `abort()`. There\n is no way at this time to continue a glob search after aborting, but\n you can re-use the statCache to avoid having to duplicate syscalls.\n* `statCache` Collection of all the stat results the glob search\n performed.\n* `cache` Convenience object. Each field has the following possible\n values:\n * `false` - Path does not exist\n * `true` - Path exists\n * `'DIR'` - Path exists, and is not a directory\n * `'FILE'` - Path exists, and is a directory\n * `[file, entries, ...]` - Path exists, is a directory, and the\n array value is the results of `fs.readdir`\n* `statCache` Cache of `fs.stat` results, to prevent statting the same\n path multiple times.\n* `symlinks` A record of which paths are symbolic links, which is\n relevant in resolving `**` patterns.\n* `realpathCache` An optional object which is passed to `fs.realpath`\n to minimize unnecessary syscalls. It is stored on the instantiated\n Glob object, and may be re-used.\n\n### Events\n\n* `end` When the matching is finished, this is emitted with all the\n matches found. If the `nonull` option is set, and no match was found,\n then the `matches` list contains the original pattern. The matches\n are sorted, unless the `nosort` flag is set.\n* `match` Every time a match is found, this is emitted with the matched.\n* `error` Emitted when an unexpected error is encountered, or whenever\n any fs error occurs if `options.strict` is set.\n* `abort` When `abort()` is called, this event is raised.\n\n### Methods\n\n* `pause` Temporarily stop the search\n* `resume` Resume the search\n* `abort` Stop the search forever\n\n### Options\n\nAll the options that can be passed to Minimatch can also be passed to\nGlob to change pattern matching behavior. Also, some have been added,\nor have glob-specific ramifications.\n\nAll options are false by default, unless otherwise noted.\n\nAll options are added to the Glob object, as well.\n\nIf you are running many `glob` operations, you can pass a Glob object\nas the `options` argument to a subsequent operation to shortcut some\n`stat` and `readdir` calls. At the very least, you may pass in shared\n`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that\nparallel glob operations will be sped up by sharing information about\nthe filesystem.\n\n* `cwd` The current working directory in which to search. Defaults\n to `process.cwd()`.\n* `root` The place where patterns starting with `/` will be mounted\n onto. Defaults to `path.resolve(options.cwd, \"/\")` (`/` on Unix\n systems, and `C:\\` or some such on Windows.)\n* `dot` Include `.dot` files in normal matches and `globstar` matches.\n Note that an explicit dot in a portion of the pattern will always\n match dot files.\n* `nomount` By default, a pattern starting with a forward-slash will be\n \"mounted\" onto the root setting, so that a valid filesystem path is\n returned. Set this flag to disable that behavior.\n* `mark` Add a `/` character to directory matches. Note that this\n requires additional stat calls.\n* `nosort` Don't sort the results.\n* `stat` Set to true to stat *all* results. This reduces performance\n somewhat, and is completely unnecessary, unless `readdir` is presumed\n to be an untrustworthy indicator of file existence.\n* `silent` When an unusual error is encountered when attempting to\n read a directory, a warning will be printed to stderr. Set the\n `silent` option to true to suppress these warnings.\n* `strict` When an unusual error is encountered when attempting to\n read a directory, the process will just continue on in search of\n other matches. Set the `strict` option to raise an error in these\n cases.\n* `cache` See `cache` property above. Pass in a previously generated\n cache object to save some fs calls.\n* `statCache` A cache of results of filesystem information, to prevent\n unnecessary stat calls. While it should not normally be necessary\n to set this, you may pass the statCache from one glob() call to the\n options object of another, if you know that the filesystem will not\n change between calls. (See \"Race Conditions\" below.)\n* `symlinks` A cache of known symbolic links. You may pass in a\n previously generated `symlinks` object to save `lstat` calls when\n resolving `**` matches.\n* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.\n* `nounique` In some cases, brace-expanded patterns can result in the\n same file showing up multiple times in the result set. By default,\n this implementation prevents duplicates in the result set. Set this\n flag to disable that behavior.\n* `nonull` Set to never return an empty set, instead returning a set\n containing the pattern itself. This is the default in glob(3).\n* `debug` Set to enable debug logging in minimatch and glob.\n* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.\n* `noglobstar` Do not match `**` against multiple filenames. (Ie,\n treat it as a normal `*` instead.)\n* `noext` Do not match `+(a|b)` \"extglob\" patterns.\n* `nocase` Perform a case-insensitive match. Note: on\n case-insensitive filesystems, non-magic patterns will match by\n default, since `stat` and `readdir` will not raise errors.\n* `matchBase` Perform a basename-only match if the pattern does not\n contain any slash characters. That is, `*.js` would be treated as\n equivalent to `**/*.js`, matching all js files in all directories.\n* `nonegate` Suppress `negate` behavior. (See below.)\n* `nocomment` Suppress `comment` behavior. (See below.)\n* `nonull` Return the pattern when no matches are found.\n* `nodir` Do not match directories, only files. (Note: to match\n *only* directories, simply put a `/` at the end of the pattern.)\n* `ignore` Add a pattern or an array of patterns to exclude matches.\n* `follow` Follow symlinked directories when expanding `**` patterns.\n Note that this can result in a lot of duplicate references in the\n presence of cyclic links.\n* `realpath` Set to true to call `fs.realpath` on all of the results.\n In the case of a symlink that cannot be resolved, the full absolute\n path to the matched entry is returned (though it will usually be a\n broken symlink)\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between node-glob and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.3, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nNote that symlinked directories are not crawled as part of a `**`,\nthough their contents may match against subsequent portions of the\npattern. This prevents infinite loops and duplicates and the like.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen glob returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`glob.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n## Windows\n\n**Please only use forward-slashes in glob expressions.**\n\nThough windows uses either `/` or `\\` as its path separator, only `/`\ncharacters are used by this glob implementation. You must use\nforward-slashes **only** in glob expressions. Back-slashes will always\nbe interpreted as escape characters, not path separators.\n\nResults from absolute patterns such as `/foo/*` are mounted onto the\nroot setting using `path.join`. On windows, this will by default result\nin `/foo/*` matching `C:\\foo\\bar.txt`.\n\n## Race Conditions\n\nGlob searching, by its very nature, is susceptible to race conditions,\nsince it relies on directory walking and such.\n\nAs a result, it is possible that a file that exists when glob looks for\nit may have been deleted or modified by the time it returns the result.\n\nAs part of its internal implementation, this program caches all stat\nand readdir calls that it makes, in order to cut down on system\noverhead. However, this also makes it even more susceptible to races,\nespecially if the cache or statCache objects are reused between glob\ncalls.\n\nUsers are thus advised not to use a glob result as a guarantee of\nfilesystem state in the face of rapid changes. For the vast majority\nof operations, this is never a problem.\n\n## Contributing\n\nAny change to behavior (including bugfixes) must come with a test.\n\nPatches that fail tests or reduce performance will be rejected.\n\n```\n# to run tests\nnpm test\n\n# to re-generate test fixtures\nnpm run test-regen\n\n# to benchmark against bash/zsh\nnpm run bench\n\n# to profile javascript\nnpm run prof\n```\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/node-glob/issues" }, - "homepage": "https://github.com/isaacs/node-glob", + "homepage": "https://github.com/isaacs/node-glob#readme", "_id": "glob@4.5.3", "_shasum": "c6cb73d3226c1efef04de3c56d012f03377ee15f", - "_from": "glob@>=3.0.0 <4.0.0||>=4.0.0 <5.0.0", - "_npmVersion": "2.7.1", - "_nodeVersion": "1.4.2", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "c6cb73d3226c1efef04de3c56d012f03377ee15f", - "tarball": "http://registry.npmjs.org/glob/-/glob-4.5.3.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", - "readme": "ERROR: No README data found!" + "_from": "glob@>=3.0.0 <4.0.0||>=4.0.0 <5.0.0" } diff --git a/deps/npm/node_modules/lru-cache/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore similarity index 100% rename from deps/npm/node_modules/lru-cache/.npmignore rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore diff --git a/deps/npm/node_modules/lru-cache/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml similarity index 100% rename from deps/npm/node_modules/lru-cache/.travis.yml rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml diff --git a/deps/npm/node_modules/lru-cache/CONTRIBUTORS b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS similarity index 100% rename from deps/npm/node_modules/lru-cache/CONTRIBUTORS rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS diff --git a/deps/npm/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/LICENSE similarity index 100% rename from deps/npm/node_modules/lru-cache/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/LICENSE diff --git a/deps/npm/node_modules/lru-cache/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md similarity index 100% rename from deps/npm/node_modules/lru-cache/README.md rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md diff --git a/deps/npm/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js similarity index 100% rename from deps/npm/node_modules/lru-cache/lib/lru-cache.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json new file mode 100644 index 00000000000000..71a3544fd5a5aa --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json @@ -0,0 +1,37 @@ +{ + "name": "lru-cache", + "description": "A cache object that deletes the least-recently-used items.", + "version": "2.7.0", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me" + }, + "keywords": [ + "mru", + "lru", + "cache" + ], + "scripts": { + "test": "tap test --gc" + }, + "main": "lib/lru-cache.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-lru-cache.git" + }, + "devDependencies": { + "tap": "^1.2.0", + "weak": "" + }, + "license": "ISC", + "readme": "# lru cache\n\nA cache object that deletes the least-recently-used items.\n\n## Usage:\n\n```javascript\nvar LRU = require(\"lru-cache\")\n , options = { max: 500\n , length: function (n) { return n * 2 }\n , dispose: function (key, n) { n.close() }\n , maxAge: 1000 * 60 * 60 }\n , cache = LRU(options)\n , otherCache = LRU(50) // sets just the max size\n\ncache.set(\"key\", \"value\")\ncache.get(\"key\") // \"value\"\n\ncache.reset() // empty the cache\n```\n\nIf you put more stuff in it, then items will fall out.\n\nIf you try to put an oversized thing in it, then it'll fall out right\naway.\n\n## Options\n\n* `max` The maximum size of the cache, checked by applying the length\n function to all values in the cache. Not setting this is kind of\n silly, since that's the whole purpose of this lib, but it defaults\n to `Infinity`.\n* `maxAge` Maximum age in ms. Items are not pro-actively pruned out\n as they age, but if you try to get an item that is too old, it'll\n drop it and return undefined instead of giving it to you.\n* `length` Function that is used to calculate the length of stored\n items. If you're storing strings or buffers, then you probably want\n to do something like `function(n){return n.length}`. The default is\n `function(n){return 1}`, which is fine if you want to store `max`\n like-sized things.\n* `dispose` Function that is called on items when they are dropped\n from the cache. This can be handy if you want to close file\n descriptors or do other cleanup tasks when items are no longer\n accessible. Called with `key, value`. It's called *before*\n actually removing the item from the internal cache, so if you want\n to immediately put it back in, you'll have to do that in a\n `nextTick` or `setTimeout` callback or it won't do anything.\n* `stale` By default, if you set a `maxAge`, it'll only actually pull\n stale items out of the cache when you `get(key)`. (That is, it's\n not pre-emptively doing a `setTimeout` or anything.) If you set\n `stale:true`, it'll return the stale value before deleting it. If\n you don't set this, then it'll return `undefined` when you try to\n get a stale entry, as if it had already been deleted.\n\n## API\n\n* `set(key, value, maxAge)`\n* `get(key) => value`\n\n Both of these will update the \"recently used\"-ness of the key.\n They do what you think. `max` is optional and overrides the\n cache `max` option if provided.\n\n* `peek(key)`\n\n Returns the key value (or `undefined` if not found) without\n updating the \"recently used\"-ness of the key.\n\n (If you find yourself using this a lot, you *might* be using the\n wrong sort of data structure, but there are some use cases where\n it's handy.)\n\n* `del(key)`\n\n Deletes a key out of the cache.\n\n* `reset()`\n\n Clear the cache entirely, throwing away all values.\n\n* `has(key)`\n\n Check if a key is in the cache, without updating the recent-ness\n or deleting it for being stale.\n\n* `forEach(function(value,key,cache), [thisp])`\n\n Just like `Array.prototype.forEach`. Iterates over all the keys\n in the cache, in order of recent-ness. (Ie, more recently used\n items are iterated over first.)\n\n* `keys()`\n\n Return an array of the keys in the cache.\n\n* `values()`\n\n Return an array of the values in the cache.\n\n* `length()`\n\n Return total length of objects in cache taking into account\n `length` options function.\n\n* `itemCount`\n\n Return total quantity of objects currently in cache. Note, that\n `stale` (see options) items are returned as part of this item\n count.\n\n* `dump()`\n\n Return an array of the cache entries ready for serialization and usage\n with 'destinationCache.load(arr)`.\n\n* `load(cacheEntriesArray)`\n\n Loads another cache entries array, obtained with `sourceCache.dump()`,\n into the cache. The destination cache is reset before loading new entries\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/node-lru-cache/issues" + }, + "homepage": "https://github.com/isaacs/node-lru-cache#readme", + "_id": "lru-cache@2.7.0", + "_shasum": "aaa376a4cd970f9cebf5ec1909566ec034f07ee6", + "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.0.tgz", + "_from": "lru-cache@>=2.0.0 <3.0.0" +} diff --git a/deps/npm/node_modules/lru-cache/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js similarity index 100% rename from deps/npm/node_modules/lru-cache/test/basic.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js diff --git a/deps/npm/node_modules/lru-cache/test/foreach.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js similarity index 100% rename from deps/npm/node_modules/lru-cache/test/foreach.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js diff --git a/deps/npm/node_modules/lru-cache/test/memory-leak.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js similarity index 100% rename from deps/npm/node_modules/lru-cache/test/memory-leak.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js diff --git a/deps/npm/node_modules/lru-cache/test/serialize.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js similarity index 100% rename from deps/npm/node_modules/lru-cache/test/serialize.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json index 4255e77a933eed..0432d4e4c55ee5 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json @@ -31,30 +31,14 @@ "url": "http://blog.izs.me/" }, "license": "ISC", - "gitHead": "527f97aa5bb253d927348698c0cd3bb267d098c6", + "readme": "# sigmund\n\nQuick and dirty signatures for Objects.\n\nThis is like a much faster `deepEquals` comparison, which returns a\nstring key suitable for caches and the like.\n\n## Usage\n\n```javascript\nfunction doSomething (someObj) {\n var key = sigmund(someObj, maxDepth) // max depth defaults to 10\n var cached = cache.get(key)\n if (cached) return cached\n\n var result = expensiveCalculation(someObj)\n cache.set(key, result)\n return result\n}\n```\n\nThe resulting key will be as unique and reproducible as calling\n`JSON.stringify` or `util.inspect` on the object, but is much faster.\nIn order to achieve this speed, some differences are glossed over.\nFor example, the object `{0:'foo'}` will be treated identically to the\narray `['foo']`.\n\nAlso, just as there is no way to summon the soul from the scribblings\nof a cocaine-addled psychoanalyst, there is no way to revive the object\nfrom the signature string that sigmund gives you. In fact, it's\nbarely even readable.\n\nAs with `util.inspect` and `JSON.stringify`, larger objects will\nproduce larger signature strings.\n\nBecause sigmund is a bit less strict than the more thorough\nalternatives, the strings will be shorter, and also there is a\nslightly higher chance for collisions. For example, these objects\nhave the same signature:\n\n var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]}\n var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']}\n\nLike a good Freudian, sigmund is most effective when you already have\nsome understanding of what you're looking for. It can help you help\nyourself, but you must be willing to do some work as well.\n\nCycles are handled, and cyclical objects are silently omitted (though\nthe key is included in the signature output.)\n\nThe second argument is the maximum depth, which defaults to 10,\nbecause that is the maximum object traversal depth covered by most\ninsurance carriers.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/sigmund/issues" }, "homepage": "https://github.com/isaacs/sigmund#readme", "_id": "sigmund@1.0.1", "_shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590", - "_from": "sigmund@>=1.0.0 <1.1.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590", - "tarball": "http://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], "_resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "readme": "ERROR: No README data found!" + "_from": "sigmund@>=1.0.0 <1.1.0" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js index 50c53a13e98d0e..6149a80239f059 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js @@ -21,4 +21,3 @@ test('basic', function (t) { t.equal(sigmund(obj3), cycleHash) t.end() }) - diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json index 253335e6234907..7b5d86dbbda5e9 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json @@ -17,32 +17,14 @@ "ms/index.js": "index.js" } }, - "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909", + "readme": "# ms.js: miliseconds conversion utility\n\n```js\nms('2 days') // 172800000\nms('1d') // 86400000\nms('10h') // 36000000\nms('2.5 hrs') // 9000000\nms('2h') // 7200000\nms('1m') // 60000\nms('5s') // 5000\nms('100') // 100\n```\n\n```js\nms(60000) // \"1m\"\nms(2 * 60000) // \"2m\"\nms(ms('10 hours')) // \"10h\"\n```\n\n```js\nms(60000, { long: true }) // \"1 minute\"\nms(2 * 60000, { long: true }) // \"2 minutes\"\nms(ms('10 hours'), { long: true }) // \"10 hours\"\n```\n\n- Node/Browser compatible. Published as [`ms`](https://www.npmjs.org/package/ms) in [NPM](http://nodejs.org/download).\n- If a number is supplied to `ms`, a string with a unit is returned.\n- If a string that contains the number is supplied, it returns it as\na number (e.g: it returns `100` for `'100'`).\n- If you pass a string with a number and a valid unit, the number of\nequivalent ms is returned.\n\n## License\n\nMIT\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/guille/ms.js/issues" }, - "homepage": "https://github.com/guille/ms.js", + "homepage": "https://github.com/guille/ms.js#readme", "_id": "ms@0.7.1", - "scripts": {}, "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098", - "_from": "ms@0.7.1", - "_npmVersion": "2.7.5", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "rauchg", - "email": "rauchg@gmail.com" - }, - "maintainers": [ - { - "name": "rauchg", - "email": "rauchg@gmail.com" - } - ], - "dist": { - "shasum": "9cd13c03adbff25b65effde7ce864ee952017098", - "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", - "readme": "ERROR: No README data found!" + "_from": "ms@0.7.1" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json index 7e6d9fc59a1755..ebe311fad9ab3a 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json @@ -38,36 +38,14 @@ "debug/debug.js": "debug.js" } }, - "gitHead": "b38458422b5aa8aa6d286b10dfe427e8a67e2b35", + "readme": "# debug\n\n tiny node.js debugging utility modelled after node core's debugging technique.\n\n## Installation\n\n```bash\n$ npm install debug\n```\n\n## Usage\n\n With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.\n\nExample _app.js_:\n\n```js\nvar debug = require('debug')('http')\n , http = require('http')\n , name = 'My App';\n\n// fake app\n\ndebug('booting %s', name);\n\nhttp.createServer(function(req, res){\n debug(req.method + ' ' + req.url);\n res.end('hello\\n');\n}).listen(3000, function(){\n debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample _worker.js_:\n\n```js\nvar debug = require('debug')('worker');\n\nsetInterval(function(){\n debug('doing some work');\n}, 1000);\n```\n\n The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:\n\n ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)\n\n ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)\n\n#### Windows note\n\n On Windows the environment variable is set using the `set` command.\n\n ```cmd\n set DEBUG=*,-not_this\n ```\n\nThen, run the program to be debugged as usual.\n\n## Millisecond diff\n\n When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the \"+NNNms\" will show you how much time was spent between calls.\n\n ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)\n\n When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:\n\n ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)\n\n## Conventions\n\n If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use \":\" to separate features. For example \"bodyParser\" from Connect would then be \"connect:bodyParser\".\n\n## Wildcards\n\n The `*` character may be used as a wildcard. Suppose for example your library has debuggers named \"connect:bodyParser\", \"connect:compress\", \"connect:session\", instead of listing all three with `DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.\n\n You can also exclude specific debuggers by prefixing them with a \"-\" character. For example, `DEBUG=*,-connect:*` would include all debuggers except those starting with \"connect:\".\n\n## Browser support\n\n Debug works in the browser as well, currently persisted by `localStorage`. Consider the situation shown below where you have `worker:a` and `worker:b`, and wish to debug both. Somewhere in the code on your page, include:\n\n```js\nwindow.myDebug = require(\"debug\");\n```\n\n (\"debug\" is a global object in the browser so we give this object a different name.) When your page is open in the browser, type the following in the console:\n\n```js\nmyDebug.enable(\"worker:*\")\n```\n\n Refresh the page. Debug output will continue to be sent to the console until it is disabled by typing `myDebug.disable()` in the console.\n\n```js\na = debug('worker:a');\nb = debug('worker:b');\n\nsetInterval(function(){\n a('doing some work');\n}, 1000);\n\nsetInterval(function(){\n b('doing some work');\n}, 1200);\n```\n\n#### Web Inspector Colors\n\n Colors are also enabled on \"Web Inspectors\" that understand the `%c` formatting\n option. These are WebKit web inspectors, Firefox ([since version\n 31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))\n and the Firebug plugin for Firefox (any version).\n\n Colored output looks something like:\n\n ![](https://cloud.githubusercontent.com/assets/71256/3139768/b98c5fd8-e8ef-11e3-862a-f7253b6f47c6.png)\n\n### stderr vs stdout\n\nYou can set an alternative logging method per-namespace by overriding the `log` method on a per-namespace or globally:\n\nExample _stdout.js_:\n\n```js\nvar debug = require('debug');\nvar error = debug('app:error');\n\n// by default stderr is used\nerror('goes to stderr!');\n\nvar log = debug('app:log');\n// set this namespace to log via console.log\nlog.log = console.log.bind(console); // don't forget to bind to console!\nlog('goes to stdout');\nerror('still goes to stderr!');\n\n// set all output to go via console.info\n// overrides all per-namespace log settings\ndebug.log = console.info.bind(console);\nerror('now goes to stdout via console.info');\nlog('still goes to stdout, but via console.info now');\n```\n\n### Save debug output to a file\n\nYou can save all debug statements to a file by piping them.\n\nExample:\n\n```bash\n$ DEBUG_FD=3 node your-app.js 3> whatever.log\n```\n\n## Authors\n\n - TJ Holowaychuk\n - Nathan Rajlich\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2014 TJ Holowaychuk <tj@vision-media.ca>\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", + "readmeFilename": "Readme.md", "bugs": { "url": "https://github.com/visionmedia/debug/issues" }, - "homepage": "https://github.com/visionmedia/debug", + "homepage": "https://github.com/visionmedia/debug#readme", "_id": "debug@2.2.0", - "scripts": {}, "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", - "_from": "debug@*", - "_npmVersion": "2.7.4", - "_nodeVersion": "0.12.2", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - "maintainers": [ - { - "name": "tjholowaychuk", - "email": "tj@vision-media.ca" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - } - ], - "dist": { - "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", - "tarball": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", - "readme": "ERROR: No README data found!" + "_from": "debug@*" } diff --git a/deps/npm/node_modules/block-stream/LICENCE b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/LICENCE similarity index 100% rename from deps/npm/node_modules/block-stream/LICENCE rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/LICENCE diff --git a/deps/npm/node_modules/minimatch/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/LICENSE similarity index 100% rename from deps/npm/node_modules/minimatch/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/LICENSE diff --git a/deps/npm/node_modules/block-stream/README.md b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/README.md similarity index 100% rename from deps/npm/node_modules/block-stream/README.md rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/README.md diff --git a/deps/npm/node_modules/block-stream/bench/block-stream-pause.js b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js similarity index 100% rename from deps/npm/node_modules/block-stream/bench/block-stream-pause.js rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/bench/block-stream-pause.js diff --git a/deps/npm/node_modules/block-stream/bench/block-stream.js b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/bench/block-stream.js similarity index 100% rename from deps/npm/node_modules/block-stream/bench/block-stream.js rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/bench/block-stream.js diff --git a/deps/npm/node_modules/block-stream/bench/dropper-pause.js b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js similarity index 100% rename from deps/npm/node_modules/block-stream/bench/dropper-pause.js rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/bench/dropper-pause.js diff --git a/deps/npm/node_modules/block-stream/bench/dropper.js b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/bench/dropper.js similarity index 100% rename from deps/npm/node_modules/block-stream/bench/dropper.js rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/bench/dropper.js diff --git a/deps/npm/node_modules/block-stream/block-stream.js b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/block-stream.js similarity index 100% rename from deps/npm/node_modules/block-stream/block-stream.js rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/block-stream.js diff --git a/deps/npm/node_modules/block-stream/package.json b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/package.json similarity index 93% rename from deps/npm/node_modules/block-stream/package.json rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/package.json index 80227bb69ed8ab..97d9d42abaf911 100644 --- a/deps/npm/node_modules/block-stream/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/package.json @@ -32,7 +32,7 @@ "homepage": "https://github.com/isaacs/block-stream#readme", "_id": "block-stream@0.0.8", "_shasum": "0688f46da2bbf9cff0c4f68225a0cb95cbe8a46b", - "_from": "block-stream@0.0.8", + "_from": "block-stream@*", "_npmVersion": "2.10.0", "_nodeVersion": "2.0.1", "_npmUser": { @@ -50,5 +50,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.8.tgz" + "_resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.8.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/block-stream/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/test/basic.js similarity index 100% rename from deps/npm/node_modules/block-stream/test/basic.js rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/test/basic.js diff --git a/deps/npm/node_modules/block-stream/test/nopad-thorough.js b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js similarity index 100% rename from deps/npm/node_modules/block-stream/test/nopad-thorough.js rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/test/nopad-thorough.js diff --git a/deps/npm/node_modules/block-stream/test/nopad.js b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/test/nopad.js similarity index 100% rename from deps/npm/node_modules/block-stream/test/nopad.js rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/test/nopad.js diff --git a/deps/npm/node_modules/block-stream/test/pause-resume.js b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/test/pause-resume.js similarity index 100% rename from deps/npm/node_modules/block-stream/test/pause-resume.js rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/test/pause-resume.js diff --git a/deps/npm/node_modules/block-stream/test/thorough.js b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/test/thorough.js similarity index 100% rename from deps/npm/node_modules/block-stream/test/thorough.js rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/test/thorough.js diff --git a/deps/npm/node_modules/block-stream/test/two-stream.js b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/test/two-stream.js similarity index 96% rename from deps/npm/node_modules/block-stream/test/two-stream.js rename to deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/test/two-stream.js index c6db79a43d91d7..b0f5d82546823e 100644 --- a/deps/npm/node_modules/block-stream/test/two-stream.js +++ b/deps/npm/node_modules/node-gyp/node_modules/tar/node_modules/block-stream/test/two-stream.js @@ -10,10 +10,10 @@ stack = new Buffer( tsize ); for ( ; i < tsize; i++) stack[i] = "x".charCodeAt(0); isize = 1 * 1024; // <- initial packet size with 4K no bug! -fsize = 2 * 1024 ; // <- first block-stream size +fsize = 2 * 1024 ; // <- first block-stream size psize = Math.ceil( isize / 6 ); // <- second block-stream size -fexpected = Math.ceil( tsize / fsize ); // <- packets expected for first +fexpected = Math.ceil( tsize / fsize ); // <- packets expected for first pexpected = Math.ceil( tsize / psize ); // <- packets expected for second diff --git a/deps/npm/node_modules/node-gyp/package.json b/deps/npm/node_modules/node-gyp/package.json index 76fc168f2d955d..6ec7ec50245b6a 100644 --- a/deps/npm/node_modules/node-gyp/package.json +++ b/deps/npm/node_modules/node-gyp/package.json @@ -59,7 +59,7 @@ "homepage": "https://github.com/nodejs/node-gyp", "_id": "node-gyp@3.0.3", "_shasum": "9b004219f4fa9efbfd78c5fc674aa12e58fb8694", - "_from": "node-gyp@3.0.3", + "_from": "node-gyp@>=3.0.3 <3.1.0", "_npmVersion": "2.14.2", "_nodeVersion": "4.0.0", "_npmUser": { diff --git a/deps/npm/node_modules/nopt/package.json b/deps/npm/node_modules/nopt/package.json index 618f93467e283f..728d13627e820d 100644 --- a/deps/npm/node_modules/nopt/package.json +++ b/deps/npm/node_modules/nopt/package.json @@ -27,12 +27,12 @@ }, "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you hit the limit of your frustration just trying to\nmanage them all, and defer it with duct-tape solutions until you see\nexactly to the core of the problem, and finally snap and write an\nawesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many1\" : [String, Array]\n , \"many2\" : [path]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk -fp # unknown opts are ok.\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many1 5 --many1 null --many1 foo\n{ many1: [\"5\", \"null\", \"foo\"] }\n\n$ node my-program.js --many2 foo --many2 bar\n{ many2: [\"/path/to/foo\", \"path/to/bar\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid values for\nknown options are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n", "readmeFilename": "README.md", - "gitHead": "f52626631ea1afef5a6dd9acf23ddd1466831a08", "bugs": { "url": "https://github.com/isaacs/nopt/issues" }, "homepage": "https://github.com/isaacs/nopt#readme", "_id": "nopt@3.0.4", "_shasum": "dd63bc9c72a6e4e85b85cdc0ca314598facede5e", - "_from": "nopt@3.0.4" + "_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.4.tgz", + "_from": "nopt@>=3.0.4 <3.1.0" } diff --git a/deps/npm/node_modules/normalize-git-url/package.json b/deps/npm/node_modules/normalize-git-url/package.json index b2dc3d910a907a..ab01c0e8f3f669 100644 --- a/deps/npm/node_modules/normalize-git-url/package.json +++ b/deps/npm/node_modules/normalize-git-url/package.json @@ -33,10 +33,33 @@ "url": "https://github.com/npm/normalize-git-url/issues" }, "homepage": "https://github.com/npm/normalize-git-url", - "readme": "# normalize-git-url\n\nYou have a bunch of Git URLs. You want to convert them to a canonical\nrepresentation, probably for use inside npm so that it doesn't end up creating\na bunch of superfluous cached origins. You use this package.\n\n## Usage\n\n```javascript\nvar ngu = require('normalize-git-url');\nvar normalized = ngu(\"git+ssh://git@github.com:organization/repo.git#hashbrowns\")\n// get back:\n// {\n// url : \"ssh://git@github.com/organization/repo.git\",\n// branch : \"hashbrowns\" // did u know hashbrowns are delicious?\n// }\n```\n\n## API\n\nThere's just the one function, and all it takes is a single parameter, a non-normalized Git URL.\n\n### normalizeGitUrl(url)\n\n* `url` {String} The Git URL (very loosely speaking) to be normalized.\n\nReturns an object with the following format:\n\n* `url` {String} The normalized URL.\n* `branch` {String} The treeish to be checked out once the repo at `url` is\n cloned. It doesn't have to be a branch, but it's a lot easier to intuit what\n the output is for with that name.\n\n## Limitations\n\nRight now this doesn't try to special-case GitHub too much -- it doesn't ensure\nthat `.git` is added to the end of URLs, it doesn't prefer `https:` over\n`http:` or `ssh:`, it doesn't deal with redirects, and it doesn't try to\nresolve symbolic names to treeish hashcodes. For now, it just tries to account\nfor minor differences in representation.\n", - "readmeFilename": "README.md", "gitHead": "8393cd4345e404eb6ad2ff6853dcc8287807ca22", "_id": "normalize-git-url@3.0.1", "_shasum": "d40d419d05a15870271e50534dbb7b8ccd9b0a5c", - "_from": "normalize-git-url@latest" + "_from": "normalize-git-url@>=3.0.1 <3.1.0", + "_npmVersion": "3.1.2", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "d40d419d05a15870271e50534dbb7b8ccd9b0a5c", + "tarball": "http://registry.npmjs.org/normalize-git-url/-/normalize-git-url-3.0.1.tgz" + }, + "maintainers": [ + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_resolved": "https://registry.npmjs.org/normalize-git-url/-/normalize-git-url-3.0.1.tgz" } diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/package.json b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/package.json index a6851b0e059203..453d1632197a53 100644 --- a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/package.json +++ b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/node_modules/builtin-modules/package.json @@ -65,5 +65,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.0.tgz" + "_resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/package.json b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/package.json index 58feefdfb8884b..3e0bf21f85c0c7 100644 --- a/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/package.json +++ b/deps/npm/node_modules/normalize-package-data/node_modules/is-builtin-module/package.json @@ -5,7 +5,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/sindresorhus/is-builtin-module" + "url": "git+https://github.com/sindresorhus/is-builtin-module.git" }, "author": { "name": "Sindre Sorhus", @@ -68,5 +68,6 @@ } ], "directories": {}, - "_resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz" + "_resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/normalize-package-data/package.json b/deps/npm/node_modules/normalize-package-data/package.json index 464b0092769317..61f9e6f941a8ff 100644 --- a/deps/npm/node_modules/normalize-package-data/package.json +++ b/deps/npm/node_modules/normalize-package-data/package.json @@ -40,8 +40,6 @@ "email": "rok@kowalski.gd" } ], - "readme": "# normalize-package-data [![Build Status](https://travis-ci.org/npm/normalize-package-data.png?branch=master)](https://travis-ci.org/npm/normalize-package-data)\n\nnormalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.\n\nnormalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools.\n\n## Installation\n\n```\nnpm install normalize-package-data\n```\n\n## Usage\n\nBasic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readFileSync(\"package.json\")\nnormalizeData(packageData)\n// packageData is now normalized\n```\n\n#### Strict mode\n\nYou may activate strict validation by passing true as the second argument.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readFileSync(\"package.json\")\nwarnFn = function(msg) { console.error(msg) }\nnormalizeData(packageData, true)\n// packageData is now normalized\n```\n\nIf strict mode is activated, only Semver 2.0 version strings are accepted. Otherwise, Semver 1.0 strings are accepted as well. Packages must have a name, and the name field must not have contain leading or trailing whitespace.\n\n#### Warnings\n\nOptionally, you may pass a \"warning\" function. It gets called whenever the `normalizeData` function encounters something that doesn't look right. It indicates less than perfect input data.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readFileSync(\"package.json\")\nwarnFn = function(msg) { console.error(msg) }\nnormalizeData(packageData, warnFn)\n// packageData is now normalized. Any number of warnings may have been logged.\n```\n\nYou may combine strict validation with warnings by passing `true` as the second argument, and `warnFn` as third.\n\nWhen `private` field is set to `true`, warnings will be suppressed.\n\n### Potential exceptions\n\nIf the supplied data has an invalid name or version vield, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback.\n\n## What normalization (currently) entails\n\n* The value of `name` field gets trimmed (unless in strict mode).\n* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n* If `name` and/or `version` fields are missing, they are set to empty strings.\n* If `files` field is not an array, it will be removed.\n* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value.\n* If `man` field is a string, it will become an array with the original string as its sole member.\n* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\\s+`.\n* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties.\n* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`.\n* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs.\n* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched.\n* As of v2: Dependencies that point at known hosted git providers (currently: github, bitbucket, gitlab) will have their URLs canonicalized, but protocols will be preserved.\n* As of v2: Dependencies that use shortcuts for hosted git providers (`org/proj`, `github:org/proj`, `bitbucket:org/proj`, `gitlab:org/proj`, `gist:docid`) will have the shortcut left in place. (In the case of github, the `org/proj` form will be expanded to `github:org/proj`.) THIS MARKS A BREAKING CHANGE FROM V1, where the shorcut was previously expanded to a URL.\n* If `description` field does not exist, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`.\n* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `\"git\"`.\n* If `repository.url` is not a valid url, but in the style of \"[owner-name]/[repo-name]\", `repository.url` will be set to git+https://github.com/[owner-name]/[repo-name].git\n* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value.\n* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.\n* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed.\n* If `homepage` field is not a string, it will be removed.\n* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`.\n* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/ . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.\n\n### Rules for name field\n\nIf `name` field is given, the value of the name field must be a string. The string may not:\n\n* start with a period.\n* contain the following characters: `/@\\s+%`\n* contain and characters that would need to be encoded for use in urls.\n* resemble the word `node_modules` or `favicon.ico` (case doesn't matter).\n\n### Rules for version field\n\nIf `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n\n### Rules for license field\n\nThe `license` field should be a valid *SDPDX license expression* or one of the special values allowed by [validate-npm-package-license](https://npmjs.com/packages/validate-npm-package-license). See [documentation for the license field in package.json](https://docs.npmjs.com/files/package.json#license).\n\n## Credits\n\nThis package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson.\n\n## License\n\nnormalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT). \nCopyright (c) 2013 Meryn Stol \n", - "readmeFilename": "README.md", "gitHead": "0aa15b23116f2dfd086f1ed6bf213cbb7e7490dd", "bugs": { "url": "https://github.com/npm/normalize-package-data/issues" @@ -49,5 +47,40 @@ "homepage": "https://github.com/npm/normalize-package-data#readme", "_id": "normalize-package-data@2.3.4", "_shasum": "b92233ce6ef04fbd6bc0c05dead155af33a623e0", - "_from": "normalize-package-data@2.3.4" + "_from": "normalize-package-data@>=2.3.4 <2.4.0", + "_npmVersion": "2.14.3", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "b92233ce6ef04fbd6bc0c05dead155af33a623e0", + "tarball": "http://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.4.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "meryn", + "email": "merynstol@gmail.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.3.4.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/npm-cache-filename/package.json b/deps/npm/node_modules/npm-cache-filename/package.json index b2431b96c2f688..76ec9d1a1355c2 100644 --- a/deps/npm/node_modules/npm-cache-filename/package.json +++ b/deps/npm/node_modules/npm-cache-filename/package.json @@ -27,7 +27,7 @@ "gitHead": "b7eef12919fdf544a3b83bba73093f7268c40c1e", "_id": "npm-cache-filename@1.0.2", "_shasum": "ded306c5b0bfc870a9e9faf823bc5f283e05ae11", - "_from": "npm-cache-filename@1.0.2", + "_from": "npm-cache-filename@>=1.0.2 <1.1.0", "_npmVersion": "2.12.1", "_nodeVersion": "2.2.2", "_npmUser": { diff --git a/deps/npm/node_modules/npm-install-checks/index.js b/deps/npm/node_modules/npm-install-checks/index.js index 10f214fa931e97..d7c3360e4c6a29 100644 --- a/deps/npm/node_modules/npm-install-checks/index.js +++ b/deps/npm/node_modules/npm-install-checks/index.js @@ -6,7 +6,6 @@ var semver = require("semver") exports.checkEngine = checkEngine function checkEngine (target, npmVer, nodeVer, force, strict, cb) { var nodev = force ? null : nodeVer - , strict = strict || target.engineStrict , eng = target.engines if (!eng) return cb() if (nodev && eng.node && !semver.satisfies(nodev, eng.node) diff --git a/deps/npm/node_modules/npm-install-checks/package.json b/deps/npm/node_modules/npm-install-checks/package.json index 3e7203c6fa549d..c504f97d1a3b71 100644 --- a/deps/npm/node_modules/npm-install-checks/package.json +++ b/deps/npm/node_modules/npm-install-checks/package.json @@ -1,6 +1,6 @@ { "name": "npm-install-checks", - "version": "1.0.6", + "version": "2.0.1", "description": "checks that npm runs during the installation of a module", "main": "index.js", "dependencies": { @@ -32,10 +32,38 @@ "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": "f28aebca7f5df0ddb13161b0f04d069004f6c367", - "_id": "npm-install-checks@1.0.6", - "_shasum": "8d4c1e852806e4e2d66601ab787be5841550d0cb", - "_from": "npm-install-checks@>=1.0.6 <1.1.0" + "gitHead": "1e9474f30490cd7621e976e91fa611d35e644f64", + "_id": "npm-install-checks@2.0.1", + "_shasum": "a93540b53f04fa9d916d2733d6541f6db7d88e46", + "_from": "npm-install-checks@>=2.0.1 <2.1.0", + "_npmVersion": "3.3.4", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "a93540b53f04fa9d916d2733d6541f6db7d88e46", + "tarball": "http://registry.npmjs.org/npm-install-checks/-/npm-install-checks-2.0.1.tgz" + }, + "maintainers": [ + { + "name": "robertkowalski", + "email": "rok@kowalski.gd" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/npm-install-checks/-/npm-install-checks-2.0.1.tgz" } diff --git a/deps/npm/node_modules/npm-install-checks/test/check-engine.js b/deps/npm/node_modules/npm-install-checks/test/check-engine.js index a16b13d7dbd8fe..c89ec5398d7acc 100644 --- a/deps/npm/node_modules/npm-install-checks/test/check-engine.js +++ b/deps/npm/node_modules/npm-install-checks/test/check-engine.js @@ -18,16 +18,16 @@ test("node version too old", function (t) { }) test("npm version too old", function (t) { - var target = { engines: { npm: "1.3.6" }} - c(target, "1.4.2", "0.2.1", false, true, function (err) { + var target = { engines: { npm: "^1.4.6" }} + c(target, "1.3.2", "0.2.1", false, true, function (err) { t.ok(err, "returns an error") - t.equals(err.required.npm, "1.3.6") + t.equals(err.required.npm, "^1.4.6") t.end() }) }) -test("strict=false does not return an error", function (t) { - var target = { engines: { npm: "1.3.6" }} +test("strict=false w/engineStrict json does not return an error", function (t) { + var target = { engines: { npm: "1.3.6" }, engineStrict: true } c(target, "1.4.2", "0.2.1", false, false, function (err) { t.notOk(err, "returns no error") t.end() diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE index 99c130e1de3427..1e836b4760025f 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE @@ -2,23 +2,23 @@ The MIT License Copyright (c) 2013 Max Ogden -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, +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 +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 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json index 466dfdfe0139b3..b67333380c265e 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -29,25 +29,9 @@ }, "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", "readmeFilename": "README.md", - "homepage": "https://github.com/isaacs/core-util-is", + "homepage": "https://github.com/isaacs/core-util-is#readme", "_id": "core-util-is@1.0.1", - "dist": { - "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" - }, - "_from": "core-util-is@>=1.0.0 <1.1.0", - "_npmVersion": "1.3.23", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz", + "_from": "core-util-is@>=1.0.0 <1.1.0" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json index 19228ab6fdcaaf..fb1eb3786d8168 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json @@ -26,28 +26,13 @@ "url": "http://juliangruber.com" }, "license": "MIT", - "_id": "isarray@0.0.1", - "dist": { - "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - }, - "_from": "isarray@0.0.1", - "_npmVersion": "1.2.18", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "directories": {}, - "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/juliangruber/isarray/issues" }, - "readme": "ERROR: No README data found!" + "_id": "isarray@0.0.1", + "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "_from": "isarray@0.0.1" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json index 087586e8f8cedd..bfaa2785f0b685 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json @@ -19,27 +19,10 @@ "devDependencies": { "tap": "~0.2.6" }, - "gitHead": "e855846a69662b9489f1ad3dde1ebf2ccc4370b8", + "readme": "process-nextick-args\n=====\n\n[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args)\n\n```bash\nnpm install --save process-nextick-args\n```\n\nAlways be able to pass arguments to process.nextTick, no matter the platform\n\n```js\nvar nextTick = require('process-nextick-args');\n\nnextTick(function (a, b, c) {\n console.log(a, b, c);\n}, 'step', 3, 'profit');\n```\n", + "readmeFilename": "readme.md", "_id": "process-nextick-args@1.0.3", "_shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", - "_from": "process-nextick-args@>=1.0.0 <1.1.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.5.0", - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "dist": { - "shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", - "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz" - }, - "maintainers": [ - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "directories": {}, "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz", - "readme": "ERROR: No README data found!" + "_from": "process-nextick-args@>=1.0.0 <1.1.0" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json index 0364d54ba46af6..ee70702359198d 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -22,33 +22,13 @@ "browserify" ], "license": "MIT", - "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", + "readme": "**string_decoder.js** (`require('string_decoder')`) from Node.js core\n\nCopyright Joyent, Inc. and other Node contributors. See LICENCE file for details.\n\nVersion numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**\n\nThe *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/rvagg/string_decoder/issues" }, "_id": "string_decoder@0.10.31", "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_from": "string_decoder@>=0.10.0 <0.11.0", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "dist": { - "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "readme": "ERROR: No README data found!" + "_from": "string_decoder@>=0.10.0 <0.11.0" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md index ec010299b1b259..acc8675372e980 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md @@ -1,4 +1,9 @@ +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + 1.0.1 / 2014-11-25 ================== diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js index 55fa5a4bc6056a..549ae2f065ea5a 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js @@ -55,7 +55,12 @@ function deprecate (fn, msg) { */ function config (name) { - if (!global.localStorage) return false; + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } var val = global.localStorage[name]; if (null == val) return false; return String(val).toLowerCase() === 'true'; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json index ea487da0e43000..ae0c70f6c633f1 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json @@ -1,6 +1,6 @@ { "name": "util-deprecate", - "version": "1.0.1", + "version": "1.0.2", "description": "The Node.js `util.deprecate()` function with browser support", "main": "node.js", "browser": "browser.js", @@ -28,11 +28,12 @@ "url": "https://github.com/TooTallNate/util-deprecate/issues" }, "homepage": "https://github.com/TooTallNate/util-deprecate", - "gitHead": "6e923f7d98a0afbe5b9c7db9d0f0029c1936746c", - "_id": "util-deprecate@1.0.1", - "_shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", + "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4", + "_id": "util-deprecate@1.0.2", + "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", "_from": "util-deprecate@>=1.0.1 <1.1.0", - "_npmVersion": "1.4.28", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.2", "_npmUser": { "name": "tootallnate", "email": "nathan@tootallnate.net" @@ -44,10 +45,10 @@ } ], "dist": { - "shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", - "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz" + "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz", + "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json index 70ad998cae2d45..0d67d9bbbfbc67 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/package.json @@ -33,43 +33,14 @@ "util": false }, "license": "MIT", - "gitHead": "1a70134a71196eeabb5e27bc7580faaa68d30513", + "readme": "# readable-stream\n\n***Node-core streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)\n\n\n[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)\n[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)\n\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)\n\n```bash\nnpm install --save readable-stream\n```\n\n***Node-core streams for userland***\n\nThis package is a mirror of the Streams2 and Streams3 implementations in\nNode-core, including [documentation](doc/stream.markdown).\n\nIf you want to guarantee a stable streams base, regardless of what version of\nNode you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *\"stream\"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).\n\nAs of version 2.0.0 **readable-stream** uses semantic versioning. \n\n# Streams WG Team Members\n\n* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com>\n - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B\n* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com>\n - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242\n* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org>\n - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D\n* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com>\n* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com>\n* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me>\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/nodejs/readable-stream/issues" }, "homepage": "https://github.com/nodejs/readable-stream#readme", "_id": "readable-stream@2.0.2", "_shasum": "bec81beae8cf455168bc2e5b2b31f5bcfaed9b1b", - "_from": "readable-stream@>=2.0.0 <2.1.0", - "_npmVersion": "2.11.1", - "_nodeVersion": "2.3.0", - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "dist": { - "shasum": "bec81beae8cf455168bc2e5b2b31f5bcfaed9b1b", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - }, - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "directories": {}, "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz", - "readme": "ERROR: No README data found!" + "_from": "readable-stream@>=2.0.0 <2.1.0" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json index b8b59f5c303991..f946a953af73c6 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/package.json @@ -52,28 +52,13 @@ "android-browser/4.2..latest" ] }, + "readme": "# typedarray\n\nTypedArray polyfill ripped from [this\nmodule](https://raw.github.com/inexorabletash/polyfill).\n\n[![build status](https://secure.travis-ci.org/substack/typedarray.png)](http://travis-ci.org/substack/typedarray)\n\n[![testling badge](https://ci.testling.com/substack/typedarray.png)](https://ci.testling.com/substack/typedarray)\n\n# example\n\n``` js\nvar Uint8Array = require('typedarray').Uint8Array;\nvar ua = new Uint8Array(5);\nua[1] = 256 + 55;\nconsole.log(ua[1]);\n```\n\noutput:\n\n```\n55\n```\n\n# methods\n\n``` js\nvar TA = require('typedarray')\n```\n\nThe `TA` object has the following constructors:\n\n* TA.ArrayBuffer\n* TA.DataView\n* TA.Float32Array\n* TA.Float64Array\n* TA.Int8Array\n* TA.Int16Array\n* TA.Int32Array\n* TA.Uint8Array\n* TA.Uint8ClampedArray\n* TA.Uint16Array\n* TA.Uint32Array\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install typedarray\n```\n\nTo use this module in the browser, compile with\n[browserify](http://browserify.org)\nor download a UMD build from browserify CDN:\n\nhttp://wzrd.in/standalone/typedarray@latest\n\n# license\n\nMIT\n", + "readmeFilename": "readme.markdown", "bugs": { "url": "https://github.com/substack/typedarray/issues" }, "_id": "typedarray@0.0.6", - "dist": { - "shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", - "tarball": "http://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" - }, - "_from": "typedarray@>=0.0.5 <0.1.0", - "_npmVersion": "1.4.3", - "_npmUser": { - "name": "substack", - "email": "mail@substack.net" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "directories": {}, "_shasum": "867ac74e3864187b1d3d47d996a78ec5c8830777", "_resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "readme": "ERROR: No README data found!" + "_from": "typedarray@>=0.0.5 <0.1.0" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js index 425950f9fc9ed7..e57dabdcebc9c1 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js @@ -11,7 +11,7 @@ test('u8a without globals', function (t) { vm.runInNewContext(src, c); var TA = c.module.exports; var ua = new(TA.Uint8Array)(5); - + t.equal(ua.length, 5); ua[1] = 256 + 55; t.equal(ua[1], 55); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json index caa06817b0e47a..19d94b3e08154b 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json @@ -54,28 +54,11 @@ "android-browser/4.2..latest" ] }, - "gitHead": "7cb37c8ddc0fd2ea03c104d07d44d84b83a31185", + "readme": "# concat-stream\n\nWritable stream that concatenates strings or binary data and calls a callback with the result. Not a transform stream -- more of a stream sink.\n\n[![Build Status](https://travis-ci.org/maxogden/concat-stream.svg?branch=master)](https://travis-ci.org/maxogden/concat-stream)\n\n[![NPM](https://nodei.co/npm/concat-stream.png)](https://nodei.co/npm/concat-stream/)\n\n### description\n\nStreams emit many buffers. If you want to collect all of the buffers, and when the stream ends concatenate all of the buffers together and receive a single buffer then this is the module for you.\n\nOnly use this if you know you can fit all of the output of your stream into a single Buffer (e.g. in RAM).\n\nThere are also `objectMode` streams that emit things other than Buffers, and you can concatenate these too. See below for details.\n\n### examples\n\n#### Buffers\n\n```js\nvar fs = require('fs')\nvar concat = require('concat-stream')\n\nvar readStream = fs.createReadStream('cat.png')\nvar concatStream = concat(gotPicture)\n\nreadStream.on('error', handleError)\nreadStream.pipe(concatStream)\n\nfunction gotPicture(imageBuffer) {\n // imageBuffer is all of `cat.png` as a node.js Buffer\n}\n\nfunction handleError(err) {\n // handle your error appropriately here, e.g.:\n console.error(err) // print the error to STDERR\n process.exit(1) // exit program with non-zero exit code\n}\n\n```\n\n#### Arrays\n\n```js\nvar write = concat(function(data) {})\nwrite.write([1,2,3])\nwrite.write([4,5,6])\nwrite.end()\n// data will be [1,2,3,4,5,6] in the above callback\n```\n\n#### Uint8Arrays\n\n```js\nvar write = concat(function(data) {})\nvar a = new Uint8Array(3)\na[0] = 97; a[1] = 98; a[2] = 99\nwrite.write(a)\nwrite.write('!')\nwrite.end(Buffer('!!1'))\n```\n\nSee `test/` for more examples\n\n# methods\n\n```js\nvar concat = require('concat-stream')\n```\n\n## var writable = concat(opts={}, cb)\n\nReturn a `writable` stream that will fire `cb(data)` with all of the data that\nwas written to the stream. Data can be written to `writable` as strings,\nBuffers, arrays of byte integers, and Uint8Arrays. \n\nBy default `concat-stream` will give you back the same data type as the type of the first buffer written to the stream. Use `opts.encoding` to set what format `data` should be returned as, e.g. if you if you don't want to rely on the built-in type checking or for some other reason.\n\n* `string` - get a string\n* `buffer` - get back a Buffer\n* `array` - get an array of byte integers\n* `uint8array`, `u8`, `uint8` - get back a Uint8Array\n* `object`, get back an array of Objects\n\nIf you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't in the list above), it will try to convert concat them into a `Buffer`.\n\n# error handling\n\n`concat-stream` does not handle errors for you, so you must handle errors on whatever streams you pipe into `concat-stream`. This is a general rule when programming with node.js streams: always handle errors on each and every stream. Since `concat-stream` is not itself a stream it does not emit errors.\n\n# license\n\nMIT LICENSE\n", + "readmeFilename": "readme.md", "homepage": "https://github.com/maxogden/concat-stream#readme", "_id": "concat-stream@1.5.0", "_shasum": "53f7d43c51c5e43f81c8fdd03321c631be68d611", - "_from": "concat-stream@>=1.4.6 <2.0.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "1.8.2", - "_npmUser": { - "name": "maxogden", - "email": "max@maxogden.com" - }, - "maintainers": [ - { - "name": "maxogden", - "email": "max@maxogden.com" - } - ], - "dist": { - "shasum": "53f7d43c51c5e43f81c8fdd03321c631be68d611", - "tarball": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.5.0.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.0.tgz", - "readme": "ERROR: No README data found!" + "_from": "concat-stream@>=1.4.6 <2.0.0" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md index 69234d52a535bb..587ff7a4dc8ef9 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md @@ -73,7 +73,7 @@ var concat = require('concat-stream') Return a `writable` stream that will fire `cb(data)` with all of the data that was written to the stream. Data can be written to `writable` as strings, -Buffers, arrays of byte integers, and Uint8Arrays. +Buffers, arrays of byte integers, and Uint8Arrays. By default `concat-stream` will give you back the same data type as the type of the first buffer written to the stream. Use `opts.encoding` to set what format `data` should be returned as, e.g. if you if you don't want to rely on the built-in type checking or for some other reason. diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json index ab9f763737eda5..c9670d1c571646 100644 --- a/deps/npm/node_modules/npm-registry-client/package.json +++ b/deps/npm/node_modules/npm-registry-client/package.json @@ -40,8 +40,6 @@ "npmlog": "" }, "license": "ISC", - "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\nvar uri = \"https://registry.npmjs.org/npm\"\nvar params = {timeout: 1000}\n\nclient.get(uri, params, function (error, data, raw, res) {\n // error is an error if there was a problem.\n // data is the parsed data object\n // raw is the json string\n // res is the response from couch\n})\n```\n\n# Registry URLs\n\nThe registry calls take either a full URL pointing to a resource in the\nregistry, or a base URL for the registry as a whole (including the registry\npath – but be sure to terminate the path with `/`). `http` and `https` URLs are\nthe only ones supported.\n\n## Using the client\n\nEvery call to the client follows the same pattern:\n\n* `uri` {String} The *fully-qualified* URI of the registry API method being\n invoked.\n* `params` {Object} Per-request parameters.\n* `callback` {Function} Callback to be invoked when the call is complete.\n\n### Credentials\n\nMany requests to the registry can by authenticated, and require credentials\nfor authorization. These credentials always look the same:\n\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n**or**\n\n* `token` {String}\n* `alwaysAuth` {Boolean} Whether calls to the target registry are always\n authed.\n\n## API\n\n### client.access(uri, params, cb)\n\n* `uri` {String} Registry URL for the package's access API endpoint.\n Looks like `/-/package//access`.\n* `params` {Object} Object containing per-request properties.\n * `access` {String} New access level for the package. Can be either\n `public` or `restricted`. Registry will raise an error if trying\n to change the access level of an unscoped package.\n * `auth` {Credentials}\n\nSet the access level for scoped packages. For now, there are only two\naccess levels: \"public\" and \"restricted\".\n\n### client.adduser(uri, params, cb)\n\n* `uri` {String} Base registry URL.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nAdd a user account to the registry, or verify the credentials.\n\n### client.deprecate(uri, params, cb)\n\n* `uri` {String} Full registry URI for the deprecated package.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Semver version range.\n * `message` {String} The message to use as a deprecation warning.\n * `auth` {Credentials}\n* `cb` {Function}\n\nDeprecate a version of a package in the registry.\n\n### client.distTags.fetch(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `auth` {Credentials}\n* `cb` {Function}\n\nFetch all of the `dist-tags` for the named package.\n\n### client.distTags.add(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTag` {String} Name of the new `dist-tag`.\n * `version` {String} Exact version to be mapped to the `dist-tag`.\n * `auth` {Credentials}\n* `cb` {Function}\n\nAdd (or replace) a single dist-tag onto the named package.\n\n### client.distTags.set(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTags` {Object} Object containing a map from tag names to package\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nSet all of the `dist-tags` for the named package at once, creating any\n`dist-tags` that do not already exit. Any `dist-tags` not included in the\n`distTags` map will be removed.\n\n### client.distTags.update(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTags` {Object} Object containing a map from tag names to package\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nUpdate the values of multiple `dist-tags`, creating any `dist-tags` that do\nnot already exist. Any pre-existing `dist-tags` not included in the `distTags`\nmap will be left alone.\n\n### client.distTags.rm(uri, params, cb)\n\n* `uri` {String} Base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `package` {String} Name of the package.\n * `distTag` {String} Name of the new `dist-tag`.\n * `auth` {Credentials}\n* `cb` {Function}\n\nRemove a single `dist-tag` from the named package.\n\n### client.get(uri, params, cb)\n\n* `uri` {String} The complete registry URI to fetch\n* `params` {Object} Object containing per-request properties.\n * `timeout` {Number} Duration before the request times out. Optional\n (default: never).\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `staleOk` {Boolean} If there's cached data available, then return that to\n the callback quickly, and update the cache the background. Optional\n (default: false).\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n\nFetches data from the registry via a GET request, saving it in the cache folder\nwith the ETag or the \"Last Modified\" timestamp.\n\n### client.publish(uri, params, cb)\n\n* `uri` {String} The registry URI for the package to publish.\n* `params` {Object} Object containing per-request properties.\n * `metadata` {Object} Package metadata.\n * `access` {String} Access for the package. Can be `public` or `restricted` (no default).\n * `body` {Stream} Stream of the package body / tarball.\n * `auth` {Credentials}\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder.\n\n### client.star(uri, params, cb)\n\n* `uri` {String} The complete registry URI for the package to star.\n* `params` {Object} Object containing per-request properties.\n * `starred` {Boolean} True to star the package, false to unstar it. Optional\n (default: false).\n * `auth` {Credentials}\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or unstar a\npackage, though other writes do require that the user be the package owner.\n\n### client.stars(uri, params, cb)\n\n* `uri` {String} The base URL for the registry.\n* `params` {Object} Object containing per-request properties.\n * `username` {String} Name of user to fetch starred packages for. Optional\n (default: user in `auth`).\n * `auth` {Credentials} Optional (required if `username` is omitted).\n* `cb` {Function}\n\nView your own or another user's starred packages.\n\n### client.tag(uri, params, cb)\n\n* `uri` {String} The complete registry URI to tag\n* `params` {Object} Object containing per-request properties.\n * `version` {String} Version to tag.\n * `tag` {String} Tag name to apply.\n * `auth` {Credentials}\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the\nspecified version.\n\n### client.unpublish(uri, params, cb)\n\n* `uri` {String} The complete registry URI of the package to unpublish.\n* `params` {Object} Object containing per-request properties.\n * `version` {String} version to unpublish. Optional – omit to unpublish all\n versions.\n * `auth` {Credentials}\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry. When the\nlast version us unpublished, the entire document is removed from the database.\n\n### client.whoami(uri, params, cb)\n\n* `uri` {String} The base registry for the URI.\n* `params` {Object} Object containing per-request properties.\n * `auth` {Credentials}\n* `cb` {Function}\n\nSimple call to see who the registry thinks you are. Especially useful with\ntoken-based auth.\n\n\n## PLUMBING\n\nThe below are primarily intended for use by the rest of the API, or by the npm\ncaching logic directly.\n\n### client.request(uri, params, cb)\n\n* `uri` {String} URI pointing to the resource to request.\n* `params` {Object} Object containing per-request properties.\n * `method` {String} HTTP method. Optional (default: \"GET\").\n * `body` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON. Optional – body\n only used for write operations.\n * `etag` {String} The cached ETag. Optional.\n * `lastModified` {String} The cached Last-Modified timestamp. Optional.\n * `follow` {Boolean} Follow 302/301 responses. Optional (default: true).\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nMake a generic request to the registry. All the other methods are wrappers\naround `client.request`.\n\n### client.fetch(uri, params, cb)\n\n* `uri` {String} The complete registry URI to upload to\n* `params` {Object} Object containing per-request properties.\n * `headers` {Stream} HTTP headers to be included with the request. Optional.\n * `auth` {Credentials} Optional.\n* `cb` {Function}\n\nFetch a package from a URL, with auth set appropriately if included. Used to\ncache remote tarballs as well as request package tarballs from the registry.\n\n# Configuration\n\nThe client uses its own configuration, which is just passed in as a simple\nnested object. The following are the supported values (with their defaults, if\nany):\n\n* `proxy.http` {URL} The URL to proxy HTTP requests through.\n* `proxy.https` {URL} The URL to proxy HTTPS requests through. Defaults to be\n the same as `proxy.http` if unset.\n* `proxy.localAddress` {IP} The local address to use on multi-homed systems.\n* `ssl.ca` {String} Certificate signing authority certificates to trust.\n* `ssl.certificate` {String} Client certificate (PEM encoded). Enable access\n to servers that require client certificates.\n* `ssl.key` {String} Private key (PEM encoded) for client certificate.\n* `ssl.strict` {Boolean} Whether or not to be strict with SSL certificates.\n Default = `true`\n* `retry.count` {Number} Number of times to retry on GET failures. Default = 2.\n* `retry.factor` {Number} `factor` setting for `node-retry`. Default = 10.\n* `retry.minTimeout` {Number} `minTimeout` setting for `node-retry`.\n Default = 10000 (10 seconds)\n* `retry.maxTimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default = 60000 (60 seconds)\n* `userAgent` {String} User agent header to send. Default =\n `\"node/{process.version}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `defaultTag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `couchToken` {Object} A token for use with\n [couch-login](https://npmjs.org/package/couch-login).\n* `sessionToken` {string} A random identifier for this set of client requests.\n Default = 8 random hexadecimal bytes.\n", - "readmeFilename": "README.md", "gitHead": "06f188917bf575fe7dc7c2f6d1d4adbaa50bc423", "bugs": { "url": "https://github.com/isaacs/npm-registry-client/issues" @@ -49,5 +47,35 @@ "homepage": "https://github.com/isaacs/npm-registry-client#readme", "_id": "npm-registry-client@7.0.7", "_shasum": "899d7c8fefe87b72a70d8c9e075fb874539e0d3e", - "_from": "npm-registry-client@7.0.7" + "_from": "npm-registry-client@>=7.0.7 <7.1.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "899d7c8fefe87b72a70d8c9e075fb874539e0d3e", + "tarball": "http://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.0.7.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.0.7.tgz" } diff --git a/deps/npm/node_modules/npm-user-validate/package.json b/deps/npm/node_modules/npm-user-validate/package.json index 8a27d7cfe1ad49..2cc56691ec4fd4 100644 --- a/deps/npm/node_modules/npm-user-validate/package.json +++ b/deps/npm/node_modules/npm-user-validate/package.json @@ -30,7 +30,7 @@ "homepage": "https://github.com/npm/npm-user-validate#readme", "_id": "npm-user-validate@0.1.2", "_shasum": "d585da0b47c9f41a9e6ca684b6fd84ba41ebe87d", - "_from": "npm-user-validate@>=0.1.1 <0.2.0", + "_from": "npm-user-validate@>=0.1.2 <0.2.0", "_npmVersion": "2.10.0", "_nodeVersion": "2.0.1", "_npmUser": { diff --git a/deps/npm/node_modules/github-url-from-git/.npmignore b/deps/npm/node_modules/npmlog/node_modules/ansi/.npmignore similarity index 100% rename from deps/npm/node_modules/github-url-from-git/.npmignore rename to deps/npm/node_modules/npmlog/node_modules/ansi/.npmignore diff --git a/deps/npm/node_modules/ansi/History.md b/deps/npm/node_modules/npmlog/node_modules/ansi/History.md similarity index 100% rename from deps/npm/node_modules/ansi/History.md rename to deps/npm/node_modules/npmlog/node_modules/ansi/History.md diff --git a/deps/npm/node_modules/ansi/README.md b/deps/npm/node_modules/npmlog/node_modules/ansi/README.md similarity index 100% rename from deps/npm/node_modules/ansi/README.md rename to deps/npm/node_modules/npmlog/node_modules/ansi/README.md diff --git a/deps/npm/node_modules/ansi/examples/beep/index.js b/deps/npm/node_modules/npmlog/node_modules/ansi/examples/beep/index.js similarity index 100% rename from deps/npm/node_modules/ansi/examples/beep/index.js rename to deps/npm/node_modules/npmlog/node_modules/ansi/examples/beep/index.js diff --git a/deps/npm/node_modules/ansi/examples/clear/index.js b/deps/npm/node_modules/npmlog/node_modules/ansi/examples/clear/index.js similarity index 100% rename from deps/npm/node_modules/ansi/examples/clear/index.js rename to deps/npm/node_modules/npmlog/node_modules/ansi/examples/clear/index.js diff --git a/deps/npm/node_modules/ansi/examples/cursorPosition.js b/deps/npm/node_modules/npmlog/node_modules/ansi/examples/cursorPosition.js similarity index 100% rename from deps/npm/node_modules/ansi/examples/cursorPosition.js rename to deps/npm/node_modules/npmlog/node_modules/ansi/examples/cursorPosition.js diff --git a/deps/npm/node_modules/ansi/examples/progress/index.js b/deps/npm/node_modules/npmlog/node_modules/ansi/examples/progress/index.js similarity index 100% rename from deps/npm/node_modules/ansi/examples/progress/index.js rename to deps/npm/node_modules/npmlog/node_modules/ansi/examples/progress/index.js diff --git a/deps/npm/node_modules/ansi/lib/ansi.js b/deps/npm/node_modules/npmlog/node_modules/ansi/lib/ansi.js similarity index 100% rename from deps/npm/node_modules/ansi/lib/ansi.js rename to deps/npm/node_modules/npmlog/node_modules/ansi/lib/ansi.js diff --git a/deps/npm/node_modules/ansi/lib/newlines.js b/deps/npm/node_modules/npmlog/node_modules/ansi/lib/newlines.js similarity index 100% rename from deps/npm/node_modules/ansi/lib/newlines.js rename to deps/npm/node_modules/npmlog/node_modules/ansi/lib/newlines.js diff --git a/deps/npm/node_modules/ansi/package.json b/deps/npm/node_modules/npmlog/node_modules/ansi/package.json similarity index 97% rename from deps/npm/node_modules/ansi/package.json rename to deps/npm/node_modules/npmlog/node_modules/ansi/package.json index 706ae63067694d..278a8f272698da 100644 --- a/deps/npm/node_modules/ansi/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/ansi/package.json @@ -28,7 +28,7 @@ "homepage": "https://github.com/TooTallNate/ansi.js", "_id": "ansi@0.3.0", "_shasum": "74b2f1f187c8553c7f95015bcb76009fb43d38e0", - "_from": "ansi@latest", + "_from": "ansi@>=0.3.0 <0.4.0", "_npmVersion": "1.4.9", "_npmUser": { "name": "tootallnate", diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md index 52f9f9ae1ed4a2..3491c5956cc236 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md @@ -25,7 +25,7 @@ single.completeWork(20) console.log(top.completed()) // 0.2 fs.stat("file", function(er, stat) { - if (er) throw er + if (er) throw er var stream = top.newStream("file", stat.size) console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete // and 50% * 20% == 10% diff --git a/deps/npm/node_modules/readable-stream/.npmignore b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/.npmignore similarity index 100% rename from deps/npm/node_modules/readable-stream/.npmignore rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/.npmignore diff --git a/deps/npm/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/LICENSE similarity index 100% rename from deps/npm/node_modules/readable-stream/LICENSE rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/LICENSE diff --git a/deps/npm/node_modules/readable-stream/README.md b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/README.md similarity index 99% rename from deps/npm/node_modules/readable-stream/README.md rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/README.md index e46b823903d2c6..9e9b6eee9f349f 100644 --- a/deps/npm/node_modules/readable-stream/README.md +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/README.md @@ -12,4 +12,3 @@ If you want to guarantee a stable streams base, regardless of what version of No **readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12. **readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"` - diff --git a/deps/npm/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/duplex.js similarity index 100% rename from deps/npm/node_modules/readable-stream/duplex.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/duplex.js diff --git a/deps/npm/node_modules/readable-stream/float.patch b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/float.patch similarity index 100% rename from deps/npm/node_modules/readable-stream/float.patch rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/float.patch diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js similarity index 100% rename from deps/npm/node_modules/readable-stream/lib/_stream_duplex.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js similarity index 100% rename from deps/npm/node_modules/readable-stream/lib/_stream_passthrough.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js similarity index 100% rename from deps/npm/node_modules/readable-stream/lib/_stream_readable.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js similarity index 100% rename from deps/npm/node_modules/readable-stream/lib/_stream_transform.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js similarity index 100% rename from deps/npm/node_modules/readable-stream/lib/_stream_writable.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js diff --git a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/README.md b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/README.md similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/core-util-is/README.md rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/README.md diff --git a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/float.patch b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/float.patch similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/core-util-is/float.patch rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/float.patch diff --git a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/lib/util.js similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/core-util-is/lib/util.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/lib/util.js diff --git a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/package.json similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/core-util-is/package.json rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/package.json diff --git a/deps/npm/node_modules/readable-stream/node_modules/core-util-is/util.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/util.js similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/core-util-is/util.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/util.js diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/README.md b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/README.md similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/isarray/README.md rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/README.md diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/build/build.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/build/build.js similarity index 99% rename from deps/npm/node_modules/readable-stream/node_modules/isarray/build/build.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/build/build.js index ec58596aeebe4e..e1856ef0943728 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/isarray/build/build.js +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/build/build.js @@ -206,4 +206,3 @@ module.exports = Array.isArray || function (arr) { }); require.alias("isarray/index.js", "isarray/index.js"); - diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/component.json b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/component.json similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/isarray/component.json rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/component.json diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/index.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/index.js similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/isarray/index.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/index.js diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/package.json similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/isarray/package.json rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/isarray/package.json diff --git a/deps/npm/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/string_decoder/.npmignore similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/string_decoder/.npmignore rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/string_decoder/.npmignore diff --git a/deps/npm/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/string_decoder/LICENSE similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/string_decoder/LICENSE rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/string_decoder/LICENSE diff --git a/deps/npm/node_modules/readable-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/string_decoder/README.md similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/string_decoder/README.md rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/string_decoder/README.md diff --git a/deps/npm/node_modules/readable-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/string_decoder/index.js similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/string_decoder/index.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/string_decoder/index.js diff --git a/deps/npm/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/string_decoder/package.json similarity index 100% rename from deps/npm/node_modules/readable-stream/node_modules/string_decoder/package.json rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/string_decoder/package.json diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/package.json b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/package.json new file mode 100644 index 00000000000000..5e945ce1121c8c --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/package.json @@ -0,0 +1,46 @@ +{ + "name": "readable-stream", + "version": "1.1.13", + "description": "Streams3, a user-land copy of the stream library from Node.js v0.11.x", + "main": "readable.js", + "dependencies": { + "core-util-is": "~1.0.0", + "isarray": "0.0.1", + "string_decoder": "~0.10.x", + "inherits": "~2.0.1" + }, + "devDependencies": { + "tap": "~0.2.6" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/isaacs/readable-stream.git" + }, + "keywords": [ + "readable", + "stream", + "pipe" + ], + "browser": { + "util": false + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "MIT", + "readme": "# readable-stream\n\n***Node-core streams for userland***\n\n[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)\n[![NPM](https://nodei.co/npm-dl/readable-stream.png&months=6&height=3)](https://nodei.co/npm/readable-stream/)\n\nThis package is a mirror of the Streams2 and Streams3 implementations in Node-core.\n\nIf you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *\"stream\"* module in Node-core.\n\n**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12.\n\n**readable-stream** uses proper patch-level versioning so if you pin to `\"~1.0.0\"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `\"~1.1.0\"`\n\n", + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/readable-stream/issues" + }, + "homepage": "https://github.com/isaacs/readable-stream#readme", + "_id": "readable-stream@1.1.13", + "_shasum": "f6eef764f514c89e2b9e23146a75ba106756d23e", + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz", + "_from": "readable-stream@>=1.1.13 <2.0.0" +} diff --git a/deps/npm/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/passthrough.js similarity index 100% rename from deps/npm/node_modules/readable-stream/passthrough.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/passthrough.js diff --git a/deps/npm/node_modules/readable-stream/readable.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/readable.js similarity index 100% rename from deps/npm/node_modules/readable-stream/readable.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/readable.js diff --git a/deps/npm/node_modules/readable-stream/transform.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/transform.js similarity index 100% rename from deps/npm/node_modules/readable-stream/transform.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/transform.js diff --git a/deps/npm/node_modules/readable-stream/writable.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/writable.js similarity index 100% rename from deps/npm/node_modules/readable-stream/writable.js rename to deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/writable.js diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js index a64e121c03a1f1..f97e1034ff9e07 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js @@ -49,7 +49,7 @@ test("TrackerGroup", function (t) { t.is(er, null, "finishAll: on change event fired") t.is(onChangeName, name, "finishAll: on change emits the correct name") t.is(track.completed(), 1, "Finishing everything ") - + track = new TrackerGroup(name) a = track.newItem("a", 10, 2) b = track.newItem("b", 10, 1) @@ -68,7 +68,7 @@ test("TrackerGroup", function (t) { t.is(er, null, "weightedFinishAll: on change event fired") t.is(onChangeName, name, "weightedFinishAll: on change emits the correct name") t.is(track.completed(), 1, "weightedFinishaAll: Finishing everything ") - + track = new TrackerGroup(name) a = track.newGroup("a", 10) b = track.newGroup("b", 10) diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/README.md index fb9eb0a7d1e125..ca0a8cd773d6d2 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/README.md +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/README.md @@ -30,6 +30,11 @@ gauge.hide() Constructs a new gauge. Gauges are drawn on a single line, and are not drawn if the current terminal isn't a tty. +If you resize your terminal in a way that can be detected then the gauge +will be drawn at the new size. As a general rule, growing your terminal will +be clean, but shrinking your terminal will result in cruft as we don't have +enough information to know where what we wrote previously is now located. + The **options** object can have the following properties, all of which are optional: @@ -117,7 +122,7 @@ will be turned into the gauge line. The default template is: ```javascript [ - {type: "name", separated: true, maxLength: 25, minWidth: 25, align: "left"}, + {type: "name", separated: true, maxLength: 25, minLength: 25, align: "left"}, {type: "spinner", separated: true}, {type: "startgroup"}, {type: "completionbar"}, @@ -131,7 +136,7 @@ be be included verbatum in the output. If the template element is an object, it can have the following keys: * *type* can be: - * `name` – The most recent name passed to `show`; if this is in response to a + * `name` – The most recent name passed to `show`; if this is in response to a `pulse` then the name passed to `pulse` will be appended along with the subsection property from the theme. * `spinner` – If you've ever called `pulse` this will be one of the characters @@ -148,7 +153,7 @@ If the template element is an object, it can have the following keys: will be padded according to the *align* value. * *align* – (Default: left) Possible values "left", "right" and "center". Works as you'd expect from word processors. -* *length* – Provides a single value for both *minLength* and *maxLength*. If both +* *length* – Provides a single value for both *minLength* and *maxLength*. If both *length* and *minLength or *maxLength* are specifed then the latter take precedence. ### Tracking Completion diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/npmlog/node_modules/gauge/node_modules/lodash._basetostring/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/README.md index ad04ea956e4d20..f81145e6ebe765 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/README.md +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/README.md @@ -1,4 +1,4 @@ -# lodash._basetostring v3.0.0 +# lodash._basetostring v3.0.1 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseToString` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var baseToString = require('lodash._basetostring'); ``` -See the [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash._basetostring) for more details. +See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basetostring) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/index.js index 71ac885889b9e6..db8ecc9fdd0094 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/index.js +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/index.js @@ -1,14 +1,14 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.0.1 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ /** - * Converts `value` to a string if it is not one. An empty string is returned + * Converts `value` to a string if it's not one. An empty string is returned * for `null` or `undefined` values. * * @private @@ -16,9 +16,6 @@ * @returns {string} Returns the string. */ function baseToString(value) { - if (typeof value == 'string') { - return value; - } return value == null ? '' : (value + ''); } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/package.json index dfb815b75772c1..d89bde9d071ea7 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._basetostring/package.json @@ -1,6 +1,6 @@ { "name": "lodash._basetostring", - "version": "3.0.0", + "version": "3.0.1", "description": "The modern build of lodash’s internal `baseToString` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -47,11 +47,11 @@ "bugs": { "url": "https://github.com/lodash/lodash/issues" }, - "_id": "lodash._basetostring@3.0.0", - "_shasum": "75a9a4aaaa2b2a8761111ff5431e7d83c1daf0e2", - "_from": "lodash._basetostring@3.0.0", - "_npmVersion": "2.3.0", - "_nodeVersion": "0.10.35", + "_id": "lodash._basetostring@3.0.1", + "_shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5", + "_from": "lodash._basetostring@3.0.1", + "_npmVersion": "2.12.0", + "_nodeVersion": "0.12.5", "_npmUser": { "name": "jdalton", "email": "john.david.dalton@gmail.com" @@ -60,13 +60,29 @@ { "name": "jdalton", "email": "john.david.dalton@gmail.com" + }, + { + "name": "d10", + "email": "demoneaux@gmail.com" + }, + { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" } ], "dist": { - "shasum": "75a9a4aaaa2b2a8761111ff5431e7d83c1daf0e2", - "tarball": "http://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.0.tgz" + "shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5", + "tarball": "http://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.0.tgz", + "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/npmlog/node_modules/gauge/node_modules/lodash._createpadding/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/README.md index 0e1c73128ce792..f9c9411c70412e 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/README.md +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/README.md @@ -1,4 +1,4 @@ -# lodash._createpadding v3.6.0 +# lodash._createpadding v3.6.1 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createPadding` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var createPadding = require('lodash._createpadding'); ``` -See the [package source](https://github.com/lodash/lodash/blob/3.6.0-npm-packages/lodash._createpadding) for more details. +See the [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash._createpadding) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/index.js index 72890bd2d8f4cf..3541a8aae32935 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/index.js +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/index.js @@ -1,18 +1,16 @@ /** - * lodash 3.6.0 (Custom Build) + * lodash 3.6.1 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var repeat = require('lodash.repeat'); -/** Native method references. */ -var ceil = Math.ceil; - /* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsFinite = global.isFinite; +var nativeCeil = Math.ceil, + nativeIsFinite = global.isFinite; /** * Creates the padding required for `string` based on the given `length`. @@ -33,7 +31,7 @@ function createPadding(string, length, chars) { } var padLength = length - strLength; chars = chars == null ? ' ' : (chars + ''); - return repeat(chars, ceil(padLength / chars.length)).slice(0, padLength); + return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength); } module.exports = createPadding; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md index d2796e3f739a4f..dec571a333a52a 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md @@ -1,4 +1,4 @@ -# lodash.repeat v3.0.0 +# lodash.repeat v3.0.1 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.repeat` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var repeat = require('lodash.repeat'); ``` -See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.0.0-npm-packages/lodash.repeat) for more details. +See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.repeat) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js index 68e100813461a4..367913f56e0ada 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js @@ -1,18 +1,16 @@ /** - * lodash 3.0.0 (Custom Build) + * lodash 3.0.1 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.7.0 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseToString = require('lodash._basetostring'); -/** Native method references. */ -var floor = Math.floor; - /* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsFinite = global.isFinite; +var nativeFloor = Math.floor, + nativeIsFinite = global.isFinite; /** * Repeats the given string `n` times. @@ -47,7 +45,7 @@ function repeat(string, n) { if (n % 2) { result += string; } - n = floor(n / 2); + n = nativeFloor(n / 2); string += string; } while (n); diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json index de5156da130dc2..f941138c4bfdcf 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json @@ -1,6 +1,6 @@ { "name": "lodash.repeat", - "version": "3.0.0", + "version": "3.0.1", "description": "The modern build of lodash’s `_.repeat` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -56,11 +56,11 @@ "bugs": { "url": "https://github.com/lodash/lodash/issues" }, - "_id": "lodash.repeat@3.0.0", - "_shasum": "c340f4136c99dc5b2e397b3fd50cffbd172a94b0", + "_id": "lodash.repeat@3.0.1", + "_shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf", "_from": "lodash.repeat@>=3.0.0 <4.0.0", - "_npmVersion": "2.3.0", - "_nodeVersion": "0.10.35", + "_npmVersion": "2.12.0", + "_nodeVersion": "0.12.5", "_npmUser": { "name": "jdalton", "email": "john.david.dalton@gmail.com" @@ -69,13 +69,29 @@ { "name": "jdalton", "email": "john.david.dalton@gmail.com" + }, + { + "name": "d10", + "email": "demoneaux@gmail.com" + }, + { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" } ], "dist": { - "shasum": "c340f4136c99dc5b2e397b3fd50cffbd172a94b0", - "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.0.tgz" + "shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf", + "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.0.tgz", + "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/package.json index ffe797253ae925..945409f3e1c152 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash._createpadding/package.json @@ -1,6 +1,6 @@ { "name": "lodash._createpadding", - "version": "3.6.0", + "version": "3.6.1", "description": "The modern build of lodash’s internal `createPadding` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -50,11 +50,11 @@ "bugs": { "url": "https://github.com/lodash/lodash/issues" }, - "_id": "lodash._createpadding@3.6.0", - "_shasum": "c466850dd1a05e6bfec54fd0cf0db28b68332d5e", - "_from": "lodash._createpadding@3.6.0", - "_npmVersion": "2.7.3", - "_nodeVersion": "0.12.0", + "_id": "lodash._createpadding@3.6.1", + "_shasum": "4907b438595adc54ee8935527a6c424c02c81a87", + "_from": "lodash._createpadding@3.6.1", + "_npmVersion": "2.12.0", + "_nodeVersion": "0.12.5", "_npmUser": { "name": "jdalton", "email": "john.david.dalton@gmail.com" @@ -63,13 +63,29 @@ { "name": "jdalton", "email": "john.david.dalton@gmail.com" + }, + { + "name": "d10", + "email": "demoneaux@gmail.com" + }, + { + "name": "kitcambridge", + "email": "github@kitcambridge.be" + }, + { + "name": "mathias", + "email": "mathias@qiwi.be" + }, + { + "name": "phated", + "email": "blaine@iceddev.com" } ], "dist": { - "shasum": "c466850dd1a05e6bfec54fd0cf0db28b68332d5e", - "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.0.tgz" + "shasum": "4907b438595adc54ee8935527a6c424c02c81a87", + "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.0.tgz", + "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE new file mode 100644 index 00000000000000..9cd87e5dcefe58 --- /dev/null +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE @@ -0,0 +1,22 @@ +Copyright 2012-2015 The Dojo Foundation +Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas, +DocumentCloud and Investigative Reporters & Editors + +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/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md index 9b4891cd8c6f41..456d23ddf0c968 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md @@ -1,4 +1,4 @@ -# lodash.pad v3.1.0 +# lodash.pad v3.1.1 The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.pad` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module. @@ -17,4 +17,4 @@ In Node.js/io.js: var pad = require('lodash.pad'); ``` -See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/3.1.0-npm-packages/lodash.pad) for more details. +See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/3.1.1-npm-packages/lodash.pad) for more details. diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js index d08251ba5939ee..a29ccea9ca189d 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js @@ -1,23 +1,21 @@ /** - * lodash 3.1.0 (Custom Build) + * lodash 3.1.1 (Custom Build) * Build: `lodash modern modularize exports="npm" -o ./` * Copyright 2012-2015 The Dojo Foundation - * Based on Underscore.js 1.8.2 + * Based on Underscore.js 1.8.3 * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors * Available under MIT license */ var baseToString = require('lodash._basetostring'), createPadding = require('lodash._createpadding'); -/** Native method references. */ -var ceil = Math.ceil, - floor = Math.floor; - /* Native method references for those with the same name as other `lodash` methods. */ -var nativeIsFinite = global.isFinite; +var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeIsFinite = global.isFinite; /** - * Pads `string` on the left and right sides if it is shorter than `length`. + * Pads `string` on the left and right sides if it's shorter than `length`. * Padding characters are truncated if they can't be evenly divided by `length`. * * @static @@ -47,8 +45,8 @@ function pad(string, length, chars) { return string; } var mid = (length - strLength) / 2, - leftLength = floor(mid), - rightLength = ceil(mid); + leftLength = nativeFloor(mid), + rightLength = nativeCeil(mid); chars = createPadding('', rightLength, chars); return chars.slice(0, leftLength) + string + chars; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json index 6f028c0cc622d8..c18ed47167af3a 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json @@ -1,6 +1,6 @@ { "name": "lodash.pad", - "version": "3.1.0", + "version": "3.1.1", "description": "The modern build of lodash’s `_.pad` as a module.", "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -57,11 +57,11 @@ "bugs": { "url": "https://github.com/lodash/lodash/issues" }, - "_id": "lodash.pad@3.1.0", - "_shasum": "9f18b1f3749a95e197b5ff2ae752ea9851ada965", + "_id": "lodash.pad@3.1.1", + "_shasum": "2e078ebc33b331d2ba34bf8732af129fd5c04624", "_from": "lodash.pad@>=3.0.0 <4.0.0", - "_npmVersion": "2.7.3", - "_nodeVersion": "0.12.0", + "_npmVersion": "2.12.0", + "_nodeVersion": "0.12.5", "_npmUser": { "name": "jdalton", "email": "john.david.dalton@gmail.com" @@ -89,10 +89,10 @@ } ], "dist": { - "shasum": "9f18b1f3749a95e197b5ff2ae752ea9851ada965", - "tarball": "http://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.0.tgz" + "shasum": "2e078ebc33b331d2ba34bf8732af129fd5c04624", + "tarball": "http://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.0.tgz", + "_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/package.json index 227173e6401edd..d16cc33df97528 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/package.json @@ -1,6 +1,6 @@ { "name": "gauge", - "version": "1.2.0", + "version": "1.2.2", "description": "A terminal based horizontal guage", "main": "progress-bar.js", "scripts": { @@ -34,27 +34,27 @@ "devDependencies": { "tap": "^0.4.13" }, - "gitHead": "db15c35374816b3fc3b9e1e54866f31ed7f4a733", - "_id": "gauge@1.2.0", - "_shasum": "3094ab1285633f799814388fc8f2de67b4c012c5", + "gitHead": "9f7eeeeed3b74a70f30b721d570435f6ffbc0168", + "_id": "gauge@1.2.2", + "_shasum": "05b6730a19a8fcad3c340a142f0945222a3f815b", "_from": "gauge@>=1.2.0 <1.3.0", - "_npmVersion": "2.6.0", - "_nodeVersion": "1.1.0", + "_npmVersion": "3.1.0", + "_nodeVersion": "0.10.38", "_npmUser": { "name": "iarna", "email": "me@re-becca.org" }, + "dist": { + "shasum": "05b6730a19a8fcad3c340a142f0945222a3f815b", + "tarball": "http://registry.npmjs.org/gauge/-/gauge-1.2.2.tgz" + }, "maintainers": [ { "name": "iarna", "email": "me@re-becca.org" } ], - "dist": { - "shasum": "3094ab1285633f799814388fc8f2de67b4c012c5", - "tarball": "http://registry.npmjs.org/gauge/-/gauge-1.2.0.tgz" - }, "directories": {}, - "_resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.0.tgz", + "_resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.2.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js b/deps/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js index 39dbf2ac43dd9a..16bdadc5103eee 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js @@ -11,8 +11,10 @@ function isTTY() { return process.stderr.isTTY } function getWritableTTYColumns() { - // One less than the actual as writing to the final column wraps the line - return process.stderr.columns - 1 + // Writing to the final column wraps the line + // We have to use stdout here, because Node's magic SIGWINCH handler only + // updates process.stdout, not process.stderr + return process.stdout.columns - 1 } var ProgressBar = module.exports = function (options, cursor) { @@ -39,6 +41,13 @@ var ProgressBar = module.exports = function (options, cursor) { this.lastCompleted = 0 this.spun = 0 this.last = new Date(0) + + var self = this + this._handleSizeChange = function () { + if (!self.showing) return + self.hide() + self.show() + } } ProgressBar.prototype = {} @@ -68,6 +77,14 @@ ProgressBar.prototype.setTemplate = function(template) { this.template = template } +ProgressBar.prototype._enableResizeEvents = function() { + process.stdout.on('resize', this._handleSizeChange) +} + +ProgressBar.prototype._disableResizeEvents = function() { + process.stdout.removeListener('resize', this._handleSizeChange) +} + ProgressBar.prototype.disable = function() { this.hide() this.disabled = true diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/test/progress-bar.js b/deps/npm/node_modules/npmlog/node_modules/gauge/test/progress-bar.js index 8e2a5ad6438fdd..39939269f5b630 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/test/progress-bar.js +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/test/progress-bar.js @@ -70,7 +70,7 @@ test("hide", function (t) { test("renderTemplate", function (t) { t.plan(16) - process.stderr.columns = 11 + process.stdout.columns = 11 var result = bar.renderTemplate(ProgressBar.ascii,[{type: "name"}],{name: "NAME"}) t.is(result, "NAME", "name substitution") var result = bar.renderTemplate(ProgressBar.ascii,[{type: "completionbar"}],{completed: 0}) @@ -108,7 +108,7 @@ test("renderTemplate", function (t) { test("show & pulse", function (t) { t.plan(23) - process.stderr.columns = 16 + process.stdout.columns = 16 cursor = [] process.stderr.isTTY = false bar.template[0].length = 6 @@ -146,3 +146,31 @@ test("show & pulse", function (t) { [ 'write', 'S -> P | |----|\n' ], [ 'show' ] ]) }) + +test("window resizing", function (t) { + t.plan(16) + process.stderr.isTTY = true + process.stdout.columns = 32 + bar.show("NAME", 0.1) + cursor = [] + bar.last = new Date(0) + bar.pulse() + isOutput(t, "32 columns", + [ [ 'up', 1 ], + [ 'hide' ], + [ 'horizontalAbsolute', 0 ], + [ 'write', 'NAME / |##------------------|\n' ], + [ 'show' ] ]) + + process.stdout.columns = 16 + bar.show("NAME", 0.5) + cursor = [] + bar.last = new Date(0) + bar.pulse() + isOutput(t, "16 columns", + [ [ 'up', 1 ], + [ 'hide' ], + [ 'horizontalAbsolute', 0 ], + [ 'write', 'NAME - |##--|\n' ], + [ 'show' ] ]); +}); diff --git a/deps/npm/node_modules/once/package.json b/deps/npm/node_modules/once/package.json index c85f12ebe1d4fa..3a714c45e4468b 100644 --- a/deps/npm/node_modules/once/package.json +++ b/deps/npm/node_modules/once/package.json @@ -31,30 +31,14 @@ "url": "http://blog.izs.me/" }, "license": "ISC", - "gitHead": "e35eed5a7867574e2bf2260a1ba23970958b22f2", + "readme": "# once\n\nOnly call a function once.\n\n## usage\n\n```javascript\nvar once = require('once')\n\nfunction load (file, cb) {\n cb = once(cb)\n loader.load('file')\n loader.once('load', cb)\n loader.once('error', cb)\n}\n```\n\nOr add to the Function.prototype in a responsible way:\n\n```javascript\n// only has to be done once\nrequire('once').proto()\n\nfunction load (file, cb) {\n cb = cb.once()\n loader.load('file')\n loader.once('load', cb)\n loader.once('error', cb)\n}\n```\n\nIronically, the prototype feature makes this module twice as\ncomplicated as necessary.\n\nTo check whether you function has been called, use `fn.called`. Once the\nfunction is called for the first time the return value of the original\nfunction is saved in `fn.value` and subsequent calls will continue to\nreturn this value.\n\n```javascript\nvar once = require('once')\n\nfunction load (cb) {\n cb = once(cb)\n var stream = createStream()\n stream.once('data', cb)\n stream.once('end', function () {\n if (!cb.called) cb(new Error('not found'))\n })\n}\n```\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/once/issues" }, "homepage": "https://github.com/isaacs/once#readme", "_id": "once@1.3.2", "_shasum": "d8feeca93b039ec1dcdee7741c92bdac5e28081b", - "_from": "once@>=1.3.2 <1.4.0", - "_npmVersion": "2.9.1", - "_nodeVersion": "2.0.0", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "d8feeca93b039ec1dcdee7741c92bdac5e28081b", - "tarball": "http://registry.npmjs.org/once/-/once-1.3.2.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], "_resolved": "https://registry.npmjs.org/once/-/once-1.3.2.tgz", - "readme": "ERROR: No README data found!" + "_from": "once@>=1.3.2 <1.4.0" } diff --git a/deps/npm/node_modules/opener/package.json b/deps/npm/node_modules/opener/package.json index aab02afc15bcb6..7364b919fc083f 100644 --- a/deps/npm/node_modules/opener/package.json +++ b/deps/npm/node_modules/opener/package.json @@ -10,7 +10,7 @@ "license": "WTFPL", "repository": { "type": "git", - "url": "https://github.com/domenic/opener" + "url": "git+https://github.com/domenic/opener.git" }, "main": "opener.js", "bin": { @@ -50,5 +50,6 @@ "tarball": "http://registry.npmjs.org/opener/-/opener-1.4.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/opener/-/opener-1.4.1.tgz" + "_resolved": "https://registry.npmjs.org/opener/-/opener-1.4.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/osenv/node_modules/os-homedir/index.js b/deps/npm/node_modules/osenv/node_modules/os-homedir/index.js index 758ff653df10a9..33066166fe6692 100644 --- a/deps/npm/node_modules/osenv/node_modules/os-homedir/index.js +++ b/deps/npm/node_modules/osenv/node_modules/os-homedir/index.js @@ -15,7 +15,7 @@ function homedir() { } if (process.platform === 'linux') { - return home || (user ? (process.getuid() === 0 ? '/root' : '/home/' + user) : null); + return home || (process.getuid() === 0 ? '/root' : (user ? '/home/' + user : null)); } return home || null; diff --git a/deps/npm/node_modules/osenv/node_modules/os-homedir/package.json b/deps/npm/node_modules/osenv/node_modules/os-homedir/package.json index c9a3b650c0516d..53c8c6e5e62c4d 100644 --- a/deps/npm/node_modules/osenv/node_modules/os-homedir/package.json +++ b/deps/npm/node_modules/osenv/node_modules/os-homedir/package.json @@ -1,6 +1,6 @@ { "name": "os-homedir", - "version": "1.0.0", + "version": "1.0.1", "description": "io.js 2.3.0 os.homedir() ponyfill", "license": "MIT", "repository": { @@ -40,31 +40,14 @@ "ava": "0.0.4", "path-exists": "^1.0.0" }, - "gitHead": "7e39e2e049de404f06233fa617ecf46fed997a78", + "readme": "# os-homedir [![Build Status](https://travis-ci.org/sindresorhus/os-homedir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-homedir)\n\n> io.js 2.3.0 [`os.homedir()`](https://iojs.org/api/os.html#os_os_homedir) ponyfill\n\n> Ponyfill: A polyfill that doesn't overwrite the native method\n\n\n## Install\n\n```\n$ npm install --save os-homedir\n```\n\n\n## Usage\n\n```js\nvar osHomedir = require('os-homedir');\n\nconsole.log(osHomedir());\n//=> /Users/sindresorhus\n```\n\n\n## Related\n\n- [user-home](https://github.com/sindresorhus/user-home) - Same as this module but caches the result\n- [home-or-tmp](https://github.com/sindresorhus/home-or-tmp) - Get the user home directory with fallback to the system temp directory\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", "bugs": { "url": "https://github.com/sindresorhus/os-homedir/issues" }, - "homepage": "https://github.com/sindresorhus/os-homedir", - "_id": "os-homedir@1.0.0", - "_shasum": "e37078bc61b5869063053897257e39ec1261b702", - "_from": "os-homedir@>=1.0.0 <2.0.0", - "_npmVersion": "2.11.1", - "_nodeVersion": "2.3.0", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "e37078bc61b5869063053897257e39ec1261b702", - "tarball": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.0.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "homepage": "https://github.com/sindresorhus/os-homedir#readme", + "_id": "os-homedir@1.0.1", + "_shasum": "0d62bdf44b916fd3bbdcf2cab191948fb094f007", + "_resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", + "_from": "os-homedir@>=1.0.0 <2.0.0" } diff --git a/deps/npm/node_modules/osenv/node_modules/os-tmpdir/package.json b/deps/npm/node_modules/osenv/node_modules/os-tmpdir/package.json index f8b2682bf83cfe..071ea5ec83fa23 100644 --- a/deps/npm/node_modules/osenv/node_modules/os-tmpdir/package.json +++ b/deps/npm/node_modules/osenv/node_modules/os-tmpdir/package.json @@ -5,7 +5,7 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/sindresorhus/os-tmpdir" + "url": "git+https://github.com/sindresorhus/os-tmpdir.git" }, "author": { "name": "Sindre Sorhus", @@ -40,30 +40,14 @@ "devDependencies": { "ava": "0.0.4" }, - "gitHead": "5c5d355f81378980db629d60128ad03e02b1c1e5", + "readme": "# os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir)\n\n> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) ponyfill\n\n> Ponyfill: A polyfill that doesn't overwrite the native method\n\nUse this instead of `require('os').tmpdir()` to get a consistent behaviour on different Node.js versions (even 0.8).\n\n*This is actually taken from io.js 2.0.2 as it contains some fixes that haven't bubbled up to Node.js yet.*\n\n\n## Install\n\n```\n$ npm install --save os-tmpdir\n```\n\n\n## Usage\n\n```js\nvar osTmpdir = require('os-tmpdir');\n\nosTmpdir();\n//=> /var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T\n```\n\n\n## API\n\nSee the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir).\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", "bugs": { "url": "https://github.com/sindresorhus/os-tmpdir/issues" }, - "homepage": "https://github.com/sindresorhus/os-tmpdir", + "homepage": "https://github.com/sindresorhus/os-tmpdir#readme", "_id": "os-tmpdir@1.0.1", "_shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e", - "_from": "os-tmpdir@>=1.0.0 <2.0.0", - "_npmVersion": "2.9.1", - "_nodeVersion": "0.12.3", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e", - "tarball": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz" + "_resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz", + "_from": "os-tmpdir@>=1.0.0 <2.0.0" } diff --git a/deps/npm/node_modules/osenv/package.json b/deps/npm/node_modules/osenv/package.json index d5718bdb1111ab..ac0c03cda62409 100644 --- a/deps/npm/node_modules/osenv/package.json +++ b/deps/npm/node_modules/osenv/package.json @@ -35,41 +35,14 @@ }, "license": "ISC", "description": "Look up environment settings specific to different operating systems", - "gitHead": "f746b3405d8f9e28054d11b97e1436f6a15016c4", + "readme": "# osenv\n\nLook up environment settings specific to different operating systems.\n\n## Usage\n\n```javascript\nvar osenv = require('osenv')\nvar path = osenv.path()\nvar user = osenv.user()\n// etc.\n\n// Some things are not reliably in the env, and have a fallback command:\nvar h = osenv.hostname(function (er, hostname) {\n h = hostname\n})\n// This will still cause it to be memoized, so calling osenv.hostname()\n// is now an immediate operation.\n\n// You can always send a cb, which will get called in the nextTick\n// if it's been memoized, or wait for the fallback data if it wasn't\n// found in the environment.\nosenv.hostname(function (er, hostname) {\n if (er) console.error('error looking up hostname')\n else console.log('this machine calls itself %s', hostname)\n})\n```\n\n## osenv.hostname()\n\nThe machine name. Calls `hostname` if not found.\n\n## osenv.user()\n\nThe currently logged-in user. Calls `whoami` if not found.\n\n## osenv.prompt()\n\nEither PS1 on unix, or PROMPT on Windows.\n\n## osenv.tmpdir()\n\nThe place where temporary files should be created.\n\n## osenv.home()\n\nNo place like it.\n\n## osenv.path()\n\nAn array of the places that the operating system will search for\nexecutables.\n\n## osenv.editor() \n\nReturn the executable name of the editor program. This uses the EDITOR\nand VISUAL environment variables, and falls back to `vi` on Unix, or\n`notepad.exe` on Windows.\n\n## osenv.shell()\n\nThe SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash'\nor 'cmd'.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/npm/osenv/issues" }, "homepage": "https://github.com/npm/osenv#readme", "_id": "osenv@0.1.3", "_shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217", - "_from": "osenv@0.1.3", - "_npmVersion": "3.0.0", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "83cf05c6d6458fc4d5ac6362ea325d92f2754217", - "tarball": "http://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - }, - { - "name": "robertkowalski", - "email": "rok@kowalski.gd" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - { - "name": "iarna", - "email": "me@re-becca.org" - } - ], - "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz" + "_resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.3.tgz", + "_from": "osenv@>=0.1.3 <0.2.0" } diff --git a/deps/npm/node_modules/path-is-inside/package.json b/deps/npm/node_modules/path-is-inside/package.json index b96d6fea0e8b92..deced257898031 100644 --- a/deps/npm/node_modules/path-is-inside/package.json +++ b/deps/npm/node_modules/path-is-inside/package.json @@ -33,11 +33,9 @@ }, "readme": "# Is This Path Inside This Other Path?\n\nIt turns out this question isn't trivial to answer using Node's built-in path APIs. A naive `indexOf`-based solution will fail sometimes on Windows, which is case-insensitive (see e.g. [isaacs/npm#4214][]). You might then think to be clever with `path.resolve`, but you have to be careful to account for situations whether the paths have different drive letters, or else you'll cause bugs like [isaacs/npm#4313][]. And let's not even get started on trailing slashes.\n\nThe **path-is-inside** package will give you a robust, cross-platform way of detecting whether a given path is inside another path.\n\n## Usage\n\nPretty simple. First the path being tested; then the potential parent. Like so:\n\n```js\nvar pathIsInside = require(\"path-is-inside\");\n\npathIsInside(\"/x/y/z\", \"/x/y\") // true\npathIsInside(\"/x/y\", \"/x/y/z\") // false\n```\n\n## OS-Specific Behavior\n\nLike Node's built-in path module, path-is-inside treats all file paths on Windows as case-insensitive, whereas it treats all file paths on *-nix operating systems as case-sensitive. Keep this in mind especially when working on a Mac, where, despite Node's defaults, the OS usually treats paths case-insensitively.\n\nIn practice, this means:\n\n```js\n// On Windows\n\npathIsInside(\"C:\\\\X\\\\Y\\\\Z\", \"C:\\\\x\\\\y\") // true\n\n// On *-nix, including Mac OS X\n\npathIsInside(\"/X/Y/Z\", \"/x/y\") // false\n```\n\n[isaacs/npm#4214]: https://github.com/isaacs/npm/pull/4214\n[isaacs/npm#4313]: https://github.com/isaacs/npm/issues/4313\n", "readmeFilename": "README.md", - "homepage": "https://github.com/domenic/path-is-inside", + "homepage": "https://github.com/domenic/path-is-inside#readme", "_id": "path-is-inside@1.0.1", - "dist": { - "shasum": "c5e6c4764c4cd41f2ac839c53be5621d085726b3" - }, - "_from": "path-is-inside@1.0.1", - "_resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.1.tgz" + "_shasum": "98d8f1d030bf04bd7aeee4a1ba5485d40318fd89", + "_resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.1.tgz", + "_from": "path-is-inside@>=1.0.1 <1.1.0" } diff --git a/deps/npm/node_modules/read-cmd-shim/.npmignore b/deps/npm/node_modules/read-cmd-shim/.npmignore new file mode 100644 index 00000000000000..ac50549639a976 --- /dev/null +++ b/deps/npm/node_modules/read-cmd-shim/.npmignore @@ -0,0 +1,3 @@ +.#* +*~ +node_modules diff --git a/deps/npm/node_modules/read-cmd-shim/README.md b/deps/npm/node_modules/read-cmd-shim/README.md new file mode 100644 index 00000000000000..2f0b5f6cc671e0 --- /dev/null +++ b/deps/npm/node_modules/read-cmd-shim/README.md @@ -0,0 +1,36 @@ +# read-cmd-shim + +Figure out what a [`cmd-shim`](https://github.com/ForbesLindesay/cmd-shim) +is pointing at. This acts as the equivalent of +[`fs.readlink`](https://nodejs.org/api/fs.html#fs_fs_readlink_path_callback). + +### Usage + +``` +var readCmdShim = require('read-cmd-shim') + +readCmdShim('/path/to/shim.cmd', function (er, destination) { + … +}) + +var destination = readCmdShim.sync('/path/to/shim.cmd') + +### readCmdShim(path, callback) + +Reads the `cmd-shim` located at `path` and calls back with the _relative_ +path that the shim points at. Consider this as roughly the equivalent of +`fs.readlink`. + +This can read both `.cmd` style that are run by the Windows Command Prompt +and Powershell, and the kind without any extension that are used by Cygwin. + +This can return errors that `fs.readFile` returns, except that they'll +include a stack trace from where `readCmdShim` was called. Plus it can +return a special `ENOTASHIM` exception, when it can't find a cmd-shim in the +file referenced by `path`. This should only happen if you pass in a +non-command shim. + + +### readCmdShim.sync(path) + +Same as above but synchronous. Errors are thrown. diff --git a/deps/npm/node_modules/read-cmd-shim/index.js b/deps/npm/node_modules/read-cmd-shim/index.js new file mode 100644 index 00000000000000..6a2265449af268 --- /dev/null +++ b/deps/npm/node_modules/read-cmd-shim/index.js @@ -0,0 +1,54 @@ +'use strict' +var fs = require('graceful-fs') + +function extractPath (path, cmdshimContents) { + if (/[.]cmd$/.test(path)) { + return extractPathFromCmd(cmdshimContents) + } else { + return extractPathFromCygwin(cmdshimContents) + } +} + +function extractPathFromCmd (cmdshimContents) { + var matches = cmdshimContents.match(/"%~dp0\\([^"]+?)"\s+%[*]/) + return matches && matches[1] +} + +function extractPathFromCygwin (cmdshimContents) { + var matches = cmdshimContents.match(/"[$]basedir[/]([^"]+?)"\s+"[$]@"/) + return matches && matches[1] +} + +function wrapError (thrown, newError) { + newError.message = thrown.message + newError.code = thrown.code + return newError +} + +function notaShim (path, er) { + if (!er) { + er = new Error() + Error.captureStackTrace(er, notaShim) + } + er.code = 'ENOTASHIM' + er.message = "Can't read shim path from '" + path + "', it doesn't appear to be a cmd-shim" + return er +} + +var readCmdShim = module.exports = function (path, cb) { + var er = new Error() + Error.captureStackTrace(er, readCmdShim) + fs.readFile(path, function (readFileEr, contents) { + if (readFileEr) return cb(wrapError(readFileEr, er)) + var destination = extractPath(path, contents.toString()) + if (destination) return cb(null, destination) + return cb(notaShim(path, er)) + }) +} + +module.exports.sync = function (path) { + var contents = fs.readFileSync(path) + var destination = extractPath(path, contents.toString()) + if (!destination) throw notaShim(path) + return destination +} diff --git a/deps/npm/node_modules/read-cmd-shim/package.json b/deps/npm/node_modules/read-cmd-shim/package.json new file mode 100644 index 00000000000000..04f8addc4d9bb9 --- /dev/null +++ b/deps/npm/node_modules/read-cmd-shim/package.json @@ -0,0 +1,54 @@ +{ + "name": "read-cmd-shim", + "version": "1.0.1", + "description": "Figure out what a cmd-shim is pointing at. This acts as the equivalent of fs.readlink.", + "main": "index.js", + "dependencies": { + "graceful-fs": "^4.1.2" + }, + "devDependencies": { + "cmd-shim": "^2.0.1", + "rimraf": "^2.4.3", + "standard": "^5.2.2", + "tap": "^1.4.1" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/read-cmd-shim.git" + }, + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/read-cmd-shim/issues" + }, + "homepage": "https://github.com/npm/read-cmd-shim#readme", + "gitHead": "7c50879bf49743a1c69f9d7f0ba1638fc46bb40c", + "_id": "read-cmd-shim@1.0.1", + "_shasum": "2d5d157786a37c055d22077c32c53f8329e91c7b", + "_from": "read-cmd-shim@>=1.0.1 <1.1.0", + "_npmVersion": "3.3.0", + "_nodeVersion": "3.1.0", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "2d5d157786a37c055d22077c32c53f8329e91c7b", + "tarball": "http://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-1.0.1.tgz" +} diff --git a/deps/npm/node_modules/read-cmd-shim/test/integration.js b/deps/npm/node_modules/read-cmd-shim/test/integration.js new file mode 100644 index 00000000000000..269f964727cd6b --- /dev/null +++ b/deps/npm/node_modules/read-cmd-shim/test/integration.js @@ -0,0 +1,139 @@ +'use strict' +var path = require('path') +var fs = require('graceful-fs') +var test = require('tap').test +var rimraf = require('rimraf') +var cmdShim = require('cmd-shim') +var readCmdShim = require('../index.js') +var workDir = path.join(__dirname, path.basename(__filename, '.js')) +var testShbang = path.join(workDir, 'test-shbang') +var testShbangCmd = testShbang + '.cmd' +var testShim = path.join(workDir, 'test') +var testShimCmd = testShim + '.cmd' + +test('setup', function (t) { + rimraf.sync(workDir) + fs.mkdirSync(workDir) + fs.writeFileSync(testShbang + '.js', '#!/usr/bin/env node\ntrue') + cmdShim(__filename, testShim, function (er) { + t.error(er) + cmdShim(testShbang + '.js', testShbang, function (er) { + t.error(er) + t.done() + }) + }) +}) + +test('async-read-no-shbang', function (t) { + t.plan(2) + readCmdShim(testShimCmd, function (er, dest) { + t.error(er) + t.is(dest, '..\\basic.js') + t.done() + }) +}) + +test('sync-read-no-shbang', function (t) { + t.plan(1) + var dest = readCmdShim.sync(testShimCmd) + t.is(dest, '..\\basic.js') + t.done() +}) + +test('async-read-shbang', function (t) { + t.plan(2) + readCmdShim(testShbangCmd, function (er, dest) { + t.error(er) + t.is(dest, 'test-shbang.js') + t.done() + }) +}) + +test('sync-read-shbang', function (t) { + t.plan(1) + var dest = readCmdShim.sync(testShbangCmd) + t.is(dest, 'test-shbang.js') + t.done() +}) + +test('async-read-no-shbang-cygwin', function (t) { + t.plan(2) + readCmdShim(testShim, function (er, dest) { + t.error(er) + t.is(dest, '../basic.js') + t.done() + }) +}) + +test('sync-read-no-shbang-cygwin', function (t) { + t.plan(1) + var dest = readCmdShim.sync(testShim) + t.is(dest, '../basic.js') + t.done() +}) + +test('async-read-shbang-cygwin', function (t) { + t.plan(2) + readCmdShim(testShbang, function (er, dest) { + t.error(er) + t.is(dest, 'test-shbang.js') + t.done() + }) +}) + +test('sync-read-shbang-cygwin', function (t) { + t.plan(1) + var dest = readCmdShim.sync(testShbang) + t.is(dest, 'test-shbang.js') + t.done() +}) + +test('async-read-dir', function (t) { + t.plan(2) + readCmdShim(workDir, function (er) { + t.ok(er) + t.is(er.code, 'EISDIR', "cmd-shims can't be directories") + t.done() + }) +}) + +test('sync-read-dir', function (t) { + t.plan(1) + t.throws(function () { readCmdShim.sync(workDir) }, "cmd-shims can't be directories") + t.done() +}) + +test('async-read-not-there', function (t) { + t.plan(2) + readCmdShim('/path/to/nowhere', function (er, dest) { + t.ok(er, 'missing files throw errors') + t.is(er.code, 'ENOENT', "cmd-shim file doesn't exist") + t.done() + }) +}) + +test('sync-read-not-there', function (t) { + t.plan(1) + t.throws(function () { readCmdShim.sync('/path/to/nowhere') }, "cmd-shim file doesn't exist") + t.done() +}) + +test('async-read-not-shim', function (t) { + t.plan(2) + readCmdShim(__filename, function (er, dest) { + t.ok(er) + t.is(er.code, 'ENOTASHIM', 'shim file specified is not a shim') + t.done() + }) +}) + +test('sync-read-not-shim', function (t) { + t.plan(1) + t.throws(function () { readCmdShim.sync(__filename) }, 'shim file specified is not a shim') + t.done() +}) + +test('cleanup', function (t) { + rimraf.sync(workDir) + t.done() +}) diff --git a/deps/npm/node_modules/read-installed/package.json b/deps/npm/node_modules/read-installed/package.json index b1b3c5fa5a9fbc..76977474cddf21 100644 --- a/deps/npm/node_modules/read-installed/package.json +++ b/deps/npm/node_modules/read-installed/package.json @@ -33,8 +33,6 @@ "rimraf": "^2.2.8", "tap": "^1.2.0" }, - "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": "da02df6acdb5f5ee31d8c637ef31fb50efb455c1", "bugs": { "url": "https://github.com/isaacs/read-installed/issues" @@ -42,5 +40,35 @@ "homepage": "https://github.com/isaacs/read-installed#readme", "_id": "read-installed@4.0.3", "_shasum": "ff9b8b67f187d1e4c29b9feb31f6b223acd19067", - "_from": "read-installed@4.0.3" + "_from": "read-installed@>=4.0.3 <4.1.0", + "_npmVersion": "2.14.3", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "ff9b8b67f187d1e4c29b9feb31f6b223acd19067", + "tarball": "http://registry.npmjs.org/read-installed/-/read-installed-4.0.3.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/read-installed/-/read-installed-4.0.3.tgz" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE index e637724b3bc595..c3d2eb3550079b 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE @@ -19,4 +19,3 @@ 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-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.editorconfig b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.editorconfig deleted file mode 100644 index 8de2a35e3a2b74..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.editorconfig +++ /dev/null @@ -1,19 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -trim_trailing_whitespace = true -insert_final_newline = true - -[{.,}*.{js,json,json5,yml,yaml}] -indent_style = space -indent_size = 2 - -[*.md] -indent_style = space -indent_size = 4 -trim_trailing_whitespace = false - -[Makefile] -indent_style = tab diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore index b561496c91d48f..5ae40150eea106 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/.npmignore @@ -1,6 +1,9 @@ package.json node_modules -test/external +test +benchmark +docs examples +/.editorconfig /.eslint* /.travis.yml diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md index 85d52a2dcea030..3d61083fb04dd0 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md @@ -240,4 +240,3 @@ JSON.stringify will split this into 15 lines, and it's hard to read. Yet again, this feature comes with a performance hit, so if user experience matters to you more than performance, use this module. If your JSON will be consumed by machines, use JSON.stringify instead. As a rule of thumb, if you use "space" argument to indent your JSON, you'd better use this module instead. - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/benchmark/benchmark.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/benchmark/benchmark.js deleted file mode 100755 index 28a6aad75ad937..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/benchmark/benchmark.js +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env node - -var Benchmark = require('benchmark') -var YAML = require('js-yaml') -var JJU = require('../') -var JSON5 = require('json5') -var suite = new Benchmark.Suite - -var sample -sample = require('fs').readFileSync(__dirname + '/../package.yaml') -sample = YAML.safeLoad(sample) -sample = JSON.stringify(sample) - -var functions = { - 'JSON': function(x) { JSON.parse(x) }, - 'JSON5': function(x) { JSON5.parse(x) }, - 'JJU': function(x) { JJU.parse(x) }, - 'JS-YAML': function(x) { YAML.safeLoad(x) }, -} - -for (var name in functions) { - with ({ fn: functions[name] }) { - suite.add(name, { - onCycle: function onCycle(event) { - process.stdout.write('\r\033[2K - ' + event.target) - }, - fn: function () { - fn(sample) - }, - }) - } -} - -console.log() -suite.on('cycle', function(event) { - console.log('\r\033[2K + ' + String(event.target)) -}) -.run() - -process.on('exit', function() { console.log() }) diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/benchmark/package.json b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/benchmark/package.json deleted file mode 100644 index 7f0dcf08b7209d..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/benchmark/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "benchmarks", - "private": true, - "dependencies": { - "json5": "*", - "js-yaml": "*", - "benchmark": "*" - } -} diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/docs/Grammar.md b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/docs/Grammar.md deleted file mode 100644 index eb7c8bc667fd54..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/docs/Grammar.md +++ /dev/null @@ -1,219 +0,0 @@ - -JSON5 grammar expressed in EBNF form. - -PS: I don't know what is appropriate syntax highlighter for this, so I'm using "modula2" because why not. I also inserted after backslash to preserve syntax highlighting, this character has nothing to do with actual JSON5 syntax and should be ignored. - -```modula2 -json5_text = expression_with_whitespace - -expression_with_whitespace = [white_space] , expression , [white_space] - -expression = literal - | array_literal - | object_literal - -literal = null_literal - | boolean_literal - | signed_numeric_literal - | string_literal - -null_literal = 'null' - -boolean_literal = 'true' - | 'false' - -(* Source Characters *) - -source_character = . - (* any Unicode code unit *) - -line_terminator = - | - | - | - -line_terminator_sequence = - | - | - | - | , - -white_space = white_space_element - | white_space , white_space_element - -white_space_element = white_space_character - | comment - -white_space_character = - | - | - | - | - | - | - -comment = multi_line_comment - | single_line_comment - -multi_line_comment = '/*' , [multi_line_comment_chars] , '*/' - -multi_line_comment_chars = (source_character - '*') , [multi_line_comment_chars] - | '*' , [post_asterisk_comment_chars] - -post_asterisk_comment_chars = (source_character - ('*' | '/')) , [multi_line_comment_chars] - | '*' , [post_asterisk_comment_chars] - -single_line_comment = '//' , [single_line_comment_chars] - -single_line_comment_chars = single_line_comment_char , single_line_comment_chars - -single_line_comment_char = source_character - line_terminator - -(* Character classes *) - -decimal_digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' - -non_zero_digit = decimal_digit - '0' - -hex_digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | 'a' - | 'b' | 'c' | 'd' | 'e' | 'f' | 'A' | 'B' | 'C' | 'D' | 'E' | 'F' - -ascii_letter = ascii_letter_lowercase - | ascii_letter_uppercase - -ascii_letter_lowercase = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' - | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' - | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z' - -ascii_letter_uppercase = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' - | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' - | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z' - -(* Numeric Literals *) - -signed_numeric_literal = '-' , numeric_literal - | '+' , numeric_literal - | numeric_literal - -numeric_literal = decimal_literal - | hex_integer_literal - | non_finite_literal - -non_finite_literal = 'Infinity' - | 'NaN' - -decimal_literal = decimal_integer_literal , '.' , [decimal_digits] , [exponent_part] - | '.' , decimal_digits , [exponent_part] - | decimal_integer_literal , [exponent_part] - -decimal_integer_literal = '0' - | non_zero_digit , [decimal_digits] - -decimal_digits = decimal_digit - | decimal_digits , decimal_digit - -exponent_part = exponent_indicator , signed_integer - -exponent_indicator = 'e' | 'E' - -signed_integer = decimal_digits - | '+' , decimal_digits - | '-' , decimal_digits - -hex_integer_literal = '0x' , hex_digit - | '0X' , hex_digit - | hex_integer_literal , hex_digit - -(* String Literals *) - -string_literal = '"' , [double_string_characters] , '"' - | "'" , [single_string_characters] , "'" - -double_string_characters = double_string_character , [double_string_characters] - -single_string_characters = single_string_character , [single_string_characters] - -double_string_character = source_character - ('"' | '\​' | line_terminator) - | '\​' , escape_sequence - | line_continuation - -single_string_character = source_character - ("'" | '\​' | line_terminator) - | '\​' , escape_sequence - | line_continuation - -line_continuation = '\​' , line_terminator_sequence - -escape_sequence = character_escape_sequence - | '0' - | hex_escape_sequence - | unicode_escape_sequence - -character_escape_sequence = single_escape_character - | non_escape_character - -single_escape_character = '"' | "'" | '\​' | 'b' | 'f' | 'n' | 'r' | 't' | 'v' - -non_escape_character = source_character - (escape_character | line_terminator) - -escape_character = single_escape_character - | decimal_digit - | 'x' - | 'u' - -hex_escape_sequence = 'x' , hex_digit , hex_digit - -unicode_escape_sequence = 'u' , hex_digit , hex_digit , hex_digit , hex_digit - -(* Array Literals *) - -array_literal = '[' , [white_space] , ']' - | '[' , [white_space] , element_list , ']' - | '[' , [white_space] , element_list , ',' , [white_space] , ']' - -element_list = expression , [white_space] - | element_list , ',' , [white_space] , expression , [white_space] - -(* Object Literals *) - -object_literal = '{' , [white_space] , '}' - | '{' , [white_space] , property_name_and_value_list , '}' - | '{' , [white_space] , property_name_and_value_list , ',' , '}' - -property_name_and_value_list = property_assignment , [white_space] - | property_name_and_value_list , [white_space] , ',' , [white_space] , property_assignment , [white_space] - -property_assignment = property_name , [white_space] , ':' , [white_space] , expression - -property_name = identifier_name - | string_literal - | numeric_literal - -identifier_name = identifier_start - | identifier_name , identifier_part - -identifier_start = unicode_letter - | '$' - | '_' - | '\​' , unicode_escape_sequence - -identifier_part = identifier_start - | unicode_combining_mark - | unicode_digit - | unicode_connector_punctuation - | - | - -unicode_letter = ascii_letter - (* + any character in the Unicode categories "Uppercase letter (Lu)", "Lowercase letter (Ll)", "Titlecase letter (Lt)", "Modifier letter (Lm)", "Other letter (Lo)", or "Letter number (Nl)" *) - -unicode_combining_mark = - (* + any character in the Unicode categories "Non-spacing mark (Mn)" or "Combining spacing mark (Mc)" *) - -unicode_digit = decimal_digit - (* + any character in the Unicode category "Decimal number (Nd)" *) - -unicode_connector_punctuation = - (* + any character in the Unicode category "Connector punctuation (Pc)" *) - - -``` diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/docs/JSON5.md b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/docs/JSON5.md deleted file mode 100644 index bbe18a3d8ce213..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/docs/JSON5.md +++ /dev/null @@ -1,50 +0,0 @@ -## JSON5 syntax - -We support slighly modified version of JSON5, see https://groups.google.com/forum/#!topic/json5/3DjClVYI6Wg - -I started from ES5 specification and added a set of additional restrictions on top of ES5 spec. So I'd expect my implementation to be much closer to javascript. It's no longer an extension of json, but a reduction of ecmascript, which was my original intent. - -This JSON5 version is a subset of ES5 language, specification is here: - -http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf - -This is a language that defines data structures only, so following notes/restrictions are applied: - -- Literals (NullLiteral, BooleanLiteral, NumericLiteral, StringLiteral) are allowed. -- Compatibility syntax is not supported, which means octal literals are forbidden. -- ArrayLiterals and allowed, but instead of AssignmentExpressions you can only use other allowed Literals, ArrayLiterals and ObjectLiterals. Elisions are currently not supported. -- ObjectLiterals and allowed, but instead of AssignmentExpressions you can only use other allowed Literals, ArrayLiterals and ObjectLiterals. Setters and getters are forbidden. -- All other primary expressions ("this", Identifier, Expression) are forbidden. -- Two unary expressions ('-' and '+') allowed before NumericLiterals. -- Any data that has a number type can be represented, including +0, -0, +Infinity, -Infinity and NaN. -- "undefined" is forbidden, use null instead if applicable. -- Comments and whitespace are defined according to spec. - -Main authority here is ES5 spec, so strict backward JSON compatibility is not guaranteed. - - -If you're unsure whether a behaviour of this library is a bug or not, you can run this test: - -```javascript -JSON5.parse(String(something)) -``` - -Should always be equal to: - -```javascript -eval('(function(){return ('+String(something)+'\n)\n})()') -``` - -If `something` meets all rules above. Parens and newlines in the example above are carefully placed so comments and another newlines will work properly, so don't look so impressed about that. - - -## Weirdness of JSON5 - -These are the parts that I don't particulary like, but see no good way to fix: - - - no elisions, `[,,,] -> [null,null,null]` - - `[Object], [Circular]` aren't parsed - - no way of nicely representing multiline strings - - unicode property names are way to hard to implement - - Date and other custom objects - - incompatible with YAML (at least comments) diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js index 9b0f9af01cd9e8..39303b0969081c 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js @@ -89,4 +89,3 @@ module.exports.analyze = function analyzeJSON(input, options) { return result } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js index cfab8691fc9aba..af1a01a03d062b 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js @@ -482,4 +482,3 @@ module.exports.Document = Document module.exports.update = function updateJSON(source, new_value, options) { return Document(source, options).update(new_value).toString() } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js index 5f9fe998610d0f..2b7894937862d5 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js @@ -749,4 +749,3 @@ module.exports.tokenize = function tokenizeJSON(input, options) { tokens.data = module.exports.parse(input, options) return tokens } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js index ce89d77ee1f433..754019eac551c1 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js @@ -380,4 +380,3 @@ module.exports.stringify = function stringifyJSON(object, options, _space) { return _stringify(object, options, 0, '') } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js index a8476b6c4630e1..dd4752c73a4078 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js @@ -43,4 +43,3 @@ module.exports.middleware = function() { throw Error('this function is removed, use express-json5 instead') } } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json index ed34885e26881b..f1b467a6ebd039 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.json @@ -1,6 +1,6 @@ { "name": "jju", - "version": "1.2.0", + "version": "1.2.1", "description": "a set of utilities to work with JSON / JSON5 documents", "author": { "name": "Alex Kocharin", @@ -37,12 +37,12 @@ "type": "WTFPL", "url": "http://www.wtfpl.net/txt/copying/" }, - "gitHead": "6f1b2a8321cb0dfcffc50378b3632853cf529671", - "_id": "jju@1.2.0", - "_shasum": "add5b586fec853b44929d78bf94864ab577c02e9", + "gitHead": "8b079c1d03af527ab28a47c7b714d6f888abc53d", + "_id": "jju@1.2.1", + "_shasum": "edf6ec20d5d668c80c2c00cea63f8a9422a4b528", "_from": "jju@>=1.1.0 <2.0.0", "_npmVersion": "2.0.1", - "_nodeVersion": "1.1.1", + "_nodeVersion": "2.2.1", "_npmUser": { "name": "rlidwka", "email": "alex@kocharin.ru" @@ -54,10 +54,10 @@ } ], "dist": { - "shasum": "add5b586fec853b44929d78bf94864ab577c02e9", - "tarball": "http://registry.npmjs.org/jju/-/jju-1.2.0.tgz" + "shasum": "edf6ec20d5d668c80c2c00cea63f8a9422a4b528", + "tarball": "http://registry.npmjs.org/jju/-/jju-1.2.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/jju/-/jju-1.2.0.tgz", + "_resolved": "https://registry.npmjs.org/jju/-/jju-1.2.1.tgz", "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml index cab7b5d0bcad28..4d81c219f19511 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml @@ -3,7 +3,7 @@ # "jju" stands for "json/json5 utils" name: jju -version: 1.2.0 +version: 1.2.1 description: a set of utilities to work with JSON / JSON5 documents author: @@ -43,4 +43,3 @@ publishConfig: license: type: WTFPL url: http://www.wtfpl.net/txt/copying/ - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/portable-json5-tests.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/portable-json5-tests.yaml deleted file mode 100644 index 5bf6ac38fe13bf..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/portable-json5-tests.yaml +++ /dev/null @@ -1,916 +0,0 @@ -# vi:set ts=2 sts=2 sw=2 et: -# -# Copyright (c) JD 2456730 Alex Kocharin -# -# 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 original file is available here: -# https://github.com/rlidwka/jju/tree/master/test/portable-json5-tests.yaml -# -# ---------------------------------------------------------------------------- -# -# Portable JSON5 test suite. -# -# This file contains an actual YAML data and it may include fancy syntax. -# If your platform does not support YAML, you might wish to pre-process it -# using a generic YAML parser. -# - -%YAML 1.2 ---- -# -# "input" is an arbitrary JSON5 you have to parse -# "output" is a normalized JSON you have to compare your result with, -# or !error (null) if your input should result in parser error -# -# Types of tests: -# -# - basic - Tests that every JSON5 parser should pass. -# -# - advanced - Tests that bring close compatibility with javascript. Not -# strictly required, but nice to have for completeness. -# -# - extra - Extra test cases you can follow at your discretion. -# -# Questionable features like elisions go to extra. All valid javascript, but -# invalid json5 also goes to extra. Feel free to ignore this section if you -# want to. Thus, eval(input) is a complete json5 parser, that should pass all -# basic and advanced tests. -# - -# Basic types in minimal form -# --------------------------- - -type-no-data: - type: extra - output: !error - input: '' - -type-null: - type: basic - output: null - input: > - null - -# undefined is not supported, -# null should be used instead -type-no-undefined: - type: extra - output: !error - input: > - undefined - -type-no-raw: - type: extra - output: !error - input: > - foobar - -type-bool-true: - type: basic - output: true - input: > - true - -type-bool-false: - type: basic - output: false - input: > - false - -type-number: - type: basic - output: 0 - input: > - 0 - -type-string: - type: basic - output: "" - input: > - "" - -type-object: - type: basic - output: {} - input: > - {} - -type-array: - type: basic - output: [] - input: > - [] - -# Numbers: special -# ---------------- - -# note: it's hard to test this -# just add `1/x < 0` check in your code somewhere -num-negative-zero: - type: extra - output: -0.0 - input: > - -0 - -num-nan: - type: basic - output: .nan - input: > - NaN - -num-signed-nan: - type: basic - output: .nan - input: > - +NaN - -num-positive-inf: - type: basic - output: +.inf - input: > - Infinity - -num-negative-inf: - type: basic - output: -.inf - input: > - -Infinity - -num-inf-exact-case: - type: extra - output: !error - input: > - INFINITY - -# Numbers: hexadecimal -# -------------------- - -num-hex-zero: - type: basic - output: 0 - input: > - 0x0 - -num-cut-hex: - type: basic - output: !error - input: > - 0x - -num-all-hex: - type: basic - output: 12841684683518 - input: > - 0xBADF00DCAFE - -num-mixed-case: - type: basic - output: 3735928559 - input: > - 0xDeAdBEef - -num-signed-hex: - type: advanced - output: 31 - input: > - +0x1F - -num-negative-hex: - type: advanced - output: -31 - input: > - -0x1f - -num-bad-hex: - type: advanced - output: !error - input: > - 0xBADxF00D - -num-no-hex-float: - type: advanced - output: !error - input: > - 0x12.345 - -# this is not actually an exponent :) -num-hex-exponent: - type: advanced - output: 4836 - input: > - 0x0012e4 - -# Numbers: octal -# -------------- - -# Octals are primarily used in config files -# to set up a file mask (like 0777) -# -# Note: they will have 0o12345 syntax instead -# of 012345 in the ES6, so we'll need to switch -# as well in the future - -num-octal: - type: extra - output: 342391 - input: > - 01234567 - -num-octal-zeroes: - type: extra - output: -24000 - input: > - -000000056700 - -num-bad-octal: - type: extra - output: !error - input: > - 012345678 - -num-no-octal-float: - type: extra - output: !error - input: > - 012.345 - -num-no-octal-exp: - type: extra - output: !error - input: > - 0123e4 - -# Numbers: floating point -# ----------------------- - -num-float: - type: basic - output: 123.456 - input: > - 123.456 - -num-signed-foat: - type: basic - output: -0.00098765 - input: > - -0.00098765 - -num-omit-trailing-mantissa: - type: basic - output: 1234000 - input: > - 1234.e3 - -num-omit-leading-mantissa: - type: advanced - output: -123.4 - input: > - -.1234e3 - -num-bad-float: - type: advanced - output: !error - input: > - 0.12.345 - -num-bad-sum: - type: extra - output: !error - input: > - 0.12+345 - -num-uc-exp: - type: advanced - output: -1230000 - input: > - -123E+4 - -num-float-exp: - type: basic - output: 123000 - input: > - 0.0123e7 - -num-bad-exp: - type: extra - output: !error - input: > - 123e7.3 - -num-bad-char: - type: extra - output: !error - input: > - 123a456 - -num-no-exp: - type: advanced - output: !error - input: > - 123e - -num-zero-exp: - type: advanced - output: -0.0 - input: > - -.00e-0 - -num-dec-base-signed-exp: - type: advanced - output: 0.00000123 - input: > - 1230000E-012 - -# String: quotes -# -------------- - -string-double-quotes: - type: basic - output: foobar - input: > - "foobar" - -string-single-quotes: - type: basic - output: foobar - input: > - 'foobar' - -string-open: - type: basic - output: !error - input: > - "\\\\\\\\\\\\\" - -string-not-open: - type: basic - output: "\\\\\\\\\\\\\\" - input: > - "\\\\\\\\\\\\\\" - -string-continuation: - type: advanced - output: " foo bar " - input: > - " foo \ - bar \ - " - -string-win-continuation: - type: advanced - output: "foobar" - input: "'foo\\\r\nbar'" - -string-win-reverse-continuation: - type: advanced - output: !error - input: "'foo\\\n\rbar'" - -string-unicode-continuation: - type: advanced - output: "foobarbaz" - input: "'foo\\\u2028bar\\\u2029baz'" - -string-multi-bad-continuation: - type: advanced - output: !error - input: > - foo\ - - bar - -string-bad-ending: - type: basic - output: !error - input: "'foo\rbar'" - -string-bad-ending-2028: - type: advanced - output: !error - input: "'foo\u2028bar'" - -string-bad-ending-2029: - type: advanced - output: !error - input: "'foo\u2029bar'" - -string-literal-unicode: - type: advanced - output: "foo\uFEFF\u2030bar\u1234" - input: "'foo\uFEFF\u2030bar\u1234'" - -string-control-char: - type: advanced - output: "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0b\x0c\x0e\x0f" - input: "'\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0b\x0c\x0e\x0f'" - -# String: escape sequences -# ------------------------ - -string-octal-escape: - type: extra - output: "\x1b[1;32mhi\x1b[m??" - input: > - '\033[1;32mhi\033[m\077\077' - -string-octal-two-digits: - type: extra - output: "\n\x1c\x2e\x07890\x01" - input: > - '\12\34\56\78\90\1' - -string-octal-three-digits: - type: extra - output: "\n34.78\xff 0" - input: > - '\01234\5678\377\400' - -string-hex-escape: - type: extra - output: "\x01\x23\xab\xcd\xef" - input: > - "\x01\x23\xab\xCd\xEF" - -# \0 is *not* an octal escape sequence, -# and is allowed even in strict mode -string-zero-point: - type: basic - output: "\0" - input: > - '\0' - -string-escape-double-quotes: - type: basic - output: "\"''" - input: > - "\"'\'" - -string-escape-single-quotes: - type: basic - output: " '\"\" " - input: > - ' \'"\" ' - -string-escape-json-chars: - type: basic - output: "\\\/\b\f\n\r\t" - input: > - "\\\/\b\f\n\r\t" - -# this character was left out of -# json spec for whatever reason -string-escape-slash-v: - type: basic - output: "\v" - input: > - "\v" - -string-unicode-escape: - type: basic - output: "\u0000\uffffx\ufeff\u1234\u9f6a\u2028\uabcd" - input: > - "\u0000\uFFFFx\uFeFf\u1234\u9F6a\u2028\uabcd" - -string-arbitrary-escape: - type: advanced - output: "X12Uqwe\r\tyiopasd\fghjklzc\u000b\b\nm9 " - input: > - '\X12\U\q\w\e\r\t\y\i\o\p\a\s\d\f\g\h\j\k\l\z\c\v\b\n\m\9\ ' - -string-bad-unicode: - type: advanced - output: !error - input: > - '\uEFGH' - -string-incomplete-unicode: - type: advanced - output: !error - input: > - '\u$' - -string-bad-hex: - type: advanced - output: !error - input: > - '\xFG' - -string-incomplete-hex: - type: advanced - output: !error - input: > - '\x$' - -# Object literals -# --------------- - -object-nested: - type: basic - output: {q:{'w':{"e":[1]}}} - input: | - {q:{'w':{"e":[1]}}} - -object-trailing-comma: - type: basic - output: {foo: 'bar'} - input: | - {foo: 'bar',} - -object-leading-comma-style: - type: basic - output: {q: 1,w: 2,e: 3} - input: | - { q: 1 - , w: 2 - , e: 3 - } - -object-incomplete: - type: basic - output: !error - input: | - {q:1,w:2,{} - -object-isnt-array: - type: basic - output: !error - input: | - {1,2} - -object-no-single-comma: - type: basic - output: !error - input: | - {,} - -object-no-elisions: - type: basic - output: !error - input: | - {q:1,,w:2} - -# Objects: keys -# ------------- - -object-singlequoted: - type: basic - output: {q: 1,w: 2,e: 3} - input: | - {'q':1,'w':2,'e':3} - -object-doublequoted: - type: basic - output: {q: 1,w: 2,e: 3} - input: | - {"q":1,"w":2,"e":3} - -object-unquoted: - type: basic - output: {$FOO_bar123: 'baz'} - input: > - {$FOO_bar123: 'baz'} - -object-no-first-digit: - type: advanced - output: !error - input: > - {123foo: bar} - -object-unquoted-unicode: - type: advanced - output: {"\u1f04\u03bb\u03c6\u03b1": baz} - input: "{\u1f04\u03bb\u03c6\u03b1:'baz'}" - -object-unicode-escape-key: - type: advanced - output: {foo: 'bar', "\u1f04\u03bb\u03c6\u03b1": baz, "qwe\u1f04rty": quux} - input: | - {foo:'bar', \u1f04\u03bb\u03c6\u03b1:'baz', qwe\u1f04rty: "quux"} - -object-no-raw-literal: - type: extra - output: !error - input: | - {foo: bar} - -object-bad-literal: - type: advanced - output: !error - input: | - {foo-bar: 123} - -object-no-space-in-key: - type: advanced - output: !error - input: | - {foo bar: 123} - -object-no-comment-in-key: - type: advanced - output: !error - input: | - {foo/*bar*/baz: 123} - -object-float-keys: - type: advanced - output: {'1': 'one', '3.1415': 'pi'} - input: | - {1:'one', 3.1415:'pi'} - -object-no-negative: - type: advanced - output: !error - input: | - {-5: 123} - -object-exponent-keys: - type: advanced - output: {'1': 'exp', '1000': 'pos', '0.001': 'neg'} - input: | - {1e0: 'exp', 1e+3: 'pos', 1e-3: 'neg'} - -object-octal-keys: - type: extra - output: {'668': 1} - input: | - {01234: 1} - -object-hex-keys: - type: advanced - output: {'51966': 1} - input: | - {0xCAFE: 1} - -object-null-keys: - type: basic - output: {'null': null} - input: | - {null: null} - -object-no-array-keys: - type: extra - output: !error - input: | - {[]: 123} - -object-no-empty-keys: - type: basic - output: !error - input: | - {: 123} - -object-empty-string-key: - type: basic - output: {s: {'': 1}, m: {'': 2}} - input: | - {s: {'': 1}, m: {"": 2}} - -object-bad-unicode-space: - type: advanced - output: !error - input: | - { \u0020foobar: 123 } - -object-bad-unicode-dash: - type: advanced - output: !error - input: | - { foo\u002dbar: 123} - -object-incomplete-unicode-sequence: - type: advanced - output: !error - input: | - { foo\u12f: 123 } - -object-double-escape: - type: advanced - output: !error - input: | - { foo\\u1234bar: 123 } - -object-we-arent-es3: - type: basic - output: {new: 1, delete: 2, throw: 3} - input: | - {new: 1, delete: 2, throw: 3} - -object-last-digits: - type: basic - output: {$123e2: 1, abc123: 2} - input: | - {$123e2: 1, abc123: 2} - -object-unicode-in-string: - type: advanced - output: {"\uff13qwe": 123} - input: | - {"\uff13qwe": 123} - -object-unicode-esc-in-string: - type: advanced - output: {"\\uff13qwe": 123} - input: | - {"\\uff13qwe": 123} - -object-unicode-digits-first-esc: - type: advanced - output: !error - input: | - {\uff13qwe: 123} - -object-unicode-digits-first-lit: - type: advanced - output: !error - input: "{\uff13qwe: 123}" - -object-unicode-weirdness-esc: - type: advanced - output: {"digit\uff13": 1, "comb\u094F": 2, "punct\u2040": 3, "zwnj\u200C": 4} - input: | - {digit\uff13: 1, comb\u094F: 2, punct\u2040: 3, zwnj\u200C: 4} - -object-unicode-weirdness-lit: - type: advanced - output: {"digit\uff13": 1, "comb\u094F": 2, "punct\u2040": 3, "zwnj\u200C": 4} - input: "{digit\uff13: 1, comb\u094F: 2, punct\u2040: 3, zwnj\u200C: 4}" - -# Array literals -# -------------- - -array-all-types: - type: basic - output: [1.2,"3,4",{},[],null,+.inf] - input: | - [1.2,"3,4",{},[],null,Infinity] - -array-trailing-comma: - type: basic - output: [1,2,3,4] - input: | - [1,2,3,4,] - -array-leading-comma-style: - type: basic - output: [quux,foo,bar,baz] - input: | - [ 'quux' - , 'foo' - , 'bar' - , 'baz' - ] - -array-incomplete: - type: basic - output: !error - input: | - [1,2,3,[] - -array-nested: - type: basic - output: [[[[[[]]]]],[[],[]]] - input: | - [[[[[[/*[]*/]]]]],[[],[]]] - -array-isnt-object: - type: extra - output: !error - input: | - [1:2] - -array-no-single-comma: - type: extra - output: !error - input: | - [,] - -array-no-elisions: - type: extra - output: !error - input: | - [1,,2,3] - -# Comments -# -------- - -comment-single: - type: basic - output: foobar - input: | - // blahblah - "foobar" - // another one - -comment-multi: - type: basic - output: foobar - input: | - /* - * 123 - */ - "foobar" - /**/ - -comment-single-newlines: - type: advanced - output: [ 123, 456, 789 ] - input: "[// foo\r123,// bar\u2028456,// baz\u2029789]" - -comment-inside: - type: advanced - output: [123, '// foo', '/* bar'] - input: > - [ - /* - " // */ 123, // ", - "// foo", - '/* bar', - ] - -comment-in-token: - type: advanced - output: !error - input: - 123/*comment*/456 - -comment-java-style: - type: basic - output: 123 - input: - /*****************/ - 123 - /****************/ - -comment-object: - type: basic - output: {q: 123} - input: /**/{/**/q/**/:/**/123/**/,/**/}// - -# Whitespace -# ---------- - -ws-no-whitespace: - type: basic - output: {"foo":bar,bar:["qwe",null,[],{}],"baz":123} - input: '{foo:"bar","bar":["qwe",null,[],{}],"baz":123}' - -ws-allow-prefix: - type: basic - output: 123 - input: " \t123" - -ws-unicode-spaces: - type: advanced - output: { foo : 123 } - input: " - \u0020\u00A0\uFEFF - { - \x09\x0A\x0B\x0C\x0D\u1680\u180E - foo - \u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A - : - \u2028\u2029\u202F\u205F\u3000 - 123 - \uFEFF - }" - -ws-unicode-newlines: - type: advanced - output: [ 123, 456 ] - input: " - [ - \u000D - 123, - \u2028 - 456, - \u2029 - ] - " - -# Multiple tokens -# --------------- - -multi-string-nospace: - type: basic - output: !error - input: '"foo""bar"' - -multi-string: - type: basic - output: !error - input: '"foo" "bar"' - -# note: valid javascript -multi-array: - type: extra - output: !error - input: '[0] [0]' - -multi-object: - type: basic - output: !error - input: '{} {}' -... diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_analyze.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_analyze.js deleted file mode 100644 index 2a24e01eac2c2d..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_analyze.js +++ /dev/null @@ -1,53 +0,0 @@ -var _assert = require('assert') -var analyze = require('../').analyze - -function addTest(a, b) { - if (typeof(describe) === 'function') { - it('test_analyze: ' + a + ' == ' + b, function() { - _assert.equal(a, b) - }) - } else { - _assert.equal(a, b) - } -} - -var t = analyze(JSON.stringify(require('os').networkInterfaces())) -addTest(t.has_whitespace, false) -addTest(t.has_comments, false) -addTest(t.has_newlines, false) -addTest(t.newline, '\n') -addTest(t.quote, '"') -addTest(t.quote_keys, true) -addTest(t.indent, '') - -var t = analyze(JSON.stringify(require('os').networkInterfaces(), null, 2)) -addTest(t.has_whitespace, true) -addTest(t.has_comments, false) -addTest(t.has_newlines, true) -addTest(t.newline, '\n') -addTest(t.quote, '"') -addTest(t.quote_keys, true) -addTest(t.indent, ' ') - -var t = analyze(JSON.stringify(require('os').networkInterfaces(), null, 3)) -addTest(t.indent, ' ') - -var t = analyze(JSON.stringify(require('os').networkInterfaces(), null, '\t')) -addTest(t.indent, '\t') - -var t = analyze(JSON.stringify(require('os').networkInterfaces(), null, 3).replace(/\n/g, '\r\n')) -addTest(t.indent, ' ') -addTest(t.newline, '\r\n') - -var t = analyze(JSON.stringify(require('os').networkInterfaces()).replace(/"/g, "'")) -addTest(t.quote, "'") -addTest(t.quote_keys, true) - -var t = analyze("{foo:'bar', 'bar':\"baz\", 'baz':\"quux\"}") -addTest(t.quote, "'") -addTest(t.quote_keys, false) - -var t = analyze("{foo:'bar', \"bar\":'baz', \"baz\":\"quux\"}") -addTest(t.quote, '"') -addTest(t.quote_keys, false) - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_document.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_document.js deleted file mode 100644 index 5f1ef2aaf6a764..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_document.js +++ /dev/null @@ -1,214 +0,0 @@ -var assert = require('assert') -var create = require('../lib/document').Document -var jju = require('..') - -var str = '{ x\r\n:\n1, y: {"..z.": 123, t: null, s:"123", a:[ 1,2,{x:3},] }}\n' -var d = create(str) -assert.equal(d + '', str) -assert.deepEqual(d.get(''), {x:1,y:{'..z.':123,t:null,s:'123',a:[1,2,{x:3}]}}) -assert.deepEqual(d.get('x'), 1) -assert.deepEqual(d.get('x.x'), undefined) -assert.deepEqual(d.get('x.x.x.x'), undefined) -assert.strictEqual(d.get('y.x'), undefined) -assert.deepEqual(d.get('y.s'), '123') -assert.strictEqual(d.get('y.t'), null) -assert.strictEqual(d.get('y.t.x'), undefined) -assert.equal(d.has(''), true) -assert.equal(d.has('x'), true) -assert.equal(d.has('x.x'), false) -assert.equal(d.has('x.x.x.x'), false) -assert.equal(d.has('y.x'), false) -assert.equal(d.has('y'), true) -assert.equal(d.has('y.s'), true) -assert.equal(d.has('y.t'), true) -assert.equal(d.has('a'), false) - -// arrays -assert.deepEqual(d.get('y.a'), [1,2,{x:3}]) -assert.deepEqual(d.get('y.a.0'), 1) -assert.deepEqual(d.get('y.a.2.x'), 3) -assert.deepEqual(d.get('y.a.10'), undefined) -assert.deepEqual(d.has('y.a.0'), true) -assert.deepEqual(d.has('y.a.10'), false) -assert.deepEqual(d.get('y.a.2'), {x:3}) -assert.deepEqual(d.get('y.a.-1'), undefined) - -// controversial -assert.strictEqual(d.get('y.s.0'), undefined) -assert.equal(d.has('y.s.0'), false) - -// paths -assert.deepEqual(d.get([]), {x:1,y:{'..z.':123,t:null,s:'123',a:[1,2,{x:3}]}}) -assert.strictEqual(d.has([]), true) -assert.strictEqual(d.get(['y','..z.']), 123) -assert.strictEqual(d.has(['y','..z.']), true) -assert.deepEqual(d.get(['y','a',2,'x']), 3) -assert.deepEqual(create('[1]').set(0, 4).get(''), [4]) -assert.deepEqual(create('[1]').set(1, 4).get(''), [1,4]) -assert.deepEqual(create('[1]').has(0), true) -assert.deepEqual(create('[1]').has(1), false) -assert.deepEqual(create('[1]').get(0), 1) - -// invalid paths -assert.throws(function() { create('[1]').set(null, 4) }, /invalid path type/i) -assert.throws(function() { create('[1]').set({}, 4) }, /invalid path type/i) -assert.throws(function() { create('[1]').set(/./, 4) }, /invalid path type/i) -assert.throws(function() { create('[1]').set(function(){}, 4) }, /invalid path type/i) -assert.throws(function() { create('[1]').set(false, 4) }, /invalid path type/i) -assert.throws(function() { create('[1]').set(undefined, 4) }, /invalid path type/i) - -// set root -assert.strictEqual(create(str).set('', 4).get(''), 4) -assert.strictEqual(create(str).set('', null).get(''), null) -assert.strictEqual(create(str).set('', {x:4}).get('x'), 4) -assert.deepEqual(create(str).set('', [1,2,3]).get(''), [1,2,3]) -assert.strictEqual(create('1').set('', 4).get(''), 4) -assert.strictEqual(create('null').set('', 4).get(''), 4) -assert.strictEqual(create('[]').set('', 4).get(''), 4) -assert.strictEqual(create('{}').set('', 4).get(''), 4) - -// set 1st level -assert.deepEqual(create('{}').set('x', 4).get('x'), 4) -assert.deepEqual(create('{a:{b:[]}}').set('a.b.0', 4).get('a'), {b:[4]}) -//assert.deepEqual(create('1').set('x', 4).get('x'), 4) -//assert.deepEqual(create('null').set('x', 4).get('x'), 4) - -// array: boundaries -assert.strictEqual(create('[]').set('0', 4).get('0'), 4) -assert.strictEqual(create('[1,2,3]').set('2', 4).get('2'), 4) -assert.strictEqual(create('[1,2,3]').set('3', 4).get('3'), 4) - -// various error cases -assert.throws(function() { create('1').set('x', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('null').set('x', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('[]').set('x', 4) }, /set key .* of an array/) -assert.throws(function() { create('""').set('x', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('{}').set('x.x.x', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('1').set('1', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('null').set('1', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('""').set('1', 4) }, /set key .* of an non-object/) -assert.throws(function() { create('[]').set('-1', 4) }, /set key .* of an array/) -assert.throws(function() { create('[]').set('1', 4) }, /set key .* out of bounds/) -assert.throws(function() { create('[1,2,3]').set('4', 4) }, /set key .* out of bounds/) -assert.throws(function() { create('{a:{b:[]}}').set('a.b.x', 4) }, /set key .* of an array/) - -// unsetting stuff -assert.throws(function() { create('[]').unset('') }, /can't remove root document/) - -// arrays: handling spaces correctly -assert.equal(create("[]").set(0,{})+"", '[{}]') -assert.equal(create("[0]").set(1,{})+"", '[0,{}]') -assert.equal(create("[0,]").set(1,{})+"", '[0,{},]') -assert.equal(create("[ ]").set(0,{})+"", '[{} ]') -assert.equal(create("[ 0 , ]").set(1,{})+"", '[ 0 , {}, ]') -assert.equal(create("[ 0 ]").set(1,{})+"", '[ 0, {} ]') -assert.equal(create("{}").set('y',{})+"", '{"y":{}}') -assert.equal(create("{x:1}").set('y',{})+"", '{x:1,y:{}}') -assert.equal(create("{x:1,}").set('y',{})+"", '{x:1,y:{},}') -assert.equal(create("{ }").set('y',{})+"", '{"y":{} }') -assert.equal(create("{ x:1 , }").set('y',{})+"", '{ x:1 , y:{}, }') -assert.equal(create("{ x:1 }").set('y',{})+"", '{ x:1, y:{} }') - -// deleting elements -assert.throws(function() { create('[]').unset('0') }, /unset key .* out of bounds/) -assert.throws(function() { create('[1,2]').unset('2') }, /unset key .* out of bounds/) -assert.throws(function() { create('[1,2,3]').unset('0') }, /in the middle of an array/) - -// CommonJS assert spec is "awesome" -assert.deepEqual(create('[1,2]').unset('1').get(''), [1]) -assert.deepEqual(create('[1,2]').unset('1').get('').length, 1) -assert.deepEqual(create('[1,2,3]').unset('2').unset('1').get(''), [1]) -assert.deepEqual(create('[1,2,3]').unset('2').unset('1').get('').length, 1) -assert.deepEqual(create('[1]').unset('0').get(''), []) -assert.deepEqual(create('[1]').unset('0').get('').length, 0) - -assert.deepEqual(create('{x:{y:"z"}, z:4}').unset('x').get(''), {z:4}) -assert.throws(function() { create('[1,2]').unset('') }, /root/) - -// getting crazy -//assert.deepEqual(create(str).set('a.b.c.d.e', 1).get('a'), {b:{c:{d:{e:1}}}}) - -// update: arrays -assert.deepEqual(create("[1]").update([2,3])+"", '[2,3]') -assert.deepEqual(create("[1]").update([2,3,4])+"", '[2,3,4]') -assert.deepEqual(create("[]").update([2])+"", '[2]') -assert.deepEqual(create("[2]").update([])+"", '[]') -assert.deepEqual(create("[2,3,4]").update([2,3])+"", '[2,3]') -assert.deepEqual(create("[2,3,4]").update([])+"", '[]') -assert.deepEqual(create("[]").update([2,3,4])+"", '[2,3,4]') -assert.deepEqual(create(" /*zz*/ [ 2 , 3 , 4 ] /*xx*/ ").update([])+"", ' /*zz*/ [ ] /*xx*/ ') -assert.deepEqual(create(" /*zz*/ [ ] /*xx*/ ").update([2,3,4])+"", ' /*zz*/ [2,3,4 ] /*xx*/ ') - -// update: objects -assert.deepEqual(create("{x:1}").update({x:1,y:2,z:3})+"", '{x:1,y:2,z:3}') -assert.deepEqual(create("{x:1}").update({x:2,z:3,t:4})+"", '{x:2,z:3,t:4}') -assert.deepEqual(create("{}").update({x:1,y:2})+"", '{"x":1,"y":2}') -assert.deepEqual(create("{x:1}").update({})+"", '{}') -assert.deepEqual(create("{x:1,y:2}").update({x:1})+"", '{x:1}') -assert.deepEqual(create(" /*zz*/ { x /*a*/ : /*b*/ 2 , y:3 , z //\n: 4 } /*xx*/ ").update({})+"", ' /*zz*/ { } /*xx*/ ') -assert.deepEqual(create(" /*zz*/ { } /*xx*/ ").update({x: 2, y: 3, z: 4})+"", ' /*zz*/ {"x":2,"y":3,"z":4 } /*xx*/ ') - -// remove trailing comma -assert.deepEqual(create("{x:1,}").update({})+"", '{}') -assert.deepEqual(create("[0,]").update([])+"", '[]') -assert.deepEqual(create("[0 /*z*/ , /*z*/]").update([])+"", '[ /*z*/]') - -// mode -assert.equal(create('{"test":123}', {mode:'json'}).update({q:1,w:2})+'', '{"q":1,"w":2}') - -assert.equal(create('{1:2}').update({ a: 1, b: [1,2], c: 3})+'', '{a:1,b:[1,2],c:3}') - -// undef -//assert.throws(function(){ jju.update(undefined, undefined) }, /root doc/) -assert.equal(jju.update(undefined, undefined), '') -assert.equal(jju.update(undefined, 42), '42') -assert.equal(jju.update(undefined, {x: 5}), '{"x":5}') - -/* - * real test - */ -var upd = { name: 'yapm', - version: '0.6.0', - description: 'npm wrapper allowing to use package.yaml instead of package.json', - author: { name: 'Alex Kocharin', email: 'alex@kocharin.ru' }, - keywords: - [ 'package manager', - 'modules', - 'install', - 'package.yaml', - 'package.json5', - 'yaml', - 'json5', - 'npm' ], - preferGlobal: true, - homepage: 'https://npmjs.org/doc/', - repository: { type: 'git', url: 'https://github.com/rlidwka/yapm' }, - bugs: { url: 'http://github.com/rlidwka/yapm/issues' }, - main: './yapm.js', - bin: { yapm: './yapm.js' }, - dependencies: { npm: '*', 'js-yaml': '*', through: '*', 'json5-utils': '*' }, - devDependencies: { async: '*' }, - optionalDependencies: { 'yaml-update': '*' }, - test_nonascii: 'тест' } - -assert.deepEqual(create(create('{"garbage":"garbage"}').update(upd)).get(''), upd) -assert.deepEqual(JSON.parse(create('{"garbage":"garbage"}', {mode:'json',legacy:true}).update(upd)), upd) - -//console.log(create('{"garbage":"garbage"}').update(upd)+'') - -//assert.deepEqual(create(" [ ] //").set(0,{})+"" [ ,{}] // - - -//node -e 'console.log(require("./document").Document("{}").set("",[1,2,3])+"")'[1, 2, 3] - -//alex@elu:~/json5-utils/lib$ node -e 'console.log(require("./document").Document("[]").set("0",[1,2,3]).get(""))' -//[ [ 1, 2, 3 ] ] - - -/*assert.equal(create('"test"').get(''), 'test') -assert.equal(create('"test"').get([]), 'test') -assert.equal(create('"test"').get(false), 'test') -assert.equal(create(undefined).get(''), undefined) - -//assert.equal(create('"test"').set('', 'foo').toString(), '"foo"') -*/ diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_errors.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_errors.js deleted file mode 100644 index 8b2cdb7dcbdf67..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_errors.js +++ /dev/null @@ -1,56 +0,0 @@ -var assert = require('assert') -var parse = require('../').parse - -function addTest(arg, row, col, errRegExp) { - var fn = function() { - try { - parse(arg) - } catch(err) { - if (row !== undefined) assert.equal(err.row, row, 'wrong row: ' + err.row) - if (col !== undefined) assert.equal(err.column, col, 'wrong column: ' + err.column) - if (errRegExp) assert(errRegExp.exec(err.message)) - return - } - throw Error("no error") - } - - if (typeof(describe) === 'function') { - it('test_errors: ' + JSON.stringify(arg), fn) - } else { - fn() - } -} - -// semicolon will be unexpected, so it indicates an error position -addTest(';', 1, 1) -addTest('\n\n\n;', 4, 1) -addTest('\r\n;', 2, 1) -addTest('\n\r;', 3, 1) -addTest('\n\u2028;', 3, 1) -addTest('\n\u2029;', 3, 1) -addTest('[\n1\n,\n;', 4, 1) -addTest('{\n;', 2, 1) -addTest('{\n1\n:\n;', 4, 1) -addTest('.e3', 1, 3, /"\.e3"/) - -// line continuations -addTest('["\\\n",\n;', 3, 1) -addTest('["\\\r\n",\n;', 3, 1) -addTest('["\\\u2028",\n;', 3, 1) -addTest('["\\\u2029",\n;', 3, 1) - -// bareword rewind -addTest('nulz', 1, 1) - -// no data -addTest(' ', 1, 3, /No data.*whitespace/) -addTest('blah', 1, 1, /Unexpected token 'b'/) -addTest('', 1, 1, /No data.*empty input/) - -try { - parse('{{{{{{{{{') -} catch(err) { - var x = err.stack.match(/parseObject/g) - assert(!x || x.length < 2, "shouldn't blow up the stack with internal calls") -} - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_parse.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_parse.js deleted file mode 100644 index d33e61ee7e37be..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_parse.js +++ /dev/null @@ -1,171 +0,0 @@ -var assert = require('assert') -var parse = require('../').parse - -function addTest(arg, bulk) { - function fn_json5() { - //console.log('testing: ', arg) - try { - var x = parse(arg) - } catch(err) { - x = 'fail' - } - try { - var z = eval('(function(){"use strict"\nreturn ('+String(arg)+'\n)\n})()') - } catch(err) { - z = 'fail' - } - assert.deepEqual(x, z) - } - - function fn_strict() { - //console.log('testing: ', arg) - try { - var x = parse(arg, {mode: 'json'}) - } catch(err) { - x = 'fail' - } - try { - var z = JSON.parse(arg) - } catch(err) { - z = 'fail' - } - assert.deepEqual(x, z) - } - - if (typeof(describe) === 'function' && !bulk) { - it('test_parse_json5: ' + JSON.stringify(arg), fn_json5) - it('test_parse_strict: ' + JSON.stringify(arg), fn_strict) - } else { - fn_json5() - fn_strict() - } -} - -addTest('"\\uaaaa\\u0000\\uFFFF\\uFaAb"') -addTest(' "\\xaa\\x00\xFF\xFa\0\0" ') -addTest('"\\\'\\"\\b\\f\\t\\n\\r\\v"') -addTest('"\\q\\w\\e\\r\\t\\y\\\\i\\o\\p\\[\\/\\\\"') -addTest('"\\\n\\\r\n\\\n"') -addTest('\'\\\n\\\r\n\\\n\'') -addTest(' null') -addTest('true ') -addTest('false') -addTest(' Infinity ') -addTest('+Infinity') -addTest('[]') -addTest('[ 0xA2, 0X024324AaBf]') -addTest('-0x12') -addTest(' [1,2,3,4,5]') -addTest('[1,2,3,4,5,] ') -addTest('[1e-13]') -addTest('[null, true, false]') -addTest(' [1,2,"3,4,",5,]') -addTest('[ 1,\n2,"3,4," \r\n,\n5,]') -addTest('[ 1 , 2 , 3 , 4 , 5 , ]') -addTest('{} ') -addTest('{"2":1,"3":null,}') -addTest('{ "2 " : 1 , "3":null , }') -addTest('{ \"2\" : 25e245 , \"3\": 23 }') -addTest('{"2":1,"3":nul,}') -addTest('{:1,"3":nul,}') -addTest('[1,2] // ssssssssss 3,4,5,] ') -addTest('[1,2 , // ssssssssss \n//xxx\n3,4,5,] ') -addTest('[1,2 /* ssssssssss 3,4,*/ /* */ , 5 ] ') -addTest('[1,2 /* ssssssssss 3,4,*/ /* * , 5 ] ') -addTest('{"3":1,"3":,}') -addTest('{ чйуач:1, щцкшчлм : 4,}') -addTest('{ qef-:1 }') -addTest('{ $$$:1 , ___: 3}') -addTest('{3:1,2:1}') -addTest('{3.4e3:1}') -addTest('{-3e3:1}') -addTest('{+3e3:1}') -addTest('{.3e3:1}') - -for (var i=0; i<200; i++) { - addTest('"' + String.fromCharCode(i) + '"', true) -} - -// strict JSON test cases -addTest('"\\xaa"') -addTest('"\\0"') -addTest('"\0"') -addTest('"\\v"') -addTest('{null: 123}') -addTest("{'null': 123}") - -assert.throws(function() { - parse('0o') -}) - -assert.strictEqual(parse('01234567'), 342391) -assert.strictEqual(parse('0o1234567'), 342391) - -// undef -assert.strictEqual(parse(undefined), undefined) - -// whitespaces -addTest('[1,\r\n2,\r3,\n]') -'\u0020\u00A0\uFEFF\x09\x0A\x0B\x0C\x0D\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000'.split('').forEach(function(x) { - addTest(x+'[1,'+x+'2]'+x) - addTest('"'+x+'"'+x) -}) -'\u000A\u000D\u2028\u2029'.split('').forEach(function(x) { - addTest(x+'[1,'+x+'2]'+x) - addTest('"\\'+x+'"'+x) -}) - -/* weird ES6 stuff, not working - -if (process.version > 'v0.11.7') { - assert(Array.isArray(parse('{__proto__:[]}').__proto__)) - assert.equal(parse('{__proto__:{xxx:5}}').xxx, undefined) - assert.equal(parse('{__proto__:{xxx:5}}').__proto__.xxx, 5) - - var o1 = parse('{"__proto__":[]}') - assert.deepEqual([], o1.__proto__) - assert.deepEqual(["__proto__"], Object.keys(o1)) - assert.deepEqual([], Object.getOwnPropertyDescriptor(o1, "__proto__").value) - assert.deepEqual(["__proto__"], Object.getOwnPropertyNames(o1)) - assert(o1.hasOwnProperty("__proto__")) - assert(Object.prototype.isPrototypeOf(o1)) - - // Parse a non-object value as __proto__. - var o2 = JSON.parse('{"__proto__":5}') - assert.deepEqual(5, o2.__proto__) - assert.deepEqual(["__proto__"], Object.keys(o2)) - assert.deepEqual(5, Object.getOwnPropertyDescriptor(o2, "__proto__").value) - assert.deepEqual(["__proto__"], Object.getOwnPropertyNames(o2)) - assert(o2.hasOwnProperty("__proto__")) - assert(Object.prototype.isPrototypeOf(o2)) -}*/ - -assert.throws(parse.bind(null, "{-1:42}")) - -for (var i=0; i<100; i++) { - var str = '-01.e'.split('') - - var rnd = [1,2,3,4,5].map(function(x) { - x = ~~(Math.random()*str.length) - return str[x] - }).join('') - - try { - var x = parse(rnd) - } catch(err) { - x = 'fail' - } - try { - var y = JSON.parse(rnd) - } catch(err) { - y = 'fail' - } - try { - var z = eval(rnd) - } catch(err) { - z = 'fail' - } - //console.log(rnd, x, y, z) - if (x !== y && x !== z) throw 'ERROR' -} - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_portable.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_portable.js deleted file mode 100644 index 0143e7d8e5bff6..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_portable.js +++ /dev/null @@ -1,60 +0,0 @@ -var assert = require('assert') -var FS = require('fs') -var YAML = require('js-yaml') -var jju = require('../') - -function addTest(name, fn) { - if (typeof(describe) === 'function') { - it(name, fn) - } else { - fn() - } -} - -var schema = YAML.Schema.create([ - new YAML.Type('!error', { - kind: 'scalar', - resolve: function (state) { - //state.result = null - return true - }, - }) -]) - -var tests = YAML.safeLoad(FS.readFileSync(__dirname + '/portable-json5-tests.yaml', 'utf8'), { - schema: schema -}) - -if (!Object.is) { - Object.defineProperty(Object, 'is', { - value: function(x, y) { - if (x === y) { - return x !== 0 || 1 / x === 1 / y; - } - return x !== x && y !== y; - }, - configurable: true, - enumerable: false, - writable: true, - }) -} - -for (var k in tests) { - ;(function(k) { - addTest(k, function() { - try { - var result = jju.parse(tests[k].input) - } catch(err) { - result = null - } - - // need deepStrictEqual - if (typeof(result) === 'object') { - assert.deepEqual(result, tests[k].output) - } else { - assert(Object.is(result, tests[k].output), String(result) + ' == ' + tests[k].output) - } - }) - })(k) -} - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_stringify.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_stringify.js deleted file mode 100644 index c97e38e93c1f61..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_stringify.js +++ /dev/null @@ -1,89 +0,0 @@ -var assert = require('assert') -var parse = require('../').parse -var stringify = require('../').stringify - -function deepEqual(x, y) { - if (Number.isNaN(x)) { - return assert(Number.isNaN(y)) - } - assert.deepEqual(x, y) -} - -function addTest(arg, arg2, arg3) { - function fn() { - deepEqual(parse(stringify(arg)), arg2 === undefined ? arg : arg2) - if (arg !== undefined) deepEqual(JSON.parse(stringify(arg, {mode: 'json', indent: false})), (arg3 === undefined ? (arg2 === undefined ? arg : arg2) : arg3)) - } - - if (typeof(describe) === 'function') { - it('test_stringify: ' + JSON.stringify(arg), fn) - } else { - fn() - } -} - -addTest(0) -addTest(-0) -addTest(NaN, undefined, null) -addTest(Infinity, undefined, null) -addTest(-Infinity, undefined, null) -addTest(123) -addTest(19508130958019385.135135) -addTest(-2e123) -addTest(null) -addTest(undefined) -addTest([]) -addTest([,,,,,,,], [null,null,null,null,null,null,null]) -addTest([undefined,null,1,2,3,], [null,null,1,2,3]) -addTest([[[[]]],[[]]]) -addTest({}) -addTest({1:2,3:4}) -addTest({1:{1:{1:{1:4}}}, 3:4}) -addTest({1:undefined, 3:undefined}, {}) -addTest(new Number(4), 4) -addTest(new Boolean(true), true) -addTest(new String('xqefxef'), 'xqefxef') -addTest(new Boolean(), false) - -var r='';for (var i=0; i<5000; i++) {r+=String.fromCharCode(i)} -addTest(r) - -assert.equal("[1, 2, 3]", stringify([1, 2, 3], {indent: 1})) -assert.equal("[1, 2, 3]", stringify([1, 2, 3], {indent: 2})) - -var oddball = Object(42) -oddball.__proto__ = { __proto__: null } -assert.equal('{}', stringify(oddball)) - -/* this WILL throw -var falseNum = Object("37") -falseNum.__proto__ = Number.prototype -assert.equal("{0: '3', 1: '7'}", stringify(falseNum))*/ - -assert.equal(stringify(Infinity), 'Infinity') -assert.equal(stringify(Infinity, {mode: 'json'}), 'null') -assert.equal(stringify(NaN), 'NaN') -assert.equal(stringify(NaN, {mode: 'json'}), 'null') -assert.equal(stringify(-0), '-0') - -assert.equal(stringify('test', null), "'test'") - -var array = [""] -var expected = "''" -for (var i = 0; i < 1000; i++) { - array.push("") - expected = "''," + expected -} -expected = '[' + expected + ']' -assert.equal(expected, stringify(array, {indent: false})) - -assert.strictEqual(stringify([1,2,3], function(){}), undefined) - -// don't stringify prototype -assert.equal('{a: 1}', stringify({a:1,__proto__:{b:2}})) - -// sort keys tests -assert.equal('{a: 1, b: 2, z: 3}', stringify({b:2,a:1,z:3}, {sort_keys: 1})) -assert.equal('{a: 1, b: {a: 2, b: 5, c: 1}, z: 3}', stringify({b:{c:1,a:2,b:5},a:1,z:3}, {sort_keys: 1})) -assert.equal('{a: [3, 5, 1], b: 2, z: 3}', stringify({b:2,a:[3,5,1],z:3}, {sort_keys: 1})) -assert.equal('{b: 2, a: 1, z: 3}', stringify({b:2,a:1,z:3}, {sort_keys: 0})) diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_tokenize.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_tokenize.js deleted file mode 100644 index 64fb7ec93d9fef..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_tokenize.js +++ /dev/null @@ -1,99 +0,0 @@ -var assert = require('assert') -var parse = require('../').parse - -function tokenize(arg) { - var result = [] - parse(arg, {_tokenize: function(smth) { - result.push(smth) - }}) - assert.deepEqual(result.map(function(x){return x.raw}).join(''), arg) - return result -} - -function addTest(x, exp) { - function fn(){assert.deepEqual(tokenize(x), exp)} - - if (typeof(describe) === 'function') { - it('test_tokenize: ' + JSON.stringify(x), fn) - } else { - fn() - } -} - -addTest('123', [ { raw: '123', value: 123, type: 'literal', stack: [] }]) - -addTest(' /* zz */\r\n true /* zz */\n', -[ { raw: ' ', type: 'whitespace', stack: [] }, - { raw: '/* zz */', type: 'comment', stack: [] }, - { raw: '\r\n', type: 'newline', stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: 'true', type: 'literal', value: true, stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: '/* zz */', type: 'comment', stack: [] }, - { raw: '\n', type: 'newline', stack: [] } ]) - -addTest('{q:123, w : /*zz*/\n\r 345 } ', -[ { raw: '{', type: 'separator', stack: [] }, - { raw: 'q', type: 'key', value: 'q', stack: [] }, - { raw: ':', type: 'separator', stack: [] }, - { raw: '123', type: 'literal', value: 123, stack: ['q'] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: 'w', type: 'key', value: 'w', stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: ':', type: 'separator', stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: '/*zz*/', type: 'comment', stack: [] }, - { raw: '\n', type: 'newline', stack: [] }, - { raw: '\r', type: 'newline', stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: '345', type: 'literal', value: 345, stack: ['w'] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: '}', type: 'separator', stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] } ]) - -addTest('null /* */// xxx\n//xxx', -[ { raw: 'null', type: 'literal', value: null, stack: [] }, - { raw: ' ', type: 'whitespace', stack: [] }, - { raw: '/* */', type: 'comment', stack: [] }, - { raw: '// xxx', type: 'comment', stack: [] }, - { raw: '\n', type: 'newline', stack: [] }, - { raw: '//xxx', type: 'comment', stack: [] } ]) - -addTest('[1,2,[[],[1]],{},{1:2},{q:{q:{}}},]', -[ { raw: '[', type: 'separator', stack: [] }, - { raw: '1', type: 'literal', value: 1, stack: [0] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: '2', type: 'literal', value: 2, stack: [1] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: '[', type: 'separator', stack: [2] }, - { raw: '[', type: 'separator', stack: [2,0] }, - { raw: ']', type: 'separator', stack: [2,0] }, - { raw: ',', type: 'separator', stack: [2] }, - { raw: '[', type: 'separator', stack: [2,1] }, - { raw: '1', type: 'literal', value: 1, stack: [2,1,0] }, - { raw: ']', type: 'separator', stack: [2,1] }, - { raw: ']', type: 'separator', stack: [2] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: '{', type: 'separator', stack: [3] }, - { raw: '}', type: 'separator', stack: [3] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: '{', type: 'separator', stack: [4] }, - { raw: '1', type: 'key', value: 1, stack: [4] }, - { raw: ':', type: 'separator', stack: [4] }, - { raw: '2', type: 'literal', value: 2, stack: [4,'1'] }, - { raw: '}', type: 'separator', stack: [4] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: '{', type: 'separator', stack: [5] }, - { raw: 'q', type: 'key', value: 'q', stack: [5] }, - { raw: ':', type: 'separator', stack: [5] }, - { raw: '{', type: 'separator', stack: [5,'q'] }, - { raw: 'q', type: 'key', value: 'q', stack: [5,'q'] }, - { raw: ':', type: 'separator', stack: [5,'q'] }, - { raw: '{', type: 'separator', stack: [5,'q','q'] }, - { raw: '}', type: 'separator', stack: [5,'q','q'] }, - { raw: '}', type: 'separator', stack: [5,'q'] }, - { raw: '}', type: 'separator', stack: [5] }, - { raw: ',', type: 'separator', stack: [] }, - { raw: ']', type: 'separator', stack: [] } ]) - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_updates.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_updates.js deleted file mode 100644 index b7482519a919a7..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/test_updates.js +++ /dev/null @@ -1,22 +0,0 @@ -var assert = require('assert') -var FS = require('fs') -var YAML = require('js-yaml') -var jju = require('../') - -function addTest(name, fn) { - if (typeof(describe) === 'function') { - it(name, fn) - } else { - fn() - } -} - -FS.readdirSync(__dirname + '/update').filter(function(file) { - return file.match(/^[^\.].*\.yaml$/) -}).forEach(function(file) { - addTest('update: ' + file, function() { - var test = YAML.load(FS.readFileSync(__dirname + '/update/' + file, 'utf8')) - assert.strictEqual(test.test(jju, test.input), test.output) - }) -}) - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/author.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/author.yaml deleted file mode 100644 index 4b08bb61b49056..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/author.yaml +++ /dev/null @@ -1,31 +0,0 @@ -input: | - { "name": "just-a-demo", - "version": "0.1.2", - "description": "blahblahblah", - "main": "test.js", - "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": "John Doe ", - "license": "BSD-2-Clause" } - -output: | - { "name": "just-a-demo", - "version": "0.1.2", - "description": "blahblahblah", - "main": "test.js", - "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": { - "name": "John Doe", - "email": "whoever@google.com" - }, - "license": "BSD-2-Clause" } - -test: !!js/function | - function(jju, input) { - obj = jju.parse(input) - obj.author = { - name: 'John Doe', - email: 'whoever@google.com', - } - return jju.update(input, obj) - } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/deep-object.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/deep-object.yaml deleted file mode 100644 index e0795a37874e9e..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/deep-object.yaml +++ /dev/null @@ -1,36 +0,0 @@ -input: | - { - "foo": { - "bar": { - "baz": { - "quux": "4" - } - } - } - } - -output: | - { - "foo": { - "bar": { - "baz": { - "quux": "4" - }, - "qwe": { - "rty": { - "aaa": { - "bbb": 1 - } - } - } - } - } - } - -test: !!js/function | - function(jju, input) { - obj = jju.parse(input) - obj.foo.bar.qwe = {rty: {aaa: {bbb: 1}}} - return jju.update(input, obj, {mode:'json'}) - } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/delete.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/delete.yaml deleted file mode 100644 index b964715d37b0b4..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/delete.yaml +++ /dev/null @@ -1,36 +0,0 @@ -input: | - { - "name": "test", - "version": "0.0.0", - "dependencies": { - "foo": "1.2.x", - "bar": ">= 1" - }, - "bundleDependencies": [ - "foo", - "bar" - ], - "license": "BSD-2-Clause" - } - -output: | - { - "name": "test", - "version": "0.0.0", - "dependencies": { - "foo": "1.2.x" - }, - "bundleDependencies": [ - "foo" - ], - "license": "BSD-2-Clause" - } - -test: !!js/function | - function(jju, input) { - obj = jju.parse(input) - obj.bundleDependencies.pop() - delete obj.dependencies.bar - return jju.update(input, obj, {mode:'json'}) - } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/norm-array.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/norm-array.yaml deleted file mode 100644 index c5b9dd952d1255..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/norm-array.yaml +++ /dev/null @@ -1,32 +0,0 @@ -input: | - { - "name": "test", - "version": "0.0.0", - "bundleDependencies": [ - "foo", - "bar" - ], - "license": "BSD-2-Clause" - } - -output: | - { - "name": "test", - "version": "0.0.0", - "bundleDependencies": [ - "foo", - "bar", - "baz", - "quux" - ], - "license": "BSD-2-Clause" - } - -test: !!js/function | - function(jju, input) { - obj = jju.parse(input) - obj.bundleDependencies.push('baz') - obj.bundleDependencies.push('quux') - return jju.update(input, obj, {mode:'json'}) - } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/norm-object.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/norm-object.yaml deleted file mode 100644 index 93878675b7abc7..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/norm-object.yaml +++ /dev/null @@ -1,32 +0,0 @@ -input: | - { - "name": "test", - "version": "0.0.0", - "dependencies": { - "foobar": "*", - "bazquux": ">= 1.1.1" - }, - "license": "BSD-2-Clause" - } - -output: | - { - "name": "test", - "version": "0.0.0", - "dependencies": { - "foobar": "*", - "bazquux": ">= 1.1.1", - "whatever": "1.2.x", - "qwerty": "1" - }, - "license": "BSD-2-Clause" - } - -test: !!js/function | - function(jju, input) { - obj = jju.parse(input) - obj.dependencies.whatever = '1.2.x' - obj.dependencies.qwerty = '1' - return jju.update(input, obj, {mode:'json'}) - } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/npm-array-bin.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/npm-array-bin.yaml deleted file mode 100644 index 35e1639bfda28b..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/npm-array-bin.yaml +++ /dev/null @@ -1,29 +0,0 @@ -input: | - { "name":"npm-test-array-bin" - , "version":"1.2.5" - , "bin": [ "bin/array-bin" ] - , "scripts": { "test": "node test.js" } } - -# less than ideal, I know... -output: | - { "name":"npm-test-array-bin" - , "version":"1.2.5" - , "bin": {"array-bin":"bin/array-bin"} - , "scripts": { "test": "node test.js" }, "readme": "just an npm test\n", "readmeFilename": "README", "description": "just an npm test", "_id": "npm-test-array-bin@1.2.5", "dist": {"shasum":"9c426a1bd55e98718ab4ddcc01fa57ea83c649f1"}, "_from": "npm-test-array-bin/" } - -test: !!js/function | - function(jju, input) { - obj = - { name: 'npm-test-array-bin', - version: '1.2.5', - bin: { 'array-bin': 'bin/array-bin' }, - scripts: { test: 'node test.js' }, - readme: 'just an npm test\n', - readmeFilename: 'README', - description: 'just an npm test', - _id: 'npm-test-array-bin@1.2.5', - dist: { shasum: '9c426a1bd55e98718ab4ddcc01fa57ea83c649f1' }, - _from: 'npm-test-array-bin/' } - return jju.update(input, obj) - } - diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/pkg-json5.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/pkg-json5.yaml deleted file mode 100644 index 21a5c6eb141ed4..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/test/update/pkg-json5.yaml +++ /dev/null @@ -1,36 +0,0 @@ -input: | - // vim:syntax=javascript - { - name: 'yapm', - version: '1.1.0-1325', // upstream npm@1.3.25 - description: 'A package manager for node (npm fork)', - } - -output: | - // vim:syntax=javascript - { - name: 'yapm', - version: '1.1.0-1325', // upstream npm@1.3.25 - description: 'A package manager for node (npm fork)', - _id: 'yapm@1.1.0-1325', - dist: { - shasum: 'd5aa31c1ad00c1e7e57e07cea1b22c1806a47111', - }, - _from: './zzz', - } - -test: !!js/function | - function(jju, input) { - var upd = { - "name": "yapm", - "version": "1.1.0-1325", - "description": "A package manager for node (npm fork)", - "_id": "yapm@1.1.0-1325", - "dist": { - "shasum": "d5aa31c1ad00c1e7e57e07cea1b22c1806a47111" - }, - "_from": "./zzz" - } - return jju.update(input, upd) - } - diff --git a/deps/npm/node_modules/read-package-json/package.json b/deps/npm/node_modules/read-package-json/package.json index 17113419c0ab74..1dc60532c71d75 100644 --- a/deps/npm/node_modules/read-package-json/package.json +++ b/deps/npm/node_modules/read-package-json/package.json @@ -29,8 +29,6 @@ "graceful-fs": "^4.1.2" }, "license": "ISC", - "readme": "# read-package-json\n\nThis is the thing that npm uses to read package.json files. It\nvalidates some stuff, and loads some default things.\n\nIt keeps a cache of the files you've read, so that you don't end\nup reading the same package.json file multiple times.\n\nNote that if you just want to see what's literally in the package.json\nfile, you can usually do `var data = require('some-module/package.json')`.\n\nThis module is basically only needed by npm, but it's handy to see what\nnpm will see when it looks at your package.\n\n## Usage\n\n```javascript\nvar readJson = require('read-package-json')\n\n// readJson(filename, [logFunction=noop], [strict=false], cb)\nreadJson('/path/to/package.json', console.error, false, function (er, data) {\n if (er) {\n console.error(\"There was an error reading the file\")\n return\n }\n\n console.error('the package data is', data)\n});\n```\n\n## readJson(file, [logFn = noop], [strict = false], cb)\n\n* `file` {String} The path to the package.json file\n* `logFn` {Function} Function to handle logging. Defaults to a noop.\n* `strict` {Boolean} True to enforce SemVer 2.0 version strings, and\n other strict requirements.\n* `cb` {Function} Gets called with `(er, data)`, as is The Node Way.\n\nReads the JSON file and does the things.\n\n## `package.json` Fields\n\nSee `man 5 package.json` or `npm help json`.\n\n## readJson.log\n\nBy default this is a reference to the `npmlog` module. But if that\nmodule can't be found, then it'll be set to just a dummy thing that does\nnothing.\n\nReplace with your own `{log,warn,error}` object for fun loggy time.\n\n## readJson.extras(file, data, cb)\n\nRun all the extra stuff relative to the file, with the parsed data.\n\nModifies the data as it does stuff. Calls the cb when it's done.\n\n## readJson.extraSet = [fn, fn, ...]\n\nArray of functions that are called by `extras`. Each one receives the\narguments `fn(file, data, cb)` and is expected to call `cb(er, data)`\nwhen done or when an error occurs.\n\nOrder is indeterminate, so each function should be completely\nindependent.\n\nMix and match!\n\n## readJson.cache\n\nThe `lru-cache` object that readJson uses to not read the same file over\nand over again. See\n[lru-cache](https://github.com/isaacs/node-lru-cache) for details.\n\n## Other Relevant Files Besides `package.json`\n\nSome other files have an effect on the resulting data object, in the\nfollowing ways:\n\n### `README?(.*)`\n\nIf there is a `README` or `README.*` file present, then npm will attach\na `readme` field to the data with the contents of this file.\n\nOwing to the fact that roughly 100% of existing node modules have\nMarkdown README files, it will generally be assumed to be Markdown,\nregardless of the extension. Please plan accordingly.\n\n### `server.js`\n\nIf there is a `server.js` file, and there is not already a\n`scripts.start` field, then `scripts.start` will be set to `node\nserver.js`.\n\n### `AUTHORS`\n\nIf there is not already a `contributors` field, then the `contributors`\nfield will be set to the contents of the `AUTHORS` file, split by lines,\nand parsed.\n\n### `bindings.gyp`\n\nIf a bindings.gyp file exists, and there is not already a\n`scripts.install` field, then the `scripts.install` field will be set to\n`node-gyp rebuild`.\n\n### `wscript`\n\nIf a wscript file exists, and there is not already a `scripts.install`\nfield, then the `scripts.install` field will be set to `node-waf clean ;\nnode-waf configure build`.\n\nNote that the `bindings.gyp` file supercedes this, since node-waf has\nbeen deprecated in favor of node-gyp.\n\n### `index.js`\n\nIf the json file does not exist, but there is a `index.js` file\npresent instead, and that file has a package comment, then it will try\nto parse the package comment, and use that as the data instead.\n\nA package comment looks like this:\n\n```javascript\n/**package\n * { \"name\": \"my-bare-module\"\n * , \"version\": \"1.2.3\"\n * , \"description\": \"etc....\" }\n **/\n\n// or...\n\n/**package\n{ \"name\": \"my-bare-module\"\n, \"version\": \"1.2.3\"\n, \"description\": \"etc....\" }\n**/\n```\n\nThe important thing is that it starts with `/**package`, and ends with\n`**/`. If the package.json file exists, then the index.js is not\nparsed.\n\n### `{directories.man}/*.[0-9]`\n\nIf there is not already a `man` field defined as an array of files or a\nsingle file, and\nthere is a `directories.man` field defined, then that directory will\nbe searched for manpages.\n\nAny valid manpages found in that directory will be assigned to the `man`\narray, and installed in the appropriate man directory at package install\ntime, when installed globally on a Unix system.\n\n### `{directories.bin}/*`\n\nIf there is not already a `bin` field defined as a string filename or a\nhash of ` : ` pairs, then the `directories.bin`\ndirectory will be searched and all the files within it will be linked as\nexecutables at install time.\n\nWhen installing locally, npm links bins into `node_modules/.bin`, which\nis in the `PATH` environ when npm runs scripts. When\ninstalling globally, they are linked into `{prefix}/bin`, which is\npresumably in the `PATH` environment variable.\n", - "readmeFilename": "README.md", "gitHead": "d4f9f52c823750e7f2a7b9069bc56b9fd3a0ee96", "bugs": { "url": "https://github.com/isaacs/read-package-json/issues" @@ -38,5 +36,36 @@ "homepage": "https://github.com/isaacs/read-package-json#readme", "_id": "read-package-json@2.0.1", "_shasum": "b822abfc2c4f0abfe7f52de6448be4560b6e7053", - "_from": "read-package-json@2.0.1" + "_from": "read-package-json@>=2.0.1 <2.1.0", + "_npmVersion": "2.14.3", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "b822abfc2c4f0abfe7f52de6448be4560b6e7053", + "tarball": "http://registry.npmjs.org/read-package-json/-/read-package-json-2.0.1.tgz" + }, + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "directories": {}, + "_resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/.travis.yml b/deps/npm/node_modules/read-package-tree/.travis.yml similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/.travis.yml rename to deps/npm/node_modules/read-package-tree/.travis.yml diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/LICENSE b/deps/npm/node_modules/read-package-tree/LICENSE similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/LICENSE rename to deps/npm/node_modules/read-package-tree/LICENSE diff --git a/deps/npm/node_modules/read-package-tree/README.md b/deps/npm/node_modules/read-package-tree/README.md new file mode 100644 index 00000000000000..b3cda81f7fdcf4 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/README.md @@ -0,0 +1,68 @@ +# read-package-tree + +Read the contents of node_modules. + +## USAGE + +```javascript +var rpt = require ('read-package-tree') +rpt('/path/to/pkg/root', function (node, kidName) { + // optional filter function– if included, each package folder found is passed to + // it to see if it should be included in the final tree + // node is what we're adding children to + // kidName is the directory name of the module we're considering adding + // return true -> include, false -> skip +}, function (er, data) { + // er means that something didn't work. + // data is a structure like: + // { + // package: + // package.name: defaults to `basename(path)` + // children: [ ] + // parent: + // path: + // realpath: + // isLink: + // target: + // error: + // } +}) +``` + +That's it. It doesn't figure out if dependencies are met, it doesn't +mutate package.json data objects (beyond what +[read-package-json](http://npm.im/read-package-json) already does), it +doesn't limit its search to include/exclude `devDependencies`, or +anything else. + +Just follows the links in the `node_modules` heirarchy and reads the +package.json files it finds therein. + +## Symbolic Links + +When there are symlinks to packages in the `node_modules` hierarchy, a +`Link` object will be created, with a `target` that is a `Node` +object. + +For the most part, you can treat `Link` objects just the same as +`Node` objects. But if your tree-walking program needs to treat +symlinks differently from normal folders, then make sure to check the +object. + +In a given `read-package-tree` run, a specific `path` will always +correspond to a single object, and a specific `realpath` will always +correspond to a single `Node` object. This means that you may not be +able to pass the resulting data object to `JSON.stringify`, because it +may contain cycles. + +## Errors + +Errors parsing or finding a package.json in node_modules will result in a +node with the error property set. We will still find deeper node_modules +if any exist. *Prior to `5.0.0` these aborted tree reading with an error +callback.* + +Only a few classes of errors are fatal (result in an error callback): + +* If the top level location is entirely missing, that will error. +* if `fs.realpath` returns an error for any path its trying to resolve. diff --git a/deps/npm/node_modules/read-package-tree/package.json b/deps/npm/node_modules/read-package-tree/package.json new file mode 100644 index 00000000000000..4691dae1d2ad8b --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/package.json @@ -0,0 +1,62 @@ +{ + "name": "read-package-tree", + "version": "5.1.2", + "description": "Read the contents of node_modules.", + "main": "rpt.js", + "directories": { + "test": "test" + }, + "dependencies": { + "debuglog": "^1.0.1", + "dezalgo": "^1.0.0", + "once": "^1.3.0", + "read-package-json": "^2.0.0", + "readdir-scoped-modules": "^1.0.0" + }, + "devDependencies": { + "archy": "0", + "tap": "^1.2.0" + }, + "scripts": { + "test": "tap test/*.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/npm/read-package-tree.git" + }, + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "ISC", + "bugs": { + "url": "https://github.com/npm/read-package-tree/issues" + }, + "homepage": "https://github.com/npm/read-package-tree", + "gitHead": "2ed40c4654804f2a5ddb7b0b2c509080731eea6b", + "_id": "read-package-tree@5.1.2", + "_shasum": "e3a488792f40cf470819f01a610e719d64f09094", + "_from": "read-package-tree@>=5.1.2 <5.2.0", + "_npmVersion": "2.13.3", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "dist": { + "shasum": "e3a488792f40cf470819f01a610e719d64f09094", + "tarball": "http://registry.npmjs.org/read-package-tree/-/read-package-tree-5.1.2.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "_resolved": "https://registry.npmjs.org/read-package-tree/-/read-package-tree-5.1.2.tgz" +} diff --git a/deps/npm/node_modules/read-package-tree/rpt.js b/deps/npm/node_modules/read-package-tree/rpt.js new file mode 100644 index 00000000000000..acd91bd8c01434 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/rpt.js @@ -0,0 +1,190 @@ +var fs = require('fs') +var rpj = require('read-package-json') +var path = require('path') +var dz = require('dezalgo') +var once = require('once') +var readdir = require('readdir-scoped-modules') +var debug = require('debuglog')('rpt') + +function dpath (p) { + if (!p) return '' + if (p.indexOf(process.cwd()) === 0) { + p = p.substr(process.cwd().length + 1) + } + return p +} + +module.exports = rpt + +rpt.Node = Node +rpt.Link = Link + +var ID = 0 +function Node (pkg, logical, physical, er, cache) { + if (cache[physical]) return cache[physical] + + if (!(this instanceof Node)) { + return new Node(pkg, logical, physical, er, cache) + } + + cache[physical] = this + + debug(this.constructor.name, dpath(physical), pkg && pkg._id) + + this.id = ID++ + this.package = pkg || {} + this.path = logical + this.realpath = physical + this.parent = null + this.isLink = false + this.children = [] + this.error = er +} + +Node.prototype.package = null +Node.prototype.path = '' +Node.prototype.realpath = '' +Node.prototype.children = null +Node.prototype.error = null + +function Link (pkg, logical, physical, realpath, er, cache) { + if (cache[physical]) return cache[physical] + + if (!(this instanceof Link)) { + return new Link(pkg, logical, physical, realpath, er, cache) + } + + cache[physical] = this + + debug(this.constructor.name, dpath(physical), pkg && pkg._id) + + this.id = ID++ + this.path = logical + this.realpath = realpath + this.package = pkg || {} + this.parent = null + this.target = new Node(this.package, logical, realpath, er, cache) + this.isLink = true + this.children = this.target.children + this.error = er +} + +Link.prototype = Object.create(Node.prototype, { + constructor: { value: Link } +}) +Link.prototype.target = null +Link.prototype.realpath = '' + +function loadNode (logical, physical, cache, cb) { + debug('loadNode', dpath(logical)) + fs.realpath(physical, function (er, real) { + if (er) return cb(er) + debug('realpath l=%j p=%j real=%j', dpath(logical), dpath(physical), dpath(real)) + var pj = path.resolve(real, 'package.json') + rpj(pj, function (er, pkg) { + pkg = pkg || null + var node + if (physical === real) { + node = new Node(pkg, logical, physical, er, cache) + } else { + node = new Link(pkg, logical, physical, real, er, cache) + } + + cb(null, node) + }) + }) +} + +function loadChildren (node, cache, filterWith, cb) { + debug('loadChildren', dpath(node.path)) + // don't let it be called more than once + cb = once(cb) + var nm = path.resolve(node.path, 'node_modules') + readdir(nm, function (er, kids) { + // If there are no children, that's fine, just return + if (er) return cb(null, node) + + kids = kids.filter(function (kid) { + return kid[0] !== '.' && (!filterWith || filterWith(node, kid)) + }) + + var l = kids . length + if (l === 0) return cb(null, node) + + kids.forEach(function (kid) { + var kidPath = path.resolve(nm, kid) + var kidRealPath = path.resolve(node.realpath,'node_modules',kid) + loadNode(kidPath, kidRealPath, cache, then) + }) + + function then (er, kid) { + if (er) return cb(er) + + node.children.push(kid) + kid.parent = node + if (--l === 0) { + sortChildren(node) + return cb(null, node) + } + } + }) +} + +function sortChildren (node) { + node.children = node.children.sort(function (a, b) { + a = a.package.name ? a.package.name.toLowerCase() : a.path + b = b.package.name ? b.package.name.toLowerCase() : b.path + return a > b ? 1 : -1 + }) +} + +function loadTree (node, did, cache, filterWith, cb) { + debug('loadTree', dpath(node.path), !!cache[node.path]) + + if (did[node.realpath]) { + return dz(cb)(null, node) + } + + did[node.realpath] = true + + cb = once(cb) + loadChildren(node, cache, filterWith, function (er, node) { + if (er) return cb(er) + + var kids = node.children.filter(function (kid) { + return !did[kid.realpath] + }) + + var l = kids.length + if (l === 0) return cb(null, node) + + kids.forEach(function (kid, index) { + loadTree(kid, did, cache, filterWith, then) + }) + + function then (er, kid) { + if (er) return cb(er) + + if (--l === 0) cb(null, node) + } + }) +} + +function rpt (root, filterWith, cb) { + if (!cb) { + cb = filterWith + filterWith = null + } + fs.realpath(root, function (er, realRoot) { + if (er) return cb(er) + debug('rpt', dpath(realRoot)) + var cache = Object.create(null) + loadNode(root, realRoot, cache, function (er, node) { + // if there's an error, it's fine, as long as we got a node + if (!node) return cb(er) + loadTree(node, {}, cache, filterWith, function (lter, tree) { + cb(er && er.code !== 'ENOENT' ? er : lter, tree) + }) + }) + }) +} diff --git a/deps/npm/node_modules/read-package-tree/test/basic.js b/deps/npm/node_modules/read-package-tree/test/basic.js new file mode 100644 index 00000000000000..0dcb538911f3f2 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/basic.js @@ -0,0 +1,155 @@ +var test = require('tap').test +var rpt = require('../rpt.js') +var path = require('path') +var fs = require('fs') +var archy = require('archy') +var fixtures = path.resolve(__dirname, 'fixtures') +var roots = [ 'root', 'other', 'selflink', 'noname' ] +var cwd = path.resolve(__dirname, '..') + +var symlinks = { + 'selflink/node_modules/@scope/z/node_modules/glob': + '../../../foo/node_modules/glob', + 'other/node_modules/glob': + '../../root/node_modules/@scope/x/node_modules/glob', + 'linkedroot': + 'root', + 'deep/root': + '../root', + 'deeproot': + 'deep' +} + +function cleanup () { + Object.keys(symlinks).forEach(function (s) { + var p = path.resolve(cwd, 'test/fixtures', s) + try { + fs.unlinkSync(p) + } catch (er) {} + }) +} + +test('setup symlinks', function (t) { + cleanup() + + Object.keys(symlinks).forEach(function (s) { + var p = path.resolve(cwd, 'test/fixtures', s) + fs.symlinkSync(symlinks [ s ], p, 'dir') + }) + + t.end() +}) + +roots.forEach(function (root) { + var dir = path.resolve(fixtures, root) + var expectedtxt = path.resolve(dir, 'archy.txt') + var expectedre = path.resolve(dir, 'archy.re') + + test(root, function (t) { + rpt(dir, function (er, d) { + if (er && er.code !== 'ENOENT') throw er + + var actual = archy(archyize(d)).trim() + // console . log ('----', dir) + console.log(actual) + // console . log (require ('util') . inspect (d, { + // depth: Infinity + // })) + try { + var expect = fs.readFileSync(expectedtxt, 'utf8').trim() + t.equal(actual, expect, root + ' tree') + } catch (e) { + var expect = new RegExp(fs.readFileSync(expectedre, 'utf8').trim()) + t.like(actual, expect, root + ' tree') + } + t.end() + }) + }) +}) + +test('linkedroot', function (t) { + var dir = path.resolve(fixtures, 'linkedroot') + var out = dir + '-archy.txt' + rpt(dir, function (er, d) { + if (er && er.code !== 'ENOENT') throw er + + var actual = archy(archyize(d)).trim() + console.log(actual) + var expect = fs.readFileSync(out, 'utf8').trim() + t.equal(actual, expect, 'linkedroot tree') + t.end() + }) +}) + +test('deeproot', function (t) { + var dir = path.resolve(fixtures, 'deeproot/root') + var out = path.resolve(fixtures, 'deep') + '-archy.txt' + rpt(dir, function (er, d) { + if (er && er.code !== 'ENOENT') throw er + + var actual = archy(archyize(d)).trim() + console.log(actual) + var expect = fs.readFileSync(out, 'utf8').trim() + t.equal(actual, expect, 'deeproot tree') + t.end() + }) +}) + +test('broken json', function (t) { + rpt(path.resolve(fixtures, 'bad'), function (er, d) { + t.ok(d.error, 'Got an error object') + t.equal(d.error && d.error.code, 'EJSONPARSE') + t.ok(d, 'Got a tree') + t.end() + }) +}) + +test('missing json does not obscure deeper errors', function (t) { + rpt(path.resolve(fixtures, 'empty'), function (er, d) { + var error = d.error + t.ok(error, 'Error reading json of top level') + t.equal(error && error.code, 'ENOENT') + var childError = d.children.length===1 && d.children[0].error + t.ok(childError, 'Error parsing JSON of child node') + t.equal(childError && childError.code, 'EJSONPARSE') + t.end() + }) +}) +test('missing folder', function (t) { + rpt(path.resolve(fixtures, 'does-not-exist'), function (er, d) { + t.ok(er, 'Got an error object') + t.equal(er && er.code, 'ENOENT') + t.ok(!d, 'No tree on top level error') + t.end() + }) +}) + + +function archyize (d, seen) { + seen = seen || {} + var path = d.path + if (d.target) { + path = d.target.path + } + + var label = d.package._id ? d.package._id + ' ' : + d.package.name ? d.package.name + (d.package.version ? '@' + d.package.version : '') + ' ' : + '' + label += path.substr(cwd.length + 1) + + if (d . target) { + return { label: label + ' (symlink)', nodes: [] } + } + + return { + label: label, + nodes: d.children.map(function (kid) { + return archyize(kid, seen) + }) + } +} + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/bad/package.json b/deps/npm/node_modules/read-package-tree/test/fixtures/bad/package.json new file mode 100644 index 00000000000000..21d815ec3b0c33 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/bad/package.json @@ -0,0 +1,2 @@ +{ + "NOPE" diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/deep-archy.txt b/deps/npm/node_modules/read-package-tree/test/fixtures/deep-archy.txt new file mode 100644 index 00000000000000..630eab1a493700 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/deep-archy.txt @@ -0,0 +1,11 @@ +root@1.2.3 test/fixtures/deeproot/root +├─┬ @scope/x@1.2.3 test/fixtures/deeproot/root/node_modules/@scope/x +│ └─┬ glob@4.0.5 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob +│ ├── graceful-fs@3.0.2 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/graceful-fs +│ ├── inherits@2.0.1 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/inherits +│ ├─┬ minimatch@1.0.0 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch +│ │ ├── lru-cache@2.5.0 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/lru-cache +│ │ └── sigmund@1.0.0 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/sigmund +│ └── once@1.3.0 test/fixtures/deeproot/root/node_modules/@scope/x/node_modules/glob/node_modules/once +├── @scope/y@1.2.3 test/fixtures/deeproot/root/node_modules/@scope/y +└── foo@1.2.3 test/fixtures/deeproot/root/node_modules/foo \ No newline at end of file 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-package-tree/test/fixtures/deep/.keep similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep rename to deps/npm/node_modules/read-package-tree/test/fixtures/deep/.keep diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/empty/node_modules/foo/package.json b/deps/npm/node_modules/read-package-tree/test/fixtures/empty/node_modules/foo/package.json new file mode 100644 index 00000000000000..98232c64fce936 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/empty/node_modules/foo/package.json @@ -0,0 +1 @@ +{ diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/linkedroot-archy.txt b/deps/npm/node_modules/read-package-tree/test/fixtures/linkedroot-archy.txt new file mode 100644 index 00000000000000..e34a46031304d4 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/linkedroot-archy.txt @@ -0,0 +1,11 @@ +root@1.2.3 test/fixtures/linkedroot +├─┬ @scope/x@1.2.3 test/fixtures/linkedroot/node_modules/@scope/x +│ └─┬ glob@4.0.5 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob +│ ├── graceful-fs@3.0.2 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/graceful-fs +│ ├── inherits@2.0.1 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/inherits +│ ├─┬ minimatch@1.0.0 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/minimatch +│ │ ├── lru-cache@2.5.0 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/lru-cache +│ │ └── sigmund@1.0.0 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/sigmund +│ └── once@1.3.0 test/fixtures/linkedroot/node_modules/@scope/x/node_modules/glob/node_modules/once +├── @scope/y@1.2.3 test/fixtures/linkedroot/node_modules/@scope/y +└── foo@1.2.3 test/fixtures/linkedroot/node_modules/foo \ No newline at end of file diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/noname/archy.txt b/deps/npm/node_modules/read-package-tree/test/fixtures/noname/archy.txt new file mode 100644 index 00000000000000..03d78dfc69b8b3 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/noname/archy.txt @@ -0,0 +1,2 @@ +test/fixtures/noname +└── test/fixtures/noname/node_modules/foo 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-package-tree/test/fixtures/noname/node_modules/foo/keep-alive similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep rename to deps/npm/node_modules/read-package-tree/test/fixtures/noname/node_modules/foo/keep-alive diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/other/archy.txt b/deps/npm/node_modules/read-package-tree/test/fixtures/other/archy.txt new file mode 100644 index 00000000000000..23666226c91820 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/other/archy.txt @@ -0,0 +1,2 @@ +test/fixtures/other +└── glob@4.0.5 test/fixtures/other/node_modules/glob (symlink) \ No newline at end of file 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-package-tree/test/fixtures/other/node_modules/.bin similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep rename to deps/npm/node_modules/read-package-tree/test/fixtures/other/node_modules/.bin diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/root/archy.txt b/deps/npm/node_modules/read-package-tree/test/fixtures/root/archy.txt new file mode 100644 index 00000000000000..1aacd3f0b7bc65 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/root/archy.txt @@ -0,0 +1,11 @@ +root@1.2.3 test/fixtures/root +├─┬ @scope/x@1.2.3 test/fixtures/root/node_modules/@scope/x +│ └─┬ glob@4.0.5 test/fixtures/root/node_modules/@scope/x/node_modules/glob +│ ├── graceful-fs@3.0.2 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/graceful-fs +│ ├── inherits@2.0.1 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/inherits +│ ├─┬ minimatch@1.0.0 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch +│ │ ├── lru-cache@2.5.0 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/lru-cache +│ │ └── sigmund@1.0.0 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/minimatch/node_modules/sigmund +│ └── once@1.3.0 test/fixtures/root/node_modules/@scope/x/node_modules/glob/node_modules/once +├── @scope/y@1.2.3 test/fixtures/root/node_modules/@scope/y +└── foo@1.2.3 test/fixtures/root/node_modules/foo \ No newline at end of file diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/root/package.json b/deps/npm/node_modules/read-package-tree/test/fixtures/root/package.json new file mode 100644 index 00000000000000..010347cee63bc5 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/root/package.json @@ -0,0 +1,2 @@ +{"name":"root", + "version":"1.2.3"} \ No newline at end of file diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/selflink/archy.re b/deps/npm/node_modules/read-package-tree/test/fixtures/selflink/archy.re new file mode 100644 index 00000000000000..22e18109b1b37a --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/selflink/archy.re @@ -0,0 +1,13 @@ +selflink@1[.]2[.]3 test/fixtures/selflink +├── @scope/y@1[.]2[.]3 test/fixtures/selflink/node_modules/@scope/y +├─┬ @scope/z@1[.]2[.]3 test/fixtures/selflink/node_modules/@scope/z +│ └── glob@4[.]0[.]5 test/fixtures/selflink/node_modules/foo/node_modules/glob [(]symlink[)] +└─┬ foo@1[.]2[.]3 test/fixtures/selflink/node_modules/foo + ├─┬ glob@4[.]0[.]5 test/fixtures/selflink/node_modules/foo/node_modules/glob + │ ├── graceful-fs@3[.]0[.]2 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/graceful-fs + │ ├── inherits@2[.]0[.]1 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/inherits + │ ├─┬ minimatch@1[.]0[.]0 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/minimatch + │ │ ├── lru-cache@2[.]5[.]0 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/minimatch/node_modules/lru-cache + │ │ └── sigmund@1[.]0[.]0 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/minimatch/node_modules/sigmund + │ └── once@1[.]3[.]0 test/fixtures/selflink/node_modules/(foo|@scope/z)/node_modules/glob/node_modules/once + └── selflink@1[.]2[.]3 test/fixtures/selflink [(]symlink[)] diff --git a/deps/npm/node_modules/read-package-tree/test/fixtures/selflink/package.json b/deps/npm/node_modules/read-package-tree/test/fixtures/selflink/package.json new file mode 100644 index 00000000000000..5bbf35e55b8407 --- /dev/null +++ b/deps/npm/node_modules/read-package-tree/test/fixtures/selflink/package.json @@ -0,0 +1,2 @@ +{"name":"selflink", + "version":"1.2.3"} diff --git a/deps/npm/node_modules/read/node_modules/mute-stream/package.json b/deps/npm/node_modules/read/node_modules/mute-stream/package.json index 9cdb30284561ec..ff64101467594a 100644 --- a/deps/npm/node_modules/read/node_modules/mute-stream/package.json +++ b/deps/npm/node_modules/read/node_modules/mute-stream/package.json @@ -27,29 +27,14 @@ }, "license": "ISC", "description": "Bytes go in, but they don't come out (when muted).", - "gitHead": "17d9854a315f56088d039534f87b740e470a9af0", + "readme": "# mute-stream\n\nBytes go in, but they don't come out (when muted).\n\nThis is a basic pass-through stream, but when muted, the bytes are\nsilently dropped, rather than being passed through.\n\n## Usage\n\n```javascript\nvar MuteStream = require('mute-stream')\n\nvar ms = new MuteStream(options)\n\nms.pipe(process.stdout)\nms.write('foo') // writes 'foo' to stdout\nms.mute()\nms.write('bar') // does not write 'bar'\nms.unmute()\nms.write('baz') // writes 'baz' to stdout\n\n// can also be used to mute incoming data\nvar ms = new MuteStream\ninput.pipe(ms)\n\nms.on('data', function (c) {\n console.log('data: ' + c)\n})\n\ninput.emit('data', 'foo') // logs 'foo'\nms.mute()\ninput.emit('data', 'bar') // does not log 'bar'\nms.unmute()\ninput.emit('data', 'baz') // logs 'baz'\n```\n\n## Options\n\nAll options are optional.\n\n* `replace` Set to a string to replace each character with the\n specified string when muted. (So you can show `****` instead of the\n password, for example.)\n\n* `prompt` If you are using a replacement char, and also using a\n prompt with a readline stream (as for a `Password: *****` input),\n then specify what the prompt is so that backspace will work\n properly. Otherwise, pressing backspace will overwrite the prompt\n with the replacement character, which is weird.\n\n## ms.mute()\n\nSet `muted` to `true`. Turns `.write()` into a no-op.\n\n## ms.unmute()\n\nSet `muted` to `false`\n\n## ms.isTTY\n\nTrue if the pipe destination is a TTY, or if the incoming pipe source is\na TTY.\n\n## Other stream methods...\n\nThe other standard readable and writable stream methods are all\navailable. The MuteStream object acts as a facade to its pipe source\nand destination.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/mute-stream/issues" }, "homepage": "https://github.com/isaacs/mute-stream#readme", "_id": "mute-stream@0.0.5", "_shasum": "8fbfabb0a98a253d3184331f9e8deb7372fac6c0", - "_from": "mute-stream@>=0.0.4 <0.1.0", - "_npmVersion": "2.10.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "8fbfabb0a98a253d3184331f9e8deb7372fac6c0", - "tarball": "http://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "_resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz" + "_resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.5.tgz", + "_from": "mute-stream@>=0.0.4 <0.1.0" } diff --git a/deps/npm/node_modules/read/package.json b/deps/npm/node_modules/read/package.json index b8357c6315dde0..f869931811e2a4 100644 --- a/deps/npm/node_modules/read/package.json +++ b/deps/npm/node_modules/read/package.json @@ -28,30 +28,14 @@ "files": [ "lib/read.js" ], - "gitHead": "b14516b9236c40140fd0666567f5d0c588a09a62", + "readme": "## read\n\nFor reading user input from stdin.\n\nSimilar to the `readline` builtin's `question()` method, but with a\nfew more features.\n\n## USAGE\n\n```javascript\nvar read = require(\"read\")\nread(options, callback)\n```\n\nThe callback gets called with either the user input, or the default\nspecified, or an error, as `callback(error, result, isDefault)`\nnode style.\n\n## OPTIONS\n\nEvery option is optional.\n\n* `prompt` What to write to stdout before reading input.\n* `silent` Don't echo the output as the user types it.\n* `replace` Replace silenced characters with the supplied character value.\n* `timeout` Number of ms to wait for user input before giving up.\n* `default` The default value if the user enters nothing.\n* `edit` Allow the user to edit the default value.\n* `terminal` Treat the output as a TTY, whether it is or not.\n* `input` Readable stream to get input data from. (default `process.stdin`)\n* `output` Writeable stream to write prompts to. (default: `process.stdout`)\n\nIf silent is true, and the input is a TTY, then read will set raw\nmode, and read character by character.\n\n## COMPATIBILITY\n\nThis module works sort of with node 0.6. It does not work with node\nversions less than 0.6. It is best on node 0.8.\n\nOn node version 0.6, it will remove all listeners on the input\nstream's `data` and `keypress` events, because the readline module did\nnot fully clean up after itself in that version of node, and did not\nmake it possible to clean up after it in a way that has no potential\nfor side effects.\n\nAdditionally, some of the readline options (like `terminal`) will not\nfunction in versions of node before 0.8, because they were not\nimplemented in the builtin readline module.\n\n## CONTRIBUTING\n\nPatches welcome.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/read/issues" }, "homepage": "https://github.com/isaacs/read#readme", "_id": "read@1.0.7", "_shasum": "b3da19bd052431a97671d44a42634adf710b40c4", - "_from": "read@1.0.7", - "_npmVersion": "3.2.2", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "b3da19bd052431a97671d44a42634adf710b40c4", - "tarball": "http://registry.npmjs.org/read/-/read-1.0.7.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz" + "_resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz", + "_from": "read@>=1.0.7 <1.1.0" } diff --git a/deps/npm/node_modules/readable-stream/package.json b/deps/npm/node_modules/readable-stream/package.json deleted file mode 100644 index fbc5e7fa4983be..00000000000000 --- a/deps/npm/node_modules/readable-stream/package.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "readable-stream", - "version": "1.1.13", - "description": "Streams3, a user-land copy of the stream library from Node.js v0.11.x", - "main": "readable.js", - "dependencies": { - "core-util-is": "~1.0.0", - "isarray": "0.0.1", - "string_decoder": "~0.10.x", - "inherits": "~2.0.1" - }, - "devDependencies": { - "tap": "~0.2.6" - }, - "scripts": { - "test": "tap test/simple/*.js" - }, - "repository": { - "type": "git", - "url": "git://github.com/isaacs/readable-stream.git" - }, - "keywords": [ - "readable", - "stream", - "pipe" - ], - "browser": { - "util": false - }, - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "license": "MIT", - "gitHead": "3b672fd7ae92acf5b4ffdbabf74b372a0a56b051", - "bugs": { - "url": "https://github.com/isaacs/readable-stream/issues" - }, - "homepage": "https://github.com/isaacs/readable-stream", - "_id": "readable-stream@1.1.13", - "_shasum": "f6eef764f514c89e2b9e23146a75ba106756d23e", - "_from": "readable-stream@>=1.1.13 <1.2.0", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "dist": { - "shasum": "f6eef764f514c89e2b9e23146a75ba106756d23e", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/readdir-scoped-modules/.travis.yml b/deps/npm/node_modules/readdir-scoped-modules/.travis.yml new file mode 100644 index 00000000000000..e1bcee1acd90c1 --- /dev/null +++ b/deps/npm/node_modules/readdir-scoped-modules/.travis.yml @@ -0,0 +1,7 @@ +language: node_js +before_script: npm install -g npm@latest +node_js: + - '0.8' + - '0.10' + - '0.12' + - 'iojs' diff --git a/deps/npm/node_modules/char-spinner/LICENSE b/deps/npm/node_modules/readdir-scoped-modules/LICENSE similarity index 93% rename from deps/npm/node_modules/char-spinner/LICENSE rename to deps/npm/node_modules/readdir-scoped-modules/LICENSE index 05eeeb88c2ef4c..19129e315fe593 100644 --- a/deps/npm/node_modules/char-spinner/LICENSE +++ b/deps/npm/node_modules/readdir-scoped-modules/LICENSE @@ -1,6 +1,6 @@ The ISC License -Copyright (c) Isaac Z. Schlueter +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 diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/README.md b/deps/npm/node_modules/readdir-scoped-modules/README.md similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/README.md rename to deps/npm/node_modules/readdir-scoped-modules/README.md diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json b/deps/npm/node_modules/readdir-scoped-modules/package.json similarity index 57% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json rename to deps/npm/node_modules/readdir-scoped-modules/package.json index d9c7b715554e80..7ca808a1f2aecf 100644 --- a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/package.json +++ b/deps/npm/node_modules/readdir-scoped-modules/package.json @@ -32,10 +32,34 @@ "url": "https://github.com/npm/readdir-scoped-modules/issues" }, "homepage": "https://github.com/npm/readdir-scoped-modules", - "readme": "# readdir-scoped-modules\n\nLike `fs.readdir` but handling `@org/module` dirs as if they were\na single entry.\n\nUsed by npm.\n\n## USAGE\n\n```javascript\nvar readdir = require('readdir-scoped-modules')\n\nreaddir('node_modules', function (er, entries) {\n // entries will be something like\n // ['a', '@org/foo', '@org/bar']\n})\n```\n", - "readmeFilename": "README.md", "gitHead": "d41d5de877cb4e9e3f14b92913132680af73d1b4", "_id": "readdir-scoped-modules@1.0.2", "_shasum": "9fafa37d286be5d92cbaebdee030dc9b5f406747", - "_from": "readdir-scoped-modules@>=1.0.0 <2.0.0" + "_from": "readdir-scoped-modules@1.0.2", + "_npmVersion": "2.14.3", + "_nodeVersion": "2.2.2", + "_npmUser": { + "name": "zkat", + "email": "kat@sykosomatic.org" + }, + "dist": { + "shasum": "9fafa37d286be5d92cbaebdee030dc9b5f406747", + "tarball": "http://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "_resolved": "https://registry.npmjs.org/readdir-scoped-modules/-/readdir-scoped-modules-1.0.2.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js b/deps/npm/node_modules/readdir-scoped-modules/readdir.js similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/readdir.js rename to deps/npm/node_modules/readdir-scoped-modules/readdir.js diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/basic.js b/deps/npm/node_modules/readdir-scoped-modules/test/basic.js similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/basic.js rename to deps/npm/node_modules/readdir-scoped-modules/test/basic.js diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep rename to deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@org/x/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep rename to deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@org/y/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep rename to deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@scope/x/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep rename to deps/npm/node_modules/readdir-scoped-modules/test/fixtures/@scope/y/.keep diff --git a/deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep similarity index 100% rename from deps/npm/node_modules/read-installed/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep rename to deps/npm/node_modules/readdir-scoped-modules/test/fixtures/a/x/.keep diff --git a/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/a/y/.keep new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/b/x/.keep new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep b/deps/npm/node_modules/readdir-scoped-modules/test/fixtures/b/y/.keep new file mode 100644 index 00000000000000..e69de29bb2d1d6 diff --git a/deps/npm/node_modules/realize-package-specifier/package.json b/deps/npm/node_modules/realize-package-specifier/package.json index b14b24beffe366..6f08eef5be88cc 100644 --- a/deps/npm/node_modules/realize-package-specifier/package.json +++ b/deps/npm/node_modules/realize-package-specifier/package.json @@ -25,33 +25,13 @@ "require-inject": "^1.1.0", "tap": "^0.4.12" }, + "readme": "realize-package-specifier\n-------------------------\n\nParse a package specifier, peeking at the disk to differentiate between\nlocal tarballs, directories and named modules. This implements the logic\nused by `npm install` and `npm cache` to determine where to get packages\nfrom.\n\n```javascript\nvar realizePackageSpecifier = require(\"realize-package-specifier\")\nrealizePackageSpecifier(\"foo.tar.gz\", \".\", function (err, package) {\n …\n})\n```\n\n## Using\n\n* realizePackageSpecifier(*spec*, [*where*,] *callback*)\n\nParses *spec* using `npm-package-arg` and then uses stat to check to see if\nit refers to a local tarball or package directory. Stats are done relative\nto *where*. If it does then the local module is loaded. If it doesn't then\ntarget is left as a remote package specifier. Package directories are\nrecognized by the presence of a package.json in them.\n\n*spec* -- a package specifier, like: `foo@1.2`, or `foo@user/foo`, or\n`http://x.com/foo.tgz`, or `git+https://github.com/user/foo`\n\n*where* (optional, default: .) -- The directory in which we should look for\nlocal tarballs or package directories.\n\n*callback* function(*err*, *result*) -- Called once we've determined what\nkind of specifier this is. The *result* object will be very like the one\nreturned by `npm-package-arg` except with three differences: 1) There's a\nnew type of `directory`. 2) The `local` type only refers to tarballs. 2)\nFor all `local` and `directory` type results spec will contain the full path of\nthe local package.\n\n## Result Object\n\nThe full definition of the result object is:\n\n* `name` - If known, the `name` field expected in the resulting pkg.\n* `type` - One of the following strings:\n * `git` - A git repo\n * `hosted` - A hosted project, from github, bitbucket or gitlab. Originally\n either a full url pointing at one of these services or a shorthand like\n `user/project` or `github:user/project` for github or `bitbucket:user/project`\n for bitbucket.\n * `tag` - A tagged version, like `\"foo@latest\"`\n * `version` - A specific version number, like `\"foo@1.2.3\"`\n * `range` - A version range, like `\"foo@2.x\"`\n * `local` - A local file path\n * `directory` - A local package directory\n * `remote` - An http url (presumably to a tgz)\n* `spec` - The \"thing\". URL, the range, git repo, etc.\n* `hosted` - If type=hosted this will be an object with the following keys:\n * `type` - github, bitbucket or gitlab\n * `ssh` - The ssh path for this git repo\n * `sshurl` - The ssh URL for this git repo\n * `https` - The HTTPS URL for this git repo\n * `directUrl` - The URL for the package.json in this git repo\n* `raw` - The original un-modified string that was provided.\n* `rawSpec` - The part after the `name@...`, as it was originally\n provided.\n* `scope` - If a name is something like `@org/module` then the `scope`\n field will be set to `org`. If it doesn't have a scoped name, then\n scope is `null`.\n\n", + "readmeFilename": "README.md", "gitHead": "4f50130fa6b5e80954a90ea12bab382f53d890b1", "bugs": { "url": "https://github.com/npm/realize-package-specifier/issues" }, "_id": "realize-package-specifier@3.0.1", "_shasum": "fde32e926448e38f99334d95b7b08d51e3a98d9f", - "_from": "realize-package-specifier@>=3.0.0 <3.1.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "2.0.2", - "_npmUser": { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - }, - "dist": { - "shasum": "fde32e926448e38f99334d95b7b08d51e3a98d9f", - "tarball": "http://registry.npmjs.org/realize-package-specifier/-/realize-package-specifier-3.0.1.tgz" - }, - "maintainers": [ - { - "name": "iarna", - "email": "me@re-becca.org" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/realize-package-specifier/-/realize-package-specifier-3.0.1.tgz" + "_from": "realize-package-specifier@>=3.0.1 <3.1.0" } diff --git a/deps/npm/node_modules/request/CHANGELOG.md b/deps/npm/node_modules/request/CHANGELOG.md index a5da7d968f7094..a43c6726a479d5 100644 --- a/deps/npm/node_modules/request/CHANGELOG.md +++ b/deps/npm/node_modules/request/CHANGELOG.md @@ -1,5 +1,20 @@ ## Change Log +### v2.65.0 (2015/10/11) +- [#1833](https://github.com/request/request/pull/1833) Update aws-sign2 to version 0.6.0 🚀 (@greenkeeperio-bot) +- [#1811](https://github.com/request/request/pull/1811) Enable loose cookie parsing in tough-cookie (@Sebmaster) +- [#1830](https://github.com/request/request/pull/1830) Bring back tilde ranges for all dependencies (@simov) +- [#1821](https://github.com/request/request/pull/1821) Implement support for RFC 2617 MD5-sess algorithm. (@BigDSK) +- [#1828](https://github.com/request/request/pull/1828) Updated qs dependency to 5.2.0 (@acroca) +- [#1818](https://github.com/request/request/pull/1818) Extract `readResponseBody` method out of `onRequestResponse` (@pvoisin) +- [#1819](https://github.com/request/request/pull/1819) Run stringify once (@mgenereu) +- [#1814](https://github.com/request/request/pull/1814) Updated har-validator to version 2.0.2 (@greenkeeperio-bot) +- [#1807](https://github.com/request/request/pull/1807) Updated tough-cookie to version 2.1.0 (@greenkeeperio-bot) +- [#1800](https://github.com/request/request/pull/1800) Add caret ranges for devDependencies, except eslint (@simov) +- [#1799](https://github.com/request/request/pull/1799) Updated karma-browserify to version 4.4.0 (@greenkeeperio-bot) +- [#1797](https://github.com/request/request/pull/1797) Updated tape to version 4.2.0 (@greenkeeperio-bot) +- [#1788](https://github.com/request/request/pull/1788) Pinned all dependencies (@greenkeeperio-bot) + ### v2.64.0 (2015/09/25) - [#1787](https://github.com/request/request/pull/1787) npm ignore examples, release.sh and disabled.appveyor.yml (@thisconnect) - [#1775](https://github.com/request/request/pull/1775) Fix typo in README.md (@djchie) diff --git a/deps/npm/node_modules/request/lib/auth.js b/deps/npm/node_modules/request/lib/auth.js index 1be1f42587b1e5..1cb695216f6b16 100644 --- a/deps/npm/node_modules/request/lib/auth.js +++ b/deps/npm/node_modules/request/lib/auth.js @@ -50,8 +50,6 @@ Auth.prototype.bearer = function (bearer, sendImmediately) { Auth.prototype.digest = function (method, path, authHeader) { // TODO: More complete implementation of RFC 2617. - // - check challenge.algorithm - // - support algorithm="MD5-sess" // - handle challenge.domain // - support qop="auth-int" only // - handle Authentication-Info (not necessarily?) @@ -73,11 +71,28 @@ Auth.prototype.digest = function (method, path, authHeader) { challenge[match[1]] = match[2] || match[3] } - var ha1 = md5(self.user + ':' + challenge.realm + ':' + self.pass) - var ha2 = md5(method + ':' + path) + /** + * RFC 2617: handle both MD5 and MD5-sess algorithms. + * + * If the algorithm directive's value is "MD5" or unspecified, then HA1 is + * HA1=MD5(username:realm:password) + * If the algorithm directive's value is "MD5-sess", then HA1 is + * HA1=MD5(MD5(username:realm:password):nonce:cnonce) + */ + var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) { + var ha1 = md5(user + ':' + realm + ':' + pass) + if (algorithm && algorithm.toLowerCase() === 'md5-sess') { + return md5(ha1 + ':' + nonce + ':' + cnonce) + } else { + return ha1 + } + } + var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth' var nc = qop && '00000001' var cnonce = qop && uuid().replace(/-/g, '') + var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce) + var ha2 = md5(method + ':' + path) var digestResponse = qop ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2) : md5(ha1 + ':' + challenge.nonce + ':' + ha2) diff --git a/deps/npm/node_modules/request/lib/cookies.js b/deps/npm/node_modules/request/lib/cookies.js index adde7c6012bded..412c07d63becb9 100644 --- a/deps/npm/node_modules/request/lib/cookies.js +++ b/deps/npm/node_modules/request/lib/cookies.js @@ -13,13 +13,13 @@ exports.parse = function(str) { if (typeof str !== 'string') { throw new Error('The cookie function only accepts STRING as param') } - return Cookie.parse(str) + return Cookie.parse(str, {loose: true}) } // Adapt the sometimes-Async api of tough.CookieJar to our requirements function RequestJar(store) { var self = this - self._jar = new CookieJar(store) + self._jar = new CookieJar(store, {looseMode: true}) } RequestJar.prototype.setCookie = function(cookieOrStr, uri, options) { var self = this diff --git a/deps/npm/node_modules/request/node_modules/aws-sign2/index.js b/deps/npm/node_modules/request/node_modules/aws-sign2/index.js index 576e49ddff1bce..54766a13518173 100644 --- a/deps/npm/node_modules/request/node_modules/aws-sign2/index.js +++ b/deps/npm/node_modules/request/node_modules/aws-sign2/index.js @@ -1,8 +1,18 @@ /*! - * knox - auth - * Copyright(c) 2010 LearnBoost - * MIT Licensed + * Copyright 2010 LearnBoost + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ /** @@ -17,7 +27,7 @@ var crypto = require('crypto') * Valid keys. */ -var keys = +var keys = [ 'acl' , 'location' , 'logging' @@ -56,7 +66,7 @@ module.exports.authorization = authorization * @param {Object} options * @return {String} * @api private - */ + */ function hmacSha1 (options) { return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') @@ -65,8 +75,8 @@ function hmacSha1 (options) { module.exports.hmacSha1 = hmacSha1 /** - * Create a base64 sha1 HMAC for `options`. - * + * Create a base64 sha1 HMAC for `options`. + * * @param {Object} options * @return {String} * @api private @@ -79,10 +89,10 @@ function sign (options) { module.exports.sign = sign /** - * Create a base64 sha1 HMAC for `options`. + * Create a base64 sha1 HMAC for `options`. * * Specifically to be used with S3 presigned URLs - * + * * @param {Object} options * @return {String} * @api private @@ -98,7 +108,7 @@ module.exports.signQuery= signQuery * Return a string for sign() with the given `options`. * * Spec: - * + * * \n * \n * \n @@ -114,7 +124,7 @@ module.exports.signQuery= signQuery function stringToSign (options) { var headers = options.amazonHeaders || '' if (headers) headers += '\n' - var r = + var r = [ options.verb , options.md5 , options.contentType @@ -130,7 +140,7 @@ module.exports.queryStringToSign = stringToSign * for S3 presigned URLs * * Spec: - * + * * \n * * 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 b454fe46973974..0fe40d0b6e88b3 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 @@ -6,10 +6,11 @@ }, "name": "aws-sign2", "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", - "version": "0.5.0", + "version": "0.6.0", "repository": { "url": "git+https://github.com/mikeal/aws-sign.git" }, + "license": "Apache-2.0", "main": "index.js", "dependencies": {}, "devDependencies": {}, @@ -17,18 +18,17 @@ "engines": { "node": "*" }, - "readme": "aws-sign\n========\n\nAWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.\n", - "readmeFilename": "README.md", + "gitHead": "8554bdb41268fa295eb1ee300f4adaa9f7f07fec", "bugs": { "url": "https://github.com/mikeal/aws-sign/issues" }, - "_id": "aws-sign2@0.5.0", - "dist": { - "shasum": "c57103f7a17fc037f02d7c2e64b602ea223f7d63", - "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz" - }, - "_from": "aws-sign2@>=0.5.0 <0.6.0", - "_npmVersion": "1.3.2", + "homepage": "https://github.com/mikeal/aws-sign#readme", + "_id": "aws-sign2@0.6.0", + "scripts": {}, + "_shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "_from": "aws-sign2@>=0.6.0 <0.7.0", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.2", "_npmUser": { "name": "mikeal", "email": "mikeal.rogers@gmail.com" @@ -39,8 +39,11 @@ "email": "mikeal.rogers@gmail.com" } ], + "dist": { + "shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" + }, "directories": {}, - "_shasum": "c57103f7a17fc037f02d7c2e64b602ea223f7d63", - "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.5.0.tgz", - "homepage": "https://github.com/mikeal/aws-sign#readme" + "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "readme": "ERROR: No README data found!" } 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 466dfdfe0139b3..b67333380c265e 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 @@ -29,25 +29,9 @@ }, "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", "readmeFilename": "README.md", - "homepage": "https://github.com/isaacs/core-util-is", + "homepage": "https://github.com/isaacs/core-util-is#readme", "_id": "core-util-is@1.0.1", - "dist": { - "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" - }, - "_from": "core-util-is@>=1.0.0 <1.1.0", - "_npmVersion": "1.3.23", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz", + "_from": "core-util-is@>=1.0.0 <1.1.0" } diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json index 19228ab6fdcaaf..fb1eb3786d8168 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json @@ -26,28 +26,13 @@ "url": "http://juliangruber.com" }, "license": "MIT", - "_id": "isarray@0.0.1", - "dist": { - "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" - }, - "_from": "isarray@0.0.1", - "_npmVersion": "1.2.18", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "directories": {}, - "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies\nof the Software, and to permit persons to whom the Software is furnished to do\nso, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/juliangruber/isarray/issues" }, - "readme": "ERROR: No README data found!" + "_id": "isarray@0.0.1", + "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "_from": "isarray@0.0.1" } diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json index 087586e8f8cedd..bfaa2785f0b685 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json @@ -19,27 +19,10 @@ "devDependencies": { "tap": "~0.2.6" }, - "gitHead": "e855846a69662b9489f1ad3dde1ebf2ccc4370b8", + "readme": "process-nextick-args\n=====\n\n[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args)\n\n```bash\nnpm install --save process-nextick-args\n```\n\nAlways be able to pass arguments to process.nextTick, no matter the platform\n\n```js\nvar nextTick = require('process-nextick-args');\n\nnextTick(function (a, b, c) {\n console.log(a, b, c);\n}, 'step', 3, 'profit');\n```\n", + "readmeFilename": "readme.md", "_id": "process-nextick-args@1.0.3", "_shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", - "_from": "process-nextick-args@>=1.0.0 <1.1.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.5.0", - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "dist": { - "shasum": "e272eed825d5e9f4ea74d8d73b1fe311c3beb630", - "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz" - }, - "maintainers": [ - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "directories": {}, "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.3.tgz", - "readme": "ERROR: No README data found!" + "_from": "process-nextick-args@>=1.0.0 <1.1.0" } 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 0364d54ba46af6..ee70702359198d 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 @@ -22,33 +22,13 @@ "browserify" ], "license": "MIT", - "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", + "readme": "**string_decoder.js** (`require('string_decoder')`) from Node.js core\n\nCopyright Joyent, Inc. and other Node contributors. See LICENCE file for details.\n\nVersion numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**\n\nThe *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/rvagg/string_decoder/issues" }, "_id": "string_decoder@0.10.31", "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_from": "string_decoder@>=0.10.0 <0.11.0", - "_npmVersion": "1.4.23", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "dist": { - "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "readme": "ERROR: No README data found!" + "_from": "string_decoder@>=0.10.0 <0.11.0" } diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md index ec010299b1b259..acc8675372e980 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/History.md @@ -1,4 +1,9 @@ +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + 1.0.1 / 2014-11-25 ================== diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js index 55fa5a4bc6056a..549ae2f065ea5a 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/browser.js @@ -55,7 +55,12 @@ function deprecate (fn, msg) { */ function config (name) { - if (!global.localStorage) return false; + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } var val = global.localStorage[name]; if (null == val) return false; return String(val).toLowerCase() === 'true'; diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json index ea487da0e43000..ae0c70f6c633f1 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json @@ -1,6 +1,6 @@ { "name": "util-deprecate", - "version": "1.0.1", + "version": "1.0.2", "description": "The Node.js `util.deprecate()` function with browser support", "main": "node.js", "browser": "browser.js", @@ -28,11 +28,12 @@ "url": "https://github.com/TooTallNate/util-deprecate/issues" }, "homepage": "https://github.com/TooTallNate/util-deprecate", - "gitHead": "6e923f7d98a0afbe5b9c7db9d0f0029c1936746c", - "_id": "util-deprecate@1.0.1", - "_shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", + "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4", + "_id": "util-deprecate@1.0.2", + "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", "_from": "util-deprecate@>=1.0.1 <1.1.0", - "_npmVersion": "1.4.28", + "_npmVersion": "2.14.4", + "_nodeVersion": "4.1.2", "_npmUser": { "name": "tootallnate", "email": "nathan@tootallnate.net" @@ -44,10 +45,10 @@ } ], "dist": { - "shasum": "3556a3d13c4c6aa7983d7e2425478197199b7881", - "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz" + "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", + "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.1.tgz", + "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "readme": "ERROR: No README data found!" } 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 70ad998cae2d45..0d67d9bbbfbc67 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 @@ -33,43 +33,14 @@ "util": false }, "license": "MIT", - "gitHead": "1a70134a71196eeabb5e27bc7580faaa68d30513", + "readme": "# readable-stream\n\n***Node-core streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)\n\n\n[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)\n[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)\n\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)\n\n```bash\nnpm install --save readable-stream\n```\n\n***Node-core streams for userland***\n\nThis package is a mirror of the Streams2 and Streams3 implementations in\nNode-core, including [documentation](doc/stream.markdown).\n\nIf you want to guarantee a stable streams base, regardless of what version of\nNode you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *\"stream\"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).\n\nAs of version 2.0.0 **readable-stream** uses semantic versioning. \n\n# Streams WG Team Members\n\n* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com>\n - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B\n* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com>\n - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242\n* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org>\n - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D\n* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com>\n* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com>\n* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me>\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/nodejs/readable-stream/issues" }, "homepage": "https://github.com/nodejs/readable-stream#readme", "_id": "readable-stream@2.0.2", "_shasum": "bec81beae8cf455168bc2e5b2b31f5bcfaed9b1b", - "_from": "readable-stream@>=2.0.0 <2.1.0", - "_npmVersion": "2.11.1", - "_nodeVersion": "2.3.0", - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "dist": { - "shasum": "bec81beae8cf455168bc2e5b2b31f5bcfaed9b1b", - "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - }, - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "directories": {}, "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.2.tgz", - "readme": "ERROR: No README data found!" + "_from": "readable-stream@>=2.0.0 <2.1.0" } diff --git a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile index b4ff85a33b6eb4..2d7580746d0b84 100644 --- a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile +++ b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile @@ -4,4 +4,3 @@ test: @./test/run.js .PHONY: test - diff --git a/deps/npm/node_modules/request/node_modules/combined-stream/package.json b/deps/npm/node_modules/request/node_modules/combined-stream/package.json index 10339866f9134b..e0cd160ff6dbe5 100644 --- a/deps/npm/node_modules/request/node_modules/combined-stream/package.json +++ b/deps/npm/node_modules/request/node_modules/combined-stream/package.json @@ -32,7 +32,7 @@ }, "_id": "combined-stream@1.0.5", "_shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", - "_from": "combined-stream@>=1.0.1 <1.1.0", + "_from": "combined-stream@>=1.0.5 <1.1.0", "_npmVersion": "2.10.1", "_nodeVersion": "0.12.4", "_npmUser": { diff --git a/deps/npm/node_modules/request/node_modules/forever-agent/index.js b/deps/npm/node_modules/request/node_modules/forever-agent/index.js index 416c7abd709233..d7276fd97391c6 100644 --- a/deps/npm/node_modules/request/node_modules/forever-agent/index.js +++ b/deps/npm/node_modules/request/node_modules/forever-agent/index.js @@ -6,8 +6,8 @@ var util = require('util') , net = require('net') , tls = require('tls') , AgentSSL = require('https').Agent - -function getConnectionName(host, port) { + +function getConnectionName(host, port) { var name = '' if (typeof host === 'string') { name = host + ':' + port @@ -16,7 +16,7 @@ function getConnectionName(host, port) { name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':') } return name -} +} function ForeverAgent(options) { var self = this @@ -34,7 +34,7 @@ function ForeverAgent(options) { } else if (self.sockets[name].length < self.minSockets) { if (!self.freeSockets[name]) self.freeSockets[name] = [] self.freeSockets[name].push(socket) - + // if an error happens while we don't use the socket anyway, meh, throw the socket away var onIdleError = function() { socket.destroy() @@ -60,7 +60,7 @@ ForeverAgent.prototype.createConnection = net.createConnection ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest ForeverAgent.prototype.addRequest = function(req, host, port) { var name = getConnectionName(host, port) - + if (typeof host !== 'string') { var options = host port = options.port @@ -89,7 +89,7 @@ ForeverAgent.prototype.removeSocket = function(s, name, host, port) { delete this.sockets[name] delete this.requests[name] } - + if (this.freeSockets[name]) { var index = this.freeSockets[name].indexOf(s) if (index !== -1) { 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 ef074a51063a85..1d672c1c9a885e 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 @@ -18,39 +18,14 @@ "engines": { "node": "*" }, - "gitHead": "1b3b6163f2b3c2c4122bbfa288c1325c0df9871d", + "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n", + "readmeFilename": "README.md", "bugs": { "url": "https://github.com/mikeal/forever-agent/issues" }, - "homepage": "https://github.com/mikeal/forever-agent", + "homepage": "https://github.com/mikeal/forever-agent#readme", "_id": "forever-agent@0.6.1", - "scripts": {}, "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", - "_from": "forever-agent@>=0.6.0 <0.7.0", - "_npmVersion": "1.4.28", - "_npmUser": { - "name": "simov", - "email": "simeonvelichkov@gmail.com" - }, - "maintainers": [ - { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, - { - "name": "nylen", - "email": "jnylen@gmail.com" - }, - { - "name": "simov", - "email": "simeonvelichkov@gmail.com" - } - ], - "dist": { - "shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", - "tarball": "http://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "readme": "ERROR: No README data found!" + "_from": "forever-agent@>=0.6.1 <0.7.0" } 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 d646d803453f3d..cdc0f8ccc894c1 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 @@ -81,40 +81,10 @@ "tests" ] }, - "gitHead": "92f78aebad222d60c13e4299c0e723f2fe2d6611", + "readme": "ERROR: No README data found!", "homepage": "https://github.com/caolan/async#readme", "_id": "async@1.4.2", "_shasum": "6c9edcb11ced4f0dd2f2d40db0d49a109c088aab", - "_from": "async@>=1.4.0 <2.0.0", - "_npmVersion": "2.9.0", - "_nodeVersion": "2.0.1", - "_npmUser": { - "name": "megawac", - "email": "megawac@gmail.com" - }, - "dist": { - "shasum": "6c9edcb11ced4f0dd2f2d40db0d49a109c088aab", - "tarball": "http://registry.npmjs.org/async/-/async-1.4.2.tgz" - }, - "maintainers": [ - { - "name": "caolan", - "email": "caolan.mcmahon@gmail.com" - }, - { - "name": "beaugunderson", - "email": "beau@beaugunderson.com" - }, - { - "name": "aearly", - "email": "alexander.early@gmail.com" - }, - { - "name": "megawac", - "email": "megawac@gmail.com" - } - ], - "directories": {}, "_resolved": "https://registry.npmjs.org/async/-/async-1.4.2.tgz", - "readme": "ERROR: No README data found!" + "_from": "async@>=1.4.0 <2.0.0" } 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 8fba29b8002baa..662e628b206630 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/form-data/form-data#readme", "_id": "form-data@1.0.0-rc3", "_shasum": "d35bc62e7fbc2937ae78f948aaa0d38d90607577", - "_from": "form-data@>=1.0.0-rc1 <1.1.0", + "_from": "form-data@>=1.0.0-rc3 <1.1.0", "_npmVersion": "2.11.0", "_nodeVersion": "2.2.1", "_npmUser": { diff --git a/deps/npm/node_modules/request/node_modules/har-validator/README.md b/deps/npm/node_modules/request/node_modules/har-validator/README.md index f40ab755da29e1..2399b316e07e00 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/README.md +++ b/deps/npm/node_modules/request/node_modules/har-validator/README.md @@ -42,282 +42,306 @@ har-validator --schema request request.json ## API -### Validate(data [, callback]) +**Note**: as of [`v2.0.0`](https://github.com/ahmadnassri/har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. *For backward comptability with `v1.x` an [async/callback API](#callback-api) is provided* + +### Validate(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a full [HAR](http://www.softwareishard.com/blog/har-12-spec/) object -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var HAR = require('./har.json'); -var validate = require('har-validator'); - -validate(HAR, function (e, valid) { - if (e) console.log(e.errors) - - if (valid) console.log('horray!'); -}); +var HAR = require('./har.json') +var validate = require('har-validator') + +validate(HAR) + .then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.log(data [, callback]) +### Validate.log(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a [log](http://www.softwareishard.com/blog/har-12-spec/#log) object -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var validate = require('har-validator'); - -validate.log(data, function (e, valid) { - if (e) console.log(e.errors) -}); +var validate = require('har-validator') + +validate.log(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.cache(data [, callback]) +### Validate.cache(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a [cache](http://www.softwareishard.com/blog/har-12-spec/#cache) object -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var validate = require('har-validator'); - -validate.cache(data, function (e, valid) { - if (e) console.log(e.errors) -}); +var validate = require('har-validator') + +validate.cache(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.cacheEntry(data [, callback]) +### Validate.cacheEntry(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a ["beforeRequest" or "afterRequest"](http://www.softwareishard.com/blog/har-12-spec/#cache) objects -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var validate = require('har-validator'); - -validate.cacheEntry(data, function (e, valid) { - if (e) console.log(e.errors) -}); +var validate = require('har-validator') + +validate.cacheEntry(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.content(data [, callback]) +### Validate.content(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a [content](http://www.softwareishard.com/blog/har-12-spec/#content) object -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var validate = require('har-validator'); - -validate.content(data, function (e, valid) { - if (e) console.log(e.errors) -}); +var validate = require('har-validator') + +validate.content(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.cookie(data [, callback]) +### Validate.cookie(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a [cookie](http://www.softwareishard.com/blog/har-12-spec/#cookies) object -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var validate = require('har-validator'); - -validate.cookie(data, function (e, valid) { - if (e) console.log(e.errors) -}); +var validate = require('har-validator') + +validate.cookie(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.creator(data [, callback]) +### Validate.creator(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a [creator](http://www.softwareishard.com/blog/har-12-spec/#creator) object -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var validate = require('har-validator'); - -validate.creator(data, function (e, valid) { - if (e) console.log(e.errors) -}); +var validate = require('har-validator') + +validate.creator(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.entry(data [, callback]) +### Validate.entry(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* an [entry](http://www.softwareishard.com/blog/har-12-spec/#entries) object -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var validate = require('har-validator'); - -validate.entry(data, function (e, valid) { - if (e) console.log(e.errors) -}); +var validate = require('har-validator') + +validate.entry(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.log(data [, callback]) +### Validate.log(data) -alias of [`Validate(data [, callback])`](#validate-data-callback-) +alias of [`Validate(data)`](#validate-data-callback-) -### Validate.page(data [, callback]) +### Validate.page(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a [page](http://www.softwareishard.com/blog/har-12-spec/#pages) object -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var validate = require('har-validator'); - -validate.page(data, function (e, valid) { - if (e) console.log(e.errors) -}); +var validate = require('har-validator') + +validate.page(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.pageTimings(data [, callback]) +### Validate.pageTimings(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a [pageTimings](http://www.softwareishard.com/blog/har-12-spec/#pageTimings) object -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var validate = require('har-validator'); - -validate.pageTimings(data, function (e, valid) { - if (e) console.log(e.errors) -}); +var validate = require('har-validator') + +validate.pageTimings(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.postData(data [, callback]) +### Validate.postData(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a [postData](http://www.softwareishard.com/blog/har-12-spec/#postData) object -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var validate = require('har-validator'); - -validate.postData(data, function (e, valid) { - if (e) console.log(e.errors) -}); +var validate = require('har-validator') + +validate.postData(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.record(data [, callback]) +### Validate.record(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a [record](http://www.softwareishard.com/blog/har-12-spec/#headers) object -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var validate = require('har-validator'); - -validate.record(data, function (e, valid) { - if (e) console.log(e.errors) -}); +var validate = require('har-validator') + +validate.record(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.request(data [, callback]) +### Validate.request(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a [request](http://www.softwareishard.com/blog/har-12-spec/#request) object -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var validate = require('har-validator'); - -validate.request(data, function (e, valid) { - if (e) console.log(e.errors) -}); +var validate = require('har-validator') + +validate.request(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.response(data [, callback]) +### Validate.response(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a [response](http://www.softwareishard.com/blog/har-12-spec/#response) object -- **callback**: `Function` - gets two arguments (err, valid) - ```js -var validate = require('har-validator'); - -validate.cacheEntry(data, function (e, valid) { - if (e) console.log(e.errors) -}); +var validate = require('har-validator') + +validate.cacheEntry(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) ``` -### Validate.timings(data [, callback]) +### Validate.timings(data) -Returns `true` or `false`. +> Returns a promise that resolves to the valid object. - **data**: `Object` *(Required)* a [timings](http://www.softwareishard.com/blog/har-12-spec/#timings) object -- **callback**: `Function` - gets two arguments (err, valid) +```js +var validate = require('har-validator') + +validate.timings(data.then(function (HAR) { + console.log('horray!') + }) + .catch(function (error) { + console.error(error) + }) +``` + +---- + +## Callback API + +### Validate(data [, callback]) + +> Returns `true` or `false`. ```js -var validate = require('har-validator'); +var HAR = require('./har.json'); +var validate = require('har-validator/lib/async'); -validate.timings(data, function (e, valid) { +validate(HAR, function (e, valid) { if (e) console.log(e.errors) + + if (valid) console.log('horray!'); }); + ``` +The async API provides exactly the same methods as the [Promise API](#promise-api) + +---- ## Support diff --git a/deps/npm/node_modules/request/node_modules/har-validator/bin/har-validator b/deps/npm/node_modules/request/node_modules/har-validator/bin/har-validator index ab1db256f798e2..fd7cc0d34dc42c 100755 --- a/deps/npm/node_modules/request/node_modules/har-validator/bin/har-validator +++ b/deps/npm/node_modules/request/node_modules/har-validator/bin/har-validator @@ -2,14 +2,14 @@ 'use strict' -var Promise = require('bluebird') - var chalk = require('chalk') var cmd = require('commander') -var fs = Promise.promisifyAll(require('fs')) +var fs = require('fs') var path = require('path') var pkg = require('../package.json') -var validate = Promise.promisifyAll(require('..')) +var Promise = require('pinkie-promise') +var validate = require('..') +var ValidationError = require('../lib/error') cmd .version(pkg.version) @@ -21,25 +21,36 @@ if (!cmd.args.length) { cmd.help() } -if (!cmd.schema) { - cmd.schema = 'har' -} - cmd.args.map(function (fileName) { var file = chalk.yellow.italic(path.basename(fileName)) - fs.readFileAsync(fileName) + new Promise(function (resolve, reject) { + fs.readFile(fileName, function (err, data) { + return err === null ? resolve(data) : reject(err) + }) + }) + .then(JSON.parse) - .then(validate[cmd.schema + 'Async']) - .then(function () { + + .then(cmd.schema ? validate[cmd.schema] : validate) + + .then(function (data) { console.log('%s [%s] is valid', chalk.green('✓'), file) }) - .catch(SyntaxError, function (e) { - console.error('%s [%s] failed to read JSON: %s', chalk.red('✖'), file, chalk.red(e.message)) - }) - .catch(function (e) { - e.errors.map(function (err) { - console.error('%s [%s] failed validation: (%s: %s) %s', chalk.red('✖'), file, chalk.cyan.italic(err.field), chalk.magenta.italic(err.value), chalk.red(err.message)) - }) + + .catch(function (err) { + if (err instanceof SyntaxError) { + return console.error('%s [%s] failed to read JSON: %s', chalk.red('✖'), file, chalk.red(err.message)) + } + + if (err instanceof ValidationError) { + err.errors.forEach(function (details) { + console.error('%s [%s] failed validation: (%s: %s) %s', chalk.red('✖'), file, chalk.cyan.italic(details.field), chalk.magenta.italic(details.value), chalk.red(details.message)) + }) + + return + } + + console.error('%s [%s] an unknown error has occured: %s', chalk.red('✖'), file, chalk.red(err.message)) }) }) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/async.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/async.js new file mode 100644 index 00000000000000..77b99a7db7b697 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/async.js @@ -0,0 +1,14 @@ +'use strict' + +var runner = require('./runner') +var schemas = require('./schemas') + +module.exports = function (data, cb) { + return runner(schemas.har, data, cb) +} + +Object.keys(schemas).map(function (name) { + module.exports[name] = function (data, cb) { + return runner(schemas[name], data, cb) + } +}) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/index.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/index.js index 81d55607c9e5ff..e8351b8d568435 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/lib/index.js +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/index.js @@ -1,39 +1,22 @@ 'use strict' +var Promise = require('pinkie-promise') +var runner = require('./runner') var schemas = require('./schemas') -var ValidationError = require('./error') -var validator = require('is-my-json-valid') -var runner = function (schema, data, cb) { - var validate = validator(schema, { - greedy: true, - verbose: true, - schemas: schemas - }) - - var valid = false - - if (data !== undefined) { - // execute is-my-json-valid - valid = validate(data) - } - - // callback? - if (!cb) { - return valid - } else { - return cb(validate.errors ? new ValidationError(validate.errors) : null, valid) +var promisify = function (schema) { + return function (data) { + return new Promise(function (resolve, reject) { + runner(schema, data, function (err, valid) { + return err === null ? resolve(data) : reject(err) + }) + }) } - - return valid } -module.exports = function (data, cb) { - return runner(schemas.har, data, cb) -} +module.exports = promisify(schemas.har) +// utility methods for all parts of the schema Object.keys(schemas).map(function (name) { - module.exports[name] = function (data, cb) { - return runner(schemas[name], data, cb) - } + module.exports[name] = promisify(schemas[name]) }) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/lib/runner.js b/deps/npm/node_modules/request/node_modules/har-validator/lib/runner.js new file mode 100644 index 00000000000000..f0ed484e155561 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/har-validator/lib/runner.js @@ -0,0 +1,29 @@ +'use strict' + +var schemas = require('./schemas') +var ValidationError = require('./error') +var validator = require('is-my-json-valid') + +module.exports = function (schema, data, cb) { + // default value + var valid = false + + // validator config + var validate = validator(schema, { + greedy: true, + verbose: true, + schemas: schemas + }) + + // execute is-my-json-valid + if (data !== undefined) { + valid = validate(data) + } + + // callback? + if (typeof cb === 'function') { + return cb(validate.errors ? new ValidationError(validate.errors) : null, valid) + } + + return valid +} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/LICENSE b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/LICENSE deleted file mode 100644 index 4182a1e1cce041..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2015 Petka Antonov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -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/request/node_modules/har-validator/node_modules/bluebird/README.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/README.md deleted file mode 100644 index 949f6257990d1b..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/README.md +++ /dev/null @@ -1,679 +0,0 @@ - - Promises/A+ logo - -[![Build Status](https://travis-ci.org/petkaantonov/bluebird.svg?branch=master)](https://travis-ci.org/petkaantonov/bluebird) -[![coverage-98%](http://img.shields.io/badge/coverage-98%-brightgreen.svg?style=flat)](http://petkaantonov.github.io/bluebird/coverage/debug/index.html) - -**Got a question?** Join us on [stackoverflow](http://stackoverflow.com/questions/tagged/bluebird), the [mailing list](https://groups.google.com/forum/#!forum/bluebird-js) or chat on [IRC](https://webchat.freenode.net/?channels=#promises) - -# Introduction - -Bluebird is a fully featured [promise](#what-are-promises-and-why-should-i-use-them) library with focus on innovative features and performance - - - -# Topics - -- [Features](#features) -- [Quick start](#quick-start) -- [API Reference and examples](API.md) -- [Support](#support) -- [What are promises and why should I use them?](#what-are-promises-and-why-should-i-use-them) -- [Questions and issues](#questions-and-issues) -- [Error handling](#error-handling) -- [Development](#development) - - [Testing](#testing) - - [Benchmarking](#benchmarks) - - [Custom builds](#custom-builds) - - [For library authors](#for-library-authors) -- [What is the sync build?](#what-is-the-sync-build) -- [License](#license) -- [Snippets for common problems](https://github.com/petkaantonov/bluebird/wiki/Snippets) -- [Promise anti-patterns](https://github.com/petkaantonov/bluebird/wiki/Promise-anti-patterns) -- [Changelog](changelog.md) -- [Optimization guide](#optimization-guide) - -# Features -bluebird logo - -- [Promises A+](http://promisesaplus.com) -- [Synchronous inspection](API.md#synchronous-inspection) -- [Concurrency coordination](API.md#collections) -- [Promisification on steroids](API.md#promisification) -- [Resource management through a parallel of python `with`/C# `using`](API.md#resource-management) -- [Cancellation and timeouts](API.md#cancellation) -- [Parallel for C# `async` and `await`](API.md#generators) -- Mind blowing utilities such as - - [`.bind()`](API.md#binddynamic-thisarg---promise) - - [`.call()`](API.md#callstring-propertyname--dynamic-arg---promise) - - [`Promise.join()`](API.md#promisejoinpromisethenablevalue-promises-function-handler---promise) - - [And](API.md#core) [much](API.md#timers) [more](API.md#utility)! -- [Practical debugging solutions and sane defaults](#error-handling) -- [Sick performance](benchmark/) - -
      - -# Quick start - -## Node.js - - npm install bluebird - -Then: - -```js -var Promise = require("bluebird"); -``` - -## Browsers - -There are many ways to use bluebird in browsers: - -- Direct downloads - - Full build [bluebird.js](https://cdn.jsdelivr.net/bluebird/latest/bluebird.js) - - Full build minified [bluebird.min.js](https://cdn.jsdelivr.net/bluebird/latest/bluebird.min.js) - - Core build [bluebird.core.js](https://cdn.jsdelivr.net/bluebird/latest/bluebird.core.js) - - Core build minified [bluebird.core.min.js](https://cdn.jsdelivr.net/bluebird/latest/bluebird.core.min.js) -- You may use browserify on the main export -- You may use the [bower](http://bower.io) package. - -When using script tags the global variables `Promise` and `P` (alias for `Promise`) become available. - -A [minimal bluebird browser build](#custom-builds) is ≈38.92KB minified*, 11.65KB gzipped and has no external dependencies. - -*Google Closure Compiler using Simple. - -#### Browser support - -Browsers that [implement ECMA-262, edition 3](http://en.wikipedia.org/wiki/Ecmascript#Implementations) and later are supported. - -[![Selenium Test Status](https://saucelabs.com/browser-matrix/petka_antonov.svg)](https://saucelabs.com/u/petka_antonov) - -**Note** that in ECMA-262, edition 3 (IE7, IE8 etc.) it is not possible to use methods that have keyword names like `.catch` and `.finally`. The [API documentation](API.md) always lists a compatible alternative name that you can use if you need to support these browsers. For example `.catch` is replaced with `.caught` and `.finally` with `.lastly`. - -Also, [long stack trace](API.md#promiselongstacktraces---void) support is only available in Chrome, Firefox and Internet Explorer 10+. - -After quick start, see [API Reference and examples](API.md) - -
      - -# Support - -- Mailing list: [bluebird-js@googlegroups.com](https://groups.google.com/forum/#!forum/bluebird-js) -- IRC: #promises @freenode -- StackOverflow: [bluebird tag](http://stackoverflow.com/questions/tagged/bluebird) -- Bugs and feature requests: [github issue tracker](https://github.com/petkaantonov/bluebird/issues?state=open) - -
      - -# What are promises and why should I use them? - -You should use promises to turn this: - -```js -fs.readFile("file.json", function(err, val) { - if( err ) { - console.error("unable to read file"); - } - else { - try { - val = JSON.parse(val); - console.log(val.success); - } - catch( e ) { - console.error("invalid json in file"); - } - } -}); -``` - -Into this: - -```js -fs.readFileAsync("file.json").then(JSON.parse).then(function(val) { - console.log(val.success); -}) -.catch(SyntaxError, function(e) { - console.error("invalid json in file"); -}) -.catch(function(e) { - console.error("unable to read file"); -}); -``` - -*If you are wondering "there is no `readFileAsync` method on `fs` that returns a promise", see [promisification](API.md#promisification)* - -Actually you might notice the latter has a lot in common with code that would do the same using synchronous I/O: - -```js -try { - var val = JSON.parse(fs.readFileSync("file.json")); - console.log(val.success); -} -//Syntax actually not supported in JS but drives the point -catch(SyntaxError e) { - console.error("invalid json in file"); -} -catch(Error e) { - console.error("unable to read file"); -} -``` - -And that is the point - being able to have something that is a lot like `return` and `throw` in synchronous code. - -You can also use promises to improve code that was written with callback helpers: - - -```js -//Copyright Plato http://stackoverflow.com/a/19385911/995876 -//CC BY-SA 2.5 -mapSeries(URLs, function (URL, done) { - var options = {}; - needle.get(URL, options, function (error, response, body) { - if (error) { - return done(error); - } - try { - var ret = JSON.parse(body); - return done(null, ret); - } - catch (e) { - done(e); - } - }); -}, function (err, results) { - if (err) { - console.log(err); - } else { - console.log('All Needle requests successful'); - // results is a 1 to 1 mapping in order of URLs > needle.body - processAndSaveAllInDB(results, function (err) { - if (err) { - return done(err); - } - console.log('All Needle requests saved'); - done(null); - }); - } -}); -``` - -Is more pleasing to the eye when done with promises: - -```js -Promise.promisifyAll(needle); -var options = {}; - -var current = Promise.resolve(); -Promise.map(URLs, function(URL) { - current = current.then(function () { - return needle.getAsync(URL, options); - }); - return current; -}).map(function(responseAndBody){ - return JSON.parse(responseAndBody[1]); -}).then(function (results) { - return processAndSaveAllInDB(results); -}).then(function(){ - console.log('All Needle requests saved'); -}).catch(function (e) { - console.log(e); -}); -``` - -Also promises don't just give you correspondences for synchronous features but can also be used as limited event emitters or callback aggregators. - -More reading: - - - [Promise nuggets](https://promise-nuggets.github.io/) - - [Why I am switching to promises](http://spion.github.io/posts/why-i-am-switching-to-promises.html) - - [What is the the point of promises](http://domenic.me/2012/10/14/youre-missing-the-point-of-promises/#toc_1) - - [Snippets for common problems](https://github.com/petkaantonov/bluebird/wiki/Snippets) - - [Promise anti-patterns](https://github.com/petkaantonov/bluebird/wiki/Promise-anti-patterns) - -# Questions and issues - -The [github issue tracker](https://github.com/petkaantonov/bluebird/issues) is **_only_** for bug reports and feature requests. Anything else, such as questions for help in using the library, should be posted in [StackOverflow](http://stackoverflow.com/questions/tagged/bluebird) under tags `promise` and `bluebird`. - -# Error handling - -This is a problem every promise library needs to handle in some way. Unhandled rejections/exceptions don't really have a good agreed-on asynchronous correspondence. The problem is that it is impossible to predict the future and know if a rejected promise will eventually be handled. - -There are two common pragmatic attempts at solving the problem that promise libraries do. - -The more popular one is to have the user explicitly communicate that they are done and any unhandled rejections should be thrown, like so: - -```js -download().then(...).then(...).done(); -``` - -For handling this problem, in my opinion, this is completely unacceptable and pointless. The user must remember to explicitly call `.done` and that cannot be justified when the problem is forgetting to create an error handler in the first place. - -The second approach, which is what bluebird by default takes, is to call a registered handler if a rejection is unhandled by the start of a second turn. The default handler is to write the stack trace to `stderr` or `console.error` in browsers. This is close to what happens with synchronous code - your code doesn't work as expected and you open console and see a stack trace. Nice. - -Of course this is not perfect, if your code for some reason needs to swoop in and attach error handler to some promise after the promise has been hanging around a while then you will see annoying messages. In that case you can use the `.done()` method to signal that any hanging exceptions should be thrown. - -If you want to override the default handler for these possibly unhandled rejections, you can pass yours like so: - -```js -Promise.onPossiblyUnhandledRejection(function(error){ - throw error; -}); -``` - -If you want to also enable long stack traces, call: - -```js -Promise.longStackTraces(); -``` - -right after the library is loaded. - -In node.js use the environment flag `BLUEBIRD_DEBUG`: - -``` -BLUEBIRD_DEBUG=1 node server.js -``` - -to enable long stack traces in all instances of bluebird. - -Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have already been created. Long stack traces imply a substantial performance penalty, even after using every trick to optimize them. - -Long stack traces are enabled by default in the debug build. - -#### Expected and unexpected errors - -A practical problem with Promises/A+ is that it models Javascript `try-catch` too closely for its own good. Therefore by default promises inherit `try-catch` warts such as the inability to specify the error types that the catch block is eligible for. It is an anti-pattern in every other language to use catch-all handlers because they swallow exceptions that you might not know about. - -Now, Javascript does have a perfectly fine and working way of creating error type hierarchies. It is still quite awkward to use them with the built-in `try-catch` however: - -```js -try { - //code -} -catch(e) { - if( e instanceof WhatIWantError) { - //handle - } - else { - throw e; - } -} -``` - -Without such checking, unexpected errors would be silently swallowed. However, with promises, bluebird brings the future (hopefully) here now and extends the `.catch` to [accept potential error type eligibility](API.md#catchfunction-errorclass-function-handler---promise). - -For instance here it is expected that some evil or incompetent entity will try to crash our server from `SyntaxError` by providing syntactically invalid JSON: - -```js -getJSONFromSomewhere().then(function(jsonString) { - return JSON.parse(jsonString); -}).then(function(object) { - console.log("it was valid json: ", object); -}).catch(SyntaxError, function(e){ - console.log("don't be evil"); -}); -``` - -Here any kind of unexpected error will be automatically reported on `stderr` along with a stack trace because we only register a handler for the expected `SyntaxError`. - -Ok, so, that's pretty neat. But actually not many libraries define error types and it is in fact a complete ghetto out there with ad hoc strings being attached as some arbitrary property name like `.name`, `.type`, `.code`, not having any property at all or even throwing strings as errors and so on. So how can we still listen for expected errors? - -Bluebird defines a special error type `OperationalError` (you can get a reference from `Promise.OperationalError`). This type of error is given as rejection reason by promisified methods when -their underlying library gives an untyped, but expected error. Primitives such as strings, and error objects that are directly created like `new Error("database didn't respond")` are considered untyped. - -Example of such library is the node core library `fs`. So if we promisify it, we can catch just the errors we want pretty easily and have programmer errors be redirected to unhandled rejection handler so that we notice them: - -```js -//Read more about promisification in the API Reference: -//API.md -var fs = Promise.promisifyAll(require("fs")); - -fs.readFileAsync("myfile.json").then(JSON.parse).then(function (json) { - console.log("Successful json"); -}).catch(SyntaxError, function (e) { - console.error("file contains invalid json"); -}).catch(Promise.OperationalError, function (e) { - console.error("unable to read file, because: ", e.message); -}); -``` - -The last `catch` handler is only invoked when the `fs` module explicitly used the `err` argument convention of async callbacks to inform of an expected error. The `OperationalError` instance will contain the original error in its `.cause` property but it does have a direct copy of the `.message` and `.stack` too. In this code any unexpected error - be it in our code or the `fs` module - would not be caught by these handlers and therefore not swallowed. - -Since a `catch` handler typed to `Promise.OperationalError` is expected to be used very often, it has a neat shorthand: - -```js -.error(function (e) { - console.error("unable to read file, because: ", e.message); -}); -``` - -See [API documentation for `.error()`](API.md#error-rejectedhandler----promise) - -Finally, Bluebird also supports predicate-based filters. If you pass a -predicate function instead of an error type, the predicate will receive -the error as an argument. The return result will be used to determine whether -the error handler should be called. - -Predicates should allow for very fine grained control over caught errors: -pattern matching, error typesets with set operations and many other techniques -can be implemented on top of them. - -Example of using a predicate-based filter: - -```js -var Promise = require("bluebird"); -var request = Promise.promisify(require("request")); - -function clientError(e) { - return e.code >= 400 && e.code < 500; -} - -request("http://www.google.com").then(function(contents){ - console.log(contents); -}).catch(clientError, function(e){ - //A client error like 400 Bad Request happened -}); -``` - -**Danger:** The JavaScript language allows throwing primitive values like strings. Throwing primitives can lead to worse or no stack traces. Primitives [are not exceptions](http://www.devthought.com/2011/12/22/a-string-is-not-an-error/). You should consider always throwing Error objects when handling exceptions. - -
      - -#### How do long stack traces differ from e.g. Q? - -Bluebird attempts to have more elaborate traces. Consider: - -```js -Error.stackTraceLimit = 25; -Q.longStackSupport = true; -Q().then(function outer() { - return Q().then(function inner() { - return Q().then(function evenMoreInner() { - a.b.c.d(); - }).catch(function catcher(e){ - console.error(e.stack); - }); - }) -}); -``` - -You will see - - ReferenceError: a is not defined - at evenMoreInner (:7:13) - From previous event: - at inner (:6:20) - -Compare to: - -```js -Error.stackTraceLimit = 25; -Promise.longStackTraces(); -Promise.resolve().then(function outer() { - return Promise.resolve().then(function inner() { - return Promise.resolve().then(function evenMoreInner() { - a.b.c.d(); - }).catch(function catcher(e){ - console.error(e.stack); - }); - }); -}); -``` - - ReferenceError: a is not defined - at evenMoreInner (:7:13) - From previous event: - at inner (:6:36) - From previous event: - at outer (:5:32) - From previous event: - at :4:21 - at Object.InjectedScript._evaluateOn (:572:39) - at Object.InjectedScript._evaluateAndWrap (:531:52) - at Object.InjectedScript.evaluate (:450:21) - - -A better and more practical example of the differences can be seen in gorgikosev's [debuggability competition](https://github.com/spion/async-compare#debuggability). - -
      - -# Development - -For development tasks such as running benchmarks or testing, you need to clone the repository and install dev-dependencies. - -Install [node](http://nodejs.org/) and [npm](https://npmjs.org/) - - git clone git@github.com:petkaantonov/bluebird.git - cd bluebird - npm install - -## Testing - -To run all tests, run - - node tools/test - -If you need to run generator tests run the `tool/test.js` script with `--harmony` argument and node 0.11+: - - node-dev --harmony tools/test - -You may specify an individual test file to run with the `--run` script flag: - - node tools/test --run=cancel.js - - -This enables output from the test and may give a better idea where the test is failing. The paramter to `--run` can be any file name located in `test/mocha` folder. - -#### Testing in browsers - -To run the test in a browser instead of node, pass the flag `--browser` to the test tool - - node tools/test --run=cancel.js --browser - -This will automatically create a server (default port 9999) and open it in your default browser once the tests have been compiled. - -Keep the test tab active because some tests are timing-sensitive and will fail if the browser is throttling timeouts. Chrome will do this for example when the tab is not active. - -#### Supported options by the test tool - -The value of boolean flags is determined by presence, if you want to pass false value for a boolean flag, use the `no-`-prefix e.g. `--no-browser`. - - - `--run=String` - Which tests to run (or compile when testing in browser). Default `"all"`. Can also be a glob string (relative to ./test/mocha folder). - - `--cover=String`. Create code coverage using the String as istanbul reporter. Coverage is created in the ./coverage folder. No coverage is created by default, default reporter is `"html"` (use `--cover` to use default reporter). - - `--browser` - Whether to compile tests for browsers. Default `false`. - - `--port=Number` - Port where local server is hosted when testing in browser. Default `9999` - - `--execute-browser-tests` - Whether to execute the compiled tests for browser when using `--browser`. Default `true`. - - `--open-browser` - Whether to open the default browser when executing browser tests. Default `true`. - - `--fake-timers` - Whether to use fake timers (`setTimeout` etc) when running tests in node. Default `true`. - - `--js-hint` - Whether to run JSHint on source files. Default `true`. - - `--saucelabs` - Whether to create a tunnel to sauce labs and run tests in their VMs instead of your browser when compiling tests for browser. Default `false`. - -## Benchmarks - -To run a benchmark, run the given command for a benchmark while on the project root. Requires bash (on windows the mingw32 that comes with git works fine too). - -Node 0.11.2+ is required to run the generator examples. - -### 1\. DoxBee sequential - -Currently the most relevant benchmark is @gorkikosev's benchmark in the article [Analysis of generators and other async patterns in node](http://spion.github.io/posts/analysis-generators-and-other-async-patterns-node.html). The benchmark emulates a situation where n amount of users are making a request in parallel to execute some mixed async/sync action. The benchmark has been modified to include a warm-up phase to minimize any JITing during timed sections. - -Command: `bench doxbee` - -### 2\. Made-up parallel - -This made-up scenario runs 15 shimmed queries in parallel. - -Command: `bench parallel` - -## Custom builds - -Custom builds for browsers are supported through a command-line utility. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      The following features can be disabled
      Feature(s)Command line identifier
      .any and Promise.anyany
      .race and Promise.racerace
      .call and .getcall_get
      .filter and Promise.filterfilter
      .map and Promise.mapmap
      .reduce and Promise.reducereduce
      .props and Promise.propsprops
      .settle and Promise.settlesettle
      .some and Promise.somesome
      .nodeifynodeify
      Promise.coroutine and Promise.spawngenerators
      Progressionprogress
      Promisificationpromisify
      Cancellationcancel
      Timerstimers
      Resource managementusing
      - - -Make sure you have cloned the repo somewhere and did `npm install` successfully. - -After that you can run: - - node tools/build --features="core" - - -The above builds the most minimal build you can get. You can add more features separated by spaces from the above list: - - node tools/build --features="core filter map reduce" - -The custom build file will be found from `/js/browser/bluebird.js`. It will have a comment that lists the disabled and enabled features. - -Note that the build leaves the `/js/main` etc folders with same features so if you use the folder for node.js at the same time, don't forget to build -a full version afterwards (after having taken a copy of the bluebird.js somewhere): - - node tools/build --debug --main --zalgo --browser --minify - -#### Supported options by the build tool - -The value of boolean flags is determined by presence, if you want to pass false value for a boolean flag, use the `no-`-prefix e.g. `--no-debug`. - - - `--main` - Whether to build the main build. The main build is placed at `js/main` directory. Default `false`. - - `--debug` - Whether to build the debug build. The debug build is placed at `js/debug` directory. Default `false`. - - `--zalgo` - Whether to build the zalgo build. The zalgo build is placed at `js/zalgo` directory. Default `false`. - - `--browser` - Whether to compile the browser build. The browser build file is placed at `js/browser/bluebird.js` Default `false`. - - `--minify` - Whether to minify the compiled browser build. The minified browser build file is placed at `js/browser/bluebird.min.js` Default `true`. - - `--features=String` - See [custom builds](#custom-builds) - -
      - -## For library authors - -Building a library that depends on bluebird? You should know about a few features. - -If your library needs to do something obtrusive like adding or modifying methods on the `Promise` prototype, uses long stack traces or uses a custom unhandled rejection handler then... that's totally ok as long as you don't use `require("bluebird")`. Instead you should create a file -that creates an isolated copy. For example, creating a file called `bluebird-extended.js` that contains: - -```js - //NOTE the function call right after -module.exports = require("bluebird/js/main/promise")(); -``` - -Your library can then use `var Promise = require("bluebird-extended");` and do whatever it wants with it. Then if the application or other library uses their own bluebird promises they will all play well together because of Promises/A+ thenable assimilation magic. - -You should also know about [`.nodeify()`](API.md#nodeifyfunction-callback---promise) which makes it easy to provide a dual callback/promise API. - -
      - -## What is the sync build? - -You may now use sync build by: - - var Promise = require("bluebird/zalgo"); - -The sync build is provided to see how forced asynchronity affects benchmarks. It should not be used in real code due to the implied hazards. - -The normal async build gives Promises/A+ guarantees about asynchronous resolution of promises. Some people think this affects performance or just plain love their code having a possibility -of stack overflow errors and non-deterministic behavior. - -The sync build skips the async call trampoline completely, e.g code like: - - async.invoke( this.fn, this, val ); - -Appears as this in the sync build: - - this.fn(val); - -This should pressure the CPU slightly less and thus the sync build should perform better. Indeed it does, but only marginally. The biggest performance boosts are from writing efficient Javascript, not from compromising determinism. - -Note that while some benchmarks are waiting for the next event tick, the CPU is actually not in use during that time. So the resulting benchmark result is not completely accurate because on node.js you only care about how much the CPU is taxed. Any time spent on CPU is time the whole process (or server) is paralyzed. And it is not graceful like it would be with threads. - - -```js -var cache = new Map(); //ES6 Map or DataStructures/Map or whatever... -function getResult(url) { - var resolver = Promise.pending(); - if (cache.has(url)) { - resolver.resolve(cache.get(url)); - } - else { - http.get(url, function(err, content) { - if (err) resolver.reject(err); - else { - cache.set(url, content); - resolver.resolve(content); - } - }); - } - return resolver.promise; -} - - - -//The result of console.log is truly random without async guarantees -function guessWhatItPrints( url ) { - var i = 3; - getResult(url).then(function(){ - i = 4; - }); - console.log(i); -} -``` - -# Optimization guide - -Articles about optimization will be periodically posted in [the wiki section](https://github.com/petkaantonov/bluebird/wiki), polishing edits are welcome. - -A single cohesive guide compiled from the articles will probably be done eventually. - -# License - -The MIT License (MIT) - -Copyright (c) 2014 Petka Antonov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -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/request/node_modules/har-validator/node_modules/bluebird/changelog.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/changelog.md deleted file mode 100644 index f300fe9f0c41f1..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/changelog.md +++ /dev/null @@ -1,1717 +0,0 @@ -## 2.10.1 (2015-09-21) - - - Fix error "Cannot promisify an API that has normal methods with 'Async'-suffix" when promisifying certain objects with a custom promisifier - -## 2.10.0 (2015-09-08) - -Features: - - - `Promise.using` can now take the promises-for-resources as an array ([#733](.)). - - Browser builds for minimal core are now hosted on CDN ([#724](.)). - -Bugfixes: - - - Disabling debug mode with `BLUEBIRD_DEBUG=0` environment variable now works ([#719](.)). - - Fix unhandled rejection reporting when passing rejected promise to `.return()` ([#721](.)). - - Fix unbound promise's then handlers being called with wrong `this` value ([#738](.)). - -## 2.9.34 (2015-07-15) - -Bugfixes: - -- Correct domain for .map, .each, .filter, .reduce callbacks ([#701](.)). - - Preserve bound-with-promise promises across the entire chain ([#702](.)). - -## 2.9.33 (2015-07-09) - -Bugfixes: - - - Methods on `Function.prototype` are no longer promisified ([#680](.)). - -## 2.9.32 (2015-07-03) - -Bugfixes: - - - Fix `.return(primitiveValue)` returning a wrapped version of the primitive value when a Node.js domain is active ([#689](.)). - -## 2.9.31 (2015-07-03) - -Bugfixes: - - - Fix Promises/A+ compliance issue regarding circular thenables: the correct behavior is to go into an infinite loop instead of warning with an error (Fixes [#682](.)). - - Fix "(node) warning: possible EventEmitter memory leak detected" ([#661](.)). - - Fix callbacks sometimes being called with a wrong node.js domain ([#664](.)). - - Fix callbacks sometimes not being called at all in iOS 8.1 WebApp mode ([#666](.), [#687](.)). - -## 2.9.30 (2015-06-14) - -Bugfixes: - - - Fix regression with `promisifyAll` not promisifying certain methods - -## 2.9.29 (2015-06-14) - -Bugfixes: - - - Improve `promisifyAll` detection of functions that are class constructors. Fixes mongodb 2.x promisification. - -## 2.9.28 (2015-06-14) - -Bugfixes: - - - Fix handled rejection being reported as unhandled in certain scenarios when using [.all](.) or [Promise.join](.) ([#645](.)) - - Fix custom scheduler not being called in Google Chrome when long stack traces are enabled ([#650](.)) - -## 2.9.27 (2015-05-30) - -Bugfixes: - - - Fix `sinon.useFakeTimers()` breaking scheduler ([#631](.)) - -Misc: - - - Add nw testing facilities (`node tools/test --nw`) - -## 2.9.26 (2015-05-25) - -Bugfixes: - - - Fix crash in NW [#624](.) - - Fix [`.return()`](.) not supporting `undefined` as return value [#627](.) - -## 2.9.25 (2015-04-28) - -Bugfixes: - - - Fix crash in node 0.8 - -## 2.9.24 (2015-04-02) - -Bugfixes: - - - Fix not being able to load multiple bluebird copies introduced in 2.9.22 ([#559](.), [#561](.), [#560](.)). - -## 2.9.23 (2015-04-02) - -Bugfixes: - - - Fix node.js domain propagation ([#521](.)). - -## 2.9.22 (2015-04-02) - - - Fix `.promisify` crashing in phantom JS ([#556](.)) - -## 2.9.21 (2015-03-30) - - - Fix error object's `'stack'`' overwriting causing an error when its defined to be a setter that throws an error ([#552](.)). - -## 2.9.20 (2015-03-29) - -Bugfixes: - - - Fix regression where there is a long delay between calling `.cancel()` and promise actually getting cancelled in Chrome when long stack traces are enabled - -## 2.9.19 (2015-03-29) - -Bugfixes: - - - Fix crashing in Chrome when long stack traces are disabled - -## 2.9.18 (2015-03-29) - -Bugfixes: - - - Fix settlePromises using trampoline - -## 2.9.17 (2015-03-29) - - -Bugfixes: - - - Fix Chrome DevTools async stack traceability ([#542](.)). - -## 2.9.16 (2015-03-28) - -Features: - - - Use setImmediate if available - -## 2.9.15 (2015-03-26) - -Features: - - - Added `.asCallback` alias for `.nodeify`. - -Bugfixes: - - - Don't always use nextTick, but try to pick up setImmediate or setTimeout in NW. Fixes [#534](.), [#525](.) - - Make progress a core feature. Fixes [#535](.) Note that progress has been removed in 3.x - this is only a fix necessary for 2.x custom builds. - -## 2.9.14 (2015-03-12) - -Bugfixes: - - - Always use process.nextTick. Fixes [#525](.) - -## 2.9.13 (2015-02-27) - -Bugfixes: - - - Fix .each, .filter, .reduce and .map callbacks being called synchornously if the input is immediate. ([#513](.)) - -## 2.9.12 (2015-02-19) - -Bugfixes: - - - Fix memory leak introduced in 2.9.0 ([#502](.)) - -## 2.9.11 (2015-02-19) - -Bugfixes: - - - Fix [#503](.) - -## 2.9.10 (2015-02-18) - -Bugfixes: - - - Fix [#501](.) - -## 2.9.9 (2015-02-12) - -Bugfixes: - - - Fix `TypeError: Cannot assign to read only property 'length'` when jsdom has declared a read-only length for all objects to inherit. - -## 2.9.8 (2015-02-10) - -Bugfixes: - - - Fix regression introduced in 2.9.7 where promisify didn't properly dynamically look up methods on `this` - -## 2.9.7 (2015-02-08) - -Bugfixes: - - - Fix `promisify` not retaining custom properties of the function. This enables promisifying the `"request"` module's export function and its methods at the same time. - - Fix `promisifyAll` methods being dependent on `this` when they are not originally dependent on `this`. This enables e.g. passing promisified `fs` functions directly as callbacks without having to bind them to `fs`. - - Fix `process.nextTick` being used over `setImmediate` in node. - -## 2.9.6 (2015-02-02) - -Bugfixes: - - - Node environment detection can no longer be fooled - -## 2.9.5 (2015-02-02) - -Misc: - - - Warn when [`.then()`](.) is passed non-functions - -## 2.9.4 (2015-01-30) - -Bugfixes: - - - Fix [.timeout()](.) not calling `clearTimeout` with the proper handle in node causing the process to wait for unneeded timeout. This was a regression introduced in 2.9.1. - -## 2.9.3 (2015-01-27) - -Bugfixes: - - - Fix node-webkit compatibility issue ([#467](https://github.com/petkaantonov/bluebird/pull/467)) - - Fix long stack trace support in recent firefox versions - -## 2.9.2 (2015-01-26) - -Bugfixes: - - - Fix critical bug regarding to using promisifyAll in browser that was introduced in 2.9.0 ([#466](https://github.com/petkaantonov/bluebird/issues/466)). - -Misc: - - - Add `"browser"` entry point to package.json - -## 2.9.1 (2015-01-24) - -Features: - - - If a bound promise is returned by the callback to [`Promise.method`](#promisemethodfunction-fn---function) and [`Promise.try`](#promisetryfunction-fn--arraydynamicdynamic-arguments--dynamic-ctx----promise), the returned promise will be bound to the same value - -## 2.9.0 (2015-01-24) - -Features: - - - Add [`Promise.fromNode`](API.md#promisefromnodefunction-resolver---promise) - - Add new paramter `value` for [`Promise.bind`](API.md#promisebinddynamic-thisarg--dynamic-value---promise) - -Bugfixes: - - - Fix several issues with [`cancellation`](API.md#cancellation) and [`.bind()`](API.md#binddynamic-thisarg---promise) interoperation when `thisArg` is a promise or thenable - - Fix promises created in [`disposers`](API#disposerfunction-disposer---disposer) not having proper long stack trace context - - Fix [`Promise.join`](API.md#promisejoinpromisethenablevalue-promises-function-handler---promise) sometimes passing the passed in callback function as the last argument to itself. - -Misc: - - - Reduce minified full browser build file size by not including unused code generation functionality. - - Major internal refactoring related to testing code and source code file layout - -## 2.8.2 (2015-01-20) - -Features: - - - [Global rejection events](https://github.com/petkaantonov/bluebird/blob/master/API.md#global-rejection-events) are now fired both as DOM3 events and as legacy events in browsers - -## 2.8.1 (2015-01-20) - -Bugfixes: - - - Fix long stack trace stiching consistency when rejected from thenables - -## 2.8.0 (2015-01-19) - -Features: - - - Major debuggability improvements: - - Long stack traces have been re-designed. They are now much more readable, - succint, relevant and consistent across bluebird features. - - Long stack traces are supported now in IE10+ - -## 2.7.1 (2015-01-15) - -Bugfixes: - - - Fix [#447](https://github.com/petkaantonov/bluebird/issues/447) - -## 2.7.0 (2015-01-15) - -Features: - - - Added more context to stack traces originating from coroutines ([#421](https://github.com/petkaantonov/bluebird/issues/421)) - - Implemented [global rejection events](https://github.com/petkaantonov/bluebird/blob/master/API.md#global-rejection-events) ([#428](https://github.com/petkaantonov/bluebird/issues/428), [#357](https://github.com/petkaantonov/bluebird/issues/357)) - - [Custom promisifiers](https://github.com/petkaantonov/bluebird/blob/master/API.md#option-promisifier) are now passed the default promisifier which can be used to add enhancements on top of normal node promisification - - [Promisification filters](https://github.com/petkaantonov/bluebird/blob/master/API.md#option-filter) are now passed `passesDefaultFilter` boolean - -Bugfixes: - - - Fix `.noConflict()` call signature ([#446]()) - - Fix `Promise.method`ified functions being called with `undefined` when they were called with no arguments - -## 2.6.4 (2015-01-12) - -Bugfixes: - - - `OperationalErrors` thrown by promisified functions retain custom properties, such as `.code` and `.path`. - -## 2.6.3 (2015-01-12) - -Bugfixes: - - - Fix [#429](https://github.com/petkaantonov/bluebird/issues/429) - - Fix [#432](https://github.com/petkaantonov/bluebird/issues/432) - - Fix [#433](https://github.com/petkaantonov/bluebird/issues/433) - -## 2.6.2 (2015-01-07) - -Bugfixes: - - - Fix [#426](https://github.com/petkaantonov/bluebird/issues/426) - -## 2.6.1 (2015-01-07) - -Bugfixes: - - - Fixed built browser files not being included in the git tag release for bower - -## 2.6.0 (2015-01-06) - -Features: - - - Significantly improve parallel promise performance and memory usage (+50% faster, -50% less memory) - - -## 2.5.3 (2014-12-30) - -## 2.5.2 (2014-12-29) - -Bugfixes: - - - Fix bug where already resolved promise gets attached more handlers while calling its handlers resulting in some handlers not being called - - Fix bug where then handlers are not called in the same order as they would run if Promises/A+ 2.3.2 was implemented as adoption - - Fix bug where using `Object.create(null)` as a rejection reason would crash bluebird - -## 2.5.1 (2014-12-29) - -Bugfixes: - - - Fix `.finally` throwing null error when it is derived from a promise that is resolved with a promise that is resolved with a promise - -## 2.5.0 (2014-12-28) - -Features: - - - [`.get`](#API.md#https://github.com/petkaantonov/bluebird/blob/master/API.md#getstring-propertyname---promise) now supports negative indexing. - -Bugfixes: - - - Fix bug with `Promise.method` wrapped function returning a promise that never resolves if the function returns a promise that is resolved with another promise - - Fix bug with `Promise.delay` never resolving if the value is a promise that is resolved with another promise - -## 2.4.3 (2014-12-28) - -Bugfixes: - - - Fix memory leak as described in [this Promises/A+ spec issue](https://github.com/promises-aplus/promises-spec/issues/179). - -## 2.4.2 (2014-12-21) - -Bugfixes: - - - Fix bug where spread rejected handler is ignored in case of rejection - - Fix synchronous scheduler passed to `setScheduler` causing infinite loop - -## 2.4.1 (2014-12-20) - -Features: - - - Error messages now have links to wiki pages for additional information - - Promises now clean up all references (to handlers, child promises etc) as soon as possible. - -## 2.4.0 (2014-12-18) - -Features: - - - Better filtering of bluebird internal calls in long stack traces, especially when using minified file in browsers - - Small performance improvements for all collection methods - - Promises now delete references to handlers attached to them as soon as possible - - Additional stack traces are now output on stderr/`console.warn` for errors that are thrown in the process/window from rejected `.done()` promises. See [#411](https://github.com/petkaantonov/bluebird/issues/411) - -## 2.3.11 (2014-10-31) - -Bugfixes: - - - Fix [#371](https://github.com/petkaantonov/bluebird/issues/371), [#373](https://github.com/petkaantonov/bluebird/issues/373) - - -## 2.3.10 (2014-10-28) - -Features: - - - `Promise.method` no longer wraps primitive errors - - `Promise.try` no longer wraps primitive errors - -## 2.3.7 (2014-10-25) - -Bugfixes: - - - Fix [#359](https://github.com/petkaantonov/bluebird/issues/359), [#362](https://github.com/petkaantonov/bluebird/issues/362) and [#364](https://github.com/petkaantonov/bluebird/issues/364) - -## 2.3.6 (2014-10-15) - -Features: - - - Implement [`.reflect()`](API.md#reflect---promisepromiseinspection) - -## 2.3.5 (2014-10-06) - -Bugfixes: - - - Fix issue when promisifying methods whose names contain the string 'args' - -## 2.3.4 (2014-09-27) - - - `P` alias was not declared inside WebWorkers - -## 2.3.3 (2014-09-27) - -Bugfixes: - - - Fix [#318](https://github.com/petkaantonov/bluebird/issues/318), [#314](https://github.com/petkaantonov/bluebird/issues/#314) - -## 2.3.2 (2014-08-25) - -Bugfixes: - - - `P` alias for `Promise` now exists in global scope when using browser builds without a module loader, fixing an issue with firefox extensions - -## 2.3.1 (2014-08-23) - -Features: - - - `.using` can now be used with disposers created from different bluebird copy - -## 2.3.0 (2014-08-13) - -Features: - - - [`.bind()`](API.md#binddynamic-thisarg---promise) and [`Promise.bind()`](API.md#promisebinddynamic-thisarg---promise) now await for the resolution of the `thisArg` if it's a promise or a thenable - -Bugfixes: - - - Fix [#276](https://github.com/petkaantonov/bluebird/issues/276) - -## 2.2.2 (2014-07-14) - - - Fix [#259](https://github.com/petkaantonov/bluebird/issues/259) - -## 2.2.1 (2014-07-07) - - - Fix multiline error messages only showing the first line - -## 2.2.0 (2014-07-07) - -Bugfixes: - - - `.any` and `.some` now consistently reject with RangeError when input array contains too few promises - - Fix iteration bug with `.reduce` when input array contains already fulfilled promises - -## 2.1.3 (2014-06-18) - -Bugfixes: - - - Fix [#235](https://github.com/petkaantonov/bluebird/issues/235) - -## 2.1.2 (2014-06-15) - -Bugfixes: - - - Fix [#232](https://github.com/petkaantonov/bluebird/issues/232) - -## 2.1.1 (2014-06-11) - -## 2.1.0 (2014-06-11) - -Features: - - - Add [`promisifier`](API.md#option-promisifier) option to `Promise.promisifyAll()` - - Improve performance of `.props()` and collection methods when used with immediate values - - -Bugfixes: - - - Fix a bug where .reduce calls the callback for an already visited item - - Fix a bug where stack trace limit is calculated to be too small, which resulted in too short stack traces - -Add undocumented experimental `yieldHandler` option to `Promise.coroutine` - -## 2.0.7 (2014-06-08) -## 2.0.6 (2014-06-07) -## 2.0.5 (2014-06-05) -## 2.0.4 (2014-06-05) -## 2.0.3 (2014-06-05) -## 2.0.2 (2014-06-04) -## 2.0.1 (2014-06-04) - -## 2.0.0 (2014-06-04) - -#What's new in 2.0 - -- [Resource management](API.md#resource-management) - never leak resources again -- [Promisification](API.md#promisification) on steroids - entire modules can now be promisified with one line of code -- [`.map()`](API.md#mapfunction-mapper--object-options---promise), [`.each()`](API.md#eachfunction-iterator---promise), [`.filter()`](API.md#filterfunction-filterer--object-options---promise), [`.reduce()`](API.md#reducefunction-reducer--dynamic-initialvalue---promise) reimagined from simple sugar to powerful concurrency coordination tools -- [API Documentation](API.md) has been reorganized and more elaborate examples added -- Deprecated [progression](#progression-migration) and [deferreds](#deferred-migration) -- Improved performance and readability - -Features: - -- Added [`using()`](API.md#promiseusingpromisedisposer-promise-promisedisposer-promise--function-handler---promise) and [`disposer()`](API.md#disposerfunction-disposer---disposer) -- [`.map()`](API.md#mapfunction-mapper--object-options---promise) now calls the handler as soon as items in the input array become fulfilled -- Added a concurrency option to [`.map()`](API.md#mapfunction-mapper--object-options---promise) -- [`.filter()`](API.md#filterfunction-filterer--object-options---promise) now calls the handler as soon as items in the input array become fulfilled -- Added a concurrency option to [`.filter()`](API.md#filterfunction-filterer--object-options---promise) -- [`.reduce()`](API.md#reducefunction-reducer--dynamic-initialvalue---promise) now calls the handler as soon as items in the input array become fulfilled, but in-order -- Added [`.each()`](API.md#eachfunction-iterator---promise) -- [`Promise.resolve()`](API.md#promiseresolvedynamic-value---promise) behaves like `Promise.cast`. `Promise.cast` deprecated. -- [Synchronous inspection](API.md#synchronous-inspection): Removed `.inspect()`, added [`.value()`](API.md#value---dynamic) and [`.reason()`](API.md#reason---dynamic) -- [`Promise.join()`](API.md#promisejoinpromisethenablevalue-promises-function-handler---promise) now takes a function as the last argument -- Added [`Promise.setScheduler()`](API.md#promisesetschedulerfunction-scheduler---void) -- [`.cancel()`](API.md#cancelerror-reason---promise) supports a custom cancellation reason -- [`.timeout()`](API.md#timeoutint-ms--string-message---promise) now cancels the promise instead of rejecting it -- [`.nodeify()`](API.md#nodeifyfunction-callback--object-options---promise) now supports passing multiple success results when mapping promises to nodebacks -- Added `suffix` and `filter` options to [`Promise.promisifyAll()`](API.md#promisepromisifyallobject-target--object-options---object) - -Breaking changes: - -- Sparse array holes are not skipped by collection methods but treated as existing elements with `undefined` value -- `.map()` and `.filter()` do not call the given mapper or filterer function in any specific order -- Removed the `.inspect()` method -- Yielding an array from a coroutine is not supported by default. You can use [`coroutine.addYieldHandler()`](API.md#promisecoroutineaddyieldhandlerfunction-handler---void) to configure the old behavior (or any behavior you want). -- [`.any()`](API.md#any---promise) and [`.some()`](API.md#someint-count---promise) no longer use an array as the rejection reason. [`AggregateError`](API.md#aggregateerror) is used instead. - - -## 1.2.4 (2014-04-27) - -Bugfixes: - - - Fix promisifyAll causing a syntax error when a method name is not a valid identifier - - Fix syntax error when es5.js is used in strict mode - -## 1.2.3 (2014-04-17) - -Bugfixes: - - - Fix [#179](https://github.com/petkaantonov/bluebird/issues/179) - -## 1.2.2 (2014-04-09) - -Bugfixes: - - - Promisified methods from promisifyAll no longer call the original method when it is overriden - - Nodeify doesn't pass second argument to the callback if the promise is fulfilled with `undefined` - -## 1.2.1 (2014-03-31) - -Bugfixes: - - - Fix [#168](https://github.com/petkaantonov/bluebird/issues/168) - -## 1.2.0 (2014-03-29) - -Features: - - - New method: [`.value()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#value---dynamic) - - New method: [`.reason()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#reason---dynamic) - - New method: [`Promise.onUnhandledRejectionHandled()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#promiseonunhandledrejectionhandledfunction-handler---undefined) - - `Promise.map()`, `.map()`, `Promise.filter()` and `.filter()` start calling their callbacks as soon as possible while retaining a correct order. See [`8085922f`](https://github.com/petkaantonov/bluebird/commit/8085922fb95a9987fda0cf2337598ab4a98dc315). - -Bugfixes: - - - Fix [#165](https://github.com/petkaantonov/bluebird/issues/165) - - Fix [#166](https://github.com/petkaantonov/bluebird/issues/166) - -## 1.1.1 (2014-03-18) - -Bugfixes: - - - [#138](https://github.com/petkaantonov/bluebird/issues/138) - - [#144](https://github.com/petkaantonov/bluebird/issues/144) - - [#148](https://github.com/petkaantonov/bluebird/issues/148) - - [#151](https://github.com/petkaantonov/bluebird/issues/151) - -## 1.1.0 (2014-03-08) - -Features: - - - Implement [`Promise.prototype.tap()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#tapfunction-handler---promise) - - Implement [`Promise.coroutine.addYieldHandler()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#promisecoroutineaddyieldhandlerfunction-handler---void) - - Deprecate `Promise.prototype.spawn` - -Bugfixes: - - - Fix already rejected promises being reported as unhandled when handled through collection methods - - Fix browserisfy crashing from checking `process.version.indexOf` - -## 1.0.8 (2014-03-03) - -Bugfixes: - - - Fix active domain being lost across asynchronous boundaries in Node.JS 10.xx - -## 1.0.7 (2014-02-25) - -Bugfixes: - - - Fix handled errors being reported - -## 1.0.6 (2014-02-17) - -Bugfixes: - - - Fix bug with unhandled rejections not being reported - when using `Promise.try` or `Promise.method` without - attaching further handlers - -## 1.0.5 (2014-02-15) - -Features: - - - Node.js performance: promisified functions try to check amount of passed arguments in most optimal order - - Node.js promisified functions will have same `.length` as the original function minus one (for the callback parameter) - -## 1.0.4 (2014-02-09) - -Features: - - - Possibly unhandled rejection handler will always get a stack trace, even if the rejection or thrown error was not an error - - Unhandled rejections are tracked per promise, not per error. So if you create multiple branches from a single ancestor and that ancestor gets rejected, each branch with no error handler with the end will cause a possibly unhandled rejection handler invocation - -Bugfixes: - - - Fix unhandled non-writable objects or primitives not reported by possibly unhandled rejection handler - -## 1.0.3 (2014-02-05) - -Bugfixes: - - - [#93](https://github.com/petkaantonov/bluebird/issues/88) - -## 1.0.2 (2014-02-04) - -Features: - - - Significantly improve performance of foreign bluebird thenables - -Bugfixes: - - - [#88](https://github.com/petkaantonov/bluebird/issues/88) - -## 1.0.1 (2014-01-28) - -Features: - - - Error objects that have property `.isAsync = true` will now be caught by `.error()` - -Bugfixes: - - - Fix TypeError and RangeError shims not working without `new` operator - -## 1.0.0 (2014-01-12) - -Features: - - - `.filter`, `.map`, and `.reduce` no longer skip sparse array holes. This is a backwards incompatible change. - - Like `.map` and `.filter`, `.reduce` now allows returning promises and thenables from the iteration function. - -Bugfixes: - - - [#58](https://github.com/petkaantonov/bluebird/issues/58) - - [#61](https://github.com/petkaantonov/bluebird/issues/61) - - [#64](https://github.com/petkaantonov/bluebird/issues/64) - - [#60](https://github.com/petkaantonov/bluebird/issues/60) - -## 0.11.6-1 (2013-12-29) - -## 0.11.6-0 (2013-12-29) - -Features: - - - You may now return promises and thenables from the filterer function used in `Promise.filter` and `Promise.prototype.filter`. - - - `.error()` now catches additional sources of rejections: - - - Rejections originating from `Promise.reject` - - - Rejections originating from thenables using - the `reject` callback - - - Rejections originating from promisified callbacks - which use the `errback` argument - - - Rejections originating from `new Promise` constructor - where the `reject` callback is called explicitly - - - Rejections originating from `PromiseResolver` where - `.reject()` method is called explicitly - -Bugfixes: - - - Fix `captureStackTrace` being called when it was `null` - - Fix `Promise.map` not unwrapping thenables - -## 0.11.5-1 (2013-12-15) - -## 0.11.5-0 (2013-12-03) - -Features: - - - Improve performance of collection methods - - Improve performance of promise chains - -## 0.11.4-1 (2013-12-02) - -## 0.11.4-0 (2013-12-02) - -Bugfixes: - - - Fix `Promise.some` behavior with arguments like negative integers, 0... - - Fix stack traces of synchronously throwing promisified functions' - -## 0.11.3-0 (2013-12-02) - -Features: - - - Improve performance of generators - -Bugfixes: - - - Fix critical bug with collection methods. - -## 0.11.2-0 (2013-12-02) - -Features: - - - Improve performance of all collection methods - -## 0.11.1-0 (2013-12-02) - -Features: - -- Improve overall performance. -- Improve performance of promisified functions. -- Improve performance of catch filters. -- Improve performance of .finally. - -Bugfixes: - -- Fix `.finally()` rejecting if passed non-function. It will now ignore non-functions like `.then`. -- Fix `.finally()` not converting thenables returned from the handler to promises. -- `.spread()` now rejects if the ultimate value given to it is not spreadable. - -## 0.11.0-0 (2013-12-02) - -Features: - - - Improve overall performance when not using `.bind()` or cancellation. - - Promises are now not cancellable by default. This is backwards incompatible change - see [`.cancellable()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#cancellable---promise) - - [`Promise.delay`](https://github.com/petkaantonov/bluebird/blob/master/API.md#promisedelaydynamic-value-int-ms---promise) - - [`.delay()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#delayint-ms---promise) - - [`.timeout()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#timeoutint-ms--string-message---promise) - -## 0.10.14-0 (2013-12-01) - -Bugfixes: - - - Fix race condition when mixing 3rd party asynchrony. - -## 0.10.13-1 (2013-11-30) - -## 0.10.13-0 (2013-11-30) - -Bugfixes: - - - Fix another bug with progression. - -## 0.10.12-0 (2013-11-30) - -Bugfixes: - - - Fix bug with progression. - -## 0.10.11-4 (2013-11-29) - -## 0.10.11-2 (2013-11-29) - -Bugfixes: - - - Fix `.race()` not propagating bound values. - -## 0.10.11-1 (2013-11-29) - -Features: - - - Improve performance of `Promise.race` - -## 0.10.11-0 (2013-11-29) - -Bugfixes: - - - Fixed `Promise.promisifyAll` invoking property accessors. Only data properties with function values are considered. - -## 0.10.10-0 (2013-11-28) - -Features: - - - Disable long stack traces in browsers by default. Call `Promise.longStackTraces()` to enable them. - -## 0.10.9-1 (2013-11-27) - -Bugfixes: - - - Fail early when `new Promise` is constructed incorrectly - -## 0.10.9-0 (2013-11-27) - -Bugfixes: - - - Promise.props now takes a [thenable-for-collection](https://github.com/petkaantonov/bluebird/blob/f41edac61b7c421608ff439bb5a09b7cffeadcf9/test/mocha/props.js#L197-L217) - - All promise collection methods now reject when a promise-or-thenable-for-collection turns out not to give a collection - -## 0.10.8-0 (2013-11-25) - -Features: - - - All static collection methods take thenable-for-collection - -## 0.10.7-0 (2013-11-25) - -Features: - - - throw TypeError when thenable resolves with itself - - Make .race() and Promise.race() forever pending on empty collections - -## 0.10.6-0 (2013-11-25) - -Bugfixes: - - - Promise.resolve and PromiseResolver.resolve follow thenables too. - -## 0.10.5-0 (2013-11-24) - -Bugfixes: - - - Fix infinite loop when thenable resolves with itself - -## 0.10.4-1 (2013-11-24) - -Bugfixes: - - - Fix a file missing from build. (Critical fix) - -## 0.10.4-0 (2013-11-24) - -Features: - - - Remove dependency of es5-shim and es5-sham when using ES3. - -## 0.10.3-0 (2013-11-24) - -Features: - - - Improve performance of `Promise.method` - -## 0.10.2-1 (2013-11-24) - -Features: - - - Rename PromiseResolver#asCallback to PromiseResolver#callback - -## 0.10.2-0 (2013-11-24) - -Features: - - - Remove memoization of thenables - -## 0.10.1-0 (2013-11-21) - -Features: - - - Add methods `Promise.resolve()`, `Promise.reject()`, `Promise.defer()` and `.resolve()`. - -## 0.10.0-1 (2013-11-17) - -## 0.10.0-0 (2013-11-17) - -Features: - - - Implement `Promise.method()` - - Implement `.return()` - - Implement `.throw()` - -Bugfixes: - - - Fix promises being able to use themselves as resolution or follower value - -## 0.9.11-1 (2013-11-14) - -Features: - - - Implicit `Promise.all()` when yielding an array from generators - -## 0.9.11-0 (2013-11-13) - -Bugfixes: - - - Fix `.spread` not unwrapping thenables - -## 0.9.10-2 (2013-11-13) - -Features: - - - Improve performance of promisified functions on V8 - -Bugfixes: - - - Report unhandled rejections even when long stack traces are disabled - - Fix `.error()` showing up in stack traces - -## 0.9.10-1 (2013-11-05) - -Bugfixes: - - - Catch filter method calls showing in stack traces - -## 0.9.10-0 (2013-11-05) - -Bugfixes: - - - Support primitives in catch filters - -## 0.9.9-0 (2013-11-05) - -Features: - - - Add `Promise.race()` and `.race()` - -## 0.9.8-0 (2013-11-01) - -Bugfixes: - - - Fix bug with `Promise.try` not unwrapping returned promises and thenables - -## 0.9.7-0 (2013-10-29) - -Bugfixes: - - - Fix bug with build files containing duplicated code for promise.js - -## 0.9.6-0 (2013-10-28) - -Features: - - - Improve output of reporting unhandled non-errors - - Implement RejectionError wrapping and `.error()` method - -## 0.9.5-0 (2013-10-27) - -Features: - - - Allow fresh copies of the library to be made - -## 0.9.4-1 (2013-10-27) - -## 0.9.4-0 (2013-10-27) - -Bugfixes: - - - Rollback non-working multiple fresh copies feature - -## 0.9.3-0 (2013-10-27) - -Features: - - - Allow fresh copies of the library to be made - - Add more components to customized builds - -## 0.9.2-1 (2013-10-25) - -## 0.9.2-0 (2013-10-25) - -Features: - - - Allow custom builds - -## 0.9.1-1 (2013-10-22) - -Bugfixes: - - - Fix unhandled rethrown exceptions not reported - -## 0.9.1-0 (2013-10-22) - -Features: - - - Improve performance of `Promise.try` - - Extend `Promise.try` to accept arguments and ctx to make it more usable in promisification of synchronous functions. - -## 0.9.0-0 (2013-10-18) - -Features: - - - Implement `.bind` and `Promise.bind` - -Bugfixes: - - - Fix `.some()` when argument is a pending promise that later resolves to an array - -## 0.8.5-1 (2013-10-17) - -Features: - - - Enable process wide long stack traces through BLUEBIRD_DEBUG environment variable - -## 0.8.5-0 (2013-10-16) - -Features: - - - Improve performance of all collection methods - -Bugfixes: - - - Fix .finally passing the value to handlers - - Remove kew from benchmarks due to bugs in the library breaking the benchmark - - Fix some bluebird library calls potentially appearing in stack traces - -## 0.8.4-1 (2013-10-15) - -Bugfixes: - - - Fix .pending() call showing in long stack traces - -## 0.8.4-0 (2013-10-15) - -Bugfixes: - - - Fix PromiseArray and its sub-classes swallowing possibly unhandled rejections - -## 0.8.3-3 (2013-10-14) - -Bugfixes: - - - Fix AMD-declaration using named module. - -## 0.8.3-2 (2013-10-14) - -Features: - - - The mortals that can handle it may now release Zalgo by `require("bluebird/zalgo");` - -## 0.8.3-1 (2013-10-14) - -Bugfixes: - - - Fix memory leak when using the same promise to attach handlers over and over again - -## 0.8.3-0 (2013-10-13) - -Features: - - - Add `Promise.props()` and `Promise.prototype.props()`. They work like `.all()` for object properties. - -Bugfixes: - - - Fix bug with .some returning garbage when sparse arrays have rejections - -## 0.8.2-2 (2013-10-13) - -Features: - - - Improve performance of `.reduce()` when `initialValue` can be synchronously cast to a value - -## 0.8.2-1 (2013-10-12) - -Bugfixes: - - - Fix .npmignore having irrelevant files - -## 0.8.2-0 (2013-10-12) - -Features: - - - Improve performance of `.some()` - -## 0.8.1-0 (2013-10-11) - -Bugfixes: - - - Remove uses of dynamic evaluation (`new Function`, `eval` etc) when strictly not necessary. Use feature detection to use static evaluation to avoid errors when dynamic evaluation is prohibited. - -## 0.8.0-3 (2013-10-10) - -Features: - - - Add `.asCallback` property to `PromiseResolver`s - -## 0.8.0-2 (2013-10-10) - -## 0.8.0-1 (2013-10-09) - -Features: - - - Improve overall performance. Be able to sustain infinite recursion when using promises. - -## 0.8.0-0 (2013-10-09) - -Bugfixes: - - - Fix stackoverflow error when function calls itself "synchronously" from a promise handler - -## 0.7.12-2 (2013-10-09) - -Bugfixes: - - - Fix safari 6 not using `MutationObserver` as a scheduler - - Fix process exceptions interfering with internal queue flushing - -## 0.7.12-1 (2013-10-09) - -Bugfixes: - - - Don't try to detect if generators are available to allow shims to be used - -## 0.7.12-0 (2013-10-08) - -Features: - - - Promisification now consider all functions on the object and its prototype chain - - Individual promisifcation uses current `this` if no explicit receiver is given - - Give better stack traces when promisified callbacks throw or errback primitives such as strings by wrapping them in an `Error` object. - -Bugfixes: - - - Fix runtime APIs throwing synchronous errors - -## 0.7.11-0 (2013-10-08) - -Features: - - - Deprecate `Promise.promisify(Object target)` in favor of `Promise.promisifyAll(Object target)` to avoid confusion with function objects - - Coroutines now throw error when a non-promise is `yielded` - -## 0.7.10-1 (2013-10-05) - -Features: - - - Make tests pass Internet Explorer 8 - -## 0.7.10-0 (2013-10-05) - -Features: - - - Create browser tests - -## 0.7.9-1 (2013-10-03) - -Bugfixes: - - - Fix promise cast bug when thenable fulfills using itself as the fulfillment value - -## 0.7.9-0 (2013-10-03) - -Features: - - - More performance improvements when long stack traces are enabled - -## 0.7.8-1 (2013-10-02) - -Features: - - - Performance improvements when long stack traces are enabled - -## 0.7.8-0 (2013-10-02) - -Bugfixes: - - - Fix promisified methods not turning synchronous exceptions into rejections - -## 0.7.7-1 (2013-10-02) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.7-0 (2013-10-01) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.6-0 (2013-09-29) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.5-0 (2013-09-28) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.4-1 (2013-09-28) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.4-0 (2013-09-28) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.3-1 (2013-09-28) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.3-0 (2013-09-27) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.2-0 (2013-09-27) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.1-5 (2013-09-26) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.1-4 (2013-09-25) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.1-3 (2013-09-25) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.1-2 (2013-09-24) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.1-1 (2013-09-24) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.1-0 (2013-09-24) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.0-1 (2013-09-23) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.0-0 (2013-09-23) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.5-2 (2013-09-20) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.5-1 (2013-09-18) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.5-0 (2013-09-18) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.4-1 (2013-09-18) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.4-0 (2013-09-18) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.3-4 (2013-09-18) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.3-3 (2013-09-18) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.3-2 (2013-09-16) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.3-1 (2013-09-16) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.3-0 (2013-09-15) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.2-1 (2013-09-14) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.2-0 (2013-09-14) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.1-0 (2013-09-14) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.0-0 (2013-09-13) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-6 (2013-09-12) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-5 (2013-09-12) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-4 (2013-09-12) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-3 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-2 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-1 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-0 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.8-1 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.8-0 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.7-0 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.6-1 (2013-09-10) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.6-0 (2013-09-10) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.5-1 (2013-09-10) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.5-0 (2013-09-09) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.4-1 (2013-09-08) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.4-0 (2013-09-08) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.3-0 (2013-09-07) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.2-0 (2013-09-07) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.1-0 (2013-09-07) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.0-0 (2013-09-07) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.4.0-0 (2013-09-06) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.3.0-1 (2013-09-06) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.3.0 (2013-09-06) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.js deleted file mode 100644 index c8db9da3efc918..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.js +++ /dev/null @@ -1,4881 +0,0 @@ -/* @preserve - * The MIT License (MIT) - * - * Copyright (c) 2013-2015 Petka Antonov - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * 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. - * - */ -/** - * bluebird build version 2.10.1 - * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, cancel, using, filter, any, each, timers -*/ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o 0; -}; - -Async.prototype.throwLater = function(fn, arg) { - if (arguments.length === 1) { - arg = fn; - fn = function () { throw arg; }; - } - if (typeof setTimeout !== "undefined") { - setTimeout(function() { - fn(arg); - }, 0); - } else try { - this._schedule(function() { - fn(arg); - }); - } catch (e) { - throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/m3OTXk\u000a"); - } -}; - -function AsyncInvokeLater(fn, receiver, arg) { - this._lateQueue.push(fn, receiver, arg); - this._queueTick(); -} - -function AsyncInvoke(fn, receiver, arg) { - this._normalQueue.push(fn, receiver, arg); - this._queueTick(); -} - -function AsyncSettlePromises(promise) { - this._normalQueue._pushOne(promise); - this._queueTick(); -} - -if (!util.hasDevTools) { - Async.prototype.invokeLater = AsyncInvokeLater; - Async.prototype.invoke = AsyncInvoke; - Async.prototype.settlePromises = AsyncSettlePromises; -} else { - if (schedule.isStatic) { - schedule = function(fn) { setTimeout(fn, 0); }; - } - Async.prototype.invokeLater = function (fn, receiver, arg) { - if (this._trampolineEnabled) { - AsyncInvokeLater.call(this, fn, receiver, arg); - } else { - this._schedule(function() { - setTimeout(function() { - fn.call(receiver, arg); - }, 100); - }); - } - }; - - Async.prototype.invoke = function (fn, receiver, arg) { - if (this._trampolineEnabled) { - AsyncInvoke.call(this, fn, receiver, arg); - } else { - this._schedule(function() { - fn.call(receiver, arg); - }); - } - }; - - Async.prototype.settlePromises = function(promise) { - if (this._trampolineEnabled) { - AsyncSettlePromises.call(this, promise); - } else { - this._schedule(function() { - promise._settlePromises(); - }); - } - }; -} - -Async.prototype.invokeFirst = function (fn, receiver, arg) { - this._normalQueue.unshift(fn, receiver, arg); - this._queueTick(); -}; - -Async.prototype._drainQueue = function(queue) { - while (queue.length() > 0) { - var fn = queue.shift(); - if (typeof fn !== "function") { - fn._settlePromises(); - continue; - } - var receiver = queue.shift(); - var arg = queue.shift(); - fn.call(receiver, arg); - } -}; - -Async.prototype._drainQueues = function () { - this._drainQueue(this._normalQueue); - this._reset(); - this._drainQueue(this._lateQueue); -}; - -Async.prototype._queueTick = function () { - if (!this._isTickUsed) { - this._isTickUsed = true; - this._schedule(this.drainQueues); - } -}; - -Async.prototype._reset = function () { - this._isTickUsed = false; -}; - -module.exports = new Async(); -module.exports.firstLineError = firstLineError; - -},{"./queue.js":28,"./schedule.js":31,"./util.js":38}],3:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL, tryConvertToPromise) { -var rejectThis = function(_, e) { - this._reject(e); -}; - -var targetRejected = function(e, context) { - context.promiseRejectionQueued = true; - context.bindingPromise._then(rejectThis, rejectThis, null, this, e); -}; - -var bindingResolved = function(thisArg, context) { - if (this._isPending()) { - this._resolveCallback(context.target); - } -}; - -var bindingRejected = function(e, context) { - if (!context.promiseRejectionQueued) this._reject(e); -}; - -Promise.prototype.bind = function (thisArg) { - var maybePromise = tryConvertToPromise(thisArg); - var ret = new Promise(INTERNAL); - ret._propagateFrom(this, 1); - var target = this._target(); - - ret._setBoundTo(maybePromise); - if (maybePromise instanceof Promise) { - var context = { - promiseRejectionQueued: false, - promise: ret, - target: target, - bindingPromise: maybePromise - }; - target._then(INTERNAL, targetRejected, ret._progress, ret, context); - maybePromise._then( - bindingResolved, bindingRejected, ret._progress, ret, context); - } else { - ret._resolveCallback(target); - } - return ret; -}; - -Promise.prototype._setBoundTo = function (obj) { - if (obj !== undefined) { - this._bitField = this._bitField | 131072; - this._boundTo = obj; - } else { - this._bitField = this._bitField & (~131072); - } -}; - -Promise.prototype._isBound = function () { - return (this._bitField & 131072) === 131072; -}; - -Promise.bind = function (thisArg, value) { - var maybePromise = tryConvertToPromise(thisArg); - var ret = new Promise(INTERNAL); - - ret._setBoundTo(maybePromise); - if (maybePromise instanceof Promise) { - maybePromise._then(function() { - ret._resolveCallback(value); - }, ret._reject, ret._progress, ret, null); - } else { - ret._resolveCallback(value); - } - return ret; -}; -}; - -},{}],4:[function(_dereq_,module,exports){ -"use strict"; -var old; -if (typeof Promise !== "undefined") old = Promise; -function noConflict() { - try { if (Promise === bluebird) Promise = old; } - catch (e) {} - return bluebird; -} -var bluebird = _dereq_("./promise.js")(); -bluebird.noConflict = noConflict; -module.exports = bluebird; - -},{"./promise.js":23}],5:[function(_dereq_,module,exports){ -"use strict"; -var cr = Object.create; -if (cr) { - var callerCache = cr(null); - var getterCache = cr(null); - callerCache[" size"] = getterCache[" size"] = 0; -} - -module.exports = function(Promise) { -var util = _dereq_("./util.js"); -var canEvaluate = util.canEvaluate; -var isIdentifier = util.isIdentifier; - -var getMethodCaller; -var getGetter; -if (!true) { -var makeMethodCaller = function (methodName) { - return new Function("ensureMethod", " \n\ - return function(obj) { \n\ - 'use strict' \n\ - var len = this.length; \n\ - ensureMethod(obj, 'methodName'); \n\ - switch(len) { \n\ - case 1: return obj.methodName(this[0]); \n\ - case 2: return obj.methodName(this[0], this[1]); \n\ - case 3: return obj.methodName(this[0], this[1], this[2]); \n\ - case 0: return obj.methodName(); \n\ - default: \n\ - return obj.methodName.apply(obj, this); \n\ - } \n\ - }; \n\ - ".replace(/methodName/g, methodName))(ensureMethod); -}; - -var makeGetter = function (propertyName) { - return new Function("obj", " \n\ - 'use strict'; \n\ - return obj.propertyName; \n\ - ".replace("propertyName", propertyName)); -}; - -var getCompiled = function(name, compiler, cache) { - var ret = cache[name]; - if (typeof ret !== "function") { - if (!isIdentifier(name)) { - return null; - } - ret = compiler(name); - cache[name] = ret; - cache[" size"]++; - if (cache[" size"] > 512) { - var keys = Object.keys(cache); - for (var i = 0; i < 256; ++i) delete cache[keys[i]]; - cache[" size"] = keys.length - 256; - } - } - return ret; -}; - -getMethodCaller = function(name) { - return getCompiled(name, makeMethodCaller, callerCache); -}; - -getGetter = function(name) { - return getCompiled(name, makeGetter, getterCache); -}; -} - -function ensureMethod(obj, methodName) { - var fn; - if (obj != null) fn = obj[methodName]; - if (typeof fn !== "function") { - var message = "Object " + util.classString(obj) + " has no method '" + - util.toString(methodName) + "'"; - throw new Promise.TypeError(message); - } - return fn; -} - -function caller(obj) { - var methodName = this.pop(); - var fn = ensureMethod(obj, methodName); - return fn.apply(obj, this); -} -Promise.prototype.call = function (methodName) { - var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];} - if (!true) { - if (canEvaluate) { - var maybeCaller = getMethodCaller(methodName); - if (maybeCaller !== null) { - return this._then( - maybeCaller, undefined, undefined, args, undefined); - } - } - } - args.push(methodName); - return this._then(caller, undefined, undefined, args, undefined); -}; - -function namedGetter(obj) { - return obj[this]; -} -function indexedGetter(obj) { - var index = +this; - if (index < 0) index = Math.max(0, index + obj.length); - return obj[index]; -} -Promise.prototype.get = function (propertyName) { - var isIndex = (typeof propertyName === "number"); - var getter; - if (!isIndex) { - if (canEvaluate) { - var maybeGetter = getGetter(propertyName); - getter = maybeGetter !== null ? maybeGetter : namedGetter; - } else { - getter = namedGetter; - } - } else { - getter = indexedGetter; - } - return this._then(getter, undefined, undefined, propertyName, undefined); -}; -}; - -},{"./util.js":38}],6:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise) { -var errors = _dereq_("./errors.js"); -var async = _dereq_("./async.js"); -var CancellationError = errors.CancellationError; - -Promise.prototype._cancel = function (reason) { - if (!this.isCancellable()) return this; - var parent; - var promiseToReject = this; - while ((parent = promiseToReject._cancellationParent) !== undefined && - parent.isCancellable()) { - promiseToReject = parent; - } - this._unsetCancellable(); - promiseToReject._target()._rejectCallback(reason, false, true); -}; - -Promise.prototype.cancel = function (reason) { - if (!this.isCancellable()) return this; - if (reason === undefined) reason = new CancellationError(); - async.invokeLater(this._cancel, this, reason); - return this; -}; - -Promise.prototype.cancellable = function () { - if (this._cancellable()) return this; - async.enableTrampoline(); - this._setCancellable(); - this._cancellationParent = undefined; - return this; -}; - -Promise.prototype.uncancellable = function () { - var ret = this.then(); - ret._unsetCancellable(); - return ret; -}; - -Promise.prototype.fork = function (didFulfill, didReject, didProgress) { - var ret = this._then(didFulfill, didReject, didProgress, - undefined, undefined); - - ret._setCancellable(); - ret._cancellationParent = undefined; - return ret; -}; -}; - -},{"./async.js":2,"./errors.js":13}],7:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function() { -var async = _dereq_("./async.js"); -var util = _dereq_("./util.js"); -var bluebirdFramePattern = - /[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/; -var stackFramePattern = null; -var formatStack = null; -var indentStackFrames = false; -var warn; - -function CapturedTrace(parent) { - this._parent = parent; - var length = this._length = 1 + (parent === undefined ? 0 : parent._length); - captureStackTrace(this, CapturedTrace); - if (length > 32) this.uncycle(); -} -util.inherits(CapturedTrace, Error); - -CapturedTrace.prototype.uncycle = function() { - var length = this._length; - if (length < 2) return; - var nodes = []; - var stackToIndex = {}; - - for (var i = 0, node = this; node !== undefined; ++i) { - nodes.push(node); - node = node._parent; - } - length = this._length = i; - for (var i = length - 1; i >= 0; --i) { - var stack = nodes[i].stack; - if (stackToIndex[stack] === undefined) { - stackToIndex[stack] = i; - } - } - for (var i = 0; i < length; ++i) { - var currentStack = nodes[i].stack; - var index = stackToIndex[currentStack]; - if (index !== undefined && index !== i) { - if (index > 0) { - nodes[index - 1]._parent = undefined; - nodes[index - 1]._length = 1; - } - nodes[i]._parent = undefined; - nodes[i]._length = 1; - var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; - - if (index < length - 1) { - cycleEdgeNode._parent = nodes[index + 1]; - cycleEdgeNode._parent.uncycle(); - cycleEdgeNode._length = - cycleEdgeNode._parent._length + 1; - } else { - cycleEdgeNode._parent = undefined; - cycleEdgeNode._length = 1; - } - var currentChildLength = cycleEdgeNode._length + 1; - for (var j = i - 2; j >= 0; --j) { - nodes[j]._length = currentChildLength; - currentChildLength++; - } - return; - } - } -}; - -CapturedTrace.prototype.parent = function() { - return this._parent; -}; - -CapturedTrace.prototype.hasParent = function() { - return this._parent !== undefined; -}; - -CapturedTrace.prototype.attachExtraTrace = function(error) { - if (error.__stackCleaned__) return; - this.uncycle(); - var parsed = CapturedTrace.parseStackAndMessage(error); - var message = parsed.message; - var stacks = [parsed.stack]; - - var trace = this; - while (trace !== undefined) { - stacks.push(cleanStack(trace.stack.split("\n"))); - trace = trace._parent; - } - removeCommonRoots(stacks); - removeDuplicateOrEmptyJumps(stacks); - util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); - util.notEnumerableProp(error, "__stackCleaned__", true); -}; - -function reconstructStack(message, stacks) { - for (var i = 0; i < stacks.length - 1; ++i) { - stacks[i].push("From previous event:"); - stacks[i] = stacks[i].join("\n"); - } - if (i < stacks.length) { - stacks[i] = stacks[i].join("\n"); - } - return message + "\n" + stacks.join("\n"); -} - -function removeDuplicateOrEmptyJumps(stacks) { - for (var i = 0; i < stacks.length; ++i) { - if (stacks[i].length === 0 || - ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { - stacks.splice(i, 1); - i--; - } - } -} - -function removeCommonRoots(stacks) { - var current = stacks[0]; - for (var i = 1; i < stacks.length; ++i) { - var prev = stacks[i]; - var currentLastIndex = current.length - 1; - var currentLastLine = current[currentLastIndex]; - var commonRootMeetPoint = -1; - - for (var j = prev.length - 1; j >= 0; --j) { - if (prev[j] === currentLastLine) { - commonRootMeetPoint = j; - break; - } - } - - for (var j = commonRootMeetPoint; j >= 0; --j) { - var line = prev[j]; - if (current[currentLastIndex] === line) { - current.pop(); - currentLastIndex--; - } else { - break; - } - } - current = prev; - } -} - -function cleanStack(stack) { - var ret = []; - for (var i = 0; i < stack.length; ++i) { - var line = stack[i]; - var isTraceLine = stackFramePattern.test(line) || - " (No stack trace)" === line; - var isInternalFrame = isTraceLine && shouldIgnore(line); - if (isTraceLine && !isInternalFrame) { - if (indentStackFrames && line.charAt(0) !== " ") { - line = " " + line; - } - ret.push(line); - } - } - return ret; -} - -function stackFramesAsArray(error) { - var stack = error.stack.replace(/\s+$/g, "").split("\n"); - for (var i = 0; i < stack.length; ++i) { - var line = stack[i]; - if (" (No stack trace)" === line || stackFramePattern.test(line)) { - break; - } - } - if (i > 0) { - stack = stack.slice(i); - } - return stack; -} - -CapturedTrace.parseStackAndMessage = function(error) { - var stack = error.stack; - var message = error.toString(); - stack = typeof stack === "string" && stack.length > 0 - ? stackFramesAsArray(error) : [" (No stack trace)"]; - return { - message: message, - stack: cleanStack(stack) - }; -}; - -CapturedTrace.formatAndLogError = function(error, title) { - if (typeof console !== "undefined") { - var message; - if (typeof error === "object" || typeof error === "function") { - var stack = error.stack; - message = title + formatStack(stack, error); - } else { - message = title + String(error); - } - if (typeof warn === "function") { - warn(message); - } else if (typeof console.log === "function" || - typeof console.log === "object") { - console.log(message); - } - } -}; - -CapturedTrace.unhandledRejection = function (reason) { - CapturedTrace.formatAndLogError(reason, "^--- With additional stack trace: "); -}; - -CapturedTrace.isSupported = function () { - return typeof captureStackTrace === "function"; -}; - -CapturedTrace.fireRejectionEvent = -function(name, localHandler, reason, promise) { - var localEventFired = false; - try { - if (typeof localHandler === "function") { - localEventFired = true; - if (name === "rejectionHandled") { - localHandler(promise); - } else { - localHandler(reason, promise); - } - } - } catch (e) { - async.throwLater(e); - } - - var globalEventFired = false; - try { - globalEventFired = fireGlobalEvent(name, reason, promise); - } catch (e) { - globalEventFired = true; - async.throwLater(e); - } - - var domEventFired = false; - if (fireDomEvent) { - try { - domEventFired = fireDomEvent(name.toLowerCase(), { - reason: reason, - promise: promise - }); - } catch (e) { - domEventFired = true; - async.throwLater(e); - } - } - - if (!globalEventFired && !localEventFired && !domEventFired && - name === "unhandledRejection") { - CapturedTrace.formatAndLogError(reason, "Unhandled rejection "); - } -}; - -function formatNonError(obj) { - var str; - if (typeof obj === "function") { - str = "[function " + - (obj.name || "anonymous") + - "]"; - } else { - str = obj.toString(); - var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; - if (ruselessToString.test(str)) { - try { - var newStr = JSON.stringify(obj); - str = newStr; - } - catch(e) { - - } - } - if (str.length === 0) { - str = "(empty array)"; - } - } - return ("(<" + snip(str) + ">, no stack trace)"); -} - -function snip(str) { - var maxChars = 41; - if (str.length < maxChars) { - return str; - } - return str.substr(0, maxChars - 3) + "..."; -} - -var shouldIgnore = function() { return false; }; -var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; -function parseLineInfo(line) { - var matches = line.match(parseLineInfoRegex); - if (matches) { - return { - fileName: matches[1], - line: parseInt(matches[2], 10) - }; - } -} -CapturedTrace.setBounds = function(firstLineError, lastLineError) { - if (!CapturedTrace.isSupported()) return; - var firstStackLines = firstLineError.stack.split("\n"); - var lastStackLines = lastLineError.stack.split("\n"); - var firstIndex = -1; - var lastIndex = -1; - var firstFileName; - var lastFileName; - for (var i = 0; i < firstStackLines.length; ++i) { - var result = parseLineInfo(firstStackLines[i]); - if (result) { - firstFileName = result.fileName; - firstIndex = result.line; - break; - } - } - for (var i = 0; i < lastStackLines.length; ++i) { - var result = parseLineInfo(lastStackLines[i]); - if (result) { - lastFileName = result.fileName; - lastIndex = result.line; - break; - } - } - if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || - firstFileName !== lastFileName || firstIndex >= lastIndex) { - return; - } - - shouldIgnore = function(line) { - if (bluebirdFramePattern.test(line)) return true; - var info = parseLineInfo(line); - if (info) { - if (info.fileName === firstFileName && - (firstIndex <= info.line && info.line <= lastIndex)) { - return true; - } - } - return false; - }; -}; - -var captureStackTrace = (function stackDetection() { - var v8stackFramePattern = /^\s*at\s*/; - var v8stackFormatter = function(stack, error) { - if (typeof stack === "string") return stack; - - if (error.name !== undefined && - error.message !== undefined) { - return error.toString(); - } - return formatNonError(error); - }; - - if (typeof Error.stackTraceLimit === "number" && - typeof Error.captureStackTrace === "function") { - Error.stackTraceLimit = Error.stackTraceLimit + 6; - stackFramePattern = v8stackFramePattern; - formatStack = v8stackFormatter; - var captureStackTrace = Error.captureStackTrace; - - shouldIgnore = function(line) { - return bluebirdFramePattern.test(line); - }; - return function(receiver, ignoreUntil) { - Error.stackTraceLimit = Error.stackTraceLimit + 6; - captureStackTrace(receiver, ignoreUntil); - Error.stackTraceLimit = Error.stackTraceLimit - 6; - }; - } - var err = new Error(); - - if (typeof err.stack === "string" && - err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { - stackFramePattern = /@/; - formatStack = v8stackFormatter; - indentStackFrames = true; - return function captureStackTrace(o) { - o.stack = new Error().stack; - }; - } - - var hasStackAfterThrow; - try { throw new Error(); } - catch(e) { - hasStackAfterThrow = ("stack" in e); - } - if (!("stack" in err) && hasStackAfterThrow && - typeof Error.stackTraceLimit === "number") { - stackFramePattern = v8stackFramePattern; - formatStack = v8stackFormatter; - return function captureStackTrace(o) { - Error.stackTraceLimit = Error.stackTraceLimit + 6; - try { throw new Error(); } - catch(e) { o.stack = e.stack; } - Error.stackTraceLimit = Error.stackTraceLimit - 6; - }; - } - - formatStack = function(stack, error) { - if (typeof stack === "string") return stack; - - if ((typeof error === "object" || - typeof error === "function") && - error.name !== undefined && - error.message !== undefined) { - return error.toString(); - } - return formatNonError(error); - }; - - return null; - -})([]); - -var fireDomEvent; -var fireGlobalEvent = (function() { - if (util.isNode) { - return function(name, reason, promise) { - if (name === "rejectionHandled") { - return process.emit(name, promise); - } else { - return process.emit(name, reason, promise); - } - }; - } else { - var customEventWorks = false; - var anyEventWorks = true; - try { - var ev = new self.CustomEvent("test"); - customEventWorks = ev instanceof CustomEvent; - } catch (e) {} - if (!customEventWorks) { - try { - var event = document.createEvent("CustomEvent"); - event.initCustomEvent("testingtheevent", false, true, {}); - self.dispatchEvent(event); - } catch (e) { - anyEventWorks = false; - } - } - if (anyEventWorks) { - fireDomEvent = function(type, detail) { - var event; - if (customEventWorks) { - event = new self.CustomEvent(type, { - detail: detail, - bubbles: false, - cancelable: true - }); - } else if (self.dispatchEvent) { - event = document.createEvent("CustomEvent"); - event.initCustomEvent(type, false, true, detail); - } - - return event ? !self.dispatchEvent(event) : false; - }; - } - - var toWindowMethodNameMap = {}; - toWindowMethodNameMap["unhandledRejection"] = ("on" + - "unhandledRejection").toLowerCase(); - toWindowMethodNameMap["rejectionHandled"] = ("on" + - "rejectionHandled").toLowerCase(); - - return function(name, reason, promise) { - var methodName = toWindowMethodNameMap[name]; - var method = self[methodName]; - if (!method) return false; - if (name === "rejectionHandled") { - method.call(self, promise); - } else { - method.call(self, reason, promise); - } - return true; - }; - } -})(); - -if (typeof console !== "undefined" && typeof console.warn !== "undefined") { - warn = function (message) { - console.warn(message); - }; - if (util.isNode && process.stderr.isTTY) { - warn = function(message) { - process.stderr.write("\u001b[31m" + message + "\u001b[39m\n"); - }; - } else if (!util.isNode && typeof (new Error().stack) === "string") { - warn = function(message) { - console.warn("%c" + message, "color: red"); - }; - } -} - -return CapturedTrace; -}; - -},{"./async.js":2,"./util.js":38}],8:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(NEXT_FILTER) { -var util = _dereq_("./util.js"); -var errors = _dereq_("./errors.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -var keys = _dereq_("./es5.js").keys; -var TypeError = errors.TypeError; - -function CatchFilter(instances, callback, promise) { - this._instances = instances; - this._callback = callback; - this._promise = promise; -} - -function safePredicate(predicate, e) { - var safeObject = {}; - var retfilter = tryCatch(predicate).call(safeObject, e); - - if (retfilter === errorObj) return retfilter; - - var safeKeys = keys(safeObject); - if (safeKeys.length) { - errorObj.e = new TypeError("Catch filter must inherit from Error or be a simple predicate function\u000a\u000a See http://goo.gl/o84o68\u000a"); - return errorObj; - } - return retfilter; -} - -CatchFilter.prototype.doFilter = function (e) { - var cb = this._callback; - var promise = this._promise; - var boundTo = promise._boundValue(); - for (var i = 0, len = this._instances.length; i < len; ++i) { - var item = this._instances[i]; - var itemIsErrorType = item === Error || - (item != null && item.prototype instanceof Error); - - if (itemIsErrorType && e instanceof item) { - var ret = tryCatch(cb).call(boundTo, e); - if (ret === errorObj) { - NEXT_FILTER.e = ret.e; - return NEXT_FILTER; - } - return ret; - } else if (typeof item === "function" && !itemIsErrorType) { - var shouldHandle = safePredicate(item, e); - if (shouldHandle === errorObj) { - e = errorObj.e; - break; - } else if (shouldHandle) { - var ret = tryCatch(cb).call(boundTo, e); - if (ret === errorObj) { - NEXT_FILTER.e = ret.e; - return NEXT_FILTER; - } - return ret; - } - } - } - NEXT_FILTER.e = e; - return NEXT_FILTER; -}; - -return CatchFilter; -}; - -},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, CapturedTrace, isDebugging) { -var contextStack = []; -function Context() { - this._trace = new CapturedTrace(peekContext()); -} -Context.prototype._pushContext = function () { - if (!isDebugging()) return; - if (this._trace !== undefined) { - contextStack.push(this._trace); - } -}; - -Context.prototype._popContext = function () { - if (!isDebugging()) return; - if (this._trace !== undefined) { - contextStack.pop(); - } -}; - -function createContext() { - if (isDebugging()) return new Context(); -} - -function peekContext() { - var lastIndex = contextStack.length - 1; - if (lastIndex >= 0) { - return contextStack[lastIndex]; - } - return undefined; -} - -Promise.prototype._peekContext = peekContext; -Promise.prototype._pushContext = Context.prototype._pushContext; -Promise.prototype._popContext = Context.prototype._popContext; - -return createContext; -}; - -},{}],10:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, CapturedTrace) { -var getDomain = Promise._getDomain; -var async = _dereq_("./async.js"); -var Warning = _dereq_("./errors.js").Warning; -var util = _dereq_("./util.js"); -var canAttachTrace = util.canAttachTrace; -var unhandledRejectionHandled; -var possiblyUnhandledRejection; -var debugging = false || (util.isNode && - (!!process.env["BLUEBIRD_DEBUG"] || - process.env["NODE_ENV"] === "development")); - -if (util.isNode && process.env["BLUEBIRD_DEBUG"] == 0) debugging = false; - -if (debugging) { - async.disableTrampolineIfNecessary(); -} - -Promise.prototype._ignoreRejections = function() { - this._unsetRejectionIsUnhandled(); - this._bitField = this._bitField | 16777216; -}; - -Promise.prototype._ensurePossibleRejectionHandled = function () { - if ((this._bitField & 16777216) !== 0) return; - this._setRejectionIsUnhandled(); - async.invokeLater(this._notifyUnhandledRejection, this, undefined); -}; - -Promise.prototype._notifyUnhandledRejectionIsHandled = function () { - CapturedTrace.fireRejectionEvent("rejectionHandled", - unhandledRejectionHandled, undefined, this); -}; - -Promise.prototype._notifyUnhandledRejection = function () { - if (this._isRejectionUnhandled()) { - var reason = this._getCarriedStackTrace() || this._settledValue; - this._setUnhandledRejectionIsNotified(); - CapturedTrace.fireRejectionEvent("unhandledRejection", - possiblyUnhandledRejection, reason, this); - } -}; - -Promise.prototype._setUnhandledRejectionIsNotified = function () { - this._bitField = this._bitField | 524288; -}; - -Promise.prototype._unsetUnhandledRejectionIsNotified = function () { - this._bitField = this._bitField & (~524288); -}; - -Promise.prototype._isUnhandledRejectionNotified = function () { - return (this._bitField & 524288) > 0; -}; - -Promise.prototype._setRejectionIsUnhandled = function () { - this._bitField = this._bitField | 2097152; -}; - -Promise.prototype._unsetRejectionIsUnhandled = function () { - this._bitField = this._bitField & (~2097152); - if (this._isUnhandledRejectionNotified()) { - this._unsetUnhandledRejectionIsNotified(); - this._notifyUnhandledRejectionIsHandled(); - } -}; - -Promise.prototype._isRejectionUnhandled = function () { - return (this._bitField & 2097152) > 0; -}; - -Promise.prototype._setCarriedStackTrace = function (capturedTrace) { - this._bitField = this._bitField | 1048576; - this._fulfillmentHandler0 = capturedTrace; -}; - -Promise.prototype._isCarryingStackTrace = function () { - return (this._bitField & 1048576) > 0; -}; - -Promise.prototype._getCarriedStackTrace = function () { - return this._isCarryingStackTrace() - ? this._fulfillmentHandler0 - : undefined; -}; - -Promise.prototype._captureStackTrace = function () { - if (debugging) { - this._trace = new CapturedTrace(this._peekContext()); - } - return this; -}; - -Promise.prototype._attachExtraTrace = function (error, ignoreSelf) { - if (debugging && canAttachTrace(error)) { - var trace = this._trace; - if (trace !== undefined) { - if (ignoreSelf) trace = trace._parent; - } - if (trace !== undefined) { - trace.attachExtraTrace(error); - } else if (!error.__stackCleaned__) { - var parsed = CapturedTrace.parseStackAndMessage(error); - util.notEnumerableProp(error, "stack", - parsed.message + "\n" + parsed.stack.join("\n")); - util.notEnumerableProp(error, "__stackCleaned__", true); - } - } -}; - -Promise.prototype._warn = function(message) { - var warning = new Warning(message); - var ctx = this._peekContext(); - if (ctx) { - ctx.attachExtraTrace(warning); - } else { - var parsed = CapturedTrace.parseStackAndMessage(warning); - warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); - } - CapturedTrace.formatAndLogError(warning, ""); -}; - -Promise.onPossiblyUnhandledRejection = function (fn) { - var domain = getDomain(); - possiblyUnhandledRejection = - typeof fn === "function" ? (domain === null ? fn : domain.bind(fn)) - : undefined; -}; - -Promise.onUnhandledRejectionHandled = function (fn) { - var domain = getDomain(); - unhandledRejectionHandled = - typeof fn === "function" ? (domain === null ? fn : domain.bind(fn)) - : undefined; -}; - -Promise.longStackTraces = function () { - if (async.haveItemsQueued() && - debugging === false - ) { - throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/DT1qyG\u000a"); - } - debugging = CapturedTrace.isSupported(); - if (debugging) { - async.disableTrampolineIfNecessary(); - } -}; - -Promise.hasLongStackTraces = function () { - return debugging && CapturedTrace.isSupported(); -}; - -if (!CapturedTrace.isSupported()) { - Promise.longStackTraces = function(){}; - debugging = false; -} - -return function() { - return debugging; -}; -}; - -},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(_dereq_,module,exports){ -"use strict"; -var util = _dereq_("./util.js"); -var isPrimitive = util.isPrimitive; - -module.exports = function(Promise) { -var returner = function () { - return this; -}; -var thrower = function () { - throw this; -}; -var returnUndefined = function() {}; -var throwUndefined = function() { - throw undefined; -}; - -var wrapper = function (value, action) { - if (action === 1) { - return function () { - throw value; - }; - } else if (action === 2) { - return function () { - return value; - }; - } -}; - - -Promise.prototype["return"] = -Promise.prototype.thenReturn = function (value) { - if (value === undefined) return this.then(returnUndefined); - - if (isPrimitive(value)) { - return this._then( - wrapper(value, 2), - undefined, - undefined, - undefined, - undefined - ); - } else if (value instanceof Promise) { - value._ignoreRejections(); - } - return this._then(returner, undefined, undefined, value, undefined); -}; - -Promise.prototype["throw"] = -Promise.prototype.thenThrow = function (reason) { - if (reason === undefined) return this.then(throwUndefined); - - if (isPrimitive(reason)) { - return this._then( - wrapper(reason, 1), - undefined, - undefined, - undefined, - undefined - ); - } - return this._then(thrower, undefined, undefined, reason, undefined); -}; -}; - -},{"./util.js":38}],12:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var PromiseReduce = Promise.reduce; - -Promise.prototype.each = function (fn) { - return PromiseReduce(this, fn, null, INTERNAL); -}; - -Promise.each = function (promises, fn) { - return PromiseReduce(promises, fn, null, INTERNAL); -}; -}; - -},{}],13:[function(_dereq_,module,exports){ -"use strict"; -var es5 = _dereq_("./es5.js"); -var Objectfreeze = es5.freeze; -var util = _dereq_("./util.js"); -var inherits = util.inherits; -var notEnumerableProp = util.notEnumerableProp; - -function subError(nameProperty, defaultMessage) { - function SubError(message) { - if (!(this instanceof SubError)) return new SubError(message); - notEnumerableProp(this, "message", - typeof message === "string" ? message : defaultMessage); - notEnumerableProp(this, "name", nameProperty); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - Error.call(this); - } - } - inherits(SubError, Error); - return SubError; -} - -var _TypeError, _RangeError; -var Warning = subError("Warning", "warning"); -var CancellationError = subError("CancellationError", "cancellation error"); -var TimeoutError = subError("TimeoutError", "timeout error"); -var AggregateError = subError("AggregateError", "aggregate error"); -try { - _TypeError = TypeError; - _RangeError = RangeError; -} catch(e) { - _TypeError = subError("TypeError", "type error"); - _RangeError = subError("RangeError", "range error"); -} - -var methods = ("join pop push shift unshift slice filter forEach some " + - "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); - -for (var i = 0; i < methods.length; ++i) { - if (typeof Array.prototype[methods[i]] === "function") { - AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; - } -} - -es5.defineProperty(AggregateError.prototype, "length", { - value: 0, - configurable: false, - writable: true, - enumerable: true -}); -AggregateError.prototype["isOperational"] = true; -var level = 0; -AggregateError.prototype.toString = function() { - var indent = Array(level * 4 + 1).join(" "); - var ret = "\n" + indent + "AggregateError of:" + "\n"; - level++; - indent = Array(level * 4 + 1).join(" "); - for (var i = 0; i < this.length; ++i) { - var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; - var lines = str.split("\n"); - for (var j = 0; j < lines.length; ++j) { - lines[j] = indent + lines[j]; - } - str = lines.join("\n"); - ret += str + "\n"; - } - level--; - return ret; -}; - -function OperationalError(message) { - if (!(this instanceof OperationalError)) - return new OperationalError(message); - notEnumerableProp(this, "name", "OperationalError"); - notEnumerableProp(this, "message", message); - this.cause = message; - this["isOperational"] = true; - - if (message instanceof Error) { - notEnumerableProp(this, "message", message.message); - notEnumerableProp(this, "stack", message.stack); - } else if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - -} -inherits(OperationalError, Error); - -var errorTypes = Error["__BluebirdErrorTypes__"]; -if (!errorTypes) { - errorTypes = Objectfreeze({ - CancellationError: CancellationError, - TimeoutError: TimeoutError, - OperationalError: OperationalError, - RejectionError: OperationalError, - AggregateError: AggregateError - }); - notEnumerableProp(Error, "__BluebirdErrorTypes__", errorTypes); -} - -module.exports = { - Error: Error, - TypeError: _TypeError, - RangeError: _RangeError, - CancellationError: errorTypes.CancellationError, - OperationalError: errorTypes.OperationalError, - TimeoutError: errorTypes.TimeoutError, - AggregateError: errorTypes.AggregateError, - Warning: Warning -}; - -},{"./es5.js":14,"./util.js":38}],14:[function(_dereq_,module,exports){ -var isES5 = (function(){ - "use strict"; - return this === undefined; -})(); - -if (isES5) { - module.exports = { - freeze: Object.freeze, - defineProperty: Object.defineProperty, - getDescriptor: Object.getOwnPropertyDescriptor, - keys: Object.keys, - names: Object.getOwnPropertyNames, - getPrototypeOf: Object.getPrototypeOf, - isArray: Array.isArray, - isES5: isES5, - propertyIsWritable: function(obj, prop) { - var descriptor = Object.getOwnPropertyDescriptor(obj, prop); - return !!(!descriptor || descriptor.writable || descriptor.set); - } - }; -} else { - var has = {}.hasOwnProperty; - var str = {}.toString; - var proto = {}.constructor.prototype; - - var ObjectKeys = function (o) { - var ret = []; - for (var key in o) { - if (has.call(o, key)) { - ret.push(key); - } - } - return ret; - }; - - var ObjectGetDescriptor = function(o, key) { - return {value: o[key]}; - }; - - var ObjectDefineProperty = function (o, key, desc) { - o[key] = desc.value; - return o; - }; - - var ObjectFreeze = function (obj) { - return obj; - }; - - var ObjectGetPrototypeOf = function (obj) { - try { - return Object(obj).constructor.prototype; - } - catch (e) { - return proto; - } - }; - - var ArrayIsArray = function (obj) { - try { - return str.call(obj) === "[object Array]"; - } - catch(e) { - return false; - } - }; - - module.exports = { - isArray: ArrayIsArray, - keys: ObjectKeys, - names: ObjectKeys, - defineProperty: ObjectDefineProperty, - getDescriptor: ObjectGetDescriptor, - freeze: ObjectFreeze, - getPrototypeOf: ObjectGetPrototypeOf, - isES5: isES5, - propertyIsWritable: function() { - return true; - } - }; -} - -},{}],15:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var PromiseMap = Promise.map; - -Promise.prototype.filter = function (fn, options) { - return PromiseMap(this, fn, options, INTERNAL); -}; - -Promise.filter = function (promises, fn, options) { - return PromiseMap(promises, fn, options, INTERNAL); -}; -}; - -},{}],16:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, NEXT_FILTER, tryConvertToPromise) { -var util = _dereq_("./util.js"); -var isPrimitive = util.isPrimitive; -var thrower = util.thrower; - -function returnThis() { - return this; -} -function throwThis() { - throw this; -} -function return$(r) { - return function() { - return r; - }; -} -function throw$(r) { - return function() { - throw r; - }; -} -function promisedFinally(ret, reasonOrValue, isFulfilled) { - var then; - if (isPrimitive(reasonOrValue)) { - then = isFulfilled ? return$(reasonOrValue) : throw$(reasonOrValue); - } else { - then = isFulfilled ? returnThis : throwThis; - } - return ret._then(then, thrower, undefined, reasonOrValue, undefined); -} - -function finallyHandler(reasonOrValue) { - var promise = this.promise; - var handler = this.handler; - - var ret = promise._isBound() - ? handler.call(promise._boundValue()) - : handler(); - - if (ret !== undefined) { - var maybePromise = tryConvertToPromise(ret, promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - return promisedFinally(maybePromise, reasonOrValue, - promise.isFulfilled()); - } - } - - if (promise.isRejected()) { - NEXT_FILTER.e = reasonOrValue; - return NEXT_FILTER; - } else { - return reasonOrValue; - } -} - -function tapHandler(value) { - var promise = this.promise; - var handler = this.handler; - - var ret = promise._isBound() - ? handler.call(promise._boundValue(), value) - : handler(value); - - if (ret !== undefined) { - var maybePromise = tryConvertToPromise(ret, promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - return promisedFinally(maybePromise, value, true); - } - } - return value; -} - -Promise.prototype._passThroughHandler = function (handler, isFinally) { - if (typeof handler !== "function") return this.then(); - - var promiseAndHandler = { - promise: this, - handler: handler - }; - - return this._then( - isFinally ? finallyHandler : tapHandler, - isFinally ? finallyHandler : undefined, undefined, - promiseAndHandler, undefined); -}; - -Promise.prototype.lastly = -Promise.prototype["finally"] = function (handler) { - return this._passThroughHandler(handler, true); -}; - -Promise.prototype.tap = function (handler) { - return this._passThroughHandler(handler, false); -}; -}; - -},{"./util.js":38}],17:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, - apiRejection, - INTERNAL, - tryConvertToPromise) { -var errors = _dereq_("./errors.js"); -var TypeError = errors.TypeError; -var util = _dereq_("./util.js"); -var errorObj = util.errorObj; -var tryCatch = util.tryCatch; -var yieldHandlers = []; - -function promiseFromYieldHandler(value, yieldHandlers, traceParent) { - for (var i = 0; i < yieldHandlers.length; ++i) { - traceParent._pushContext(); - var result = tryCatch(yieldHandlers[i])(value); - traceParent._popContext(); - if (result === errorObj) { - traceParent._pushContext(); - var ret = Promise.reject(errorObj.e); - traceParent._popContext(); - return ret; - } - var maybePromise = tryConvertToPromise(result, traceParent); - if (maybePromise instanceof Promise) return maybePromise; - } - return null; -} - -function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { - var promise = this._promise = new Promise(INTERNAL); - promise._captureStackTrace(); - this._stack = stack; - this._generatorFunction = generatorFunction; - this._receiver = receiver; - this._generator = undefined; - this._yieldHandlers = typeof yieldHandler === "function" - ? [yieldHandler].concat(yieldHandlers) - : yieldHandlers; -} - -PromiseSpawn.prototype.promise = function () { - return this._promise; -}; - -PromiseSpawn.prototype._run = function () { - this._generator = this._generatorFunction.call(this._receiver); - this._receiver = - this._generatorFunction = undefined; - this._next(undefined); -}; - -PromiseSpawn.prototype._continue = function (result) { - if (result === errorObj) { - return this._promise._rejectCallback(result.e, false, true); - } - - var value = result.value; - if (result.done === true) { - this._promise._resolveCallback(value); - } else { - var maybePromise = tryConvertToPromise(value, this._promise); - if (!(maybePromise instanceof Promise)) { - maybePromise = - promiseFromYieldHandler(maybePromise, - this._yieldHandlers, - this._promise); - if (maybePromise === null) { - this._throw( - new TypeError( - "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/4Y4pDk\u000a\u000a".replace("%s", value) + - "From coroutine:\u000a" + - this._stack.split("\n").slice(1, -7).join("\n") - ) - ); - return; - } - } - maybePromise._then( - this._next, - this._throw, - undefined, - this, - null - ); - } -}; - -PromiseSpawn.prototype._throw = function (reason) { - this._promise._attachExtraTrace(reason); - this._promise._pushContext(); - var result = tryCatch(this._generator["throw"]) - .call(this._generator, reason); - this._promise._popContext(); - this._continue(result); -}; - -PromiseSpawn.prototype._next = function (value) { - this._promise._pushContext(); - var result = tryCatch(this._generator.next).call(this._generator, value); - this._promise._popContext(); - this._continue(result); -}; - -Promise.coroutine = function (generatorFunction, options) { - if (typeof generatorFunction !== "function") { - throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/6Vqhm0\u000a"); - } - var yieldHandler = Object(options).yieldHandler; - var PromiseSpawn$ = PromiseSpawn; - var stack = new Error().stack; - return function () { - var generator = generatorFunction.apply(this, arguments); - var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, - stack); - spawn._generator = generator; - spawn._next(undefined); - return spawn.promise(); - }; -}; - -Promise.coroutine.addYieldHandler = function(fn) { - if (typeof fn !== "function") throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - yieldHandlers.push(fn); -}; - -Promise.spawn = function (generatorFunction) { - if (typeof generatorFunction !== "function") { - return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/6Vqhm0\u000a"); - } - var spawn = new PromiseSpawn(generatorFunction, this); - var ret = spawn.promise(); - spawn._run(Promise.spawn); - return ret; -}; -}; - -},{"./errors.js":13,"./util.js":38}],18:[function(_dereq_,module,exports){ -"use strict"; -module.exports = -function(Promise, PromiseArray, tryConvertToPromise, INTERNAL) { -var util = _dereq_("./util.js"); -var canEvaluate = util.canEvaluate; -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -var reject; - -if (!true) { -if (canEvaluate) { - var thenCallback = function(i) { - return new Function("value", "holder", " \n\ - 'use strict'; \n\ - holder.pIndex = value; \n\ - holder.checkFulfillment(this); \n\ - ".replace(/Index/g, i)); - }; - - var caller = function(count) { - var values = []; - for (var i = 1; i <= count; ++i) values.push("holder.p" + i); - return new Function("holder", " \n\ - 'use strict'; \n\ - var callback = holder.fn; \n\ - return callback(values); \n\ - ".replace(/values/g, values.join(", "))); - }; - var thenCallbacks = []; - var callers = [undefined]; - for (var i = 1; i <= 5; ++i) { - thenCallbacks.push(thenCallback(i)); - callers.push(caller(i)); - } - - var Holder = function(total, fn) { - this.p1 = this.p2 = this.p3 = this.p4 = this.p5 = null; - this.fn = fn; - this.total = total; - this.now = 0; - }; - - Holder.prototype.callers = callers; - Holder.prototype.checkFulfillment = function(promise) { - var now = this.now; - now++; - var total = this.total; - if (now >= total) { - var handler = this.callers[total]; - promise._pushContext(); - var ret = tryCatch(handler)(this); - promise._popContext(); - if (ret === errorObj) { - promise._rejectCallback(ret.e, false, true); - } else { - promise._resolveCallback(ret); - } - } else { - this.now = now; - } - }; - - var reject = function (reason) { - this._reject(reason); - }; -} -} - -Promise.join = function () { - var last = arguments.length - 1; - var fn; - if (last > 0 && typeof arguments[last] === "function") { - fn = arguments[last]; - if (!true) { - if (last < 6 && canEvaluate) { - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - var holder = new Holder(last, fn); - var callbacks = thenCallbacks; - for (var i = 0; i < last; ++i) { - var maybePromise = tryConvertToPromise(arguments[i], ret); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - if (maybePromise._isPending()) { - maybePromise._then(callbacks[i], reject, - undefined, ret, holder); - } else if (maybePromise._isFulfilled()) { - callbacks[i].call(ret, - maybePromise._value(), holder); - } else { - ret._reject(maybePromise._reason()); - } - } else { - callbacks[i].call(ret, maybePromise, holder); - } - } - return ret; - } - } - } - var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];} - if (fn) args.pop(); - var ret = new PromiseArray(args).promise(); - return fn !== undefined ? ret.spread(fn) : ret; -}; - -}; - -},{"./util.js":38}],19:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, - PromiseArray, - apiRejection, - tryConvertToPromise, - INTERNAL) { -var getDomain = Promise._getDomain; -var async = _dereq_("./async.js"); -var util = _dereq_("./util.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -var PENDING = {}; -var EMPTY_ARRAY = []; - -function MappingPromiseArray(promises, fn, limit, _filter) { - this.constructor$(promises); - this._promise._captureStackTrace(); - var domain = getDomain(); - this._callback = domain === null ? fn : domain.bind(fn); - this._preservedValues = _filter === INTERNAL - ? new Array(this.length()) - : null; - this._limit = limit; - this._inFlight = 0; - this._queue = limit >= 1 ? [] : EMPTY_ARRAY; - async.invoke(init, this, undefined); -} -util.inherits(MappingPromiseArray, PromiseArray); -function init() {this._init$(undefined, -2);} - -MappingPromiseArray.prototype._init = function () {}; - -MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { - var values = this._values; - var length = this.length(); - var preservedValues = this._preservedValues; - var limit = this._limit; - if (values[index] === PENDING) { - values[index] = value; - if (limit >= 1) { - this._inFlight--; - this._drainQueue(); - if (this._isResolved()) return; - } - } else { - if (limit >= 1 && this._inFlight >= limit) { - values[index] = value; - this._queue.push(index); - return; - } - if (preservedValues !== null) preservedValues[index] = value; - - var callback = this._callback; - var receiver = this._promise._boundValue(); - this._promise._pushContext(); - var ret = tryCatch(callback).call(receiver, value, index, length); - this._promise._popContext(); - if (ret === errorObj) return this._reject(ret.e); - - var maybePromise = tryConvertToPromise(ret, this._promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - if (maybePromise._isPending()) { - if (limit >= 1) this._inFlight++; - values[index] = PENDING; - return maybePromise._proxyPromiseArray(this, index); - } else if (maybePromise._isFulfilled()) { - ret = maybePromise._value(); - } else { - return this._reject(maybePromise._reason()); - } - } - values[index] = ret; - } - var totalResolved = ++this._totalResolved; - if (totalResolved >= length) { - if (preservedValues !== null) { - this._filter(values, preservedValues); - } else { - this._resolve(values); - } - - } -}; - -MappingPromiseArray.prototype._drainQueue = function () { - var queue = this._queue; - var limit = this._limit; - var values = this._values; - while (queue.length > 0 && this._inFlight < limit) { - if (this._isResolved()) return; - var index = queue.pop(); - this._promiseFulfilled(values[index], index); - } -}; - -MappingPromiseArray.prototype._filter = function (booleans, values) { - var len = values.length; - var ret = new Array(len); - var j = 0; - for (var i = 0; i < len; ++i) { - if (booleans[i]) ret[j++] = values[i]; - } - ret.length = j; - this._resolve(ret); -}; - -MappingPromiseArray.prototype.preservedValues = function () { - return this._preservedValues; -}; - -function map(promises, fn, options, _filter) { - var limit = typeof options === "object" && options !== null - ? options.concurrency - : 0; - limit = typeof limit === "number" && - isFinite(limit) && limit >= 1 ? limit : 0; - return new MappingPromiseArray(promises, fn, limit, _filter); -} - -Promise.prototype.map = function (fn, options) { - if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - - return map(this, fn, options, null).promise(); -}; - -Promise.map = function (promises, fn, options, _filter) { - if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - return map(promises, fn, options, _filter).promise(); -}; - - -}; - -},{"./async.js":2,"./util.js":38}],20:[function(_dereq_,module,exports){ -"use strict"; -module.exports = -function(Promise, INTERNAL, tryConvertToPromise, apiRejection) { -var util = _dereq_("./util.js"); -var tryCatch = util.tryCatch; - -Promise.method = function (fn) { - if (typeof fn !== "function") { - throw new Promise.TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - } - return function () { - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - ret._pushContext(); - var value = tryCatch(fn).apply(this, arguments); - ret._popContext(); - ret._resolveFromSyncValue(value); - return ret; - }; -}; - -Promise.attempt = Promise["try"] = function (fn, args, ctx) { - if (typeof fn !== "function") { - return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - } - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - ret._pushContext(); - var value = util.isArray(args) - ? tryCatch(fn).apply(ctx, args) - : tryCatch(fn).call(ctx, args); - ret._popContext(); - ret._resolveFromSyncValue(value); - return ret; -}; - -Promise.prototype._resolveFromSyncValue = function (value) { - if (value === util.errorObj) { - this._rejectCallback(value.e, false, true); - } else { - this._resolveCallback(value, true); - } -}; -}; - -},{"./util.js":38}],21:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise) { -var util = _dereq_("./util.js"); -var async = _dereq_("./async.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; - -function spreadAdapter(val, nodeback) { - var promise = this; - if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); - var ret = - tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); - if (ret === errorObj) { - async.throwLater(ret.e); - } -} - -function successAdapter(val, nodeback) { - var promise = this; - var receiver = promise._boundValue(); - var ret = val === undefined - ? tryCatch(nodeback).call(receiver, null) - : tryCatch(nodeback).call(receiver, null, val); - if (ret === errorObj) { - async.throwLater(ret.e); - } -} -function errorAdapter(reason, nodeback) { - var promise = this; - if (!reason) { - var target = promise._target(); - var newReason = target._getCarriedStackTrace(); - newReason.cause = reason; - reason = newReason; - } - var ret = tryCatch(nodeback).call(promise._boundValue(), reason); - if (ret === errorObj) { - async.throwLater(ret.e); - } -} - -Promise.prototype.asCallback = -Promise.prototype.nodeify = function (nodeback, options) { - if (typeof nodeback == "function") { - var adapter = successAdapter; - if (options !== undefined && Object(options).spread) { - adapter = spreadAdapter; - } - this._then( - adapter, - errorAdapter, - undefined, - this, - nodeback - ); - } - return this; -}; -}; - -},{"./async.js":2,"./util.js":38}],22:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, PromiseArray) { -var util = _dereq_("./util.js"); -var async = _dereq_("./async.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; - -Promise.prototype.progressed = function (handler) { - return this._then(undefined, undefined, handler, undefined, undefined); -}; - -Promise.prototype._progress = function (progressValue) { - if (this._isFollowingOrFulfilledOrRejected()) return; - this._target()._progressUnchecked(progressValue); - -}; - -Promise.prototype._progressHandlerAt = function (index) { - return index === 0 - ? this._progressHandler0 - : this[(index << 2) + index - 5 + 2]; -}; - -Promise.prototype._doProgressWith = function (progression) { - var progressValue = progression.value; - var handler = progression.handler; - var promise = progression.promise; - var receiver = progression.receiver; - - var ret = tryCatch(handler).call(receiver, progressValue); - if (ret === errorObj) { - if (ret.e != null && - ret.e.name !== "StopProgressPropagation") { - var trace = util.canAttachTrace(ret.e) - ? ret.e : new Error(util.toString(ret.e)); - promise._attachExtraTrace(trace); - promise._progress(ret.e); - } - } else if (ret instanceof Promise) { - ret._then(promise._progress, null, null, promise, undefined); - } else { - promise._progress(ret); - } -}; - - -Promise.prototype._progressUnchecked = function (progressValue) { - var len = this._length(); - var progress = this._progress; - for (var i = 0; i < len; i++) { - var handler = this._progressHandlerAt(i); - var promise = this._promiseAt(i); - if (!(promise instanceof Promise)) { - var receiver = this._receiverAt(i); - if (typeof handler === "function") { - handler.call(receiver, progressValue, promise); - } else if (receiver instanceof PromiseArray && - !receiver._isResolved()) { - receiver._promiseProgressed(progressValue, promise); - } - continue; - } - - if (typeof handler === "function") { - async.invoke(this._doProgressWith, this, { - handler: handler, - promise: promise, - receiver: this._receiverAt(i), - value: progressValue - }); - } else { - async.invoke(progress, promise, progressValue); - } - } -}; -}; - -},{"./async.js":2,"./util.js":38}],23:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function() { -var makeSelfResolutionError = function () { - return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/LhFpo0\u000a"); -}; -var reflect = function() { - return new Promise.PromiseInspection(this._target()); -}; -var apiRejection = function(msg) { - return Promise.reject(new TypeError(msg)); -}; - -var util = _dereq_("./util.js"); - -var getDomain; -if (util.isNode) { - getDomain = function() { - var ret = process.domain; - if (ret === undefined) ret = null; - return ret; - }; -} else { - getDomain = function() { - return null; - }; -} -util.notEnumerableProp(Promise, "_getDomain", getDomain); - -var UNDEFINED_BINDING = {}; -var async = _dereq_("./async.js"); -var errors = _dereq_("./errors.js"); -var TypeError = Promise.TypeError = errors.TypeError; -Promise.RangeError = errors.RangeError; -Promise.CancellationError = errors.CancellationError; -Promise.TimeoutError = errors.TimeoutError; -Promise.OperationalError = errors.OperationalError; -Promise.RejectionError = errors.OperationalError; -Promise.AggregateError = errors.AggregateError; -var INTERNAL = function(){}; -var APPLY = {}; -var NEXT_FILTER = {e: null}; -var tryConvertToPromise = _dereq_("./thenables.js")(Promise, INTERNAL); -var PromiseArray = - _dereq_("./promise_array.js")(Promise, INTERNAL, - tryConvertToPromise, apiRejection); -var CapturedTrace = _dereq_("./captured_trace.js")(); -var isDebugging = _dereq_("./debuggability.js")(Promise, CapturedTrace); - /*jshint unused:false*/ -var createContext = - _dereq_("./context.js")(Promise, CapturedTrace, isDebugging); -var CatchFilter = _dereq_("./catch_filter.js")(NEXT_FILTER); -var PromiseResolver = _dereq_("./promise_resolver.js"); -var nodebackForPromise = PromiseResolver._nodebackForPromise; -var errorObj = util.errorObj; -var tryCatch = util.tryCatch; -function Promise(resolver) { - if (typeof resolver !== "function") { - throw new TypeError("the promise constructor requires a resolver function\u000a\u000a See http://goo.gl/EC22Yn\u000a"); - } - if (this.constructor !== Promise) { - throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/KsIlge\u000a"); - } - this._bitField = 0; - this._fulfillmentHandler0 = undefined; - this._rejectionHandler0 = undefined; - this._progressHandler0 = undefined; - this._promise0 = undefined; - this._receiver0 = undefined; - this._settledValue = undefined; - if (resolver !== INTERNAL) this._resolveFromResolver(resolver); -} - -Promise.prototype.toString = function () { - return "[object Promise]"; -}; - -Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { - var len = arguments.length; - if (len > 1) { - var catchInstances = new Array(len - 1), - j = 0, i; - for (i = 0; i < len - 1; ++i) { - var item = arguments[i]; - if (typeof item === "function") { - catchInstances[j++] = item; - } else { - return Promise.reject( - new TypeError("Catch filter must inherit from Error or be a simple predicate function\u000a\u000a See http://goo.gl/o84o68\u000a")); - } - } - catchInstances.length = j; - fn = arguments[i]; - var catchFilter = new CatchFilter(catchInstances, fn, this); - return this._then(undefined, catchFilter.doFilter, undefined, - catchFilter, undefined); - } - return this._then(undefined, fn, undefined, undefined, undefined); -}; - -Promise.prototype.reflect = function () { - return this._then(reflect, reflect, undefined, this, undefined); -}; - -Promise.prototype.then = function (didFulfill, didReject, didProgress) { - if (isDebugging() && arguments.length > 0 && - typeof didFulfill !== "function" && - typeof didReject !== "function") { - var msg = ".then() only accepts functions but was passed: " + - util.classString(didFulfill); - if (arguments.length > 1) { - msg += ", " + util.classString(didReject); - } - this._warn(msg); - } - return this._then(didFulfill, didReject, didProgress, - undefined, undefined); -}; - -Promise.prototype.done = function (didFulfill, didReject, didProgress) { - var promise = this._then(didFulfill, didReject, didProgress, - undefined, undefined); - promise._setIsFinal(); -}; - -Promise.prototype.spread = function (didFulfill, didReject) { - return this.all()._then(didFulfill, didReject, undefined, APPLY, undefined); -}; - -Promise.prototype.isCancellable = function () { - return !this.isResolved() && - this._cancellable(); -}; - -Promise.prototype.toJSON = function () { - var ret = { - isFulfilled: false, - isRejected: false, - fulfillmentValue: undefined, - rejectionReason: undefined - }; - if (this.isFulfilled()) { - ret.fulfillmentValue = this.value(); - ret.isFulfilled = true; - } else if (this.isRejected()) { - ret.rejectionReason = this.reason(); - ret.isRejected = true; - } - return ret; -}; - -Promise.prototype.all = function () { - return new PromiseArray(this).promise(); -}; - -Promise.prototype.error = function (fn) { - return this.caught(util.originatesFromRejection, fn); -}; - -Promise.is = function (val) { - return val instanceof Promise; -}; - -Promise.fromNode = function(fn) { - var ret = new Promise(INTERNAL); - var result = tryCatch(fn)(nodebackForPromise(ret)); - if (result === errorObj) { - ret._rejectCallback(result.e, true, true); - } - return ret; -}; - -Promise.all = function (promises) { - return new PromiseArray(promises).promise(); -}; - -Promise.defer = Promise.pending = function () { - var promise = new Promise(INTERNAL); - return new PromiseResolver(promise); -}; - -Promise.cast = function (obj) { - var ret = tryConvertToPromise(obj); - if (!(ret instanceof Promise)) { - var val = ret; - ret = new Promise(INTERNAL); - ret._fulfillUnchecked(val); - } - return ret; -}; - -Promise.resolve = Promise.fulfilled = Promise.cast; - -Promise.reject = Promise.rejected = function (reason) { - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - ret._rejectCallback(reason, true); - return ret; -}; - -Promise.setScheduler = function(fn) { - if (typeof fn !== "function") throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - var prev = async._schedule; - async._schedule = fn; - return prev; -}; - -Promise.prototype._then = function ( - didFulfill, - didReject, - didProgress, - receiver, - internalData -) { - var haveInternalData = internalData !== undefined; - var ret = haveInternalData ? internalData : new Promise(INTERNAL); - - if (!haveInternalData) { - ret._propagateFrom(this, 4 | 1); - ret._captureStackTrace(); - } - - var target = this._target(); - if (target !== this) { - if (receiver === undefined) receiver = this._boundTo; - if (!haveInternalData) ret._setIsMigrated(); - } - - var callbackIndex = target._addCallbacks(didFulfill, - didReject, - didProgress, - ret, - receiver, - getDomain()); - - if (target._isResolved() && !target._isSettlePromisesQueued()) { - async.invoke( - target._settlePromiseAtPostResolution, target, callbackIndex); - } - - return ret; -}; - -Promise.prototype._settlePromiseAtPostResolution = function (index) { - if (this._isRejectionUnhandled()) this._unsetRejectionIsUnhandled(); - this._settlePromiseAt(index); -}; - -Promise.prototype._length = function () { - return this._bitField & 131071; -}; - -Promise.prototype._isFollowingOrFulfilledOrRejected = function () { - return (this._bitField & 939524096) > 0; -}; - -Promise.prototype._isFollowing = function () { - return (this._bitField & 536870912) === 536870912; -}; - -Promise.prototype._setLength = function (len) { - this._bitField = (this._bitField & -131072) | - (len & 131071); -}; - -Promise.prototype._setFulfilled = function () { - this._bitField = this._bitField | 268435456; -}; - -Promise.prototype._setRejected = function () { - this._bitField = this._bitField | 134217728; -}; - -Promise.prototype._setFollowing = function () { - this._bitField = this._bitField | 536870912; -}; - -Promise.prototype._setIsFinal = function () { - this._bitField = this._bitField | 33554432; -}; - -Promise.prototype._isFinal = function () { - return (this._bitField & 33554432) > 0; -}; - -Promise.prototype._cancellable = function () { - return (this._bitField & 67108864) > 0; -}; - -Promise.prototype._setCancellable = function () { - this._bitField = this._bitField | 67108864; -}; - -Promise.prototype._unsetCancellable = function () { - this._bitField = this._bitField & (~67108864); -}; - -Promise.prototype._setIsMigrated = function () { - this._bitField = this._bitField | 4194304; -}; - -Promise.prototype._unsetIsMigrated = function () { - this._bitField = this._bitField & (~4194304); -}; - -Promise.prototype._isMigrated = function () { - return (this._bitField & 4194304) > 0; -}; - -Promise.prototype._receiverAt = function (index) { - var ret = index === 0 - ? this._receiver0 - : this[ - index * 5 - 5 + 4]; - if (ret === UNDEFINED_BINDING) { - return undefined; - } else if (ret === undefined && this._isBound()) { - return this._boundValue(); - } - return ret; -}; - -Promise.prototype._promiseAt = function (index) { - return index === 0 - ? this._promise0 - : this[index * 5 - 5 + 3]; -}; - -Promise.prototype._fulfillmentHandlerAt = function (index) { - return index === 0 - ? this._fulfillmentHandler0 - : this[index * 5 - 5 + 0]; -}; - -Promise.prototype._rejectionHandlerAt = function (index) { - return index === 0 - ? this._rejectionHandler0 - : this[index * 5 - 5 + 1]; -}; - -Promise.prototype._boundValue = function() { - var ret = this._boundTo; - if (ret !== undefined) { - if (ret instanceof Promise) { - if (ret.isFulfilled()) { - return ret.value(); - } else { - return undefined; - } - } - } - return ret; -}; - -Promise.prototype._migrateCallbacks = function (follower, index) { - var fulfill = follower._fulfillmentHandlerAt(index); - var reject = follower._rejectionHandlerAt(index); - var progress = follower._progressHandlerAt(index); - var promise = follower._promiseAt(index); - var receiver = follower._receiverAt(index); - if (promise instanceof Promise) promise._setIsMigrated(); - if (receiver === undefined) receiver = UNDEFINED_BINDING; - this._addCallbacks(fulfill, reject, progress, promise, receiver, null); -}; - -Promise.prototype._addCallbacks = function ( - fulfill, - reject, - progress, - promise, - receiver, - domain -) { - var index = this._length(); - - if (index >= 131071 - 5) { - index = 0; - this._setLength(0); - } - - if (index === 0) { - this._promise0 = promise; - if (receiver !== undefined) this._receiver0 = receiver; - if (typeof fulfill === "function" && !this._isCarryingStackTrace()) { - this._fulfillmentHandler0 = - domain === null ? fulfill : domain.bind(fulfill); - } - if (typeof reject === "function") { - this._rejectionHandler0 = - domain === null ? reject : domain.bind(reject); - } - if (typeof progress === "function") { - this._progressHandler0 = - domain === null ? progress : domain.bind(progress); - } - } else { - var base = index * 5 - 5; - this[base + 3] = promise; - this[base + 4] = receiver; - if (typeof fulfill === "function") { - this[base + 0] = - domain === null ? fulfill : domain.bind(fulfill); - } - if (typeof reject === "function") { - this[base + 1] = - domain === null ? reject : domain.bind(reject); - } - if (typeof progress === "function") { - this[base + 2] = - domain === null ? progress : domain.bind(progress); - } - } - this._setLength(index + 1); - return index; -}; - -Promise.prototype._setProxyHandlers = function (receiver, promiseSlotValue) { - var index = this._length(); - - if (index >= 131071 - 5) { - index = 0; - this._setLength(0); - } - if (index === 0) { - this._promise0 = promiseSlotValue; - this._receiver0 = receiver; - } else { - var base = index * 5 - 5; - this[base + 3] = promiseSlotValue; - this[base + 4] = receiver; - } - this._setLength(index + 1); -}; - -Promise.prototype._proxyPromiseArray = function (promiseArray, index) { - this._setProxyHandlers(promiseArray, index); -}; - -Promise.prototype._resolveCallback = function(value, shouldBind) { - if (this._isFollowingOrFulfilledOrRejected()) return; - if (value === this) - return this._rejectCallback(makeSelfResolutionError(), false, true); - var maybePromise = tryConvertToPromise(value, this); - if (!(maybePromise instanceof Promise)) return this._fulfill(value); - - var propagationFlags = 1 | (shouldBind ? 4 : 0); - this._propagateFrom(maybePromise, propagationFlags); - var promise = maybePromise._target(); - if (promise._isPending()) { - var len = this._length(); - for (var i = 0; i < len; ++i) { - promise._migrateCallbacks(this, i); - } - this._setFollowing(); - this._setLength(0); - this._setFollowee(promise); - } else if (promise._isFulfilled()) { - this._fulfillUnchecked(promise._value()); - } else { - this._rejectUnchecked(promise._reason(), - promise._getCarriedStackTrace()); - } -}; - -Promise.prototype._rejectCallback = -function(reason, synchronous, shouldNotMarkOriginatingFromRejection) { - if (!shouldNotMarkOriginatingFromRejection) { - util.markAsOriginatingFromRejection(reason); - } - var trace = util.ensureErrorObject(reason); - var hasStack = trace === reason; - this._attachExtraTrace(trace, synchronous ? hasStack : false); - this._reject(reason, hasStack ? undefined : trace); -}; - -Promise.prototype._resolveFromResolver = function (resolver) { - var promise = this; - this._captureStackTrace(); - this._pushContext(); - var synchronous = true; - var r = tryCatch(resolver)(function(value) { - if (promise === null) return; - promise._resolveCallback(value); - promise = null; - }, function (reason) { - if (promise === null) return; - promise._rejectCallback(reason, synchronous); - promise = null; - }); - synchronous = false; - this._popContext(); - - if (r !== undefined && r === errorObj && promise !== null) { - promise._rejectCallback(r.e, true, true); - promise = null; - } -}; - -Promise.prototype._settlePromiseFromHandler = function ( - handler, receiver, value, promise -) { - if (promise._isRejected()) return; - promise._pushContext(); - var x; - if (receiver === APPLY && !this._isRejected()) { - x = tryCatch(handler).apply(this._boundValue(), value); - } else { - x = tryCatch(handler).call(receiver, value); - } - promise._popContext(); - - if (x === errorObj || x === promise || x === NEXT_FILTER) { - var err = x === promise ? makeSelfResolutionError() : x.e; - promise._rejectCallback(err, false, true); - } else { - promise._resolveCallback(x); - } -}; - -Promise.prototype._target = function() { - var ret = this; - while (ret._isFollowing()) ret = ret._followee(); - return ret; -}; - -Promise.prototype._followee = function() { - return this._rejectionHandler0; -}; - -Promise.prototype._setFollowee = function(promise) { - this._rejectionHandler0 = promise; -}; - -Promise.prototype._cleanValues = function () { - if (this._cancellable()) { - this._cancellationParent = undefined; - } -}; - -Promise.prototype._propagateFrom = function (parent, flags) { - if ((flags & 1) > 0 && parent._cancellable()) { - this._setCancellable(); - this._cancellationParent = parent; - } - if ((flags & 4) > 0 && parent._isBound()) { - this._setBoundTo(parent._boundTo); - } -}; - -Promise.prototype._fulfill = function (value) { - if (this._isFollowingOrFulfilledOrRejected()) return; - this._fulfillUnchecked(value); -}; - -Promise.prototype._reject = function (reason, carriedStackTrace) { - if (this._isFollowingOrFulfilledOrRejected()) return; - this._rejectUnchecked(reason, carriedStackTrace); -}; - -Promise.prototype._settlePromiseAt = function (index) { - var promise = this._promiseAt(index); - var isPromise = promise instanceof Promise; - - if (isPromise && promise._isMigrated()) { - promise._unsetIsMigrated(); - return async.invoke(this._settlePromiseAt, this, index); - } - var handler = this._isFulfilled() - ? this._fulfillmentHandlerAt(index) - : this._rejectionHandlerAt(index); - - var carriedStackTrace = - this._isCarryingStackTrace() ? this._getCarriedStackTrace() : undefined; - var value = this._settledValue; - var receiver = this._receiverAt(index); - this._clearCallbackDataAtIndex(index); - - if (typeof handler === "function") { - if (!isPromise) { - handler.call(receiver, value, promise); - } else { - this._settlePromiseFromHandler(handler, receiver, value, promise); - } - } else if (receiver instanceof PromiseArray) { - if (!receiver._isResolved()) { - if (this._isFulfilled()) { - receiver._promiseFulfilled(value, promise); - } - else { - receiver._promiseRejected(value, promise); - } - } - } else if (isPromise) { - if (this._isFulfilled()) { - promise._fulfill(value); - } else { - promise._reject(value, carriedStackTrace); - } - } - - if (index >= 4 && (index & 31) === 4) - async.invokeLater(this._setLength, this, 0); -}; - -Promise.prototype._clearCallbackDataAtIndex = function(index) { - if (index === 0) { - if (!this._isCarryingStackTrace()) { - this._fulfillmentHandler0 = undefined; - } - this._rejectionHandler0 = - this._progressHandler0 = - this._receiver0 = - this._promise0 = undefined; - } else { - var base = index * 5 - 5; - this[base + 3] = - this[base + 4] = - this[base + 0] = - this[base + 1] = - this[base + 2] = undefined; - } -}; - -Promise.prototype._isSettlePromisesQueued = function () { - return (this._bitField & - -1073741824) === -1073741824; -}; - -Promise.prototype._setSettlePromisesQueued = function () { - this._bitField = this._bitField | -1073741824; -}; - -Promise.prototype._unsetSettlePromisesQueued = function () { - this._bitField = this._bitField & (~-1073741824); -}; - -Promise.prototype._queueSettlePromises = function() { - async.settlePromises(this); - this._setSettlePromisesQueued(); -}; - -Promise.prototype._fulfillUnchecked = function (value) { - if (value === this) { - var err = makeSelfResolutionError(); - this._attachExtraTrace(err); - return this._rejectUnchecked(err, undefined); - } - this._setFulfilled(); - this._settledValue = value; - this._cleanValues(); - - if (this._length() > 0) { - this._queueSettlePromises(); - } -}; - -Promise.prototype._rejectUncheckedCheckError = function (reason) { - var trace = util.ensureErrorObject(reason); - this._rejectUnchecked(reason, trace === reason ? undefined : trace); -}; - -Promise.prototype._rejectUnchecked = function (reason, trace) { - if (reason === this) { - var err = makeSelfResolutionError(); - this._attachExtraTrace(err); - return this._rejectUnchecked(err); - } - this._setRejected(); - this._settledValue = reason; - this._cleanValues(); - - if (this._isFinal()) { - async.throwLater(function(e) { - if ("stack" in e) { - async.invokeFirst( - CapturedTrace.unhandledRejection, undefined, e); - } - throw e; - }, trace === undefined ? reason : trace); - return; - } - - if (trace !== undefined && trace !== reason) { - this._setCarriedStackTrace(trace); - } - - if (this._length() > 0) { - this._queueSettlePromises(); - } else { - this._ensurePossibleRejectionHandled(); - } -}; - -Promise.prototype._settlePromises = function () { - this._unsetSettlePromisesQueued(); - var len = this._length(); - for (var i = 0; i < len; i++) { - this._settlePromiseAt(i); - } -}; - -util.notEnumerableProp(Promise, - "_makeSelfResolutionError", - makeSelfResolutionError); - -_dereq_("./progress.js")(Promise, PromiseArray); -_dereq_("./method.js")(Promise, INTERNAL, tryConvertToPromise, apiRejection); -_dereq_("./bind.js")(Promise, INTERNAL, tryConvertToPromise); -_dereq_("./finally.js")(Promise, NEXT_FILTER, tryConvertToPromise); -_dereq_("./direct_resolve.js")(Promise); -_dereq_("./synchronous_inspection.js")(Promise); -_dereq_("./join.js")(Promise, PromiseArray, tryConvertToPromise, INTERNAL); -Promise.Promise = Promise; -_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL); -_dereq_('./cancel.js')(Promise); -_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext); -_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise); -_dereq_('./nodeify.js')(Promise); -_dereq_('./call_get.js')(Promise); -_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); -_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); -_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL); -_dereq_('./settle.js')(Promise, PromiseArray); -_dereq_('./some.js')(Promise, PromiseArray, apiRejection); -_dereq_('./promisify.js')(Promise, INTERNAL); -_dereq_('./any.js')(Promise); -_dereq_('./each.js')(Promise, INTERNAL); -_dereq_('./timers.js')(Promise, INTERNAL); -_dereq_('./filter.js')(Promise, INTERNAL); - - util.toFastProperties(Promise); - util.toFastProperties(Promise.prototype); - function fillTypes(value) { - var p = new Promise(INTERNAL); - p._fulfillmentHandler0 = value; - p._rejectionHandler0 = value; - p._progressHandler0 = value; - p._promise0 = value; - p._receiver0 = value; - p._settledValue = value; - } - // Complete slack tracking, opt out of field-type tracking and - // stabilize map - fillTypes({a: 1}); - fillTypes({b: 2}); - fillTypes({c: 3}); - fillTypes(1); - fillTypes(function(){}); - fillTypes(undefined); - fillTypes(false); - fillTypes(new Promise(INTERNAL)); - CapturedTrace.setBounds(async.firstLineError, util.lastLineError); - return Promise; - -}; - -},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL, tryConvertToPromise, - apiRejection) { -var util = _dereq_("./util.js"); -var isArray = util.isArray; - -function toResolutionValue(val) { - switch(val) { - case -2: return []; - case -3: return {}; - } -} - -function PromiseArray(values) { - var promise = this._promise = new Promise(INTERNAL); - var parent; - if (values instanceof Promise) { - parent = values; - promise._propagateFrom(parent, 1 | 4); - } - this._values = values; - this._length = 0; - this._totalResolved = 0; - this._init(undefined, -2); -} -PromiseArray.prototype.length = function () { - return this._length; -}; - -PromiseArray.prototype.promise = function () { - return this._promise; -}; - -PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { - var values = tryConvertToPromise(this._values, this._promise); - if (values instanceof Promise) { - values = values._target(); - this._values = values; - if (values._isFulfilled()) { - values = values._value(); - if (!isArray(values)) { - var err = new Promise.TypeError("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a"); - this.__hardReject__(err); - return; - } - } else if (values._isPending()) { - values._then( - init, - this._reject, - undefined, - this, - resolveValueIfEmpty - ); - return; - } else { - this._reject(values._reason()); - return; - } - } else if (!isArray(values)) { - this._promise._reject(apiRejection("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a")._reason()); - return; - } - - if (values.length === 0) { - if (resolveValueIfEmpty === -5) { - this._resolveEmptyArray(); - } - else { - this._resolve(toResolutionValue(resolveValueIfEmpty)); - } - return; - } - var len = this.getActualLength(values.length); - this._length = len; - this._values = this.shouldCopyValues() ? new Array(len) : this._values; - var promise = this._promise; - for (var i = 0; i < len; ++i) { - var isResolved = this._isResolved(); - var maybePromise = tryConvertToPromise(values[i], promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - if (isResolved) { - maybePromise._ignoreRejections(); - } else if (maybePromise._isPending()) { - maybePromise._proxyPromiseArray(this, i); - } else if (maybePromise._isFulfilled()) { - this._promiseFulfilled(maybePromise._value(), i); - } else { - this._promiseRejected(maybePromise._reason(), i); - } - } else if (!isResolved) { - this._promiseFulfilled(maybePromise, i); - } - } -}; - -PromiseArray.prototype._isResolved = function () { - return this._values === null; -}; - -PromiseArray.prototype._resolve = function (value) { - this._values = null; - this._promise._fulfill(value); -}; - -PromiseArray.prototype.__hardReject__ = -PromiseArray.prototype._reject = function (reason) { - this._values = null; - this._promise._rejectCallback(reason, false, true); -}; - -PromiseArray.prototype._promiseProgressed = function (progressValue, index) { - this._promise._progress({ - index: index, - value: progressValue - }); -}; - - -PromiseArray.prototype._promiseFulfilled = function (value, index) { - this._values[index] = value; - var totalResolved = ++this._totalResolved; - if (totalResolved >= this._length) { - this._resolve(this._values); - } -}; - -PromiseArray.prototype._promiseRejected = function (reason, index) { - this._totalResolved++; - this._reject(reason); -}; - -PromiseArray.prototype.shouldCopyValues = function () { - return true; -}; - -PromiseArray.prototype.getActualLength = function (len) { - return len; -}; - -return PromiseArray; -}; - -},{"./util.js":38}],25:[function(_dereq_,module,exports){ -"use strict"; -var util = _dereq_("./util.js"); -var maybeWrapAsError = util.maybeWrapAsError; -var errors = _dereq_("./errors.js"); -var TimeoutError = errors.TimeoutError; -var OperationalError = errors.OperationalError; -var haveGetters = util.haveGetters; -var es5 = _dereq_("./es5.js"); - -function isUntypedError(obj) { - return obj instanceof Error && - es5.getPrototypeOf(obj) === Error.prototype; -} - -var rErrorKey = /^(?:name|message|stack|cause)$/; -function wrapAsOperationalError(obj) { - var ret; - if (isUntypedError(obj)) { - ret = new OperationalError(obj); - ret.name = obj.name; - ret.message = obj.message; - ret.stack = obj.stack; - var keys = es5.keys(obj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (!rErrorKey.test(key)) { - ret[key] = obj[key]; - } - } - return ret; - } - util.markAsOriginatingFromRejection(obj); - return obj; -} - -function nodebackForPromise(promise) { - return function(err, value) { - if (promise === null) return; - - if (err) { - var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); - promise._attachExtraTrace(wrapped); - promise._reject(wrapped); - } else if (arguments.length > 2) { - var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];} - promise._fulfill(args); - } else { - promise._fulfill(value); - } - - promise = null; - }; -} - - -var PromiseResolver; -if (!haveGetters) { - PromiseResolver = function (promise) { - this.promise = promise; - this.asCallback = nodebackForPromise(promise); - this.callback = this.asCallback; - }; -} -else { - PromiseResolver = function (promise) { - this.promise = promise; - }; -} -if (haveGetters) { - var prop = { - get: function() { - return nodebackForPromise(this.promise); - } - }; - es5.defineProperty(PromiseResolver.prototype, "asCallback", prop); - es5.defineProperty(PromiseResolver.prototype, "callback", prop); -} - -PromiseResolver._nodebackForPromise = nodebackForPromise; - -PromiseResolver.prototype.toString = function () { - return "[object PromiseResolver]"; -}; - -PromiseResolver.prototype.resolve = -PromiseResolver.prototype.fulfill = function (value) { - if (!(this instanceof PromiseResolver)) { - throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a"); - } - this.promise._resolveCallback(value); -}; - -PromiseResolver.prototype.reject = function (reason) { - if (!(this instanceof PromiseResolver)) { - throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a"); - } - this.promise._rejectCallback(reason); -}; - -PromiseResolver.prototype.progress = function (value) { - if (!(this instanceof PromiseResolver)) { - throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a"); - } - this.promise._progress(value); -}; - -PromiseResolver.prototype.cancel = function (err) { - this.promise.cancel(err); -}; - -PromiseResolver.prototype.timeout = function () { - this.reject(new TimeoutError("timeout")); -}; - -PromiseResolver.prototype.isResolved = function () { - return this.promise.isResolved(); -}; - -PromiseResolver.prototype.toJSON = function () { - return this.promise.toJSON(); -}; - -module.exports = PromiseResolver; - -},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var THIS = {}; -var util = _dereq_("./util.js"); -var nodebackForPromise = _dereq_("./promise_resolver.js") - ._nodebackForPromise; -var withAppended = util.withAppended; -var maybeWrapAsError = util.maybeWrapAsError; -var canEvaluate = util.canEvaluate; -var TypeError = _dereq_("./errors").TypeError; -var defaultSuffix = "Async"; -var defaultPromisified = {__isPromisified__: true}; -var noCopyProps = [ - "arity", "length", - "name", - "arguments", - "caller", - "callee", - "prototype", - "__isPromisified__" -]; -var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); - -var defaultFilter = function(name) { - return util.isIdentifier(name) && - name.charAt(0) !== "_" && - name !== "constructor"; -}; - -function propsFilter(key) { - return !noCopyPropsPattern.test(key); -} - -function isPromisified(fn) { - try { - return fn.__isPromisified__ === true; - } - catch (e) { - return false; - } -} - -function hasPromisified(obj, key, suffix) { - var val = util.getDataPropertyOrDefault(obj, key + suffix, - defaultPromisified); - return val ? isPromisified(val) : false; -} -function checkValid(ret, suffix, suffixRegexp) { - for (var i = 0; i < ret.length; i += 2) { - var key = ret[i]; - if (suffixRegexp.test(key)) { - var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); - for (var j = 0; j < ret.length; j += 2) { - if (ret[j] === keyWithoutAsyncSuffix) { - throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/iWrZbw\u000a" - .replace("%s", suffix)); - } - } - } - } -} - -function promisifiableMethods(obj, suffix, suffixRegexp, filter) { - var keys = util.inheritedDataKeys(obj); - var ret = []; - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var value = obj[key]; - var passesDefaultFilter = filter === defaultFilter - ? true : defaultFilter(key, value, obj); - if (typeof value === "function" && - !isPromisified(value) && - !hasPromisified(obj, key, suffix) && - filter(key, value, obj, passesDefaultFilter)) { - ret.push(key, value); - } - } - checkValid(ret, suffix, suffixRegexp); - return ret; -} - -var escapeIdentRegex = function(str) { - return str.replace(/([$])/, "\\$"); -}; - -var makeNodePromisifiedEval; -if (!true) { -var switchCaseArgumentOrder = function(likelyArgumentCount) { - var ret = [likelyArgumentCount]; - var min = Math.max(0, likelyArgumentCount - 1 - 3); - for(var i = likelyArgumentCount - 1; i >= min; --i) { - ret.push(i); - } - for(var i = likelyArgumentCount + 1; i <= 3; ++i) { - ret.push(i); - } - return ret; -}; - -var argumentSequence = function(argumentCount) { - return util.filledRange(argumentCount, "_arg", ""); -}; - -var parameterDeclaration = function(parameterCount) { - return util.filledRange( - Math.max(parameterCount, 3), "_arg", ""); -}; - -var parameterCount = function(fn) { - if (typeof fn.length === "number") { - return Math.max(Math.min(fn.length, 1023 + 1), 0); - } - return 0; -}; - -makeNodePromisifiedEval = -function(callback, receiver, originalName, fn) { - var newParameterCount = Math.max(0, parameterCount(fn) - 1); - var argumentOrder = switchCaseArgumentOrder(newParameterCount); - var shouldProxyThis = typeof callback === "string" || receiver === THIS; - - function generateCallForArgumentCount(count) { - var args = argumentSequence(count).join(", "); - var comma = count > 0 ? ", " : ""; - var ret; - if (shouldProxyThis) { - ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; - } else { - ret = receiver === undefined - ? "ret = callback({{args}}, nodeback); break;\n" - : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; - } - return ret.replace("{{args}}", args).replace(", ", comma); - } - - function generateArgumentSwitchCase() { - var ret = ""; - for (var i = 0; i < argumentOrder.length; ++i) { - ret += "case " + argumentOrder[i] +":" + - generateCallForArgumentCount(argumentOrder[i]); - } - - ret += " \n\ - default: \n\ - var args = new Array(len + 1); \n\ - var i = 0; \n\ - for (var i = 0; i < len; ++i) { \n\ - args[i] = arguments[i]; \n\ - } \n\ - args[i] = nodeback; \n\ - [CodeForCall] \n\ - break; \n\ - ".replace("[CodeForCall]", (shouldProxyThis - ? "ret = callback.apply(this, args);\n" - : "ret = callback.apply(receiver, args);\n")); - return ret; - } - - var getFunctionCode = typeof callback === "string" - ? ("this != null ? this['"+callback+"'] : fn") - : "fn"; - - return new Function("Promise", - "fn", - "receiver", - "withAppended", - "maybeWrapAsError", - "nodebackForPromise", - "tryCatch", - "errorObj", - "notEnumerableProp", - "INTERNAL","'use strict'; \n\ - var ret = function (Parameters) { \n\ - 'use strict'; \n\ - var len = arguments.length; \n\ - var promise = new Promise(INTERNAL); \n\ - promise._captureStackTrace(); \n\ - var nodeback = nodebackForPromise(promise); \n\ - var ret; \n\ - var callback = tryCatch([GetFunctionCode]); \n\ - switch(len) { \n\ - [CodeForSwitchCase] \n\ - } \n\ - if (ret === errorObj) { \n\ - promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ - } \n\ - return promise; \n\ - }; \n\ - notEnumerableProp(ret, '__isPromisified__', true); \n\ - return ret; \n\ - " - .replace("Parameters", parameterDeclaration(newParameterCount)) - .replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) - .replace("[GetFunctionCode]", getFunctionCode))( - Promise, - fn, - receiver, - withAppended, - maybeWrapAsError, - nodebackForPromise, - util.tryCatch, - util.errorObj, - util.notEnumerableProp, - INTERNAL - ); -}; -} - -function makeNodePromisifiedClosure(callback, receiver, _, fn) { - var defaultThis = (function() {return this;})(); - var method = callback; - if (typeof method === "string") { - callback = fn; - } - function promisified() { - var _receiver = receiver; - if (receiver === THIS) _receiver = this; - var promise = new Promise(INTERNAL); - promise._captureStackTrace(); - var cb = typeof method === "string" && this !== defaultThis - ? this[method] : callback; - var fn = nodebackForPromise(promise); - try { - cb.apply(_receiver, withAppended(arguments, fn)); - } catch(e) { - promise._rejectCallback(maybeWrapAsError(e), true, true); - } - return promise; - } - util.notEnumerableProp(promisified, "__isPromisified__", true); - return promisified; -} - -var makeNodePromisified = canEvaluate - ? makeNodePromisifiedEval - : makeNodePromisifiedClosure; - -function promisifyAll(obj, suffix, filter, promisifier) { - var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); - var methods = - promisifiableMethods(obj, suffix, suffixRegexp, filter); - - for (var i = 0, len = methods.length; i < len; i+= 2) { - var key = methods[i]; - var fn = methods[i+1]; - var promisifiedKey = key + suffix; - if (promisifier === makeNodePromisified) { - obj[promisifiedKey] = - makeNodePromisified(key, THIS, key, fn, suffix); - } else { - var promisified = promisifier(fn, function() { - return makeNodePromisified(key, THIS, key, fn, suffix); - }); - util.notEnumerableProp(promisified, "__isPromisified__", true); - obj[promisifiedKey] = promisified; - } - } - util.toFastProperties(obj); - return obj; -} - -function promisify(callback, receiver) { - return makeNodePromisified(callback, receiver, undefined, callback); -} - -Promise.promisify = function (fn, receiver) { - if (typeof fn !== "function") { - throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - } - if (isPromisified(fn)) { - return fn; - } - var ret = promisify(fn, arguments.length < 2 ? THIS : receiver); - util.copyDescriptors(fn, ret, propsFilter); - return ret; -}; - -Promise.promisifyAll = function (target, options) { - if (typeof target !== "function" && typeof target !== "object") { - throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/9ITlV0\u000a"); - } - options = Object(options); - var suffix = options.suffix; - if (typeof suffix !== "string") suffix = defaultSuffix; - var filter = options.filter; - if (typeof filter !== "function") filter = defaultFilter; - var promisifier = options.promisifier; - if (typeof promisifier !== "function") promisifier = makeNodePromisified; - - if (!util.isIdentifier(suffix)) { - throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/8FZo5V\u000a"); - } - - var keys = util.inheritedDataKeys(target); - for (var i = 0; i < keys.length; ++i) { - var value = target[keys[i]]; - if (keys[i] !== "constructor" && - util.isClass(value)) { - promisifyAll(value.prototype, suffix, filter, promisifier); - promisifyAll(value, suffix, filter, promisifier); - } - } - - return promisifyAll(target, suffix, filter, promisifier); -}; -}; - - -},{"./errors":13,"./promise_resolver.js":25,"./util.js":38}],27:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function( - Promise, PromiseArray, tryConvertToPromise, apiRejection) { -var util = _dereq_("./util.js"); -var isObject = util.isObject; -var es5 = _dereq_("./es5.js"); - -function PropertiesPromiseArray(obj) { - var keys = es5.keys(obj); - var len = keys.length; - var values = new Array(len * 2); - for (var i = 0; i < len; ++i) { - var key = keys[i]; - values[i] = obj[key]; - values[i + len] = key; - } - this.constructor$(values); -} -util.inherits(PropertiesPromiseArray, PromiseArray); - -PropertiesPromiseArray.prototype._init = function () { - this._init$(undefined, -3) ; -}; - -PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { - this._values[index] = value; - var totalResolved = ++this._totalResolved; - if (totalResolved >= this._length) { - var val = {}; - var keyOffset = this.length(); - for (var i = 0, len = this.length(); i < len; ++i) { - val[this._values[i + keyOffset]] = this._values[i]; - } - this._resolve(val); - } -}; - -PropertiesPromiseArray.prototype._promiseProgressed = function (value, index) { - this._promise._progress({ - key: this._values[index + this.length()], - value: value - }); -}; - -PropertiesPromiseArray.prototype.shouldCopyValues = function () { - return false; -}; - -PropertiesPromiseArray.prototype.getActualLength = function (len) { - return len >> 1; -}; - -function props(promises) { - var ret; - var castValue = tryConvertToPromise(promises); - - if (!isObject(castValue)) { - return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/OsFKC8\u000a"); - } else if (castValue instanceof Promise) { - ret = castValue._then( - Promise.props, undefined, undefined, undefined, undefined); - } else { - ret = new PropertiesPromiseArray(castValue).promise(); - } - - if (castValue instanceof Promise) { - ret._propagateFrom(castValue, 4); - } - return ret; -} - -Promise.prototype.props = function () { - return props(this); -}; - -Promise.props = function (promises) { - return props(promises); -}; -}; - -},{"./es5.js":14,"./util.js":38}],28:[function(_dereq_,module,exports){ -"use strict"; -function arrayMove(src, srcIndex, dst, dstIndex, len) { - for (var j = 0; j < len; ++j) { - dst[j + dstIndex] = src[j + srcIndex]; - src[j + srcIndex] = void 0; - } -} - -function Queue(capacity) { - this._capacity = capacity; - this._length = 0; - this._front = 0; -} - -Queue.prototype._willBeOverCapacity = function (size) { - return this._capacity < size; -}; - -Queue.prototype._pushOne = function (arg) { - var length = this.length(); - this._checkCapacity(length + 1); - var i = (this._front + length) & (this._capacity - 1); - this[i] = arg; - this._length = length + 1; -}; - -Queue.prototype._unshiftOne = function(value) { - var capacity = this._capacity; - this._checkCapacity(this.length() + 1); - var front = this._front; - var i = (((( front - 1 ) & - ( capacity - 1) ) ^ capacity ) - capacity ); - this[i] = value; - this._front = i; - this._length = this.length() + 1; -}; - -Queue.prototype.unshift = function(fn, receiver, arg) { - this._unshiftOne(arg); - this._unshiftOne(receiver); - this._unshiftOne(fn); -}; - -Queue.prototype.push = function (fn, receiver, arg) { - var length = this.length() + 3; - if (this._willBeOverCapacity(length)) { - this._pushOne(fn); - this._pushOne(receiver); - this._pushOne(arg); - return; - } - var j = this._front + length - 3; - this._checkCapacity(length); - var wrapMask = this._capacity - 1; - this[(j + 0) & wrapMask] = fn; - this[(j + 1) & wrapMask] = receiver; - this[(j + 2) & wrapMask] = arg; - this._length = length; -}; - -Queue.prototype.shift = function () { - var front = this._front, - ret = this[front]; - - this[front] = undefined; - this._front = (front + 1) & (this._capacity - 1); - this._length--; - return ret; -}; - -Queue.prototype.length = function () { - return this._length; -}; - -Queue.prototype._checkCapacity = function (size) { - if (this._capacity < size) { - this._resizeTo(this._capacity << 1); - } -}; - -Queue.prototype._resizeTo = function (capacity) { - var oldCapacity = this._capacity; - this._capacity = capacity; - var front = this._front; - var length = this._length; - var moveItemsCount = (front + length) & (oldCapacity - 1); - arrayMove(this, 0, this, oldCapacity, moveItemsCount); -}; - -module.exports = Queue; - -},{}],29:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function( - Promise, INTERNAL, tryConvertToPromise, apiRejection) { -var isArray = _dereq_("./util.js").isArray; - -var raceLater = function (promise) { - return promise.then(function(array) { - return race(array, promise); - }); -}; - -function race(promises, parent) { - var maybePromise = tryConvertToPromise(promises); - - if (maybePromise instanceof Promise) { - return raceLater(maybePromise); - } else if (!isArray(promises)) { - return apiRejection("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a"); - } - - var ret = new Promise(INTERNAL); - if (parent !== undefined) { - ret._propagateFrom(parent, 4 | 1); - } - var fulfill = ret._fulfill; - var reject = ret._reject; - for (var i = 0, len = promises.length; i < len; ++i) { - var val = promises[i]; - - if (val === undefined && !(i in promises)) { - continue; - } - - Promise.cast(val)._then(fulfill, reject, undefined, ret, null); - } - return ret; -} - -Promise.race = function (promises) { - return race(promises, undefined); -}; - -Promise.prototype.race = function () { - return race(this, undefined); -}; - -}; - -},{"./util.js":38}],30:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, - PromiseArray, - apiRejection, - tryConvertToPromise, - INTERNAL) { -var getDomain = Promise._getDomain; -var async = _dereq_("./async.js"); -var util = _dereq_("./util.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -function ReductionPromiseArray(promises, fn, accum, _each) { - this.constructor$(promises); - this._promise._captureStackTrace(); - this._preservedValues = _each === INTERNAL ? [] : null; - this._zerothIsAccum = (accum === undefined); - this._gotAccum = false; - this._reducingIndex = (this._zerothIsAccum ? 1 : 0); - this._valuesPhase = undefined; - var maybePromise = tryConvertToPromise(accum, this._promise); - var rejected = false; - var isPromise = maybePromise instanceof Promise; - if (isPromise) { - maybePromise = maybePromise._target(); - if (maybePromise._isPending()) { - maybePromise._proxyPromiseArray(this, -1); - } else if (maybePromise._isFulfilled()) { - accum = maybePromise._value(); - this._gotAccum = true; - } else { - this._reject(maybePromise._reason()); - rejected = true; - } - } - if (!(isPromise || this._zerothIsAccum)) this._gotAccum = true; - var domain = getDomain(); - this._callback = domain === null ? fn : domain.bind(fn); - this._accum = accum; - if (!rejected) async.invoke(init, this, undefined); -} -function init() { - this._init$(undefined, -5); -} -util.inherits(ReductionPromiseArray, PromiseArray); - -ReductionPromiseArray.prototype._init = function () {}; - -ReductionPromiseArray.prototype._resolveEmptyArray = function () { - if (this._gotAccum || this._zerothIsAccum) { - this._resolve(this._preservedValues !== null - ? [] : this._accum); - } -}; - -ReductionPromiseArray.prototype._promiseFulfilled = function (value, index) { - var values = this._values; - values[index] = value; - var length = this.length(); - var preservedValues = this._preservedValues; - var isEach = preservedValues !== null; - var gotAccum = this._gotAccum; - var valuesPhase = this._valuesPhase; - var valuesPhaseIndex; - if (!valuesPhase) { - valuesPhase = this._valuesPhase = new Array(length); - for (valuesPhaseIndex=0; valuesPhaseIndex= this._length) { - this._resolve(this._values); - } -}; - -SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { - var ret = new PromiseInspection(); - ret._bitField = 268435456; - ret._settledValue = value; - this._promiseResolved(index, ret); -}; -SettledPromiseArray.prototype._promiseRejected = function (reason, index) { - var ret = new PromiseInspection(); - ret._bitField = 134217728; - ret._settledValue = reason; - this._promiseResolved(index, ret); -}; - -Promise.settle = function (promises) { - return new SettledPromiseArray(promises).promise(); -}; - -Promise.prototype.settle = function () { - return new SettledPromiseArray(this).promise(); -}; -}; - -},{"./util.js":38}],33:[function(_dereq_,module,exports){ -"use strict"; -module.exports = -function(Promise, PromiseArray, apiRejection) { -var util = _dereq_("./util.js"); -var RangeError = _dereq_("./errors.js").RangeError; -var AggregateError = _dereq_("./errors.js").AggregateError; -var isArray = util.isArray; - - -function SomePromiseArray(values) { - this.constructor$(values); - this._howMany = 0; - this._unwrap = false; - this._initialized = false; -} -util.inherits(SomePromiseArray, PromiseArray); - -SomePromiseArray.prototype._init = function () { - if (!this._initialized) { - return; - } - if (this._howMany === 0) { - this._resolve([]); - return; - } - this._init$(undefined, -5); - var isArrayResolved = isArray(this._values); - if (!this._isResolved() && - isArrayResolved && - this._howMany > this._canPossiblyFulfill()) { - this._reject(this._getRangeError(this.length())); - } -}; - -SomePromiseArray.prototype.init = function () { - this._initialized = true; - this._init(); -}; - -SomePromiseArray.prototype.setUnwrap = function () { - this._unwrap = true; -}; - -SomePromiseArray.prototype.howMany = function () { - return this._howMany; -}; - -SomePromiseArray.prototype.setHowMany = function (count) { - this._howMany = count; -}; - -SomePromiseArray.prototype._promiseFulfilled = function (value) { - this._addFulfilled(value); - if (this._fulfilled() === this.howMany()) { - this._values.length = this.howMany(); - if (this.howMany() === 1 && this._unwrap) { - this._resolve(this._values[0]); - } else { - this._resolve(this._values); - } - } - -}; -SomePromiseArray.prototype._promiseRejected = function (reason) { - this._addRejected(reason); - if (this.howMany() > this._canPossiblyFulfill()) { - var e = new AggregateError(); - for (var i = this.length(); i < this._values.length; ++i) { - e.push(this._values[i]); - } - this._reject(e); - } -}; - -SomePromiseArray.prototype._fulfilled = function () { - return this._totalResolved; -}; - -SomePromiseArray.prototype._rejected = function () { - return this._values.length - this.length(); -}; - -SomePromiseArray.prototype._addRejected = function (reason) { - this._values.push(reason); -}; - -SomePromiseArray.prototype._addFulfilled = function (value) { - this._values[this._totalResolved++] = value; -}; - -SomePromiseArray.prototype._canPossiblyFulfill = function () { - return this.length() - this._rejected(); -}; - -SomePromiseArray.prototype._getRangeError = function (count) { - var message = "Input array must contain at least " + - this._howMany + " items but contains only " + count + " items"; - return new RangeError(message); -}; - -SomePromiseArray.prototype._resolveEmptyArray = function () { - this._reject(this._getRangeError(0)); -}; - -function some(promises, howMany) { - if ((howMany | 0) !== howMany || howMany < 0) { - return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/1wAmHx\u000a"); - } - var ret = new SomePromiseArray(promises); - var promise = ret.promise(); - ret.setHowMany(howMany); - ret.init(); - return promise; -} - -Promise.some = function (promises, howMany) { - return some(promises, howMany); -}; - -Promise.prototype.some = function (howMany) { - return some(this, howMany); -}; - -Promise._SomePromiseArray = SomePromiseArray; -}; - -},{"./errors.js":13,"./util.js":38}],34:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise) { -function PromiseInspection(promise) { - if (promise !== undefined) { - promise = promise._target(); - this._bitField = promise._bitField; - this._settledValue = promise._settledValue; - } - else { - this._bitField = 0; - this._settledValue = undefined; - } -} - -PromiseInspection.prototype.value = function () { - if (!this.isFulfilled()) { - throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/hc1DLj\u000a"); - } - return this._settledValue; -}; - -PromiseInspection.prototype.error = -PromiseInspection.prototype.reason = function () { - if (!this.isRejected()) { - throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/hPuiwB\u000a"); - } - return this._settledValue; -}; - -PromiseInspection.prototype.isFulfilled = -Promise.prototype._isFulfilled = function () { - return (this._bitField & 268435456) > 0; -}; - -PromiseInspection.prototype.isRejected = -Promise.prototype._isRejected = function () { - return (this._bitField & 134217728) > 0; -}; - -PromiseInspection.prototype.isPending = -Promise.prototype._isPending = function () { - return (this._bitField & 402653184) === 0; -}; - -PromiseInspection.prototype.isResolved = -Promise.prototype._isResolved = function () { - return (this._bitField & 402653184) > 0; -}; - -Promise.prototype.isPending = function() { - return this._target()._isPending(); -}; - -Promise.prototype.isRejected = function() { - return this._target()._isRejected(); -}; - -Promise.prototype.isFulfilled = function() { - return this._target()._isFulfilled(); -}; - -Promise.prototype.isResolved = function() { - return this._target()._isResolved(); -}; - -Promise.prototype._value = function() { - return this._settledValue; -}; - -Promise.prototype._reason = function() { - this._unsetRejectionIsUnhandled(); - return this._settledValue; -}; - -Promise.prototype.value = function() { - var target = this._target(); - if (!target.isFulfilled()) { - throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/hc1DLj\u000a"); - } - return target._settledValue; -}; - -Promise.prototype.reason = function() { - var target = this._target(); - if (!target.isRejected()) { - throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/hPuiwB\u000a"); - } - target._unsetRejectionIsUnhandled(); - return target._settledValue; -}; - - -Promise.PromiseInspection = PromiseInspection; -}; - -},{}],35:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var util = _dereq_("./util.js"); -var errorObj = util.errorObj; -var isObject = util.isObject; - -function tryConvertToPromise(obj, context) { - if (isObject(obj)) { - if (obj instanceof Promise) { - return obj; - } - else if (isAnyBluebirdPromise(obj)) { - var ret = new Promise(INTERNAL); - obj._then( - ret._fulfillUnchecked, - ret._rejectUncheckedCheckError, - ret._progressUnchecked, - ret, - null - ); - return ret; - } - var then = util.tryCatch(getThen)(obj); - if (then === errorObj) { - if (context) context._pushContext(); - var ret = Promise.reject(then.e); - if (context) context._popContext(); - return ret; - } else if (typeof then === "function") { - return doThenable(obj, then, context); - } - } - return obj; -} - -function getThen(obj) { - return obj.then; -} - -var hasProp = {}.hasOwnProperty; -function isAnyBluebirdPromise(obj) { - return hasProp.call(obj, "_promise0"); -} - -function doThenable(x, then, context) { - var promise = new Promise(INTERNAL); - var ret = promise; - if (context) context._pushContext(); - promise._captureStackTrace(); - if (context) context._popContext(); - var synchronous = true; - var result = util.tryCatch(then).call(x, - resolveFromThenable, - rejectFromThenable, - progressFromThenable); - synchronous = false; - if (promise && result === errorObj) { - promise._rejectCallback(result.e, true, true); - promise = null; - } - - function resolveFromThenable(value) { - if (!promise) return; - promise._resolveCallback(value); - promise = null; - } - - function rejectFromThenable(reason) { - if (!promise) return; - promise._rejectCallback(reason, synchronous, true); - promise = null; - } - - function progressFromThenable(value) { - if (!promise) return; - if (typeof promise._progress === "function") { - promise._progress(value); - } - } - return ret; -} - -return tryConvertToPromise; -}; - -},{"./util.js":38}],36:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var util = _dereq_("./util.js"); -var TimeoutError = Promise.TimeoutError; - -var afterTimeout = function (promise, message) { - if (!promise.isPending()) return; - if (typeof message !== "string") { - message = "operation timed out"; - } - var err = new TimeoutError(message); - util.markAsOriginatingFromRejection(err); - promise._attachExtraTrace(err); - promise._cancel(err); -}; - -var afterValue = function(value) { return delay(+this).thenReturn(value); }; -var delay = Promise.delay = function (value, ms) { - if (ms === undefined) { - ms = value; - value = undefined; - var ret = new Promise(INTERNAL); - setTimeout(function() { ret._fulfill(); }, ms); - return ret; - } - ms = +ms; - return Promise.resolve(value)._then(afterValue, null, null, ms, undefined); -}; - -Promise.prototype.delay = function (ms) { - return delay(this, ms); -}; - -function successClear(value) { - var handle = this; - if (handle instanceof Number) handle = +handle; - clearTimeout(handle); - return value; -} - -function failureClear(reason) { - var handle = this; - if (handle instanceof Number) handle = +handle; - clearTimeout(handle); - throw reason; -} - -Promise.prototype.timeout = function (ms, message) { - ms = +ms; - var ret = this.then().cancellable(); - ret._cancellationParent = this; - var handle = setTimeout(function timeoutTimeout() { - afterTimeout(ret, message); - }, ms); - return ret._then(successClear, failureClear, undefined, handle, undefined); -}; - -}; - -},{"./util.js":38}],37:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function (Promise, apiRejection, tryConvertToPromise, - createContext) { - var TypeError = _dereq_("./errors.js").TypeError; - var inherits = _dereq_("./util.js").inherits; - var PromiseInspection = Promise.PromiseInspection; - - function inspectionMapper(inspections) { - var len = inspections.length; - for (var i = 0; i < len; ++i) { - var inspection = inspections[i]; - if (inspection.isRejected()) { - return Promise.reject(inspection.error()); - } - inspections[i] = inspection._settledValue; - } - return inspections; - } - - function thrower(e) { - setTimeout(function(){throw e;}, 0); - } - - function castPreservingDisposable(thenable) { - var maybePromise = tryConvertToPromise(thenable); - if (maybePromise !== thenable && - typeof thenable._isDisposable === "function" && - typeof thenable._getDisposer === "function" && - thenable._isDisposable()) { - maybePromise._setDisposable(thenable._getDisposer()); - } - return maybePromise; - } - function dispose(resources, inspection) { - var i = 0; - var len = resources.length; - var ret = Promise.defer(); - function iterator() { - if (i >= len) return ret.resolve(); - var maybePromise = castPreservingDisposable(resources[i++]); - if (maybePromise instanceof Promise && - maybePromise._isDisposable()) { - try { - maybePromise = tryConvertToPromise( - maybePromise._getDisposer().tryDispose(inspection), - resources.promise); - } catch (e) { - return thrower(e); - } - if (maybePromise instanceof Promise) { - return maybePromise._then(iterator, thrower, - null, null, null); - } - } - iterator(); - } - iterator(); - return ret.promise; - } - - function disposerSuccess(value) { - var inspection = new PromiseInspection(); - inspection._settledValue = value; - inspection._bitField = 268435456; - return dispose(this, inspection).thenReturn(value); - } - - function disposerFail(reason) { - var inspection = new PromiseInspection(); - inspection._settledValue = reason; - inspection._bitField = 134217728; - return dispose(this, inspection).thenThrow(reason); - } - - function Disposer(data, promise, context) { - this._data = data; - this._promise = promise; - this._context = context; - } - - Disposer.prototype.data = function () { - return this._data; - }; - - Disposer.prototype.promise = function () { - return this._promise; - }; - - Disposer.prototype.resource = function () { - if (this.promise().isFulfilled()) { - return this.promise().value(); - } - return null; - }; - - Disposer.prototype.tryDispose = function(inspection) { - var resource = this.resource(); - var context = this._context; - if (context !== undefined) context._pushContext(); - var ret = resource !== null - ? this.doDispose(resource, inspection) : null; - if (context !== undefined) context._popContext(); - this._promise._unsetDisposable(); - this._data = null; - return ret; - }; - - Disposer.isDisposer = function (d) { - return (d != null && - typeof d.resource === "function" && - typeof d.tryDispose === "function"); - }; - - function FunctionDisposer(fn, promise, context) { - this.constructor$(fn, promise, context); - } - inherits(FunctionDisposer, Disposer); - - FunctionDisposer.prototype.doDispose = function (resource, inspection) { - var fn = this.data(); - return fn.call(resource, resource, inspection); - }; - - function maybeUnwrapDisposer(value) { - if (Disposer.isDisposer(value)) { - this.resources[this.index]._setDisposable(value); - return value.promise(); - } - return value; - } - - Promise.using = function () { - var len = arguments.length; - if (len < 2) return apiRejection( - "you must pass at least 2 arguments to Promise.using"); - var fn = arguments[len - 1]; - if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - - var input; - var spreadArgs = true; - if (len === 2 && Array.isArray(arguments[0])) { - input = arguments[0]; - len = input.length; - spreadArgs = false; - } else { - input = arguments; - len--; - } - var resources = new Array(len); - for (var i = 0; i < len; ++i) { - var resource = input[i]; - if (Disposer.isDisposer(resource)) { - var disposer = resource; - resource = resource.promise(); - resource._setDisposable(disposer); - } else { - var maybePromise = tryConvertToPromise(resource); - if (maybePromise instanceof Promise) { - resource = - maybePromise._then(maybeUnwrapDisposer, null, null, { - resources: resources, - index: i - }, undefined); - } - } - resources[i] = resource; - } - - var promise = Promise.settle(resources) - .then(inspectionMapper) - .then(function(vals) { - promise._pushContext(); - var ret; - try { - ret = spreadArgs - ? fn.apply(undefined, vals) : fn.call(undefined, vals); - } finally { - promise._popContext(); - } - return ret; - }) - ._then( - disposerSuccess, disposerFail, undefined, resources, undefined); - resources.promise = promise; - return promise; - }; - - Promise.prototype._setDisposable = function (disposer) { - this._bitField = this._bitField | 262144; - this._disposer = disposer; - }; - - Promise.prototype._isDisposable = function () { - return (this._bitField & 262144) > 0; - }; - - Promise.prototype._getDisposer = function () { - return this._disposer; - }; - - Promise.prototype._unsetDisposable = function () { - this._bitField = this._bitField & (~262144); - this._disposer = undefined; - }; - - Promise.prototype.disposer = function (fn) { - if (typeof fn === "function") { - return new FunctionDisposer(fn, this, createContext()); - } - throw new TypeError(); - }; - -}; - -},{"./errors.js":13,"./util.js":38}],38:[function(_dereq_,module,exports){ -"use strict"; -var es5 = _dereq_("./es5.js"); -var canEvaluate = typeof navigator == "undefined"; -var haveGetters = (function(){ - try { - var o = {}; - es5.defineProperty(o, "f", { - get: function () { - return 3; - } - }); - return o.f === 3; - } - catch (e) { - return false; - } - -})(); - -var errorObj = {e: {}}; -var tryCatchTarget; -function tryCatcher() { - try { - var target = tryCatchTarget; - tryCatchTarget = null; - return target.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } -} -function tryCatch(fn) { - tryCatchTarget = fn; - return tryCatcher; -} - -var inherits = function(Child, Parent) { - var hasProp = {}.hasOwnProperty; - - function T() { - this.constructor = Child; - this.constructor$ = Parent; - for (var propertyName in Parent.prototype) { - if (hasProp.call(Parent.prototype, propertyName) && - propertyName.charAt(propertyName.length-1) !== "$" - ) { - this[propertyName + "$"] = Parent.prototype[propertyName]; - } - } - } - T.prototype = Parent.prototype; - Child.prototype = new T(); - return Child.prototype; -}; - - -function isPrimitive(val) { - return val == null || val === true || val === false || - typeof val === "string" || typeof val === "number"; - -} - -function isObject(value) { - return !isPrimitive(value); -} - -function maybeWrapAsError(maybeError) { - if (!isPrimitive(maybeError)) return maybeError; - - return new Error(safeToString(maybeError)); -} - -function withAppended(target, appendee) { - var len = target.length; - var ret = new Array(len + 1); - var i; - for (i = 0; i < len; ++i) { - ret[i] = target[i]; - } - ret[i] = appendee; - return ret; -} - -function getDataPropertyOrDefault(obj, key, defaultValue) { - if (es5.isES5) { - var desc = Object.getOwnPropertyDescriptor(obj, key); - - if (desc != null) { - return desc.get == null && desc.set == null - ? desc.value - : defaultValue; - } - } else { - return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; - } -} - -function notEnumerableProp(obj, name, value) { - if (isPrimitive(obj)) return obj; - var descriptor = { - value: value, - configurable: true, - enumerable: false, - writable: true - }; - es5.defineProperty(obj, name, descriptor); - return obj; -} - -function thrower(r) { - throw r; -} - -var inheritedDataKeys = (function() { - var excludedPrototypes = [ - Array.prototype, - Object.prototype, - Function.prototype - ]; - - var isExcludedProto = function(val) { - for (var i = 0; i < excludedPrototypes.length; ++i) { - if (excludedPrototypes[i] === val) { - return true; - } - } - return false; - }; - - if (es5.isES5) { - var getKeys = Object.getOwnPropertyNames; - return function(obj) { - var ret = []; - var visitedKeys = Object.create(null); - while (obj != null && !isExcludedProto(obj)) { - var keys; - try { - keys = getKeys(obj); - } catch (e) { - return ret; - } - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (visitedKeys[key]) continue; - visitedKeys[key] = true; - var desc = Object.getOwnPropertyDescriptor(obj, key); - if (desc != null && desc.get == null && desc.set == null) { - ret.push(key); - } - } - obj = es5.getPrototypeOf(obj); - } - return ret; - }; - } else { - var hasProp = {}.hasOwnProperty; - return function(obj) { - if (isExcludedProto(obj)) return []; - var ret = []; - - /*jshint forin:false */ - enumeration: for (var key in obj) { - if (hasProp.call(obj, key)) { - ret.push(key); - } else { - for (var i = 0; i < excludedPrototypes.length; ++i) { - if (hasProp.call(excludedPrototypes[i], key)) { - continue enumeration; - } - } - ret.push(key); - } - } - return ret; - }; - } - -})(); - -var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; -function isClass(fn) { - try { - if (typeof fn === "function") { - var keys = es5.names(fn.prototype); - - var hasMethods = es5.isES5 && keys.length > 1; - var hasMethodsOtherThanConstructor = keys.length > 0 && - !(keys.length === 1 && keys[0] === "constructor"); - var hasThisAssignmentAndStaticMethods = - thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; - - if (hasMethods || hasMethodsOtherThanConstructor || - hasThisAssignmentAndStaticMethods) { - return true; - } - } - return false; - } catch (e) { - return false; - } -} - -function toFastProperties(obj) { - /*jshint -W027,-W055,-W031*/ - function f() {} - f.prototype = obj; - var l = 8; - while (l--) new f(); - return obj; - eval(obj); -} - -var rident = /^[a-z$_][a-z$_0-9]*$/i; -function isIdentifier(str) { - return rident.test(str); -} - -function filledRange(count, prefix, suffix) { - var ret = new Array(count); - for(var i = 0; i < count; ++i) { - ret[i] = prefix + i + suffix; - } - return ret; -} - -function safeToString(obj) { - try { - return obj + ""; - } catch (e) { - return "[no string representation]"; - } -} - -function markAsOriginatingFromRejection(e) { - try { - notEnumerableProp(e, "isOperational", true); - } - catch(ignore) {} -} - -function originatesFromRejection(e) { - if (e == null) return false; - return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || - e["isOperational"] === true); -} - -function canAttachTrace(obj) { - return obj instanceof Error && es5.propertyIsWritable(obj, "stack"); -} - -var ensureErrorObject = (function() { - if (!("stack" in new Error())) { - return function(value) { - if (canAttachTrace(value)) return value; - try {throw new Error(safeToString(value));} - catch(err) {return err;} - }; - } else { - return function(value) { - if (canAttachTrace(value)) return value; - return new Error(safeToString(value)); - }; - } -})(); - -function classString(obj) { - return {}.toString.call(obj); -} - -function copyDescriptors(from, to, filter) { - var keys = es5.names(from); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (filter(key)) { - try { - es5.defineProperty(to, key, es5.getDescriptor(from, key)); - } catch (ignore) {} - } - } -} - -var ret = { - isClass: isClass, - isIdentifier: isIdentifier, - inheritedDataKeys: inheritedDataKeys, - getDataPropertyOrDefault: getDataPropertyOrDefault, - thrower: thrower, - isArray: es5.isArray, - haveGetters: haveGetters, - notEnumerableProp: notEnumerableProp, - isPrimitive: isPrimitive, - isObject: isObject, - canEvaluate: canEvaluate, - errorObj: errorObj, - tryCatch: tryCatch, - inherits: inherits, - withAppended: withAppended, - maybeWrapAsError: maybeWrapAsError, - toFastProperties: toFastProperties, - filledRange: filledRange, - toString: safeToString, - canAttachTrace: canAttachTrace, - ensureErrorObject: ensureErrorObject, - originatesFromRejection: originatesFromRejection, - markAsOriginatingFromRejection: markAsOriginatingFromRejection, - classString: classString, - copyDescriptors: copyDescriptors, - hasDevTools: typeof chrome !== "undefined" && chrome && - typeof chrome.loadTimes === "function", - isNode: typeof process !== "undefined" && - classString(process).toLowerCase() === "[object process]" -}; -ret.isRecentNode = ret.isNode && (function() { - var version = process.versions.node.split(".").map(Number); - return (version[0] === 0 && version[1] > 10) || (version[0] > 0); -})(); - -if (ret.isNode) ret.toFastProperties(process); - -try {throw new Error(); } catch (e) {ret.lastLineError = e;} -module.exports = ret; - -},{"./es5.js":14}]},{},[4])(4) -}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.min.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.min.js deleted file mode 100644 index f49fe5394f51df..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.min.js +++ /dev/null @@ -1,31 +0,0 @@ -/* @preserve - * The MIT License (MIT) - * - * Copyright (c) 2013-2015 Petka Antonov - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * 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. - * - */ -/** - * bluebird build version 2.10.1 - * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, cancel, using, filter, any, each, timers -*/ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,r;return function n(t,e,r){function i(s,a){if(!e[s]){if(!t[s]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,n,t,e,r)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s0},r.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(r){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},l.hasDevTools?(u.isStatic&&(u=function(t){setTimeout(t,0)}),r.prototype.invokeLater=function(t,e,r){this._trampolineEnabled?n.call(this,t,e,r):this._schedule(function(){setTimeout(function(){t.call(e,r)},100)})},r.prototype.invoke=function(t,e,r){this._trampolineEnabled?i.call(this,t,e,r):this._schedule(function(){t.call(e,r)})},r.prototype.settlePromises=function(t){this._trampolineEnabled?o.call(this,t):this._schedule(function(){t._settlePromises()})}):(r.prototype.invokeLater=n,r.prototype.invoke=i,r.prototype.settlePromises=o),r.prototype.invokeFirst=function(t,e,r){this._normalQueue.unshift(t,e,r),this._queueTick()},r.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=new r,e.exports.firstLineError=s},{"./queue.js":28,"./schedule.js":31,"./util.js":38}],3:[function(t,e){"use strict";e.exports=function(t,e,r){var n=function(t,e){this._reject(e)},i=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(n,n,null,this,t)},o=function(t,e){this._isPending()&&this._resolveCallback(e.target)},s=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(n){var a=r(n),u=new t(e);u._propagateFrom(this,1);var c=this._target();if(u._setBoundTo(a),a instanceof t){var l={promiseRejectionQueued:!1,promise:u,target:c,bindingPromise:a};c._then(e,i,u._progress,u,l),a._then(o,s,u._progress,u,l)}else u._resolveCallback(c);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=131072|this._bitField,this._boundTo=t):this._bitField=-131073&this._bitField},t.prototype._isBound=function(){return 131072===(131072&this._bitField)},t.bind=function(n,i){var o=r(n),s=new t(e);return s._setBoundTo(o),o instanceof t?o._then(function(){s._resolveCallback(i)},s._reject,s._progress,s,null):s._resolveCallback(i),s}}},{}],4:[function(t,e){"use strict";function r(){try{Promise===i&&(Promise=n)}catch(t){}return i}var n;"undefined"!=typeof Promise&&(n=Promise);var i=t("./promise.js")();i.noConflict=r,e.exports=i},{"./promise.js":23}],5:[function(t,e){"use strict";var r=Object.create;if(r){var n=r(null),i=r(null);n[" size"]=i[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+a.classString(t)+" has no method '"+a.toString(r)+"'";throw new e.TypeError(i)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}{var s,a=t("./util.js"),u=a.canEvaluate;a.isIdentifier}e.prototype.call=function(t){for(var e=arguments.length,r=new Array(e-1),i=1;e>i;++i)r[i-1]=arguments[i];return r.push(t),this._then(n,void 0,void 0,r,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=o;else if(u){var n=s(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util.js":38}],6:[function(t,e){"use strict";e.exports=function(e){var r=t("./errors.js"),n=t("./async.js"),i=r.CancellationError;e.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,r=this;void 0!==(e=r._cancellationParent)&&e.isCancellable();)r=e;this._unsetCancellable(),r._target()._rejectCallback(t,!1,!0)},e.prototype.cancel=function(t){return this.isCancellable()?(void 0===t&&(t=new i),n.invokeLater(this._cancel,this,t),this):this},e.prototype.cancellable=function(){return this._cancellable()?this:(n.enableTrampoline(),this._setCancellable(),this._cancellationParent=void 0,this)},e.prototype.uncancellable=function(){var t=this.then();return t._unsetCancellable(),t},e.prototype.fork=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);return n._setCancellable(),n._cancellationParent=void 0,n}}},{"./async.js":2,"./errors.js":13}],7:[function(t,e){"use strict";e.exports=function(){function e(t){this._parent=t;var r=this._length=1+(void 0===t?0:t._length);j(this,e),r>32&&this.uncycle()}function r(t,e){for(var r=0;r=0;--a)if(n[a]===o){s=a;break}for(var a=s;a>=0;--a){var u=n[a];if(e[i]!==u)break;e.pop(),i--}e=n}}function o(t){for(var e=[],r=0;r0&&(e=e.slice(r)),e}function a(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t.toString();var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+u(e)+">, no stack trace)"}function u(t){var e=41;return t.lengtht)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;t>n;++n){var s=e[n].stack,a=r[s];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;t-1>a?(u._parent=e[a+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var c=u._length+1,l=n-2;l>=0;--l)e[l]._length=c,c++;return}}}},e.prototype.parent=function(){return this._parent},e.prototype.hasParent=function(){return void 0!==this._parent},e.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var s=e.parseStackAndMessage(t),a=s.message,u=[s.stack],c=this;void 0!==c;)u.push(o(c.stack.split("\n"))),c=c._parent;i(u),n(u),p.notEnumerableProp(t,"stack",r(a,u)),p.notEnumerableProp(t,"__stackCleaned__",!0)}},e.parseStackAndMessage=function(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?s(t):[" (No stack trace)"],{message:r,stack:o(e)}},e.formatAndLogError=function(t,e){if("undefined"!=typeof console){var r;if("object"==typeof t||"function"==typeof t){var n=t.stack;r=e+d(n,t)}else r=e+String(t);"function"==typeof l?l(r):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}},e.unhandledRejection=function(t){e.formatAndLogError(t,"^--- With additional stack trace: ")},e.isSupported=function(){return"function"==typeof j},e.fireRejectionEvent=function(t,r,n,i){var o=!1;try{"function"==typeof r&&(o=!0,"rejectionHandled"===t?r(i):r(n,i))}catch(s){h.throwLater(s)}var a=!1;try{a=b(t,n,i)}catch(s){a=!0,h.throwLater(s)}var u=!1;if(m)try{u=m(t.toLowerCase(),{reason:n,promise:i})}catch(s){u=!0,h.throwLater(s)}a||o||u||"unhandledRejection"!==t||e.formatAndLogError(n,"Unhandled rejection ")};var y=function(){return!1},g=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;e.setBounds=function(t,r){if(e.isSupported()){for(var n,i,o=t.stack.split("\n"),s=r.stack.split("\n"),a=-1,u=-1,l=0;la||0>u||!n||!i||n!==i||a>=u||(y=function(t){if(f.test(t))return!0;var e=c(t);return e&&e.fileName===n&&a<=e.line&&e.line<=u?!0:!1})}};var m,j=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():a(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,_=t,d=e;var r=Error.captureStackTrace;return y=function(t){return f.test(t)},function(t,e){Error.stackTraceLimit=Error.stackTraceLimit+6,r(t,e),Error.stackTraceLimit=Error.stackTraceLimit-6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return _=/@/,d=e,v=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in n||!i||"number"!=typeof Error.stackTraceLimit?(d=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?a(e):e.toString()},null):(_=t,d=e,function(t){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}([]),b=function(){if(p.isNode)return function(t,e,r){return"rejectionHandled"===t?process.emit(t,r):process.emit(t,e,r)};var t=!1,e=!0;try{var r=new self.CustomEvent("test");t=r instanceof CustomEvent}catch(n){}if(!t)try{var i=document.createEvent("CustomEvent");i.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(i)}catch(n){e=!1}e&&(m=function(e,r){var n;return t?n=new self.CustomEvent(e,{detail:r,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!1,!0,r)),n?!self.dispatchEvent(n):!1});var o={};return o.unhandledRejection="onunhandledRejection".toLowerCase(),o.rejectionHandled="onrejectionHandled".toLowerCase(),function(t,e,r){var n=o[t],i=self[n];return i?("rejectionHandled"===t?i.call(self,r):i.call(self,e,r),!0):!1}}();return"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(l=function(t){console.warn(t)},p.isNode&&process.stderr.isTTY?l=function(t){process.stderr.write(""+t+"\n")}:p.isNode||"string"!=typeof(new Error).stack||(l=function(t){console.warn("%c"+t,"color: red")})),e}},{"./async.js":2,"./util.js":38}],8:[function(t,e){"use strict";e.exports=function(e){function r(t,e,r){this._instances=t,this._callback=e,this._promise=r}function n(t,e){var r={},n=s(t).call(r,e);if(n===a)return n;var i=u(r);return i.length?(a.e=new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),a):n}var i=t("./util.js"),o=t("./errors.js"),s=i.tryCatch,a=i.errorObj,u=t("./es5.js").keys,c=o.TypeError;return r.prototype.doFilter=function(t){for(var r=this._callback,i=this._promise,o=i._boundValue(),u=0,c=this._instances.length;c>u;++u){var l=this._instances[u],h=l===Error||null!=l&&l.prototype instanceof Error;if(h&&t instanceof l){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}if("function"==typeof l&&!h){var f=n(l,t);if(f===a){t=a.e;break}if(f){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}}}return e.e=t,e},r}},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(t,e){"use strict";e.exports=function(t,e,r){function n(){this._trace=new e(o())}function i(){return r()?new n:void 0}function o(){var t=s.length-1;return t>=0?s[t]:void 0}var s=[];return n.prototype._pushContext=function(){r()&&void 0!==this._trace&&s.push(this._trace)},n.prototype._popContext=function(){r()&&void 0!==this._trace&&s.pop()},t.prototype._peekContext=o,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,i}},{}],10:[function(t,e){"use strict";e.exports=function(e,r){var n,i,o=e._getDomain,s=t("./async.js"),a=t("./errors.js").Warning,u=t("./util.js"),c=u.canAttachTrace,l=!1||u.isNode&&(!!process.env.BLUEBIRD_DEBUG||"development"===process.env.NODE_ENV);return u.isNode&&0==process.env.BLUEBIRD_DEBUG&&(l=!1),l&&s.disableTrampolineIfNecessary(),e.prototype._ignoreRejections=function(){this._unsetRejectionIsUnhandled(),this._bitField=16777216|this._bitField},e.prototype._ensurePossibleRejectionHandled=function(){0===(16777216&this._bitField)&&(this._setRejectionIsUnhandled(),s.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){r.fireRejectionEvent("rejectionHandled",n,void 0,this)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),r.fireRejectionEvent("unhandledRejection",i,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},e.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},e.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},e.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},e.prototype._captureStackTrace=function(){return l&&(this._trace=new r(this._peekContext())),this},e.prototype._attachExtraTrace=function(t,e){if(l&&c(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=r.parseStackAndMessage(t);u.notEnumerableProp(t,"stack",i.message+"\n"+i.stack.join("\n")),u.notEnumerableProp(t,"__stackCleaned__",!0)}}},e.prototype._warn=function(t){var e=new a(t),n=this._peekContext();if(n)n.attachExtraTrace(e);else{var i=r.parseStackAndMessage(e);e.stack=i.message+"\n"+i.stack.join("\n")}r.formatAndLogError(e,"")},e.onPossiblyUnhandledRejection=function(t){var e=o();i="function"==typeof t?null===e?t:e.bind(t):void 0},e.onUnhandledRejectionHandled=function(t){var e=o();n="function"==typeof t?null===e?t:e.bind(t):void 0},e.longStackTraces=function(){if(s.haveItemsQueued()&&l===!1)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");l=r.isSupported(),l&&s.disableTrampolineIfNecessary()},e.hasLongStackTraces=function(){return l&&r.isSupported()},r.isSupported()||(e.longStackTraces=function(){},l=!1),function(){return l}}},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(t,e){"use strict";var r=t("./util.js"),n=r.isPrimitive;e.exports=function(t){var e=function(){return this},r=function(){throw this},i=function(){},o=function(){throw void 0},s=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype["return"]=t.prototype.thenReturn=function(r){return void 0===r?this.then(i):n(r)?this._then(s(r,2),void 0,void 0,void 0,void 0):(r instanceof t&&r._ignoreRejections(),this._then(e,void 0,void 0,r,void 0))},t.prototype["throw"]=t.prototype.thenThrow=function(t){return void 0===t?this.then(o):n(t)?this._then(s(t,1),void 0,void 0,void 0,void 0):this._then(r,void 0,void 0,t,void 0)}}},{"./util.js":38}],12:[function(t,e){"use strict";e.exports=function(t,e){var r=t.reduce;t.prototype.each=function(t){return r(this,t,null,e)},t.each=function(t,n){return r(t,n,null,e)}}},{}],13:[function(t,e){"use strict";function r(t,e){function r(n){return this instanceof r?(l(this,"message","string"==typeof n?n:e),l(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return c(r,Error),r}function n(t){return this instanceof n?(l(this,"name","OperationalError"),l(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(l(this,"message",t.message),l(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new n(t)}var i,o,s=t("./es5.js"),a=s.freeze,u=t("./util.js"),c=u.inherits,l=u.notEnumerableProp,h=r("Warning","warning"),p=r("CancellationError","cancellation error"),f=r("TimeoutError","timeout error"),_=r("AggregateError","aggregate error");try{i=TypeError,o=RangeError}catch(d){i=r("TypeError","type error"),o=r("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;y0&&"function"==typeof arguments[e]){t=arguments[e];var n}for(var i=arguments.length,o=new Array(i),s=0;i>s;++s)o[s]=arguments[s];t&&o.pop();var n=new r(o).promise();return void 0!==t?n.spread(t):n}}},{"./util.js":38}],19:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var i=c();this._callback=null===i?e:i.bind(e),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=r>=1?[]:d,l.invoke(a,this,void 0)}function a(){this._init$(void 0,-2)}function u(t,e,r,n){var i="object"==typeof r&&null!==r?r.concurrency:0;return i="number"==typeof i&&isFinite(i)&&i>=1?i:0,new s(t,e,i,n)}var c=e._getDomain,l=t("./async.js"),h=t("./util.js"),p=h.tryCatch,f=h.errorObj,_={},d=[];h.inherits(s,r),s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,a=this._limit;if(n[r]===_){if(n[r]=t,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return n[r]=t,void this._queue.push(r);null!==s&&(s[r]=t);var u=this._callback,c=this._promise._boundValue();this._promise._pushContext();var l=p(u).call(c,t,r,o);if(this._promise._popContext(),l===f)return this._reject(l.e);var h=i(l,this._promise);if(h instanceof e){if(h=h._target(),h._isPending())return a>=1&&this._inFlight++,n[r]=_,h._proxyPromiseArray(this,r);if(!h._isFulfilled())return this._reject(h._reason());l=h._value()}n[r]=l}var d=++this._totalResolved;d>=o&&(null!==s?this._filter(n,s):this._resolve(n))},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},s.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(this,t,e,null).promise()},e.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(t,e,r,i).promise()}}},{"./async.js":2,"./util.js":38}],20:[function(t,e){"use strict";e.exports=function(e,r,n,i){var o=t("./util.js"),s=o.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var n=new e(r);n._captureStackTrace(),n._pushContext();var i=s(t).apply(this,arguments);return n._popContext(),n._resolveFromSyncValue(i),n}},e.attempt=e["try"]=function(t,n,a){if("function"!=typeof t)return i("fn must be a function\n\n See http://goo.gl/916lJJ\n");var u=new e(r);u._captureStackTrace(),u._pushContext();var c=o.isArray(n)?s(t).apply(a,n):s(t).call(a,n);return u._popContext(),u._resolveFromSyncValue(c),u},e.prototype._resolveFromSyncValue=function(t){t===o.errorObj?this._rejectCallback(t.e,!1,!0):this._resolveCallback(t,!0)}}},{"./util.js":38}],21:[function(t,e){"use strict";e.exports=function(e){function r(t,e){var r=this;if(!o.isArray(t))return n.call(r,t,e);var i=a(e).apply(r._boundValue(),[null].concat(t));i===u&&s.throwLater(i.e)}function n(t,e){var r=this,n=r._boundValue(),i=void 0===t?a(e).call(n,null):a(e).call(n,null,t);i===u&&s.throwLater(i.e)}function i(t,e){var r=this;if(!t){var n=r._target(),i=n._getCarriedStackTrace();i.cause=t,t=i}var o=a(e).call(r._boundValue(),t);o===u&&s.throwLater(o.e)}var o=t("./util.js"),s=t("./async.js"),a=o.tryCatch,u=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=n;void 0!==e&&Object(e).spread&&(o=r),this._then(o,i,void 0,this,t)}return this}}},{"./async.js":2,"./util.js":38}],22:[function(t,e){"use strict";e.exports=function(e,r){var n=t("./util.js"),i=t("./async.js"),o=n.tryCatch,s=n.errorObj;e.prototype.progressed=function(t){return this._then(void 0,void 0,t,void 0,void 0)},e.prototype._progress=function(t){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(t)},e.prototype._progressHandlerAt=function(t){return 0===t?this._progressHandler0:this[(t<<2)+t-5+2]},e.prototype._doProgressWith=function(t){var r=t.value,i=t.handler,a=t.promise,u=t.receiver,c=o(i).call(u,r);if(c===s){if(null!=c.e&&"StopProgressPropagation"!==c.e.name){var l=n.canAttachTrace(c.e)?c.e:new Error(n.toString(c.e));a._attachExtraTrace(l),a._progress(c.e)}}else c instanceof e?c._then(a._progress,null,null,a,void 0):a._progress(c)},e.prototype._progressUnchecked=function(t){for(var n=this._length(),o=this._progress,s=0;n>s;s++){var a=this._progressHandlerAt(s),u=this._promiseAt(s);if(u instanceof e)"function"==typeof a?i.invoke(this._doProgressWith,this,{handler:a,promise:u,receiver:this._receiverAt(s),value:t}):i.invoke(o,u,t);else{var c=this._receiverAt(s);"function"==typeof a?a.call(c,t,u):c instanceof r&&!c._isResolved()&&c._promiseProgressed(t,u)}}}}},{"./async.js":2,"./util.js":38}],23:[function(t,e){"use strict";e.exports=function(){function e(t){if("function"!=typeof t)throw new h("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==e)throw new h("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,t!==p&&this._resolveFromResolver(t)}function r(t){var r=new e(p);r._fulfillmentHandler0=t,r._rejectionHandler0=t,r._progressHandler0=t,r._promise0=t,r._receiver0=t,r._settledValue=t}var n,i=function(){return new h("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},o=function(){return new e.PromiseInspection(this._target())},s=function(t){return e.reject(new h(t))},a=t("./util.js");n=a.isNode?function(){var t=process.domain;return void 0===t&&(t=null),t}:function(){return null},a.notEnumerableProp(e,"_getDomain",n);var u={},c=t("./async.js"),l=t("./errors.js"),h=e.TypeError=l.TypeError;e.RangeError=l.RangeError,e.CancellationError=l.CancellationError,e.TimeoutError=l.TimeoutError,e.OperationalError=l.OperationalError,e.RejectionError=l.OperationalError,e.AggregateError=l.AggregateError;var p=function(){},f={},_={e:null},d=t("./thenables.js")(e,p),v=t("./promise_array.js")(e,p,d,s),y=t("./captured_trace.js")(),g=t("./debuggability.js")(e,y),m=t("./context.js")(e,y,g),j=t("./catch_filter.js")(_),b=t("./promise_resolver.js"),w=b._nodebackForPromise,k=a.errorObj,E=a.tryCatch;return e.prototype.toString=function(){return"[object Promise]"},e.prototype.caught=e.prototype["catch"]=function(t){var r=arguments.length;if(r>1){var n,i=new Array(r-1),o=0;for(n=0;r-1>n;++n){var s=arguments[n];if("function"!=typeof s)return e.reject(new h("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));i[o++]=s}i.length=o,t=arguments[n];var a=new j(i,t,this);return this._then(void 0,a.doFilter,void 0,a,void 0)}return this._then(void 0,t,void 0,void 0,void 0)},e.prototype.reflect=function(){return this._then(o,o,void 0,this,void 0)},e.prototype.then=function(t,e,r){if(g()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+a.classString(t);arguments.length>1&&(n+=", "+a.classString(e)),this._warn(n)}return this._then(t,e,r,void 0,void 0)},e.prototype.done=function(t,e,r){var n=this._then(t,e,r,void 0,void 0); -n._setIsFinal()},e.prototype.spread=function(t,e){return this.all()._then(t,e,void 0,f,void 0)},e.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},e.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},e.prototype.all=function(){return new v(this).promise()},e.prototype.error=function(t){return this.caught(a.originatesFromRejection,t)},e.is=function(t){return t instanceof e},e.fromNode=function(t){var r=new e(p),n=E(t)(w(r));return n===k&&r._rejectCallback(n.e,!0,!0),r},e.all=function(t){return new v(t).promise()},e.defer=e.pending=function(){var t=new e(p);return new b(t)},e.cast=function(t){var r=d(t);if(!(r instanceof e)){var n=r;r=new e(p),r._fulfillUnchecked(n)}return r},e.resolve=e.fulfilled=e.cast,e.reject=e.rejected=function(t){var r=new e(p);return r._captureStackTrace(),r._rejectCallback(t,!0),r},e.setScheduler=function(t){if("function"!=typeof t)throw new h("fn must be a function\n\n See http://goo.gl/916lJJ\n");var e=c._schedule;return c._schedule=t,e},e.prototype._then=function(t,r,i,o,s){var a=void 0!==s,u=a?s:new e(p);a||(u._propagateFrom(this,5),u._captureStackTrace());var l=this._target();l!==this&&(void 0===o&&(o=this._boundTo),a||u._setIsMigrated());var h=l._addCallbacks(t,r,i,u,o,n());return l._isResolved()&&!l._isSettlePromisesQueued()&&c.invoke(l._settlePromiseAtPostResolution,l,h),u},e.prototype._settlePromiseAtPostResolution=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(t)},e.prototype._length=function(){return 131071&this._bitField},e.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},e.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},e.prototype._setLength=function(t){this._bitField=-131072&this._bitField|131071&t},e.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},e.prototype._setRejected=function(){this._bitField=134217728|this._bitField},e.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},e.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},e.prototype._isFinal=function(){return(33554432&this._bitField)>0},e.prototype._cancellable=function(){return(67108864&this._bitField)>0},e.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},e.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},e.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},e.prototype._unsetIsMigrated=function(){this._bitField=-4194305&this._bitField},e.prototype._isMigrated=function(){return(4194304&this._bitField)>0},e.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[5*t-5+4];return e===u?void 0:void 0===e&&this._isBound()?this._boundValue():e},e.prototype._promiseAt=function(t){return 0===t?this._promise0:this[5*t-5+3]},e.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[5*t-5+0]},e.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[5*t-5+1]},e.prototype._boundValue=function(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t},e.prototype._migrateCallbacks=function(t,r){var n=t._fulfillmentHandlerAt(r),i=t._rejectionHandlerAt(r),o=t._progressHandlerAt(r),s=t._promiseAt(r),a=t._receiverAt(r);s instanceof e&&s._setIsMigrated(),void 0===a&&(a=u),this._addCallbacks(n,i,o,s,a,null)},e.prototype._addCallbacks=function(t,e,r,n,i,o){var s=this._length();if(s>=131066&&(s=0,this._setLength(0)),0===s)this._promise0=n,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=null===o?t:o.bind(t)),"function"==typeof e&&(this._rejectionHandler0=null===o?e:o.bind(e)),"function"==typeof r&&(this._progressHandler0=null===o?r:o.bind(r));else{var a=5*s-5;this[a+3]=n,this[a+4]=i,"function"==typeof t&&(this[a+0]=null===o?t:o.bind(t)),"function"==typeof e&&(this[a+1]=null===o?e:o.bind(e)),"function"==typeof r&&(this[a+2]=null===o?r:o.bind(r))}return this._setLength(s+1),s},e.prototype._setProxyHandlers=function(t,e){var r=this._length();if(r>=131066&&(r=0,this._setLength(0)),0===r)this._promise0=e,this._receiver0=t;else{var n=5*r-5;this[n+3]=e,this[n+4]=t}this._setLength(r+1)},e.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},e.prototype._resolveCallback=function(t,r){if(!this._isFollowingOrFulfilledOrRejected()){if(t===this)return this._rejectCallback(i(),!1,!0);var n=d(t,this);if(!(n instanceof e))return this._fulfill(t);var o=1|(r?4:0);this._propagateFrom(n,o);var s=n._target();if(s._isPending()){for(var a=this._length(),u=0;a>u;++u)s._migrateCallbacks(this,u);this._setFollowing(),this._setLength(0),this._setFollowee(s)}else s._isFulfilled()?this._fulfillUnchecked(s._value()):this._rejectUnchecked(s._reason(),s._getCarriedStackTrace())}},e.prototype._rejectCallback=function(t,e,r){r||a.markAsOriginatingFromRejection(t);var n=a.ensureErrorObject(t),i=n===t;this._attachExtraTrace(n,e?i:!1),this._reject(t,i?void 0:n)},e.prototype._resolveFromResolver=function(t){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=E(t)(function(t){null!==e&&(e._resolveCallback(t),e=null)},function(t){null!==e&&(e._rejectCallback(t,r),e=null)});r=!1,this._popContext(),void 0!==n&&n===k&&null!==e&&(e._rejectCallback(n.e,!0,!0),e=null)},e.prototype._settlePromiseFromHandler=function(t,e,r,n){if(!n._isRejected()){n._pushContext();var o;if(o=e!==f||this._isRejected()?E(t).call(e,r):E(t).apply(this._boundValue(),r),n._popContext(),o===k||o===n||o===_){var s=o===n?i():o.e;n._rejectCallback(s,!1,!0)}else n._resolveCallback(o)}},e.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},e.prototype._followee=function(){return this._rejectionHandler0},e.prototype._setFollowee=function(t){this._rejectionHandler0=t},e.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},e.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&t._isBound()&&this._setBoundTo(t._boundTo)},e.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},e.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},e.prototype._settlePromiseAt=function(t){var r=this._promiseAt(t),n=r instanceof e;if(n&&r._isMigrated())return r._unsetIsMigrated(),c.invoke(this._settlePromiseAt,this,t);var i=this._isFulfilled()?this._fulfillmentHandlerAt(t):this._rejectionHandlerAt(t),o=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,s=this._settledValue,a=this._receiverAt(t);this._clearCallbackDataAtIndex(t),"function"==typeof i?n?this._settlePromiseFromHandler(i,a,s,r):i.call(a,s,r):a instanceof v?a._isResolved()||(this._isFulfilled()?a._promiseFulfilled(s,r):a._promiseRejected(s,r)):n&&(this._isFulfilled()?r._fulfill(s):r._reject(s,o)),t>=4&&4===(31&t)&&c.invokeLater(this._setLength,this,0)},e.prototype._clearCallbackDataAtIndex=function(t){if(0===t)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var e=5*t-5;this[e+3]=this[e+4]=this[e+0]=this[e+1]=this[e+2]=void 0}},e.prototype._isSettlePromisesQueued=function(){return-1073741824===(-1073741824&this._bitField)},e.prototype._setSettlePromisesQueued=function(){this._bitField=-1073741824|this._bitField},e.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},e.prototype._queueSettlePromises=function(){c.settlePromises(this),this._setSettlePromisesQueued()},e.prototype._fulfillUnchecked=function(t){if(t===this){var e=i();return this._attachExtraTrace(e),this._rejectUnchecked(e,void 0)}this._setFulfilled(),this._settledValue=t,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},e.prototype._rejectUncheckedCheckError=function(t){var e=a.ensureErrorObject(t);this._rejectUnchecked(t,e===t?void 0:e)},e.prototype._rejectUnchecked=function(t,e){if(t===this){var r=i();return this._attachExtraTrace(r),this._rejectUnchecked(r)}return this._setRejected(),this._settledValue=t,this._cleanValues(),this._isFinal()?void c.throwLater(function(t){throw"stack"in t&&c.invokeFirst(y.unhandledRejection,void 0,t),t},void 0===e?t:e):(void 0!==e&&e!==t&&this._setCarriedStackTrace(e),void(this._length()>0?this._queueSettlePromises():this._ensurePossibleRejectionHandled()))},e.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();for(var t=this._length(),e=0;t>e;e++)this._settlePromiseAt(e)},a.notEnumerableProp(e,"_makeSelfResolutionError",i),t("./progress.js")(e,v),t("./method.js")(e,p,d,s),t("./bind.js")(e,p,d),t("./finally.js")(e,_,d),t("./direct_resolve.js")(e),t("./synchronous_inspection.js")(e),t("./join.js")(e,v,d,p),e.Promise=e,t("./map.js")(e,v,s,d,p),t("./cancel.js")(e),t("./using.js")(e,s,d,m),t("./generators.js")(e,s,p,d),t("./nodeify.js")(e),t("./call_get.js")(e),t("./props.js")(e,v,d,s),t("./race.js")(e,p,d,s),t("./reduce.js")(e,v,s,d,p),t("./settle.js")(e,v),t("./some.js")(e,v,s),t("./promisify.js")(e,p),t("./any.js")(e),t("./each.js")(e,p),t("./timers.js")(e,p),t("./filter.js")(e,p),a.toFastProperties(e),a.toFastProperties(e.prototype),r({a:1}),r({b:2}),r({c:3}),r(1),r(function(){}),r(void 0),r(!1),r(new e(p)),y.setBounds(c.firstLineError,a.lastLineError),e}},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n,i=this._promise=new e(r);t instanceof e&&(n=t,i._propagateFrom(n,5)),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var a=t("./util.js"),u=a.isArray;return s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function c(t,r){var s=n(this._values,this._promise);if(s instanceof e){if(s=s._target(),this._values=s,!s._isFulfilled())return s._isPending()?void s._then(c,this._reject,void 0,this,r):void this._reject(s._reason());if(s=s._value(),!u(s)){var a=new e.TypeError("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");return void this.__hardReject__(a)}}else if(!u(s))return void this._promise._reject(i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n")._reason());if(0===s.length)return void(-5===r?this._resolveEmptyArray():this._resolve(o(r)));var l=this.getActualLength(s.length);this._length=l,this._values=this.shouldCopyValues()?new Array(l):this._values;for(var h=this._promise,p=0;l>p;++p){var f=this._isResolved(),_=n(s[p],h);_ instanceof e?(_=_._target(),f?_._ignoreRejections():_._isPending()?_._proxyPromiseArray(this,p):_._isFulfilled()?this._promiseFulfilled(_._value(),p):this._promiseRejected(_._reason(),p)):f||this._promiseFulfilled(_,p)}},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype.__hardReject__=s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1,!0)},s.prototype._promiseProgressed=function(t,e){this._promise._progress({index:e,value:t})},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},s.prototype._promiseRejected=function(t){this._totalResolved++,this._reject(t)},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){return t},s}},{"./util.js":38}],25:[function(t,e){"use strict";function r(t){return t instanceof Error&&p.getPrototypeOf(t)===Error.prototype}function n(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=p.keys(t),i=0;i2){for(var o=arguments.length,s=new Array(o-1),u=1;o>u;++u)s[u-1]=arguments[u];t._fulfill(s)}else t._fulfill(r);t=null}}}var o,s=t("./util.js"),a=s.maybeWrapAsError,u=t("./errors.js"),c=u.TimeoutError,l=u.OperationalError,h=s.haveGetters,p=t("./es5.js"),f=/^(?:name|message|stack|cause)$/;if(o=h?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=i(t),this.callback=this.asCallback},h){var _={get:function(){return i(this.promise)}};p.defineProperty(o.prototype,"asCallback",_),p.defineProperty(o.prototype,"callback",_)}o._nodebackForPromise=i,o.prototype.toString=function(){return"[object PromiseResolver]"},o.prototype.resolve=o.prototype.fulfill=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(t)},o.prototype.reject=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(t)},o.prototype.progress=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(t)},o.prototype.cancel=function(t){this.promise.cancel(t)},o.prototype.timeout=function(){this.reject(new c("timeout"))},o.prototype.isResolved=function(){return this.promise.isResolved()},o.prototype.toJSON=function(){return this.promise.toJSON()},e.exports=o},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(t,e){"use strict";e.exports=function(e,r){function n(t){return!w.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,r){var n=f.getDataPropertyOrDefault(t,e+r,j);return n?i(n):!1}function s(t,e,r){for(var n=0;ns;s+=2){var c=o[s],l=o[s+1],h=c+e;if(n===F)t[h]=F(c,p,c,l,e);else{var _=n(l,function(){return F(c,p,c,l,e)});f.notEnumerableProp(_,"__isPromisified__",!0),t[h]=_}}return f.toFastProperties(t),t}function l(t,e){return F(t,e,void 0,t)}var h,p={},f=t("./util.js"),_=t("./promise_resolver.js")._nodebackForPromise,d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,g=t("./errors").TypeError,m="Async",j={__isPromisified__:!0},b=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],w=new RegExp("^(?:"+b.join("|")+")$"),k=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},E=function(t){return t.replace(/([$])/,"\\$")},F=y?h:u;e.promisify=function(t,e){if("function"!=typeof t)throw new g("fn must be a function\n\n See http://goo.gl/916lJJ\n");if(i(t))return t;var r=l(t,arguments.length<2?p:e);return f.copyDescriptors(t,r,n),r},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");e=Object(e);var r=e.suffix;"string"!=typeof r&&(r=m);var n=e.filter;"function"!=typeof n&&(n=k);var i=e.promisifier;if("function"!=typeof i&&(i=F),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n");for(var o=f.inheritedDataKeys(t),s=0;si;++i){var o=e[i];n[i]=t[o],n[i+r]=o}this.constructor$(n)}function s(t){var r,s=n(t);return u(s)?(r=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&r._propagateFrom(s,4),r):i("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}var a=t("./util.js"),u=a.isObject,c=t("./es5.js");a.inherits(o,r),o.prototype._init=function(){this._init$(void 0,-3)},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;if(r>=this._length){for(var n={},i=this.length(),o=0,s=this.length();s>o;++o)n[this._values[o+i]]=this._values[o];this._resolve(n)}},o.prototype._promiseProgressed=function(t,e){this._promise._progress({key:this._values[e+this.length()],value:t})},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5.js":14,"./util.js":38}],28:[function(t,e){"use strict";function r(t,e,r,n,i){for(var o=0;i>o;++o)r[o+n]=t[o+e],t[o+e]=void 0}function n(t){this._capacity=t,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(t){return this._capacityp;++p){var _=t[p];(void 0!==_||p in t)&&e.cast(_)._then(l,h,void 0,c,null)}return c}var s=t("./util.js").isArray,a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util.js":38}],30:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,r,n,s){this.constructor$(t),this._promise._captureStackTrace(),this._preservedValues=s===o?[]:null,this._zerothIsAccum=void 0===n,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var u=i(n,this._promise),h=!1,p=u instanceof e;p&&(u=u._target(),u._isPending()?u._proxyPromiseArray(this,-1):u._isFulfilled()?(n=u._value(),this._gotAccum=!0):(this._reject(u._reason()),h=!0)),p||this._zerothIsAccum||(this._gotAccum=!0);var f=c();this._callback=null===f?r:f.bind(r),this._accum=n,h||l.invoke(a,this,void 0)}function a(){this._init$(void 0,-5)}function u(t,e,r,i){if("function"!=typeof e)return n("fn must be a function\n\n See http://goo.gl/916lJJ\n");var o=new s(t,e,r,i);return o.promise()}var c=e._getDomain,l=t("./async.js"),h=t("./util.js"),p=h.tryCatch,f=h.errorObj;h.inherits(s,r),s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},s.prototype._promiseFulfilled=function(t,r){var n=this._values;n[r]=t;var o,s=this.length(),a=this._preservedValues,u=null!==a,c=this._gotAccum,l=this._valuesPhase;if(!l)for(l=this._valuesPhase=new Array(s),o=0;s>o;++o)l[o]=0;if(o=l[r],0===r&&this._zerothIsAccum?(this._accum=t,this._gotAccum=c=!0,l[r]=0===o?1:2):-1===r?(this._accum=t,this._gotAccum=c=!0):0===o?l[r]=1:(l[r]=2,this._accum=t),c){for(var h,_=this._callback,d=this._promise._boundValue(),v=this._reducingIndex;s>v;++v)if(o=l[v],2!==o){if(1!==o)return;if(t=n[v],this._promise._pushContext(),u?(a.push(t),h=p(_).call(d,t,v,s)):h=p(_).call(d,this._accum,t,v,s),this._promise._popContext(),h===f)return this._reject(h.e);var y=i(h,this._promise);if(y instanceof e){if(y=y._target(),y._isPending())return l[v]=4,y._proxyPromiseArray(this,v);if(!y._isFulfilled())return this._reject(y._reason());h=y._value()}this._reducingIndex=v+1,this._accum=h}else this._reducingIndex=v+1;this._resolve(u?a:this._accum)}},e.prototype.reduce=function(t,e){return u(this,t,e,null)},e.reduce=function(t,e,r,n){return u(t,e,r,n)}}},{"./async.js":2,"./util.js":38}],31:[function(t,e){"use strict";var r,n=t("./util"),i=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")};if(n.isNode&&"undefined"==typeof MutationObserver){var o=global.setImmediate,s=process.nextTick;r=n.isRecentNode?function(t){o.call(global,t)}:function(t){s.call(process,t)}}else"undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&window.navigator.standalone?r="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:i:(r=function(t){var e=document.createElement("div"),r=new MutationObserver(t);return r.observe(e,{attributes:!0}),function(){e.classList.toggle("foo")}},r.isStatic=!0);e.exports=r},{"./util":38}],32:[function(t,e){"use strict";e.exports=function(e,r){function n(t){this.constructor$(t)}var i=e.PromiseInspection,o=t("./util.js");o.inherits(n,r),n.prototype._promiseResolved=function(t,e){this._values[t]=e;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},n.prototype._promiseFulfilled=function(t,e){var r=new i;r._bitField=268435456,r._settledValue=t,this._promiseResolved(e,r)},n.prototype._promiseRejected=function(t,e){var r=new i;r._bitField=134217728,r._settledValue=t,this._promiseResolved(e,r)},e.settle=function(t){return new n(t).promise()},e.prototype.settle=function(){return new n(this).promise()}}},{"./util.js":38}],33:[function(t,e){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return n("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var r=new i(t),o=r.promise();return r.setHowMany(e),r.init(),o}var s=t("./util.js"),a=t("./errors.js").RangeError,u=t("./errors.js").AggregateError,c=s.isArray;s.inherits(i,r),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),this._resolve(1===this.howMany()&&this._unwrap?this._values[0]:this._values))},i.prototype._promiseRejected=function(t){if(this._addRejected(t),this.howMany()>this._canPossiblyFulfill()){for(var e=new u,r=this.length();r0},e.prototype.isRejected=t.prototype._isRejected=function(){return(134217728&this._bitField)>0},e.prototype.isPending=t.prototype._isPending=function(){return 0===(402653184&this._bitField)},e.prototype.isResolved=t.prototype._isResolved=function(){return(402653184&this._bitField)>0},t.prototype.isPending=function(){return this._target()._isPending()},t.prototype.isRejected=function(){return this._target()._isRejected()},t.prototype.isFulfilled=function(){return this._target()._isFulfilled()},t.prototype.isResolved=function(){return this._target()._isResolved()},t.prototype._value=function(){return this._settledValue},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue},t.prototype.value=function(){var t=this._target();if(!t.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return t._settledValue},t.prototype.reason=function(){var t=this._target();if(!t.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return t._unsetRejectionIsUnhandled(),t._settledValue},t.PromiseInspection=e}},{}],35:[function(t,e){"use strict";e.exports=function(e,r){function n(t,n){if(c(t)){if(t instanceof e)return t;if(o(t)){var l=new e(r);return t._then(l._fulfillUnchecked,l._rejectUncheckedCheckError,l._progressUnchecked,l,null),l}var h=a.tryCatch(i)(t);if(h===u){n&&n._pushContext();var l=e.reject(h.e);return n&&n._popContext(),l}if("function"==typeof h)return s(t,h,n)}return t}function i(t){return t.then}function o(t){return l.call(t,"_promise0")}function s(t,n,i){function o(t){l&&(l._resolveCallback(t),l=null)}function s(t){l&&(l._rejectCallback(t,p,!0),l=null)}function c(t){l&&"function"==typeof l._progress&&l._progress(t)}var l=new e(r),h=l;i&&i._pushContext(),l._captureStackTrace(),i&&i._popContext();var p=!0,f=a.tryCatch(n).call(t,o,s,c);return p=!1,l&&f===u&&(l._rejectCallback(f.e,!0,!0),l=null),h}var a=t("./util.js"),u=a.errorObj,c=a.isObject,l={}.hasOwnProperty;return n}},{"./util.js":38}],36:[function(t,e){"use strict";e.exports=function(e,r){function n(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function i(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}var o=t("./util.js"),s=e.TimeoutError,a=function(t,e){if(t.isPending()){"string"!=typeof e&&(e="operation timed out");var r=new s(e);o.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._cancel(r)}},u=function(t){return c(+this).thenReturn(t)},c=e.delay=function(t,n){if(void 0===n){n=t,t=void 0;var i=new e(r);return setTimeout(function(){i._fulfill()},n),i}return n=+n,e.resolve(t)._then(u,null,null,n,void 0)};e.prototype.delay=function(t){return c(this,t)},e.prototype.timeout=function(t,e){t=+t;var r=this.then().cancellable();r._cancellationParent=this;var o=setTimeout(function(){a(r,e)},t);return r._then(n,i,void 0,o,void 0)}}},{"./util.js":38}],37:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){for(var r=t.length,n=0;r>n;++n){var i=t[n];if(i.isRejected())return e.reject(i.error());t[n]=i._settledValue}return t}function s(t){setTimeout(function(){throw t},0)}function a(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function u(t,r){function i(){if(o>=u)return c.resolve();var l=a(t[o++]);if(l instanceof e&&l._isDisposable()){try{l=n(l._getDisposer().tryDispose(r),t.promise)}catch(h){return s(h)}if(l instanceof e)return l._then(i,s,null,null,null)}i()}var o=0,u=t.length,c=e.defer();return i(),c.promise}function c(t){var e=new v;return e._settledValue=t,e._bitField=268435456,u(this,e).thenReturn(t)}function l(t){var e=new v;return e._settledValue=t,e._bitField=134217728,u(this,e).thenThrow(t)}function h(t,e,r){this._data=t,this._promise=e,this._context=r}function p(t,e,r){this.constructor$(t,e,r)}function f(t){return h.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}var _=t("./errors.js").TypeError,d=t("./util.js").inherits,v=e.PromiseInspection;h.prototype.data=function(){return this._data},h.prototype.promise=function(){return this._promise},h.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},h.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=null!==e?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},h.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},d(p,h),p.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},e.using=function(){var t=arguments.length;if(2>t)return r("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return r("fn must be a function\n\n See http://goo.gl/916lJJ\n");var s,a=!0;2===t&&Array.isArray(arguments[0])?(s=arguments[0],t=s.length,a=!1):(s=arguments,t--);for(var u=new Array(t),p=0;t>p;++p){var _=s[p];if(h.isDisposer(_)){var d=_;_=_.promise(),_._setDisposable(d)}else{var v=n(_);v instanceof e&&(_=v._then(f,null,null,{resources:u,index:p},void 0)) -}u[p]=_}var y=e.settle(u).then(o).then(function(t){y._pushContext();var e;try{e=a?i.apply(void 0,t):i.call(void 0,t)}finally{y._popContext()}return e})._then(c,l,void 0,u,void 0);return u.promise=y,y},e.prototype._setDisposable=function(t){this._bitField=262144|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(262144&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new _}}},{"./errors.js":13,"./util.js":38}],38:[function(t,e,r){"use strict";function n(){try{var t=C;return C=null,t.apply(this,arguments)}catch(e){return F.e=e,F}}function i(t){return C=t,n}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return!o(t)}function a(t){return o(t)?new Error(v(t)):t}function u(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;n>r;++r)i[r]=t[r];return i[r]=e,i}function c(t,e,r){if(!w.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function l(t,e,r){if(o(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return w.defineProperty(t,e,n),t}function h(t){throw t}function p(t){try{if("function"==typeof t){var e=w.names(t.prototype),r=w.isES5&&e.length>1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=x.test(t+"")&&w.names(t).length>0;if(r||n||i)return!0}return!1}catch(o){return!1}}function f(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}function _(t){return R.test(t)}function d(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=e+i+r;return n}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){try{l(t,"isOperational",!0)}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function m(t){return t instanceof Error&&w.propertyIsWritable(t,"stack")}function j(t){return{}.toString.call(t)}function b(t,e,r){for(var n=w.names(t),i=0;i10||t[0]>0}(),A.isNode&&A.toFastProperties(process);try{throw new Error}catch(O){A.lastLineError=O}e.exports=A},{"./es5.js":14}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/any.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/any.js deleted file mode 100644 index 05a6228ef9c901..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/any.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -module.exports = function(Promise) { -var SomePromiseArray = Promise._SomePromiseArray; -function any(promises) { - var ret = new SomePromiseArray(promises); - var promise = ret.promise(); - ret.setHowMany(1); - ret.setUnwrap(); - ret.init(); - return promise; -} - -Promise.any = function (promises) { - return any(promises); -}; - -Promise.prototype.any = function () { - return any(this); -}; - -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/assert.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/assert.js deleted file mode 100644 index a98955c475ecbd..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/assert.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; -module.exports = (function(){ -var AssertionError = (function() { - function AssertionError(a) { - this.constructor$(a); - this.message = a; - this.name = "AssertionError"; - } - AssertionError.prototype = new Error(); - AssertionError.prototype.constructor = AssertionError; - AssertionError.prototype.constructor$ = Error; - return AssertionError; -})(); - -function getParams(args) { - var params = []; - for (var i = 0; i < args.length; ++i) params.push("arg" + i); - return params; -} - -function nativeAssert(callName, args, expect) { - try { - var params = getParams(args); - var constructorArgs = params; - constructorArgs.push("return " + - callName + "("+ params.join(",") + ");"); - var fn = Function.apply(null, constructorArgs); - return fn.apply(null, args); - } catch (e) { - if (!(e instanceof SyntaxError)) { - throw e; - } else { - return expect; - } - } -} - -return function assert(boolExpr, message) { - if (boolExpr === true) return; - - if (typeof boolExpr === "string" && - boolExpr.charAt(0) === "%") { - var nativeCallName = boolExpr; - var $_len = arguments.length;var args = new Array($_len - 2); for(var $_i = 2; $_i < $_len; ++$_i) {args[$_i - 2] = arguments[$_i];} - if (nativeAssert(nativeCallName, args, message) === message) return; - message = (nativeCallName + " !== " + message); - } - - var ret = new AssertionError(message); - if (Error.captureStackTrace) { - Error.captureStackTrace(ret, assert); - } - throw ret; -}; -})(); diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/async.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/async.js deleted file mode 100644 index 01044596119410..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/async.js +++ /dev/null @@ -1,150 +0,0 @@ -"use strict"; -var firstLineError; -try {throw new Error(); } catch (e) {firstLineError = e;} -var schedule = require("./schedule.js"); -var Queue = require("./queue.js"); -var util = require("./util.js"); - -function Async() { - this._isTickUsed = false; - this._lateQueue = new Queue(16); - this._normalQueue = new Queue(16); - this._trampolineEnabled = true; - var self = this; - this.drainQueues = function () { - self._drainQueues(); - }; - this._schedule = - schedule.isStatic ? schedule(this.drainQueues) : schedule; -} - -Async.prototype.disableTrampolineIfNecessary = function() { - if (util.hasDevTools) { - this._trampolineEnabled = false; - } -}; - -Async.prototype.enableTrampoline = function() { - if (!this._trampolineEnabled) { - this._trampolineEnabled = true; - this._schedule = function(fn) { - setTimeout(fn, 0); - }; - } -}; - -Async.prototype.haveItemsQueued = function () { - return this._normalQueue.length() > 0; -}; - -Async.prototype.throwLater = function(fn, arg) { - if (arguments.length === 1) { - arg = fn; - fn = function () { throw arg; }; - } - if (typeof setTimeout !== "undefined") { - setTimeout(function() { - fn(arg); - }, 0); - } else try { - this._schedule(function() { - fn(arg); - }); - } catch (e) { - throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/m3OTXk\u000a"); - } -}; - -function AsyncInvokeLater(fn, receiver, arg) { - this._lateQueue.push(fn, receiver, arg); - this._queueTick(); -} - -function AsyncInvoke(fn, receiver, arg) { - this._normalQueue.push(fn, receiver, arg); - this._queueTick(); -} - -function AsyncSettlePromises(promise) { - this._normalQueue._pushOne(promise); - this._queueTick(); -} - -if (!util.hasDevTools) { - Async.prototype.invokeLater = AsyncInvokeLater; - Async.prototype.invoke = AsyncInvoke; - Async.prototype.settlePromises = AsyncSettlePromises; -} else { - if (schedule.isStatic) { - schedule = function(fn) { setTimeout(fn, 0); }; - } - Async.prototype.invokeLater = function (fn, receiver, arg) { - if (this._trampolineEnabled) { - AsyncInvokeLater.call(this, fn, receiver, arg); - } else { - this._schedule(function() { - setTimeout(function() { - fn.call(receiver, arg); - }, 100); - }); - } - }; - - Async.prototype.invoke = function (fn, receiver, arg) { - if (this._trampolineEnabled) { - AsyncInvoke.call(this, fn, receiver, arg); - } else { - this._schedule(function() { - fn.call(receiver, arg); - }); - } - }; - - Async.prototype.settlePromises = function(promise) { - if (this._trampolineEnabled) { - AsyncSettlePromises.call(this, promise); - } else { - this._schedule(function() { - promise._settlePromises(); - }); - } - }; -} - -Async.prototype.invokeFirst = function (fn, receiver, arg) { - this._normalQueue.unshift(fn, receiver, arg); - this._queueTick(); -}; - -Async.prototype._drainQueue = function(queue) { - while (queue.length() > 0) { - var fn = queue.shift(); - if (typeof fn !== "function") { - fn._settlePromises(); - continue; - } - var receiver = queue.shift(); - var arg = queue.shift(); - fn.call(receiver, arg); - } -}; - -Async.prototype._drainQueues = function () { - this._drainQueue(this._normalQueue); - this._reset(); - this._drainQueue(this._lateQueue); -}; - -Async.prototype._queueTick = function () { - if (!this._isTickUsed) { - this._isTickUsed = true; - this._schedule(this.drainQueues); - } -}; - -Async.prototype._reset = function () { - this._isTickUsed = false; -}; - -module.exports = new Async(); -module.exports.firstLineError = firstLineError; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/bind.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/bind.js deleted file mode 100644 index 9d8257ae5cfd04..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/bind.js +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL, tryConvertToPromise) { -var rejectThis = function(_, e) { - this._reject(e); -}; - -var targetRejected = function(e, context) { - context.promiseRejectionQueued = true; - context.bindingPromise._then(rejectThis, rejectThis, null, this, e); -}; - -var bindingResolved = function(thisArg, context) { - if (this._isPending()) { - this._resolveCallback(context.target); - } -}; - -var bindingRejected = function(e, context) { - if (!context.promiseRejectionQueued) this._reject(e); -}; - -Promise.prototype.bind = function (thisArg) { - var maybePromise = tryConvertToPromise(thisArg); - var ret = new Promise(INTERNAL); - ret._propagateFrom(this, 1); - var target = this._target(); - - ret._setBoundTo(maybePromise); - if (maybePromise instanceof Promise) { - var context = { - promiseRejectionQueued: false, - promise: ret, - target: target, - bindingPromise: maybePromise - }; - target._then(INTERNAL, targetRejected, ret._progress, ret, context); - maybePromise._then( - bindingResolved, bindingRejected, ret._progress, ret, context); - } else { - ret._resolveCallback(target); - } - return ret; -}; - -Promise.prototype._setBoundTo = function (obj) { - if (obj !== undefined) { - this._bitField = this._bitField | 131072; - this._boundTo = obj; - } else { - this._bitField = this._bitField & (~131072); - } -}; - -Promise.prototype._isBound = function () { - return (this._bitField & 131072) === 131072; -}; - -Promise.bind = function (thisArg, value) { - var maybePromise = tryConvertToPromise(thisArg); - var ret = new Promise(INTERNAL); - - ret._setBoundTo(maybePromise); - if (maybePromise instanceof Promise) { - maybePromise._then(function() { - ret._resolveCallback(value); - }, ret._reject, ret._progress, ret, null); - } else { - ret._resolveCallback(value); - } - return ret; -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/bluebird.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/bluebird.js deleted file mode 100644 index ed6226e7ea397c..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/bluebird.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -var old; -if (typeof Promise !== "undefined") old = Promise; -function noConflict() { - try { if (Promise === bluebird) Promise = old; } - catch (e) {} - return bluebird; -} -var bluebird = require("./promise.js")(); -bluebird.noConflict = noConflict; -module.exports = bluebird; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/call_get.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/call_get.js deleted file mode 100644 index 62c166d5c083bf..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/call_get.js +++ /dev/null @@ -1,123 +0,0 @@ -"use strict"; -var cr = Object.create; -if (cr) { - var callerCache = cr(null); - var getterCache = cr(null); - callerCache[" size"] = getterCache[" size"] = 0; -} - -module.exports = function(Promise) { -var util = require("./util.js"); -var canEvaluate = util.canEvaluate; -var isIdentifier = util.isIdentifier; - -var getMethodCaller; -var getGetter; -if (!false) { -var makeMethodCaller = function (methodName) { - return new Function("ensureMethod", " \n\ - return function(obj) { \n\ - 'use strict' \n\ - var len = this.length; \n\ - ensureMethod(obj, 'methodName'); \n\ - switch(len) { \n\ - case 1: return obj.methodName(this[0]); \n\ - case 2: return obj.methodName(this[0], this[1]); \n\ - case 3: return obj.methodName(this[0], this[1], this[2]); \n\ - case 0: return obj.methodName(); \n\ - default: \n\ - return obj.methodName.apply(obj, this); \n\ - } \n\ - }; \n\ - ".replace(/methodName/g, methodName))(ensureMethod); -}; - -var makeGetter = function (propertyName) { - return new Function("obj", " \n\ - 'use strict'; \n\ - return obj.propertyName; \n\ - ".replace("propertyName", propertyName)); -}; - -var getCompiled = function(name, compiler, cache) { - var ret = cache[name]; - if (typeof ret !== "function") { - if (!isIdentifier(name)) { - return null; - } - ret = compiler(name); - cache[name] = ret; - cache[" size"]++; - if (cache[" size"] > 512) { - var keys = Object.keys(cache); - for (var i = 0; i < 256; ++i) delete cache[keys[i]]; - cache[" size"] = keys.length - 256; - } - } - return ret; -}; - -getMethodCaller = function(name) { - return getCompiled(name, makeMethodCaller, callerCache); -}; - -getGetter = function(name) { - return getCompiled(name, makeGetter, getterCache); -}; -} - -function ensureMethod(obj, methodName) { - var fn; - if (obj != null) fn = obj[methodName]; - if (typeof fn !== "function") { - var message = "Object " + util.classString(obj) + " has no method '" + - util.toString(methodName) + "'"; - throw new Promise.TypeError(message); - } - return fn; -} - -function caller(obj) { - var methodName = this.pop(); - var fn = ensureMethod(obj, methodName); - return fn.apply(obj, this); -} -Promise.prototype.call = function (methodName) { - var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];} - if (!false) { - if (canEvaluate) { - var maybeCaller = getMethodCaller(methodName); - if (maybeCaller !== null) { - return this._then( - maybeCaller, undefined, undefined, args, undefined); - } - } - } - args.push(methodName); - return this._then(caller, undefined, undefined, args, undefined); -}; - -function namedGetter(obj) { - return obj[this]; -} -function indexedGetter(obj) { - var index = +this; - if (index < 0) index = Math.max(0, index + obj.length); - return obj[index]; -} -Promise.prototype.get = function (propertyName) { - var isIndex = (typeof propertyName === "number"); - var getter; - if (!isIndex) { - if (canEvaluate) { - var maybeGetter = getGetter(propertyName); - getter = maybeGetter !== null ? maybeGetter : namedGetter; - } else { - getter = namedGetter; - } - } else { - getter = indexedGetter; - } - return this._then(getter, undefined, undefined, propertyName, undefined); -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/cancel.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/cancel.js deleted file mode 100644 index 9eb40b6fb14f33..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/cancel.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -module.exports = function(Promise) { -var errors = require("./errors.js"); -var async = require("./async.js"); -var CancellationError = errors.CancellationError; - -Promise.prototype._cancel = function (reason) { - if (!this.isCancellable()) return this; - var parent; - var promiseToReject = this; - while ((parent = promiseToReject._cancellationParent) !== undefined && - parent.isCancellable()) { - promiseToReject = parent; - } - this._unsetCancellable(); - promiseToReject._target()._rejectCallback(reason, false, true); -}; - -Promise.prototype.cancel = function (reason) { - if (!this.isCancellable()) return this; - if (reason === undefined) reason = new CancellationError(); - async.invokeLater(this._cancel, this, reason); - return this; -}; - -Promise.prototype.cancellable = function () { - if (this._cancellable()) return this; - async.enableTrampoline(); - this._setCancellable(); - this._cancellationParent = undefined; - return this; -}; - -Promise.prototype.uncancellable = function () { - var ret = this.then(); - ret._unsetCancellable(); - return ret; -}; - -Promise.prototype.fork = function (didFulfill, didReject, didProgress) { - var ret = this._then(didFulfill, didReject, didProgress, - undefined, undefined); - - ret._setCancellable(); - ret._cancellationParent = undefined; - return ret; -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/captured_trace.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/captured_trace.js deleted file mode 100644 index 802acd35b0c8bf..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/captured_trace.js +++ /dev/null @@ -1,493 +0,0 @@ -"use strict"; -module.exports = function() { -var async = require("./async.js"); -var util = require("./util.js"); -var bluebirdFramePattern = - /[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/; -var stackFramePattern = null; -var formatStack = null; -var indentStackFrames = false; -var warn; - -function CapturedTrace(parent) { - this._parent = parent; - var length = this._length = 1 + (parent === undefined ? 0 : parent._length); - captureStackTrace(this, CapturedTrace); - if (length > 32) this.uncycle(); -} -util.inherits(CapturedTrace, Error); - -CapturedTrace.prototype.uncycle = function() { - var length = this._length; - if (length < 2) return; - var nodes = []; - var stackToIndex = {}; - - for (var i = 0, node = this; node !== undefined; ++i) { - nodes.push(node); - node = node._parent; - } - length = this._length = i; - for (var i = length - 1; i >= 0; --i) { - var stack = nodes[i].stack; - if (stackToIndex[stack] === undefined) { - stackToIndex[stack] = i; - } - } - for (var i = 0; i < length; ++i) { - var currentStack = nodes[i].stack; - var index = stackToIndex[currentStack]; - if (index !== undefined && index !== i) { - if (index > 0) { - nodes[index - 1]._parent = undefined; - nodes[index - 1]._length = 1; - } - nodes[i]._parent = undefined; - nodes[i]._length = 1; - var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; - - if (index < length - 1) { - cycleEdgeNode._parent = nodes[index + 1]; - cycleEdgeNode._parent.uncycle(); - cycleEdgeNode._length = - cycleEdgeNode._parent._length + 1; - } else { - cycleEdgeNode._parent = undefined; - cycleEdgeNode._length = 1; - } - var currentChildLength = cycleEdgeNode._length + 1; - for (var j = i - 2; j >= 0; --j) { - nodes[j]._length = currentChildLength; - currentChildLength++; - } - return; - } - } -}; - -CapturedTrace.prototype.parent = function() { - return this._parent; -}; - -CapturedTrace.prototype.hasParent = function() { - return this._parent !== undefined; -}; - -CapturedTrace.prototype.attachExtraTrace = function(error) { - if (error.__stackCleaned__) return; - this.uncycle(); - var parsed = CapturedTrace.parseStackAndMessage(error); - var message = parsed.message; - var stacks = [parsed.stack]; - - var trace = this; - while (trace !== undefined) { - stacks.push(cleanStack(trace.stack.split("\n"))); - trace = trace._parent; - } - removeCommonRoots(stacks); - removeDuplicateOrEmptyJumps(stacks); - util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); - util.notEnumerableProp(error, "__stackCleaned__", true); -}; - -function reconstructStack(message, stacks) { - for (var i = 0; i < stacks.length - 1; ++i) { - stacks[i].push("From previous event:"); - stacks[i] = stacks[i].join("\n"); - } - if (i < stacks.length) { - stacks[i] = stacks[i].join("\n"); - } - return message + "\n" + stacks.join("\n"); -} - -function removeDuplicateOrEmptyJumps(stacks) { - for (var i = 0; i < stacks.length; ++i) { - if (stacks[i].length === 0 || - ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { - stacks.splice(i, 1); - i--; - } - } -} - -function removeCommonRoots(stacks) { - var current = stacks[0]; - for (var i = 1; i < stacks.length; ++i) { - var prev = stacks[i]; - var currentLastIndex = current.length - 1; - var currentLastLine = current[currentLastIndex]; - var commonRootMeetPoint = -1; - - for (var j = prev.length - 1; j >= 0; --j) { - if (prev[j] === currentLastLine) { - commonRootMeetPoint = j; - break; - } - } - - for (var j = commonRootMeetPoint; j >= 0; --j) { - var line = prev[j]; - if (current[currentLastIndex] === line) { - current.pop(); - currentLastIndex--; - } else { - break; - } - } - current = prev; - } -} - -function cleanStack(stack) { - var ret = []; - for (var i = 0; i < stack.length; ++i) { - var line = stack[i]; - var isTraceLine = stackFramePattern.test(line) || - " (No stack trace)" === line; - var isInternalFrame = isTraceLine && shouldIgnore(line); - if (isTraceLine && !isInternalFrame) { - if (indentStackFrames && line.charAt(0) !== " ") { - line = " " + line; - } - ret.push(line); - } - } - return ret; -} - -function stackFramesAsArray(error) { - var stack = error.stack.replace(/\s+$/g, "").split("\n"); - for (var i = 0; i < stack.length; ++i) { - var line = stack[i]; - if (" (No stack trace)" === line || stackFramePattern.test(line)) { - break; - } - } - if (i > 0) { - stack = stack.slice(i); - } - return stack; -} - -CapturedTrace.parseStackAndMessage = function(error) { - var stack = error.stack; - var message = error.toString(); - stack = typeof stack === "string" && stack.length > 0 - ? stackFramesAsArray(error) : [" (No stack trace)"]; - return { - message: message, - stack: cleanStack(stack) - }; -}; - -CapturedTrace.formatAndLogError = function(error, title) { - if (typeof console !== "undefined") { - var message; - if (typeof error === "object" || typeof error === "function") { - var stack = error.stack; - message = title + formatStack(stack, error); - } else { - message = title + String(error); - } - if (typeof warn === "function") { - warn(message); - } else if (typeof console.log === "function" || - typeof console.log === "object") { - console.log(message); - } - } -}; - -CapturedTrace.unhandledRejection = function (reason) { - CapturedTrace.formatAndLogError(reason, "^--- With additional stack trace: "); -}; - -CapturedTrace.isSupported = function () { - return typeof captureStackTrace === "function"; -}; - -CapturedTrace.fireRejectionEvent = -function(name, localHandler, reason, promise) { - var localEventFired = false; - try { - if (typeof localHandler === "function") { - localEventFired = true; - if (name === "rejectionHandled") { - localHandler(promise); - } else { - localHandler(reason, promise); - } - } - } catch (e) { - async.throwLater(e); - } - - var globalEventFired = false; - try { - globalEventFired = fireGlobalEvent(name, reason, promise); - } catch (e) { - globalEventFired = true; - async.throwLater(e); - } - - var domEventFired = false; - if (fireDomEvent) { - try { - domEventFired = fireDomEvent(name.toLowerCase(), { - reason: reason, - promise: promise - }); - } catch (e) { - domEventFired = true; - async.throwLater(e); - } - } - - if (!globalEventFired && !localEventFired && !domEventFired && - name === "unhandledRejection") { - CapturedTrace.formatAndLogError(reason, "Unhandled rejection "); - } -}; - -function formatNonError(obj) { - var str; - if (typeof obj === "function") { - str = "[function " + - (obj.name || "anonymous") + - "]"; - } else { - str = obj.toString(); - var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; - if (ruselessToString.test(str)) { - try { - var newStr = JSON.stringify(obj); - str = newStr; - } - catch(e) { - - } - } - if (str.length === 0) { - str = "(empty array)"; - } - } - return ("(<" + snip(str) + ">, no stack trace)"); -} - -function snip(str) { - var maxChars = 41; - if (str.length < maxChars) { - return str; - } - return str.substr(0, maxChars - 3) + "..."; -} - -var shouldIgnore = function() { return false; }; -var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; -function parseLineInfo(line) { - var matches = line.match(parseLineInfoRegex); - if (matches) { - return { - fileName: matches[1], - line: parseInt(matches[2], 10) - }; - } -} -CapturedTrace.setBounds = function(firstLineError, lastLineError) { - if (!CapturedTrace.isSupported()) return; - var firstStackLines = firstLineError.stack.split("\n"); - var lastStackLines = lastLineError.stack.split("\n"); - var firstIndex = -1; - var lastIndex = -1; - var firstFileName; - var lastFileName; - for (var i = 0; i < firstStackLines.length; ++i) { - var result = parseLineInfo(firstStackLines[i]); - if (result) { - firstFileName = result.fileName; - firstIndex = result.line; - break; - } - } - for (var i = 0; i < lastStackLines.length; ++i) { - var result = parseLineInfo(lastStackLines[i]); - if (result) { - lastFileName = result.fileName; - lastIndex = result.line; - break; - } - } - if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || - firstFileName !== lastFileName || firstIndex >= lastIndex) { - return; - } - - shouldIgnore = function(line) { - if (bluebirdFramePattern.test(line)) return true; - var info = parseLineInfo(line); - if (info) { - if (info.fileName === firstFileName && - (firstIndex <= info.line && info.line <= lastIndex)) { - return true; - } - } - return false; - }; -}; - -var captureStackTrace = (function stackDetection() { - var v8stackFramePattern = /^\s*at\s*/; - var v8stackFormatter = function(stack, error) { - if (typeof stack === "string") return stack; - - if (error.name !== undefined && - error.message !== undefined) { - return error.toString(); - } - return formatNonError(error); - }; - - if (typeof Error.stackTraceLimit === "number" && - typeof Error.captureStackTrace === "function") { - Error.stackTraceLimit = Error.stackTraceLimit + 6; - stackFramePattern = v8stackFramePattern; - formatStack = v8stackFormatter; - var captureStackTrace = Error.captureStackTrace; - - shouldIgnore = function(line) { - return bluebirdFramePattern.test(line); - }; - return function(receiver, ignoreUntil) { - Error.stackTraceLimit = Error.stackTraceLimit + 6; - captureStackTrace(receiver, ignoreUntil); - Error.stackTraceLimit = Error.stackTraceLimit - 6; - }; - } - var err = new Error(); - - if (typeof err.stack === "string" && - err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { - stackFramePattern = /@/; - formatStack = v8stackFormatter; - indentStackFrames = true; - return function captureStackTrace(o) { - o.stack = new Error().stack; - }; - } - - var hasStackAfterThrow; - try { throw new Error(); } - catch(e) { - hasStackAfterThrow = ("stack" in e); - } - if (!("stack" in err) && hasStackAfterThrow && - typeof Error.stackTraceLimit === "number") { - stackFramePattern = v8stackFramePattern; - formatStack = v8stackFormatter; - return function captureStackTrace(o) { - Error.stackTraceLimit = Error.stackTraceLimit + 6; - try { throw new Error(); } - catch(e) { o.stack = e.stack; } - Error.stackTraceLimit = Error.stackTraceLimit - 6; - }; - } - - formatStack = function(stack, error) { - if (typeof stack === "string") return stack; - - if ((typeof error === "object" || - typeof error === "function") && - error.name !== undefined && - error.message !== undefined) { - return error.toString(); - } - return formatNonError(error); - }; - - return null; - -})([]); - -var fireDomEvent; -var fireGlobalEvent = (function() { - if (util.isNode) { - return function(name, reason, promise) { - if (name === "rejectionHandled") { - return process.emit(name, promise); - } else { - return process.emit(name, reason, promise); - } - }; - } else { - var customEventWorks = false; - var anyEventWorks = true; - try { - var ev = new self.CustomEvent("test"); - customEventWorks = ev instanceof CustomEvent; - } catch (e) {} - if (!customEventWorks) { - try { - var event = document.createEvent("CustomEvent"); - event.initCustomEvent("testingtheevent", false, true, {}); - self.dispatchEvent(event); - } catch (e) { - anyEventWorks = false; - } - } - if (anyEventWorks) { - fireDomEvent = function(type, detail) { - var event; - if (customEventWorks) { - event = new self.CustomEvent(type, { - detail: detail, - bubbles: false, - cancelable: true - }); - } else if (self.dispatchEvent) { - event = document.createEvent("CustomEvent"); - event.initCustomEvent(type, false, true, detail); - } - - return event ? !self.dispatchEvent(event) : false; - }; - } - - var toWindowMethodNameMap = {}; - toWindowMethodNameMap["unhandledRejection"] = ("on" + - "unhandledRejection").toLowerCase(); - toWindowMethodNameMap["rejectionHandled"] = ("on" + - "rejectionHandled").toLowerCase(); - - return function(name, reason, promise) { - var methodName = toWindowMethodNameMap[name]; - var method = self[methodName]; - if (!method) return false; - if (name === "rejectionHandled") { - method.call(self, promise); - } else { - method.call(self, reason, promise); - } - return true; - }; - } -})(); - -if (typeof console !== "undefined" && typeof console.warn !== "undefined") { - warn = function (message) { - console.warn(message); - }; - if (util.isNode && process.stderr.isTTY) { - warn = function(message) { - process.stderr.write("\u001b[31m" + message + "\u001b[39m\n"); - }; - } else if (!util.isNode && typeof (new Error().stack) === "string") { - warn = function(message) { - console.warn("%c" + message, "color: red"); - }; - } -} - -return CapturedTrace; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/catch_filter.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/catch_filter.js deleted file mode 100644 index df127333992b39..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/catch_filter.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -module.exports = function(NEXT_FILTER) { -var util = require("./util.js"); -var errors = require("./errors.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -var keys = require("./es5.js").keys; -var TypeError = errors.TypeError; - -function CatchFilter(instances, callback, promise) { - this._instances = instances; - this._callback = callback; - this._promise = promise; -} - -function safePredicate(predicate, e) { - var safeObject = {}; - var retfilter = tryCatch(predicate).call(safeObject, e); - - if (retfilter === errorObj) return retfilter; - - var safeKeys = keys(safeObject); - if (safeKeys.length) { - errorObj.e = new TypeError("Catch filter must inherit from Error or be a simple predicate function\u000a\u000a See http://goo.gl/o84o68\u000a"); - return errorObj; - } - return retfilter; -} - -CatchFilter.prototype.doFilter = function (e) { - var cb = this._callback; - var promise = this._promise; - var boundTo = promise._boundValue(); - for (var i = 0, len = this._instances.length; i < len; ++i) { - var item = this._instances[i]; - var itemIsErrorType = item === Error || - (item != null && item.prototype instanceof Error); - - if (itemIsErrorType && e instanceof item) { - var ret = tryCatch(cb).call(boundTo, e); - if (ret === errorObj) { - NEXT_FILTER.e = ret.e; - return NEXT_FILTER; - } - return ret; - } else if (typeof item === "function" && !itemIsErrorType) { - var shouldHandle = safePredicate(item, e); - if (shouldHandle === errorObj) { - e = errorObj.e; - break; - } else if (shouldHandle) { - var ret = tryCatch(cb).call(boundTo, e); - if (ret === errorObj) { - NEXT_FILTER.e = ret.e; - return NEXT_FILTER; - } - return ret; - } - } - } - NEXT_FILTER.e = e; - return NEXT_FILTER; -}; - -return CatchFilter; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/context.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/context.js deleted file mode 100644 index ccd7702b7e9924..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/context.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -module.exports = function(Promise, CapturedTrace, isDebugging) { -var contextStack = []; -function Context() { - this._trace = new CapturedTrace(peekContext()); -} -Context.prototype._pushContext = function () { - if (!isDebugging()) return; - if (this._trace !== undefined) { - contextStack.push(this._trace); - } -}; - -Context.prototype._popContext = function () { - if (!isDebugging()) return; - if (this._trace !== undefined) { - contextStack.pop(); - } -}; - -function createContext() { - if (isDebugging()) return new Context(); -} - -function peekContext() { - var lastIndex = contextStack.length - 1; - if (lastIndex >= 0) { - return contextStack[lastIndex]; - } - return undefined; -} - -Promise.prototype._peekContext = peekContext; -Promise.prototype._pushContext = Context.prototype._pushContext; -Promise.prototype._popContext = Context.prototype._popContext; - -return createContext; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/debuggability.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/debuggability.js deleted file mode 100644 index 106baf65975006..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/debuggability.js +++ /dev/null @@ -1,162 +0,0 @@ -"use strict"; -module.exports = function(Promise, CapturedTrace) { -var getDomain = Promise._getDomain; -var async = require("./async.js"); -var Warning = require("./errors.js").Warning; -var util = require("./util.js"); -var canAttachTrace = util.canAttachTrace; -var unhandledRejectionHandled; -var possiblyUnhandledRejection; -var debugging = false || (util.isNode && - (!!process.env["BLUEBIRD_DEBUG"] || - process.env["NODE_ENV"] === "development")); - -if (util.isNode && process.env["BLUEBIRD_DEBUG"] == 0) debugging = false; - -if (debugging) { - async.disableTrampolineIfNecessary(); -} - -Promise.prototype._ignoreRejections = function() { - this._unsetRejectionIsUnhandled(); - this._bitField = this._bitField | 16777216; -}; - -Promise.prototype._ensurePossibleRejectionHandled = function () { - if ((this._bitField & 16777216) !== 0) return; - this._setRejectionIsUnhandled(); - async.invokeLater(this._notifyUnhandledRejection, this, undefined); -}; - -Promise.prototype._notifyUnhandledRejectionIsHandled = function () { - CapturedTrace.fireRejectionEvent("rejectionHandled", - unhandledRejectionHandled, undefined, this); -}; - -Promise.prototype._notifyUnhandledRejection = function () { - if (this._isRejectionUnhandled()) { - var reason = this._getCarriedStackTrace() || this._settledValue; - this._setUnhandledRejectionIsNotified(); - CapturedTrace.fireRejectionEvent("unhandledRejection", - possiblyUnhandledRejection, reason, this); - } -}; - -Promise.prototype._setUnhandledRejectionIsNotified = function () { - this._bitField = this._bitField | 524288; -}; - -Promise.prototype._unsetUnhandledRejectionIsNotified = function () { - this._bitField = this._bitField & (~524288); -}; - -Promise.prototype._isUnhandledRejectionNotified = function () { - return (this._bitField & 524288) > 0; -}; - -Promise.prototype._setRejectionIsUnhandled = function () { - this._bitField = this._bitField | 2097152; -}; - -Promise.prototype._unsetRejectionIsUnhandled = function () { - this._bitField = this._bitField & (~2097152); - if (this._isUnhandledRejectionNotified()) { - this._unsetUnhandledRejectionIsNotified(); - this._notifyUnhandledRejectionIsHandled(); - } -}; - -Promise.prototype._isRejectionUnhandled = function () { - return (this._bitField & 2097152) > 0; -}; - -Promise.prototype._setCarriedStackTrace = function (capturedTrace) { - this._bitField = this._bitField | 1048576; - this._fulfillmentHandler0 = capturedTrace; -}; - -Promise.prototype._isCarryingStackTrace = function () { - return (this._bitField & 1048576) > 0; -}; - -Promise.prototype._getCarriedStackTrace = function () { - return this._isCarryingStackTrace() - ? this._fulfillmentHandler0 - : undefined; -}; - -Promise.prototype._captureStackTrace = function () { - if (debugging) { - this._trace = new CapturedTrace(this._peekContext()); - } - return this; -}; - -Promise.prototype._attachExtraTrace = function (error, ignoreSelf) { - if (debugging && canAttachTrace(error)) { - var trace = this._trace; - if (trace !== undefined) { - if (ignoreSelf) trace = trace._parent; - } - if (trace !== undefined) { - trace.attachExtraTrace(error); - } else if (!error.__stackCleaned__) { - var parsed = CapturedTrace.parseStackAndMessage(error); - util.notEnumerableProp(error, "stack", - parsed.message + "\n" + parsed.stack.join("\n")); - util.notEnumerableProp(error, "__stackCleaned__", true); - } - } -}; - -Promise.prototype._warn = function(message) { - var warning = new Warning(message); - var ctx = this._peekContext(); - if (ctx) { - ctx.attachExtraTrace(warning); - } else { - var parsed = CapturedTrace.parseStackAndMessage(warning); - warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); - } - CapturedTrace.formatAndLogError(warning, ""); -}; - -Promise.onPossiblyUnhandledRejection = function (fn) { - var domain = getDomain(); - possiblyUnhandledRejection = - typeof fn === "function" ? (domain === null ? fn : domain.bind(fn)) - : undefined; -}; - -Promise.onUnhandledRejectionHandled = function (fn) { - var domain = getDomain(); - unhandledRejectionHandled = - typeof fn === "function" ? (domain === null ? fn : domain.bind(fn)) - : undefined; -}; - -Promise.longStackTraces = function () { - if (async.haveItemsQueued() && - debugging === false - ) { - throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/DT1qyG\u000a"); - } - debugging = CapturedTrace.isSupported(); - if (debugging) { - async.disableTrampolineIfNecessary(); - } -}; - -Promise.hasLongStackTraces = function () { - return debugging && CapturedTrace.isSupported(); -}; - -if (!CapturedTrace.isSupported()) { - Promise.longStackTraces = function(){}; - debugging = false; -} - -return function() { - return debugging; -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/direct_resolve.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/direct_resolve.js deleted file mode 100644 index 054685a1c31713..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/direct_resolve.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; -var util = require("./util.js"); -var isPrimitive = util.isPrimitive; - -module.exports = function(Promise) { -var returner = function () { - return this; -}; -var thrower = function () { - throw this; -}; -var returnUndefined = function() {}; -var throwUndefined = function() { - throw undefined; -}; - -var wrapper = function (value, action) { - if (action === 1) { - return function () { - throw value; - }; - } else if (action === 2) { - return function () { - return value; - }; - } -}; - - -Promise.prototype["return"] = -Promise.prototype.thenReturn = function (value) { - if (value === undefined) return this.then(returnUndefined); - - if (isPrimitive(value)) { - return this._then( - wrapper(value, 2), - undefined, - undefined, - undefined, - undefined - ); - } else if (value instanceof Promise) { - value._ignoreRejections(); - } - return this._then(returner, undefined, undefined, value, undefined); -}; - -Promise.prototype["throw"] = -Promise.prototype.thenThrow = function (reason) { - if (reason === undefined) return this.then(throwUndefined); - - if (isPrimitive(reason)) { - return this._then( - wrapper(reason, 1), - undefined, - undefined, - undefined, - undefined - ); - } - return this._then(thrower, undefined, undefined, reason, undefined); -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/each.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/each.js deleted file mode 100644 index a37e22c058bdd5..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/each.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var PromiseReduce = Promise.reduce; - -Promise.prototype.each = function (fn) { - return PromiseReduce(this, fn, null, INTERNAL); -}; - -Promise.each = function (promises, fn) { - return PromiseReduce(promises, fn, null, INTERNAL); -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/errors.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/errors.js deleted file mode 100644 index c334bb1c83f504..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/errors.js +++ /dev/null @@ -1,111 +0,0 @@ -"use strict"; -var es5 = require("./es5.js"); -var Objectfreeze = es5.freeze; -var util = require("./util.js"); -var inherits = util.inherits; -var notEnumerableProp = util.notEnumerableProp; - -function subError(nameProperty, defaultMessage) { - function SubError(message) { - if (!(this instanceof SubError)) return new SubError(message); - notEnumerableProp(this, "message", - typeof message === "string" ? message : defaultMessage); - notEnumerableProp(this, "name", nameProperty); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - Error.call(this); - } - } - inherits(SubError, Error); - return SubError; -} - -var _TypeError, _RangeError; -var Warning = subError("Warning", "warning"); -var CancellationError = subError("CancellationError", "cancellation error"); -var TimeoutError = subError("TimeoutError", "timeout error"); -var AggregateError = subError("AggregateError", "aggregate error"); -try { - _TypeError = TypeError; - _RangeError = RangeError; -} catch(e) { - _TypeError = subError("TypeError", "type error"); - _RangeError = subError("RangeError", "range error"); -} - -var methods = ("join pop push shift unshift slice filter forEach some " + - "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); - -for (var i = 0; i < methods.length; ++i) { - if (typeof Array.prototype[methods[i]] === "function") { - AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; - } -} - -es5.defineProperty(AggregateError.prototype, "length", { - value: 0, - configurable: false, - writable: true, - enumerable: true -}); -AggregateError.prototype["isOperational"] = true; -var level = 0; -AggregateError.prototype.toString = function() { - var indent = Array(level * 4 + 1).join(" "); - var ret = "\n" + indent + "AggregateError of:" + "\n"; - level++; - indent = Array(level * 4 + 1).join(" "); - for (var i = 0; i < this.length; ++i) { - var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; - var lines = str.split("\n"); - for (var j = 0; j < lines.length; ++j) { - lines[j] = indent + lines[j]; - } - str = lines.join("\n"); - ret += str + "\n"; - } - level--; - return ret; -}; - -function OperationalError(message) { - if (!(this instanceof OperationalError)) - return new OperationalError(message); - notEnumerableProp(this, "name", "OperationalError"); - notEnumerableProp(this, "message", message); - this.cause = message; - this["isOperational"] = true; - - if (message instanceof Error) { - notEnumerableProp(this, "message", message.message); - notEnumerableProp(this, "stack", message.stack); - } else if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - -} -inherits(OperationalError, Error); - -var errorTypes = Error["__BluebirdErrorTypes__"]; -if (!errorTypes) { - errorTypes = Objectfreeze({ - CancellationError: CancellationError, - TimeoutError: TimeoutError, - OperationalError: OperationalError, - RejectionError: OperationalError, - AggregateError: AggregateError - }); - notEnumerableProp(Error, "__BluebirdErrorTypes__", errorTypes); -} - -module.exports = { - Error: Error, - TypeError: _TypeError, - RangeError: _RangeError, - CancellationError: errorTypes.CancellationError, - OperationalError: errorTypes.OperationalError, - TimeoutError: errorTypes.TimeoutError, - AggregateError: errorTypes.AggregateError, - Warning: Warning -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/es5.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/es5.js deleted file mode 100644 index ea41d5a566921d..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/es5.js +++ /dev/null @@ -1,80 +0,0 @@ -var isES5 = (function(){ - "use strict"; - return this === undefined; -})(); - -if (isES5) { - module.exports = { - freeze: Object.freeze, - defineProperty: Object.defineProperty, - getDescriptor: Object.getOwnPropertyDescriptor, - keys: Object.keys, - names: Object.getOwnPropertyNames, - getPrototypeOf: Object.getPrototypeOf, - isArray: Array.isArray, - isES5: isES5, - propertyIsWritable: function(obj, prop) { - var descriptor = Object.getOwnPropertyDescriptor(obj, prop); - return !!(!descriptor || descriptor.writable || descriptor.set); - } - }; -} else { - var has = {}.hasOwnProperty; - var str = {}.toString; - var proto = {}.constructor.prototype; - - var ObjectKeys = function (o) { - var ret = []; - for (var key in o) { - if (has.call(o, key)) { - ret.push(key); - } - } - return ret; - }; - - var ObjectGetDescriptor = function(o, key) { - return {value: o[key]}; - }; - - var ObjectDefineProperty = function (o, key, desc) { - o[key] = desc.value; - return o; - }; - - var ObjectFreeze = function (obj) { - return obj; - }; - - var ObjectGetPrototypeOf = function (obj) { - try { - return Object(obj).constructor.prototype; - } - catch (e) { - return proto; - } - }; - - var ArrayIsArray = function (obj) { - try { - return str.call(obj) === "[object Array]"; - } - catch(e) { - return false; - } - }; - - module.exports = { - isArray: ArrayIsArray, - keys: ObjectKeys, - names: ObjectKeys, - defineProperty: ObjectDefineProperty, - getDescriptor: ObjectGetDescriptor, - freeze: ObjectFreeze, - getPrototypeOf: ObjectGetPrototypeOf, - isES5: isES5, - propertyIsWritable: function() { - return true; - } - }; -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/filter.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/filter.js deleted file mode 100644 index ed57bf0159212e..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/filter.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var PromiseMap = Promise.map; - -Promise.prototype.filter = function (fn, options) { - return PromiseMap(this, fn, options, INTERNAL); -}; - -Promise.filter = function (promises, fn, options) { - return PromiseMap(promises, fn, options, INTERNAL); -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/finally.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/finally.js deleted file mode 100644 index c9342bcf23d9bb..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/finally.js +++ /dev/null @@ -1,98 +0,0 @@ -"use strict"; -module.exports = function(Promise, NEXT_FILTER, tryConvertToPromise) { -var util = require("./util.js"); -var isPrimitive = util.isPrimitive; -var thrower = util.thrower; - -function returnThis() { - return this; -} -function throwThis() { - throw this; -} -function return$(r) { - return function() { - return r; - }; -} -function throw$(r) { - return function() { - throw r; - }; -} -function promisedFinally(ret, reasonOrValue, isFulfilled) { - var then; - if (isPrimitive(reasonOrValue)) { - then = isFulfilled ? return$(reasonOrValue) : throw$(reasonOrValue); - } else { - then = isFulfilled ? returnThis : throwThis; - } - return ret._then(then, thrower, undefined, reasonOrValue, undefined); -} - -function finallyHandler(reasonOrValue) { - var promise = this.promise; - var handler = this.handler; - - var ret = promise._isBound() - ? handler.call(promise._boundValue()) - : handler(); - - if (ret !== undefined) { - var maybePromise = tryConvertToPromise(ret, promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - return promisedFinally(maybePromise, reasonOrValue, - promise.isFulfilled()); - } - } - - if (promise.isRejected()) { - NEXT_FILTER.e = reasonOrValue; - return NEXT_FILTER; - } else { - return reasonOrValue; - } -} - -function tapHandler(value) { - var promise = this.promise; - var handler = this.handler; - - var ret = promise._isBound() - ? handler.call(promise._boundValue(), value) - : handler(value); - - if (ret !== undefined) { - var maybePromise = tryConvertToPromise(ret, promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - return promisedFinally(maybePromise, value, true); - } - } - return value; -} - -Promise.prototype._passThroughHandler = function (handler, isFinally) { - if (typeof handler !== "function") return this.then(); - - var promiseAndHandler = { - promise: this, - handler: handler - }; - - return this._then( - isFinally ? finallyHandler : tapHandler, - isFinally ? finallyHandler : undefined, undefined, - promiseAndHandler, undefined); -}; - -Promise.prototype.lastly = -Promise.prototype["finally"] = function (handler) { - return this._passThroughHandler(handler, true); -}; - -Promise.prototype.tap = function (handler) { - return this._passThroughHandler(handler, false); -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/generators.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/generators.js deleted file mode 100644 index 4c0568d21f9eaf..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/generators.js +++ /dev/null @@ -1,136 +0,0 @@ -"use strict"; -module.exports = function(Promise, - apiRejection, - INTERNAL, - tryConvertToPromise) { -var errors = require("./errors.js"); -var TypeError = errors.TypeError; -var util = require("./util.js"); -var errorObj = util.errorObj; -var tryCatch = util.tryCatch; -var yieldHandlers = []; - -function promiseFromYieldHandler(value, yieldHandlers, traceParent) { - for (var i = 0; i < yieldHandlers.length; ++i) { - traceParent._pushContext(); - var result = tryCatch(yieldHandlers[i])(value); - traceParent._popContext(); - if (result === errorObj) { - traceParent._pushContext(); - var ret = Promise.reject(errorObj.e); - traceParent._popContext(); - return ret; - } - var maybePromise = tryConvertToPromise(result, traceParent); - if (maybePromise instanceof Promise) return maybePromise; - } - return null; -} - -function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { - var promise = this._promise = new Promise(INTERNAL); - promise._captureStackTrace(); - this._stack = stack; - this._generatorFunction = generatorFunction; - this._receiver = receiver; - this._generator = undefined; - this._yieldHandlers = typeof yieldHandler === "function" - ? [yieldHandler].concat(yieldHandlers) - : yieldHandlers; -} - -PromiseSpawn.prototype.promise = function () { - return this._promise; -}; - -PromiseSpawn.prototype._run = function () { - this._generator = this._generatorFunction.call(this._receiver); - this._receiver = - this._generatorFunction = undefined; - this._next(undefined); -}; - -PromiseSpawn.prototype._continue = function (result) { - if (result === errorObj) { - return this._promise._rejectCallback(result.e, false, true); - } - - var value = result.value; - if (result.done === true) { - this._promise._resolveCallback(value); - } else { - var maybePromise = tryConvertToPromise(value, this._promise); - if (!(maybePromise instanceof Promise)) { - maybePromise = - promiseFromYieldHandler(maybePromise, - this._yieldHandlers, - this._promise); - if (maybePromise === null) { - this._throw( - new TypeError( - "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/4Y4pDk\u000a\u000a".replace("%s", value) + - "From coroutine:\u000a" + - this._stack.split("\n").slice(1, -7).join("\n") - ) - ); - return; - } - } - maybePromise._then( - this._next, - this._throw, - undefined, - this, - null - ); - } -}; - -PromiseSpawn.prototype._throw = function (reason) { - this._promise._attachExtraTrace(reason); - this._promise._pushContext(); - var result = tryCatch(this._generator["throw"]) - .call(this._generator, reason); - this._promise._popContext(); - this._continue(result); -}; - -PromiseSpawn.prototype._next = function (value) { - this._promise._pushContext(); - var result = tryCatch(this._generator.next).call(this._generator, value); - this._promise._popContext(); - this._continue(result); -}; - -Promise.coroutine = function (generatorFunction, options) { - if (typeof generatorFunction !== "function") { - throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/6Vqhm0\u000a"); - } - var yieldHandler = Object(options).yieldHandler; - var PromiseSpawn$ = PromiseSpawn; - var stack = new Error().stack; - return function () { - var generator = generatorFunction.apply(this, arguments); - var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, - stack); - spawn._generator = generator; - spawn._next(undefined); - return spawn.promise(); - }; -}; - -Promise.coroutine.addYieldHandler = function(fn) { - if (typeof fn !== "function") throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - yieldHandlers.push(fn); -}; - -Promise.spawn = function (generatorFunction) { - if (typeof generatorFunction !== "function") { - return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/6Vqhm0\u000a"); - } - var spawn = new PromiseSpawn(generatorFunction, this); - var ret = spawn.promise(); - spawn._run(Promise.spawn); - return ret; -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/join.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/join.js deleted file mode 100644 index cf33eb1d073b48..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/join.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; -module.exports = -function(Promise, PromiseArray, tryConvertToPromise, INTERNAL) { -var util = require("./util.js"); -var canEvaluate = util.canEvaluate; -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -var reject; - -if (!false) { -if (canEvaluate) { - var thenCallback = function(i) { - return new Function("value", "holder", " \n\ - 'use strict'; \n\ - holder.pIndex = value; \n\ - holder.checkFulfillment(this); \n\ - ".replace(/Index/g, i)); - }; - - var caller = function(count) { - var values = []; - for (var i = 1; i <= count; ++i) values.push("holder.p" + i); - return new Function("holder", " \n\ - 'use strict'; \n\ - var callback = holder.fn; \n\ - return callback(values); \n\ - ".replace(/values/g, values.join(", "))); - }; - var thenCallbacks = []; - var callers = [undefined]; - for (var i = 1; i <= 5; ++i) { - thenCallbacks.push(thenCallback(i)); - callers.push(caller(i)); - } - - var Holder = function(total, fn) { - this.p1 = this.p2 = this.p3 = this.p4 = this.p5 = null; - this.fn = fn; - this.total = total; - this.now = 0; - }; - - Holder.prototype.callers = callers; - Holder.prototype.checkFulfillment = function(promise) { - var now = this.now; - now++; - var total = this.total; - if (now >= total) { - var handler = this.callers[total]; - promise._pushContext(); - var ret = tryCatch(handler)(this); - promise._popContext(); - if (ret === errorObj) { - promise._rejectCallback(ret.e, false, true); - } else { - promise._resolveCallback(ret); - } - } else { - this.now = now; - } - }; - - var reject = function (reason) { - this._reject(reason); - }; -} -} - -Promise.join = function () { - var last = arguments.length - 1; - var fn; - if (last > 0 && typeof arguments[last] === "function") { - fn = arguments[last]; - if (!false) { - if (last < 6 && canEvaluate) { - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - var holder = new Holder(last, fn); - var callbacks = thenCallbacks; - for (var i = 0; i < last; ++i) { - var maybePromise = tryConvertToPromise(arguments[i], ret); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - if (maybePromise._isPending()) { - maybePromise._then(callbacks[i], reject, - undefined, ret, holder); - } else if (maybePromise._isFulfilled()) { - callbacks[i].call(ret, - maybePromise._value(), holder); - } else { - ret._reject(maybePromise._reason()); - } - } else { - callbacks[i].call(ret, maybePromise, holder); - } - } - return ret; - } - } - } - var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];} - if (fn) args.pop(); - var ret = new PromiseArray(args).promise(); - return fn !== undefined ? ret.spread(fn) : ret; -}; - -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/map.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/map.js deleted file mode 100644 index 2f40efd2493529..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/map.js +++ /dev/null @@ -1,133 +0,0 @@ -"use strict"; -module.exports = function(Promise, - PromiseArray, - apiRejection, - tryConvertToPromise, - INTERNAL) { -var getDomain = Promise._getDomain; -var async = require("./async.js"); -var util = require("./util.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -var PENDING = {}; -var EMPTY_ARRAY = []; - -function MappingPromiseArray(promises, fn, limit, _filter) { - this.constructor$(promises); - this._promise._captureStackTrace(); - var domain = getDomain(); - this._callback = domain === null ? fn : domain.bind(fn); - this._preservedValues = _filter === INTERNAL - ? new Array(this.length()) - : null; - this._limit = limit; - this._inFlight = 0; - this._queue = limit >= 1 ? [] : EMPTY_ARRAY; - async.invoke(init, this, undefined); -} -util.inherits(MappingPromiseArray, PromiseArray); -function init() {this._init$(undefined, -2);} - -MappingPromiseArray.prototype._init = function () {}; - -MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { - var values = this._values; - var length = this.length(); - var preservedValues = this._preservedValues; - var limit = this._limit; - if (values[index] === PENDING) { - values[index] = value; - if (limit >= 1) { - this._inFlight--; - this._drainQueue(); - if (this._isResolved()) return; - } - } else { - if (limit >= 1 && this._inFlight >= limit) { - values[index] = value; - this._queue.push(index); - return; - } - if (preservedValues !== null) preservedValues[index] = value; - - var callback = this._callback; - var receiver = this._promise._boundValue(); - this._promise._pushContext(); - var ret = tryCatch(callback).call(receiver, value, index, length); - this._promise._popContext(); - if (ret === errorObj) return this._reject(ret.e); - - var maybePromise = tryConvertToPromise(ret, this._promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - if (maybePromise._isPending()) { - if (limit >= 1) this._inFlight++; - values[index] = PENDING; - return maybePromise._proxyPromiseArray(this, index); - } else if (maybePromise._isFulfilled()) { - ret = maybePromise._value(); - } else { - return this._reject(maybePromise._reason()); - } - } - values[index] = ret; - } - var totalResolved = ++this._totalResolved; - if (totalResolved >= length) { - if (preservedValues !== null) { - this._filter(values, preservedValues); - } else { - this._resolve(values); - } - - } -}; - -MappingPromiseArray.prototype._drainQueue = function () { - var queue = this._queue; - var limit = this._limit; - var values = this._values; - while (queue.length > 0 && this._inFlight < limit) { - if (this._isResolved()) return; - var index = queue.pop(); - this._promiseFulfilled(values[index], index); - } -}; - -MappingPromiseArray.prototype._filter = function (booleans, values) { - var len = values.length; - var ret = new Array(len); - var j = 0; - for (var i = 0; i < len; ++i) { - if (booleans[i]) ret[j++] = values[i]; - } - ret.length = j; - this._resolve(ret); -}; - -MappingPromiseArray.prototype.preservedValues = function () { - return this._preservedValues; -}; - -function map(promises, fn, options, _filter) { - var limit = typeof options === "object" && options !== null - ? options.concurrency - : 0; - limit = typeof limit === "number" && - isFinite(limit) && limit >= 1 ? limit : 0; - return new MappingPromiseArray(promises, fn, limit, _filter); -} - -Promise.prototype.map = function (fn, options) { - if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - - return map(this, fn, options, null).promise(); -}; - -Promise.map = function (promises, fn, options, _filter) { - if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - return map(promises, fn, options, _filter).promise(); -}; - - -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/method.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/method.js deleted file mode 100644 index 3d3eeb17c8386e..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/method.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -module.exports = -function(Promise, INTERNAL, tryConvertToPromise, apiRejection) { -var util = require("./util.js"); -var tryCatch = util.tryCatch; - -Promise.method = function (fn) { - if (typeof fn !== "function") { - throw new Promise.TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - } - return function () { - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - ret._pushContext(); - var value = tryCatch(fn).apply(this, arguments); - ret._popContext(); - ret._resolveFromSyncValue(value); - return ret; - }; -}; - -Promise.attempt = Promise["try"] = function (fn, args, ctx) { - if (typeof fn !== "function") { - return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - } - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - ret._pushContext(); - var value = util.isArray(args) - ? tryCatch(fn).apply(ctx, args) - : tryCatch(fn).call(ctx, args); - ret._popContext(); - ret._resolveFromSyncValue(value); - return ret; -}; - -Promise.prototype._resolveFromSyncValue = function (value) { - if (value === util.errorObj) { - this._rejectCallback(value.e, false, true); - } else { - this._resolveCallback(value, true); - } -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/nodeify.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/nodeify.js deleted file mode 100644 index 257565db5ec0f6..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/nodeify.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -module.exports = function(Promise) { -var util = require("./util.js"); -var async = require("./async.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; - -function spreadAdapter(val, nodeback) { - var promise = this; - if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); - var ret = - tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); - if (ret === errorObj) { - async.throwLater(ret.e); - } -} - -function successAdapter(val, nodeback) { - var promise = this; - var receiver = promise._boundValue(); - var ret = val === undefined - ? tryCatch(nodeback).call(receiver, null) - : tryCatch(nodeback).call(receiver, null, val); - if (ret === errorObj) { - async.throwLater(ret.e); - } -} -function errorAdapter(reason, nodeback) { - var promise = this; - if (!reason) { - var target = promise._target(); - var newReason = target._getCarriedStackTrace(); - newReason.cause = reason; - reason = newReason; - } - var ret = tryCatch(nodeback).call(promise._boundValue(), reason); - if (ret === errorObj) { - async.throwLater(ret.e); - } -} - -Promise.prototype.asCallback = -Promise.prototype.nodeify = function (nodeback, options) { - if (typeof nodeback == "function") { - var adapter = successAdapter; - if (options !== undefined && Object(options).spread) { - adapter = spreadAdapter; - } - this._then( - adapter, - errorAdapter, - undefined, - this, - nodeback - ); - } - return this; -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/progress.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/progress.js deleted file mode 100644 index 2e3e95e564b5bb..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/progress.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; -module.exports = function(Promise, PromiseArray) { -var util = require("./util.js"); -var async = require("./async.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; - -Promise.prototype.progressed = function (handler) { - return this._then(undefined, undefined, handler, undefined, undefined); -}; - -Promise.prototype._progress = function (progressValue) { - if (this._isFollowingOrFulfilledOrRejected()) return; - this._target()._progressUnchecked(progressValue); - -}; - -Promise.prototype._progressHandlerAt = function (index) { - return index === 0 - ? this._progressHandler0 - : this[(index << 2) + index - 5 + 2]; -}; - -Promise.prototype._doProgressWith = function (progression) { - var progressValue = progression.value; - var handler = progression.handler; - var promise = progression.promise; - var receiver = progression.receiver; - - var ret = tryCatch(handler).call(receiver, progressValue); - if (ret === errorObj) { - if (ret.e != null && - ret.e.name !== "StopProgressPropagation") { - var trace = util.canAttachTrace(ret.e) - ? ret.e : new Error(util.toString(ret.e)); - promise._attachExtraTrace(trace); - promise._progress(ret.e); - } - } else if (ret instanceof Promise) { - ret._then(promise._progress, null, null, promise, undefined); - } else { - promise._progress(ret); - } -}; - - -Promise.prototype._progressUnchecked = function (progressValue) { - var len = this._length(); - var progress = this._progress; - for (var i = 0; i < len; i++) { - var handler = this._progressHandlerAt(i); - var promise = this._promiseAt(i); - if (!(promise instanceof Promise)) { - var receiver = this._receiverAt(i); - if (typeof handler === "function") { - handler.call(receiver, progressValue, promise); - } else if (receiver instanceof PromiseArray && - !receiver._isResolved()) { - receiver._promiseProgressed(progressValue, promise); - } - continue; - } - - if (typeof handler === "function") { - async.invoke(this._doProgressWith, this, { - handler: handler, - promise: promise, - receiver: this._receiverAt(i), - value: progressValue - }); - } else { - async.invoke(progress, promise, progressValue); - } - } -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise.js deleted file mode 100644 index 96bd5456f4ae2f..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise.js +++ /dev/null @@ -1,754 +0,0 @@ -"use strict"; -module.exports = function() { -var makeSelfResolutionError = function () { - return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/LhFpo0\u000a"); -}; -var reflect = function() { - return new Promise.PromiseInspection(this._target()); -}; -var apiRejection = function(msg) { - return Promise.reject(new TypeError(msg)); -}; - -var util = require("./util.js"); - -var getDomain; -if (util.isNode) { - getDomain = function() { - var ret = process.domain; - if (ret === undefined) ret = null; - return ret; - }; -} else { - getDomain = function() { - return null; - }; -} -util.notEnumerableProp(Promise, "_getDomain", getDomain); - -var UNDEFINED_BINDING = {}; -var async = require("./async.js"); -var errors = require("./errors.js"); -var TypeError = Promise.TypeError = errors.TypeError; -Promise.RangeError = errors.RangeError; -Promise.CancellationError = errors.CancellationError; -Promise.TimeoutError = errors.TimeoutError; -Promise.OperationalError = errors.OperationalError; -Promise.RejectionError = errors.OperationalError; -Promise.AggregateError = errors.AggregateError; -var INTERNAL = function(){}; -var APPLY = {}; -var NEXT_FILTER = {e: null}; -var tryConvertToPromise = require("./thenables.js")(Promise, INTERNAL); -var PromiseArray = - require("./promise_array.js")(Promise, INTERNAL, - tryConvertToPromise, apiRejection); -var CapturedTrace = require("./captured_trace.js")(); -var isDebugging = require("./debuggability.js")(Promise, CapturedTrace); - /*jshint unused:false*/ -var createContext = - require("./context.js")(Promise, CapturedTrace, isDebugging); -var CatchFilter = require("./catch_filter.js")(NEXT_FILTER); -var PromiseResolver = require("./promise_resolver.js"); -var nodebackForPromise = PromiseResolver._nodebackForPromise; -var errorObj = util.errorObj; -var tryCatch = util.tryCatch; -function Promise(resolver) { - if (typeof resolver !== "function") { - throw new TypeError("the promise constructor requires a resolver function\u000a\u000a See http://goo.gl/EC22Yn\u000a"); - } - if (this.constructor !== Promise) { - throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/KsIlge\u000a"); - } - this._bitField = 0; - this._fulfillmentHandler0 = undefined; - this._rejectionHandler0 = undefined; - this._progressHandler0 = undefined; - this._promise0 = undefined; - this._receiver0 = undefined; - this._settledValue = undefined; - if (resolver !== INTERNAL) this._resolveFromResolver(resolver); -} - -Promise.prototype.toString = function () { - return "[object Promise]"; -}; - -Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { - var len = arguments.length; - if (len > 1) { - var catchInstances = new Array(len - 1), - j = 0, i; - for (i = 0; i < len - 1; ++i) { - var item = arguments[i]; - if (typeof item === "function") { - catchInstances[j++] = item; - } else { - return Promise.reject( - new TypeError("Catch filter must inherit from Error or be a simple predicate function\u000a\u000a See http://goo.gl/o84o68\u000a")); - } - } - catchInstances.length = j; - fn = arguments[i]; - var catchFilter = new CatchFilter(catchInstances, fn, this); - return this._then(undefined, catchFilter.doFilter, undefined, - catchFilter, undefined); - } - return this._then(undefined, fn, undefined, undefined, undefined); -}; - -Promise.prototype.reflect = function () { - return this._then(reflect, reflect, undefined, this, undefined); -}; - -Promise.prototype.then = function (didFulfill, didReject, didProgress) { - if (isDebugging() && arguments.length > 0 && - typeof didFulfill !== "function" && - typeof didReject !== "function") { - var msg = ".then() only accepts functions but was passed: " + - util.classString(didFulfill); - if (arguments.length > 1) { - msg += ", " + util.classString(didReject); - } - this._warn(msg); - } - return this._then(didFulfill, didReject, didProgress, - undefined, undefined); -}; - -Promise.prototype.done = function (didFulfill, didReject, didProgress) { - var promise = this._then(didFulfill, didReject, didProgress, - undefined, undefined); - promise._setIsFinal(); -}; - -Promise.prototype.spread = function (didFulfill, didReject) { - return this.all()._then(didFulfill, didReject, undefined, APPLY, undefined); -}; - -Promise.prototype.isCancellable = function () { - return !this.isResolved() && - this._cancellable(); -}; - -Promise.prototype.toJSON = function () { - var ret = { - isFulfilled: false, - isRejected: false, - fulfillmentValue: undefined, - rejectionReason: undefined - }; - if (this.isFulfilled()) { - ret.fulfillmentValue = this.value(); - ret.isFulfilled = true; - } else if (this.isRejected()) { - ret.rejectionReason = this.reason(); - ret.isRejected = true; - } - return ret; -}; - -Promise.prototype.all = function () { - return new PromiseArray(this).promise(); -}; - -Promise.prototype.error = function (fn) { - return this.caught(util.originatesFromRejection, fn); -}; - -Promise.is = function (val) { - return val instanceof Promise; -}; - -Promise.fromNode = function(fn) { - var ret = new Promise(INTERNAL); - var result = tryCatch(fn)(nodebackForPromise(ret)); - if (result === errorObj) { - ret._rejectCallback(result.e, true, true); - } - return ret; -}; - -Promise.all = function (promises) { - return new PromiseArray(promises).promise(); -}; - -Promise.defer = Promise.pending = function () { - var promise = new Promise(INTERNAL); - return new PromiseResolver(promise); -}; - -Promise.cast = function (obj) { - var ret = tryConvertToPromise(obj); - if (!(ret instanceof Promise)) { - var val = ret; - ret = new Promise(INTERNAL); - ret._fulfillUnchecked(val); - } - return ret; -}; - -Promise.resolve = Promise.fulfilled = Promise.cast; - -Promise.reject = Promise.rejected = function (reason) { - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - ret._rejectCallback(reason, true); - return ret; -}; - -Promise.setScheduler = function(fn) { - if (typeof fn !== "function") throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - var prev = async._schedule; - async._schedule = fn; - return prev; -}; - -Promise.prototype._then = function ( - didFulfill, - didReject, - didProgress, - receiver, - internalData -) { - var haveInternalData = internalData !== undefined; - var ret = haveInternalData ? internalData : new Promise(INTERNAL); - - if (!haveInternalData) { - ret._propagateFrom(this, 4 | 1); - ret._captureStackTrace(); - } - - var target = this._target(); - if (target !== this) { - if (receiver === undefined) receiver = this._boundTo; - if (!haveInternalData) ret._setIsMigrated(); - } - - var callbackIndex = target._addCallbacks(didFulfill, - didReject, - didProgress, - ret, - receiver, - getDomain()); - - if (target._isResolved() && !target._isSettlePromisesQueued()) { - async.invoke( - target._settlePromiseAtPostResolution, target, callbackIndex); - } - - return ret; -}; - -Promise.prototype._settlePromiseAtPostResolution = function (index) { - if (this._isRejectionUnhandled()) this._unsetRejectionIsUnhandled(); - this._settlePromiseAt(index); -}; - -Promise.prototype._length = function () { - return this._bitField & 131071; -}; - -Promise.prototype._isFollowingOrFulfilledOrRejected = function () { - return (this._bitField & 939524096) > 0; -}; - -Promise.prototype._isFollowing = function () { - return (this._bitField & 536870912) === 536870912; -}; - -Promise.prototype._setLength = function (len) { - this._bitField = (this._bitField & -131072) | - (len & 131071); -}; - -Promise.prototype._setFulfilled = function () { - this._bitField = this._bitField | 268435456; -}; - -Promise.prototype._setRejected = function () { - this._bitField = this._bitField | 134217728; -}; - -Promise.prototype._setFollowing = function () { - this._bitField = this._bitField | 536870912; -}; - -Promise.prototype._setIsFinal = function () { - this._bitField = this._bitField | 33554432; -}; - -Promise.prototype._isFinal = function () { - return (this._bitField & 33554432) > 0; -}; - -Promise.prototype._cancellable = function () { - return (this._bitField & 67108864) > 0; -}; - -Promise.prototype._setCancellable = function () { - this._bitField = this._bitField | 67108864; -}; - -Promise.prototype._unsetCancellable = function () { - this._bitField = this._bitField & (~67108864); -}; - -Promise.prototype._setIsMigrated = function () { - this._bitField = this._bitField | 4194304; -}; - -Promise.prototype._unsetIsMigrated = function () { - this._bitField = this._bitField & (~4194304); -}; - -Promise.prototype._isMigrated = function () { - return (this._bitField & 4194304) > 0; -}; - -Promise.prototype._receiverAt = function (index) { - var ret = index === 0 - ? this._receiver0 - : this[ - index * 5 - 5 + 4]; - if (ret === UNDEFINED_BINDING) { - return undefined; - } else if (ret === undefined && this._isBound()) { - return this._boundValue(); - } - return ret; -}; - -Promise.prototype._promiseAt = function (index) { - return index === 0 - ? this._promise0 - : this[index * 5 - 5 + 3]; -}; - -Promise.prototype._fulfillmentHandlerAt = function (index) { - return index === 0 - ? this._fulfillmentHandler0 - : this[index * 5 - 5 + 0]; -}; - -Promise.prototype._rejectionHandlerAt = function (index) { - return index === 0 - ? this._rejectionHandler0 - : this[index * 5 - 5 + 1]; -}; - -Promise.prototype._boundValue = function() { - var ret = this._boundTo; - if (ret !== undefined) { - if (ret instanceof Promise) { - if (ret.isFulfilled()) { - return ret.value(); - } else { - return undefined; - } - } - } - return ret; -}; - -Promise.prototype._migrateCallbacks = function (follower, index) { - var fulfill = follower._fulfillmentHandlerAt(index); - var reject = follower._rejectionHandlerAt(index); - var progress = follower._progressHandlerAt(index); - var promise = follower._promiseAt(index); - var receiver = follower._receiverAt(index); - if (promise instanceof Promise) promise._setIsMigrated(); - if (receiver === undefined) receiver = UNDEFINED_BINDING; - this._addCallbacks(fulfill, reject, progress, promise, receiver, null); -}; - -Promise.prototype._addCallbacks = function ( - fulfill, - reject, - progress, - promise, - receiver, - domain -) { - var index = this._length(); - - if (index >= 131071 - 5) { - index = 0; - this._setLength(0); - } - - if (index === 0) { - this._promise0 = promise; - if (receiver !== undefined) this._receiver0 = receiver; - if (typeof fulfill === "function" && !this._isCarryingStackTrace()) { - this._fulfillmentHandler0 = - domain === null ? fulfill : domain.bind(fulfill); - } - if (typeof reject === "function") { - this._rejectionHandler0 = - domain === null ? reject : domain.bind(reject); - } - if (typeof progress === "function") { - this._progressHandler0 = - domain === null ? progress : domain.bind(progress); - } - } else { - var base = index * 5 - 5; - this[base + 3] = promise; - this[base + 4] = receiver; - if (typeof fulfill === "function") { - this[base + 0] = - domain === null ? fulfill : domain.bind(fulfill); - } - if (typeof reject === "function") { - this[base + 1] = - domain === null ? reject : domain.bind(reject); - } - if (typeof progress === "function") { - this[base + 2] = - domain === null ? progress : domain.bind(progress); - } - } - this._setLength(index + 1); - return index; -}; - -Promise.prototype._setProxyHandlers = function (receiver, promiseSlotValue) { - var index = this._length(); - - if (index >= 131071 - 5) { - index = 0; - this._setLength(0); - } - if (index === 0) { - this._promise0 = promiseSlotValue; - this._receiver0 = receiver; - } else { - var base = index * 5 - 5; - this[base + 3] = promiseSlotValue; - this[base + 4] = receiver; - } - this._setLength(index + 1); -}; - -Promise.prototype._proxyPromiseArray = function (promiseArray, index) { - this._setProxyHandlers(promiseArray, index); -}; - -Promise.prototype._resolveCallback = function(value, shouldBind) { - if (this._isFollowingOrFulfilledOrRejected()) return; - if (value === this) - return this._rejectCallback(makeSelfResolutionError(), false, true); - var maybePromise = tryConvertToPromise(value, this); - if (!(maybePromise instanceof Promise)) return this._fulfill(value); - - var propagationFlags = 1 | (shouldBind ? 4 : 0); - this._propagateFrom(maybePromise, propagationFlags); - var promise = maybePromise._target(); - if (promise._isPending()) { - var len = this._length(); - for (var i = 0; i < len; ++i) { - promise._migrateCallbacks(this, i); - } - this._setFollowing(); - this._setLength(0); - this._setFollowee(promise); - } else if (promise._isFulfilled()) { - this._fulfillUnchecked(promise._value()); - } else { - this._rejectUnchecked(promise._reason(), - promise._getCarriedStackTrace()); - } -}; - -Promise.prototype._rejectCallback = -function(reason, synchronous, shouldNotMarkOriginatingFromRejection) { - if (!shouldNotMarkOriginatingFromRejection) { - util.markAsOriginatingFromRejection(reason); - } - var trace = util.ensureErrorObject(reason); - var hasStack = trace === reason; - this._attachExtraTrace(trace, synchronous ? hasStack : false); - this._reject(reason, hasStack ? undefined : trace); -}; - -Promise.prototype._resolveFromResolver = function (resolver) { - var promise = this; - this._captureStackTrace(); - this._pushContext(); - var synchronous = true; - var r = tryCatch(resolver)(function(value) { - if (promise === null) return; - promise._resolveCallback(value); - promise = null; - }, function (reason) { - if (promise === null) return; - promise._rejectCallback(reason, synchronous); - promise = null; - }); - synchronous = false; - this._popContext(); - - if (r !== undefined && r === errorObj && promise !== null) { - promise._rejectCallback(r.e, true, true); - promise = null; - } -}; - -Promise.prototype._settlePromiseFromHandler = function ( - handler, receiver, value, promise -) { - if (promise._isRejected()) return; - promise._pushContext(); - var x; - if (receiver === APPLY && !this._isRejected()) { - x = tryCatch(handler).apply(this._boundValue(), value); - } else { - x = tryCatch(handler).call(receiver, value); - } - promise._popContext(); - - if (x === errorObj || x === promise || x === NEXT_FILTER) { - var err = x === promise ? makeSelfResolutionError() : x.e; - promise._rejectCallback(err, false, true); - } else { - promise._resolveCallback(x); - } -}; - -Promise.prototype._target = function() { - var ret = this; - while (ret._isFollowing()) ret = ret._followee(); - return ret; -}; - -Promise.prototype._followee = function() { - return this._rejectionHandler0; -}; - -Promise.prototype._setFollowee = function(promise) { - this._rejectionHandler0 = promise; -}; - -Promise.prototype._cleanValues = function () { - if (this._cancellable()) { - this._cancellationParent = undefined; - } -}; - -Promise.prototype._propagateFrom = function (parent, flags) { - if ((flags & 1) > 0 && parent._cancellable()) { - this._setCancellable(); - this._cancellationParent = parent; - } - if ((flags & 4) > 0 && parent._isBound()) { - this._setBoundTo(parent._boundTo); - } -}; - -Promise.prototype._fulfill = function (value) { - if (this._isFollowingOrFulfilledOrRejected()) return; - this._fulfillUnchecked(value); -}; - -Promise.prototype._reject = function (reason, carriedStackTrace) { - if (this._isFollowingOrFulfilledOrRejected()) return; - this._rejectUnchecked(reason, carriedStackTrace); -}; - -Promise.prototype._settlePromiseAt = function (index) { - var promise = this._promiseAt(index); - var isPromise = promise instanceof Promise; - - if (isPromise && promise._isMigrated()) { - promise._unsetIsMigrated(); - return async.invoke(this._settlePromiseAt, this, index); - } - var handler = this._isFulfilled() - ? this._fulfillmentHandlerAt(index) - : this._rejectionHandlerAt(index); - - var carriedStackTrace = - this._isCarryingStackTrace() ? this._getCarriedStackTrace() : undefined; - var value = this._settledValue; - var receiver = this._receiverAt(index); - this._clearCallbackDataAtIndex(index); - - if (typeof handler === "function") { - if (!isPromise) { - handler.call(receiver, value, promise); - } else { - this._settlePromiseFromHandler(handler, receiver, value, promise); - } - } else if (receiver instanceof PromiseArray) { - if (!receiver._isResolved()) { - if (this._isFulfilled()) { - receiver._promiseFulfilled(value, promise); - } - else { - receiver._promiseRejected(value, promise); - } - } - } else if (isPromise) { - if (this._isFulfilled()) { - promise._fulfill(value); - } else { - promise._reject(value, carriedStackTrace); - } - } - - if (index >= 4 && (index & 31) === 4) - async.invokeLater(this._setLength, this, 0); -}; - -Promise.prototype._clearCallbackDataAtIndex = function(index) { - if (index === 0) { - if (!this._isCarryingStackTrace()) { - this._fulfillmentHandler0 = undefined; - } - this._rejectionHandler0 = - this._progressHandler0 = - this._receiver0 = - this._promise0 = undefined; - } else { - var base = index * 5 - 5; - this[base + 3] = - this[base + 4] = - this[base + 0] = - this[base + 1] = - this[base + 2] = undefined; - } -}; - -Promise.prototype._isSettlePromisesQueued = function () { - return (this._bitField & - -1073741824) === -1073741824; -}; - -Promise.prototype._setSettlePromisesQueued = function () { - this._bitField = this._bitField | -1073741824; -}; - -Promise.prototype._unsetSettlePromisesQueued = function () { - this._bitField = this._bitField & (~-1073741824); -}; - -Promise.prototype._queueSettlePromises = function() { - async.settlePromises(this); - this._setSettlePromisesQueued(); -}; - -Promise.prototype._fulfillUnchecked = function (value) { - if (value === this) { - var err = makeSelfResolutionError(); - this._attachExtraTrace(err); - return this._rejectUnchecked(err, undefined); - } - this._setFulfilled(); - this._settledValue = value; - this._cleanValues(); - - if (this._length() > 0) { - this._queueSettlePromises(); - } -}; - -Promise.prototype._rejectUncheckedCheckError = function (reason) { - var trace = util.ensureErrorObject(reason); - this._rejectUnchecked(reason, trace === reason ? undefined : trace); -}; - -Promise.prototype._rejectUnchecked = function (reason, trace) { - if (reason === this) { - var err = makeSelfResolutionError(); - this._attachExtraTrace(err); - return this._rejectUnchecked(err); - } - this._setRejected(); - this._settledValue = reason; - this._cleanValues(); - - if (this._isFinal()) { - async.throwLater(function(e) { - if ("stack" in e) { - async.invokeFirst( - CapturedTrace.unhandledRejection, undefined, e); - } - throw e; - }, trace === undefined ? reason : trace); - return; - } - - if (trace !== undefined && trace !== reason) { - this._setCarriedStackTrace(trace); - } - - if (this._length() > 0) { - this._queueSettlePromises(); - } else { - this._ensurePossibleRejectionHandled(); - } -}; - -Promise.prototype._settlePromises = function () { - this._unsetSettlePromisesQueued(); - var len = this._length(); - for (var i = 0; i < len; i++) { - this._settlePromiseAt(i); - } -}; - -util.notEnumerableProp(Promise, - "_makeSelfResolutionError", - makeSelfResolutionError); - -require("./progress.js")(Promise, PromiseArray); -require("./method.js")(Promise, INTERNAL, tryConvertToPromise, apiRejection); -require("./bind.js")(Promise, INTERNAL, tryConvertToPromise); -require("./finally.js")(Promise, NEXT_FILTER, tryConvertToPromise); -require("./direct_resolve.js")(Promise); -require("./synchronous_inspection.js")(Promise); -require("./join.js")(Promise, PromiseArray, tryConvertToPromise, INTERNAL); -Promise.Promise = Promise; -require('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL); -require('./cancel.js')(Promise); -require('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext); -require('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise); -require('./nodeify.js')(Promise); -require('./call_get.js')(Promise); -require('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); -require('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); -require('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL); -require('./settle.js')(Promise, PromiseArray); -require('./some.js')(Promise, PromiseArray, apiRejection); -require('./promisify.js')(Promise, INTERNAL); -require('./any.js')(Promise); -require('./each.js')(Promise, INTERNAL); -require('./timers.js')(Promise, INTERNAL); -require('./filter.js')(Promise, INTERNAL); - - util.toFastProperties(Promise); - util.toFastProperties(Promise.prototype); - function fillTypes(value) { - var p = new Promise(INTERNAL); - p._fulfillmentHandler0 = value; - p._rejectionHandler0 = value; - p._progressHandler0 = value; - p._promise0 = value; - p._receiver0 = value; - p._settledValue = value; - } - // Complete slack tracking, opt out of field-type tracking and - // stabilize map - fillTypes({a: 1}); - fillTypes({b: 2}); - fillTypes({c: 3}); - fillTypes(1); - fillTypes(function(){}); - fillTypes(undefined); - fillTypes(false); - fillTypes(new Promise(INTERNAL)); - CapturedTrace.setBounds(async.firstLineError, util.lastLineError); - return Promise; - -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise_array.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise_array.js deleted file mode 100644 index b2e8f1cc580c22..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise_array.js +++ /dev/null @@ -1,142 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL, tryConvertToPromise, - apiRejection) { -var util = require("./util.js"); -var isArray = util.isArray; - -function toResolutionValue(val) { - switch(val) { - case -2: return []; - case -3: return {}; - } -} - -function PromiseArray(values) { - var promise = this._promise = new Promise(INTERNAL); - var parent; - if (values instanceof Promise) { - parent = values; - promise._propagateFrom(parent, 1 | 4); - } - this._values = values; - this._length = 0; - this._totalResolved = 0; - this._init(undefined, -2); -} -PromiseArray.prototype.length = function () { - return this._length; -}; - -PromiseArray.prototype.promise = function () { - return this._promise; -}; - -PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { - var values = tryConvertToPromise(this._values, this._promise); - if (values instanceof Promise) { - values = values._target(); - this._values = values; - if (values._isFulfilled()) { - values = values._value(); - if (!isArray(values)) { - var err = new Promise.TypeError("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a"); - this.__hardReject__(err); - return; - } - } else if (values._isPending()) { - values._then( - init, - this._reject, - undefined, - this, - resolveValueIfEmpty - ); - return; - } else { - this._reject(values._reason()); - return; - } - } else if (!isArray(values)) { - this._promise._reject(apiRejection("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a")._reason()); - return; - } - - if (values.length === 0) { - if (resolveValueIfEmpty === -5) { - this._resolveEmptyArray(); - } - else { - this._resolve(toResolutionValue(resolveValueIfEmpty)); - } - return; - } - var len = this.getActualLength(values.length); - this._length = len; - this._values = this.shouldCopyValues() ? new Array(len) : this._values; - var promise = this._promise; - for (var i = 0; i < len; ++i) { - var isResolved = this._isResolved(); - var maybePromise = tryConvertToPromise(values[i], promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - if (isResolved) { - maybePromise._ignoreRejections(); - } else if (maybePromise._isPending()) { - maybePromise._proxyPromiseArray(this, i); - } else if (maybePromise._isFulfilled()) { - this._promiseFulfilled(maybePromise._value(), i); - } else { - this._promiseRejected(maybePromise._reason(), i); - } - } else if (!isResolved) { - this._promiseFulfilled(maybePromise, i); - } - } -}; - -PromiseArray.prototype._isResolved = function () { - return this._values === null; -}; - -PromiseArray.prototype._resolve = function (value) { - this._values = null; - this._promise._fulfill(value); -}; - -PromiseArray.prototype.__hardReject__ = -PromiseArray.prototype._reject = function (reason) { - this._values = null; - this._promise._rejectCallback(reason, false, true); -}; - -PromiseArray.prototype._promiseProgressed = function (progressValue, index) { - this._promise._progress({ - index: index, - value: progressValue - }); -}; - - -PromiseArray.prototype._promiseFulfilled = function (value, index) { - this._values[index] = value; - var totalResolved = ++this._totalResolved; - if (totalResolved >= this._length) { - this._resolve(this._values); - } -}; - -PromiseArray.prototype._promiseRejected = function (reason, index) { - this._totalResolved++; - this._reject(reason); -}; - -PromiseArray.prototype.shouldCopyValues = function () { - return true; -}; - -PromiseArray.prototype.getActualLength = function (len) { - return len; -}; - -return PromiseArray; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise_resolver.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise_resolver.js deleted file mode 100644 index b180a328037d8f..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise_resolver.js +++ /dev/null @@ -1,123 +0,0 @@ -"use strict"; -var util = require("./util.js"); -var maybeWrapAsError = util.maybeWrapAsError; -var errors = require("./errors.js"); -var TimeoutError = errors.TimeoutError; -var OperationalError = errors.OperationalError; -var haveGetters = util.haveGetters; -var es5 = require("./es5.js"); - -function isUntypedError(obj) { - return obj instanceof Error && - es5.getPrototypeOf(obj) === Error.prototype; -} - -var rErrorKey = /^(?:name|message|stack|cause)$/; -function wrapAsOperationalError(obj) { - var ret; - if (isUntypedError(obj)) { - ret = new OperationalError(obj); - ret.name = obj.name; - ret.message = obj.message; - ret.stack = obj.stack; - var keys = es5.keys(obj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (!rErrorKey.test(key)) { - ret[key] = obj[key]; - } - } - return ret; - } - util.markAsOriginatingFromRejection(obj); - return obj; -} - -function nodebackForPromise(promise) { - return function(err, value) { - if (promise === null) return; - - if (err) { - var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); - promise._attachExtraTrace(wrapped); - promise._reject(wrapped); - } else if (arguments.length > 2) { - var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];} - promise._fulfill(args); - } else { - promise._fulfill(value); - } - - promise = null; - }; -} - - -var PromiseResolver; -if (!haveGetters) { - PromiseResolver = function (promise) { - this.promise = promise; - this.asCallback = nodebackForPromise(promise); - this.callback = this.asCallback; - }; -} -else { - PromiseResolver = function (promise) { - this.promise = promise; - }; -} -if (haveGetters) { - var prop = { - get: function() { - return nodebackForPromise(this.promise); - } - }; - es5.defineProperty(PromiseResolver.prototype, "asCallback", prop); - es5.defineProperty(PromiseResolver.prototype, "callback", prop); -} - -PromiseResolver._nodebackForPromise = nodebackForPromise; - -PromiseResolver.prototype.toString = function () { - return "[object PromiseResolver]"; -}; - -PromiseResolver.prototype.resolve = -PromiseResolver.prototype.fulfill = function (value) { - if (!(this instanceof PromiseResolver)) { - throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a"); - } - this.promise._resolveCallback(value); -}; - -PromiseResolver.prototype.reject = function (reason) { - if (!(this instanceof PromiseResolver)) { - throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a"); - } - this.promise._rejectCallback(reason); -}; - -PromiseResolver.prototype.progress = function (value) { - if (!(this instanceof PromiseResolver)) { - throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a"); - } - this.promise._progress(value); -}; - -PromiseResolver.prototype.cancel = function (err) { - this.promise.cancel(err); -}; - -PromiseResolver.prototype.timeout = function () { - this.reject(new TimeoutError("timeout")); -}; - -PromiseResolver.prototype.isResolved = function () { - return this.promise.isResolved(); -}; - -PromiseResolver.prototype.toJSON = function () { - return this.promise.toJSON(); -}; - -module.exports = PromiseResolver; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promisify.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promisify.js deleted file mode 100644 index 86763d60bae2a8..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promisify.js +++ /dev/null @@ -1,307 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var THIS = {}; -var util = require("./util.js"); -var nodebackForPromise = require("./promise_resolver.js") - ._nodebackForPromise; -var withAppended = util.withAppended; -var maybeWrapAsError = util.maybeWrapAsError; -var canEvaluate = util.canEvaluate; -var TypeError = require("./errors").TypeError; -var defaultSuffix = "Async"; -var defaultPromisified = {__isPromisified__: true}; -var noCopyProps = [ - "arity", "length", - "name", - "arguments", - "caller", - "callee", - "prototype", - "__isPromisified__" -]; -var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); - -var defaultFilter = function(name) { - return util.isIdentifier(name) && - name.charAt(0) !== "_" && - name !== "constructor"; -}; - -function propsFilter(key) { - return !noCopyPropsPattern.test(key); -} - -function isPromisified(fn) { - try { - return fn.__isPromisified__ === true; - } - catch (e) { - return false; - } -} - -function hasPromisified(obj, key, suffix) { - var val = util.getDataPropertyOrDefault(obj, key + suffix, - defaultPromisified); - return val ? isPromisified(val) : false; -} -function checkValid(ret, suffix, suffixRegexp) { - for (var i = 0; i < ret.length; i += 2) { - var key = ret[i]; - if (suffixRegexp.test(key)) { - var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); - for (var j = 0; j < ret.length; j += 2) { - if (ret[j] === keyWithoutAsyncSuffix) { - throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/iWrZbw\u000a" - .replace("%s", suffix)); - } - } - } - } -} - -function promisifiableMethods(obj, suffix, suffixRegexp, filter) { - var keys = util.inheritedDataKeys(obj); - var ret = []; - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var value = obj[key]; - var passesDefaultFilter = filter === defaultFilter - ? true : defaultFilter(key, value, obj); - if (typeof value === "function" && - !isPromisified(value) && - !hasPromisified(obj, key, suffix) && - filter(key, value, obj, passesDefaultFilter)) { - ret.push(key, value); - } - } - checkValid(ret, suffix, suffixRegexp); - return ret; -} - -var escapeIdentRegex = function(str) { - return str.replace(/([$])/, "\\$"); -}; - -var makeNodePromisifiedEval; -if (!false) { -var switchCaseArgumentOrder = function(likelyArgumentCount) { - var ret = [likelyArgumentCount]; - var min = Math.max(0, likelyArgumentCount - 1 - 3); - for(var i = likelyArgumentCount - 1; i >= min; --i) { - ret.push(i); - } - for(var i = likelyArgumentCount + 1; i <= 3; ++i) { - ret.push(i); - } - return ret; -}; - -var argumentSequence = function(argumentCount) { - return util.filledRange(argumentCount, "_arg", ""); -}; - -var parameterDeclaration = function(parameterCount) { - return util.filledRange( - Math.max(parameterCount, 3), "_arg", ""); -}; - -var parameterCount = function(fn) { - if (typeof fn.length === "number") { - return Math.max(Math.min(fn.length, 1023 + 1), 0); - } - return 0; -}; - -makeNodePromisifiedEval = -function(callback, receiver, originalName, fn) { - var newParameterCount = Math.max(0, parameterCount(fn) - 1); - var argumentOrder = switchCaseArgumentOrder(newParameterCount); - var shouldProxyThis = typeof callback === "string" || receiver === THIS; - - function generateCallForArgumentCount(count) { - var args = argumentSequence(count).join(", "); - var comma = count > 0 ? ", " : ""; - var ret; - if (shouldProxyThis) { - ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; - } else { - ret = receiver === undefined - ? "ret = callback({{args}}, nodeback); break;\n" - : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; - } - return ret.replace("{{args}}", args).replace(", ", comma); - } - - function generateArgumentSwitchCase() { - var ret = ""; - for (var i = 0; i < argumentOrder.length; ++i) { - ret += "case " + argumentOrder[i] +":" + - generateCallForArgumentCount(argumentOrder[i]); - } - - ret += " \n\ - default: \n\ - var args = new Array(len + 1); \n\ - var i = 0; \n\ - for (var i = 0; i < len; ++i) { \n\ - args[i] = arguments[i]; \n\ - } \n\ - args[i] = nodeback; \n\ - [CodeForCall] \n\ - break; \n\ - ".replace("[CodeForCall]", (shouldProxyThis - ? "ret = callback.apply(this, args);\n" - : "ret = callback.apply(receiver, args);\n")); - return ret; - } - - var getFunctionCode = typeof callback === "string" - ? ("this != null ? this['"+callback+"'] : fn") - : "fn"; - - return new Function("Promise", - "fn", - "receiver", - "withAppended", - "maybeWrapAsError", - "nodebackForPromise", - "tryCatch", - "errorObj", - "notEnumerableProp", - "INTERNAL","'use strict'; \n\ - var ret = function (Parameters) { \n\ - 'use strict'; \n\ - var len = arguments.length; \n\ - var promise = new Promise(INTERNAL); \n\ - promise._captureStackTrace(); \n\ - var nodeback = nodebackForPromise(promise); \n\ - var ret; \n\ - var callback = tryCatch([GetFunctionCode]); \n\ - switch(len) { \n\ - [CodeForSwitchCase] \n\ - } \n\ - if (ret === errorObj) { \n\ - promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ - } \n\ - return promise; \n\ - }; \n\ - notEnumerableProp(ret, '__isPromisified__', true); \n\ - return ret; \n\ - " - .replace("Parameters", parameterDeclaration(newParameterCount)) - .replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) - .replace("[GetFunctionCode]", getFunctionCode))( - Promise, - fn, - receiver, - withAppended, - maybeWrapAsError, - nodebackForPromise, - util.tryCatch, - util.errorObj, - util.notEnumerableProp, - INTERNAL - ); -}; -} - -function makeNodePromisifiedClosure(callback, receiver, _, fn) { - var defaultThis = (function() {return this;})(); - var method = callback; - if (typeof method === "string") { - callback = fn; - } - function promisified() { - var _receiver = receiver; - if (receiver === THIS) _receiver = this; - var promise = new Promise(INTERNAL); - promise._captureStackTrace(); - var cb = typeof method === "string" && this !== defaultThis - ? this[method] : callback; - var fn = nodebackForPromise(promise); - try { - cb.apply(_receiver, withAppended(arguments, fn)); - } catch(e) { - promise._rejectCallback(maybeWrapAsError(e), true, true); - } - return promise; - } - util.notEnumerableProp(promisified, "__isPromisified__", true); - return promisified; -} - -var makeNodePromisified = canEvaluate - ? makeNodePromisifiedEval - : makeNodePromisifiedClosure; - -function promisifyAll(obj, suffix, filter, promisifier) { - var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); - var methods = - promisifiableMethods(obj, suffix, suffixRegexp, filter); - - for (var i = 0, len = methods.length; i < len; i+= 2) { - var key = methods[i]; - var fn = methods[i+1]; - var promisifiedKey = key + suffix; - if (promisifier === makeNodePromisified) { - obj[promisifiedKey] = - makeNodePromisified(key, THIS, key, fn, suffix); - } else { - var promisified = promisifier(fn, function() { - return makeNodePromisified(key, THIS, key, fn, suffix); - }); - util.notEnumerableProp(promisified, "__isPromisified__", true); - obj[promisifiedKey] = promisified; - } - } - util.toFastProperties(obj); - return obj; -} - -function promisify(callback, receiver) { - return makeNodePromisified(callback, receiver, undefined, callback); -} - -Promise.promisify = function (fn, receiver) { - if (typeof fn !== "function") { - throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - } - if (isPromisified(fn)) { - return fn; - } - var ret = promisify(fn, arguments.length < 2 ? THIS : receiver); - util.copyDescriptors(fn, ret, propsFilter); - return ret; -}; - -Promise.promisifyAll = function (target, options) { - if (typeof target !== "function" && typeof target !== "object") { - throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/9ITlV0\u000a"); - } - options = Object(options); - var suffix = options.suffix; - if (typeof suffix !== "string") suffix = defaultSuffix; - var filter = options.filter; - if (typeof filter !== "function") filter = defaultFilter; - var promisifier = options.promisifier; - if (typeof promisifier !== "function") promisifier = makeNodePromisified; - - if (!util.isIdentifier(suffix)) { - throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/8FZo5V\u000a"); - } - - var keys = util.inheritedDataKeys(target); - for (var i = 0; i < keys.length; ++i) { - var value = target[keys[i]]; - if (keys[i] !== "constructor" && - util.isClass(value)) { - promisifyAll(value.prototype, suffix, filter, promisifier); - promisifyAll(value, suffix, filter, promisifier); - } - } - - return promisifyAll(target, suffix, filter, promisifier); -}; -}; - diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/props.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/props.js deleted file mode 100644 index d6f9e64b074f28..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/props.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -module.exports = function( - Promise, PromiseArray, tryConvertToPromise, apiRejection) { -var util = require("./util.js"); -var isObject = util.isObject; -var es5 = require("./es5.js"); - -function PropertiesPromiseArray(obj) { - var keys = es5.keys(obj); - var len = keys.length; - var values = new Array(len * 2); - for (var i = 0; i < len; ++i) { - var key = keys[i]; - values[i] = obj[key]; - values[i + len] = key; - } - this.constructor$(values); -} -util.inherits(PropertiesPromiseArray, PromiseArray); - -PropertiesPromiseArray.prototype._init = function () { - this._init$(undefined, -3) ; -}; - -PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { - this._values[index] = value; - var totalResolved = ++this._totalResolved; - if (totalResolved >= this._length) { - var val = {}; - var keyOffset = this.length(); - for (var i = 0, len = this.length(); i < len; ++i) { - val[this._values[i + keyOffset]] = this._values[i]; - } - this._resolve(val); - } -}; - -PropertiesPromiseArray.prototype._promiseProgressed = function (value, index) { - this._promise._progress({ - key: this._values[index + this.length()], - value: value - }); -}; - -PropertiesPromiseArray.prototype.shouldCopyValues = function () { - return false; -}; - -PropertiesPromiseArray.prototype.getActualLength = function (len) { - return len >> 1; -}; - -function props(promises) { - var ret; - var castValue = tryConvertToPromise(promises); - - if (!isObject(castValue)) { - return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/OsFKC8\u000a"); - } else if (castValue instanceof Promise) { - ret = castValue._then( - Promise.props, undefined, undefined, undefined, undefined); - } else { - ret = new PropertiesPromiseArray(castValue).promise(); - } - - if (castValue instanceof Promise) { - ret._propagateFrom(castValue, 4); - } - return ret; -} - -Promise.prototype.props = function () { - return props(this); -}; - -Promise.props = function (promises) { - return props(promises); -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/queue.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/queue.js deleted file mode 100644 index 84d57d5f62da4b..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/queue.js +++ /dev/null @@ -1,90 +0,0 @@ -"use strict"; -function arrayMove(src, srcIndex, dst, dstIndex, len) { - for (var j = 0; j < len; ++j) { - dst[j + dstIndex] = src[j + srcIndex]; - src[j + srcIndex] = void 0; - } -} - -function Queue(capacity) { - this._capacity = capacity; - this._length = 0; - this._front = 0; -} - -Queue.prototype._willBeOverCapacity = function (size) { - return this._capacity < size; -}; - -Queue.prototype._pushOne = function (arg) { - var length = this.length(); - this._checkCapacity(length + 1); - var i = (this._front + length) & (this._capacity - 1); - this[i] = arg; - this._length = length + 1; -}; - -Queue.prototype._unshiftOne = function(value) { - var capacity = this._capacity; - this._checkCapacity(this.length() + 1); - var front = this._front; - var i = (((( front - 1 ) & - ( capacity - 1) ) ^ capacity ) - capacity ); - this[i] = value; - this._front = i; - this._length = this.length() + 1; -}; - -Queue.prototype.unshift = function(fn, receiver, arg) { - this._unshiftOne(arg); - this._unshiftOne(receiver); - this._unshiftOne(fn); -}; - -Queue.prototype.push = function (fn, receiver, arg) { - var length = this.length() + 3; - if (this._willBeOverCapacity(length)) { - this._pushOne(fn); - this._pushOne(receiver); - this._pushOne(arg); - return; - } - var j = this._front + length - 3; - this._checkCapacity(length); - var wrapMask = this._capacity - 1; - this[(j + 0) & wrapMask] = fn; - this[(j + 1) & wrapMask] = receiver; - this[(j + 2) & wrapMask] = arg; - this._length = length; -}; - -Queue.prototype.shift = function () { - var front = this._front, - ret = this[front]; - - this[front] = undefined; - this._front = (front + 1) & (this._capacity - 1); - this._length--; - return ret; -}; - -Queue.prototype.length = function () { - return this._length; -}; - -Queue.prototype._checkCapacity = function (size) { - if (this._capacity < size) { - this._resizeTo(this._capacity << 1); - } -}; - -Queue.prototype._resizeTo = function (capacity) { - var oldCapacity = this._capacity; - this._capacity = capacity; - var front = this._front; - var length = this._length; - var moveItemsCount = (front + length) & (oldCapacity - 1); - arrayMove(this, 0, this, oldCapacity, moveItemsCount); -}; - -module.exports = Queue; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/race.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/race.js deleted file mode 100644 index 30e7bb094ea664..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/race.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -module.exports = function( - Promise, INTERNAL, tryConvertToPromise, apiRejection) { -var isArray = require("./util.js").isArray; - -var raceLater = function (promise) { - return promise.then(function(array) { - return race(array, promise); - }); -}; - -function race(promises, parent) { - var maybePromise = tryConvertToPromise(promises); - - if (maybePromise instanceof Promise) { - return raceLater(maybePromise); - } else if (!isArray(promises)) { - return apiRejection("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a"); - } - - var ret = new Promise(INTERNAL); - if (parent !== undefined) { - ret._propagateFrom(parent, 4 | 1); - } - var fulfill = ret._fulfill; - var reject = ret._reject; - for (var i = 0, len = promises.length; i < len; ++i) { - var val = promises[i]; - - if (val === undefined && !(i in promises)) { - continue; - } - - Promise.cast(val)._then(fulfill, reject, undefined, ret, null); - } - return ret; -} - -Promise.race = function (promises) { - return race(promises, undefined); -}; - -Promise.prototype.race = function () { - return race(this, undefined); -}; - -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/reduce.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/reduce.js deleted file mode 100644 index 1f92dafacd6856..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/reduce.js +++ /dev/null @@ -1,148 +0,0 @@ -"use strict"; -module.exports = function(Promise, - PromiseArray, - apiRejection, - tryConvertToPromise, - INTERNAL) { -var getDomain = Promise._getDomain; -var async = require("./async.js"); -var util = require("./util.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -function ReductionPromiseArray(promises, fn, accum, _each) { - this.constructor$(promises); - this._promise._captureStackTrace(); - this._preservedValues = _each === INTERNAL ? [] : null; - this._zerothIsAccum = (accum === undefined); - this._gotAccum = false; - this._reducingIndex = (this._zerothIsAccum ? 1 : 0); - this._valuesPhase = undefined; - var maybePromise = tryConvertToPromise(accum, this._promise); - var rejected = false; - var isPromise = maybePromise instanceof Promise; - if (isPromise) { - maybePromise = maybePromise._target(); - if (maybePromise._isPending()) { - maybePromise._proxyPromiseArray(this, -1); - } else if (maybePromise._isFulfilled()) { - accum = maybePromise._value(); - this._gotAccum = true; - } else { - this._reject(maybePromise._reason()); - rejected = true; - } - } - if (!(isPromise || this._zerothIsAccum)) this._gotAccum = true; - var domain = getDomain(); - this._callback = domain === null ? fn : domain.bind(fn); - this._accum = accum; - if (!rejected) async.invoke(init, this, undefined); -} -function init() { - this._init$(undefined, -5); -} -util.inherits(ReductionPromiseArray, PromiseArray); - -ReductionPromiseArray.prototype._init = function () {}; - -ReductionPromiseArray.prototype._resolveEmptyArray = function () { - if (this._gotAccum || this._zerothIsAccum) { - this._resolve(this._preservedValues !== null - ? [] : this._accum); - } -}; - -ReductionPromiseArray.prototype._promiseFulfilled = function (value, index) { - var values = this._values; - values[index] = value; - var length = this.length(); - var preservedValues = this._preservedValues; - var isEach = preservedValues !== null; - var gotAccum = this._gotAccum; - var valuesPhase = this._valuesPhase; - var valuesPhaseIndex; - if (!valuesPhase) { - valuesPhase = this._valuesPhase = new Array(length); - for (valuesPhaseIndex=0; valuesPhaseIndex= this._length) { - this._resolve(this._values); - } -}; - -SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { - var ret = new PromiseInspection(); - ret._bitField = 268435456; - ret._settledValue = value; - this._promiseResolved(index, ret); -}; -SettledPromiseArray.prototype._promiseRejected = function (reason, index) { - var ret = new PromiseInspection(); - ret._bitField = 134217728; - ret._settledValue = reason; - this._promiseResolved(index, ret); -}; - -Promise.settle = function (promises) { - return new SettledPromiseArray(promises).promise(); -}; - -Promise.prototype.settle = function () { - return new SettledPromiseArray(this).promise(); -}; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/some.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/some.js deleted file mode 100644 index f3968cf1fadc2c..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/some.js +++ /dev/null @@ -1,125 +0,0 @@ -"use strict"; -module.exports = -function(Promise, PromiseArray, apiRejection) { -var util = require("./util.js"); -var RangeError = require("./errors.js").RangeError; -var AggregateError = require("./errors.js").AggregateError; -var isArray = util.isArray; - - -function SomePromiseArray(values) { - this.constructor$(values); - this._howMany = 0; - this._unwrap = false; - this._initialized = false; -} -util.inherits(SomePromiseArray, PromiseArray); - -SomePromiseArray.prototype._init = function () { - if (!this._initialized) { - return; - } - if (this._howMany === 0) { - this._resolve([]); - return; - } - this._init$(undefined, -5); - var isArrayResolved = isArray(this._values); - if (!this._isResolved() && - isArrayResolved && - this._howMany > this._canPossiblyFulfill()) { - this._reject(this._getRangeError(this.length())); - } -}; - -SomePromiseArray.prototype.init = function () { - this._initialized = true; - this._init(); -}; - -SomePromiseArray.prototype.setUnwrap = function () { - this._unwrap = true; -}; - -SomePromiseArray.prototype.howMany = function () { - return this._howMany; -}; - -SomePromiseArray.prototype.setHowMany = function (count) { - this._howMany = count; -}; - -SomePromiseArray.prototype._promiseFulfilled = function (value) { - this._addFulfilled(value); - if (this._fulfilled() === this.howMany()) { - this._values.length = this.howMany(); - if (this.howMany() === 1 && this._unwrap) { - this._resolve(this._values[0]); - } else { - this._resolve(this._values); - } - } - -}; -SomePromiseArray.prototype._promiseRejected = function (reason) { - this._addRejected(reason); - if (this.howMany() > this._canPossiblyFulfill()) { - var e = new AggregateError(); - for (var i = this.length(); i < this._values.length; ++i) { - e.push(this._values[i]); - } - this._reject(e); - } -}; - -SomePromiseArray.prototype._fulfilled = function () { - return this._totalResolved; -}; - -SomePromiseArray.prototype._rejected = function () { - return this._values.length - this.length(); -}; - -SomePromiseArray.prototype._addRejected = function (reason) { - this._values.push(reason); -}; - -SomePromiseArray.prototype._addFulfilled = function (value) { - this._values[this._totalResolved++] = value; -}; - -SomePromiseArray.prototype._canPossiblyFulfill = function () { - return this.length() - this._rejected(); -}; - -SomePromiseArray.prototype._getRangeError = function (count) { - var message = "Input array must contain at least " + - this._howMany + " items but contains only " + count + " items"; - return new RangeError(message); -}; - -SomePromiseArray.prototype._resolveEmptyArray = function () { - this._reject(this._getRangeError(0)); -}; - -function some(promises, howMany) { - if ((howMany | 0) !== howMany || howMany < 0) { - return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/1wAmHx\u000a"); - } - var ret = new SomePromiseArray(promises); - var promise = ret.promise(); - ret.setHowMany(howMany); - ret.init(); - return promise; -} - -Promise.some = function (promises, howMany) { - return some(promises, howMany); -}; - -Promise.prototype.some = function (howMany) { - return some(this, howMany); -}; - -Promise._SomePromiseArray = SomePromiseArray; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/synchronous_inspection.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/synchronous_inspection.js deleted file mode 100644 index 7aac1496d5f4f0..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/synchronous_inspection.js +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; -module.exports = function(Promise) { -function PromiseInspection(promise) { - if (promise !== undefined) { - promise = promise._target(); - this._bitField = promise._bitField; - this._settledValue = promise._settledValue; - } - else { - this._bitField = 0; - this._settledValue = undefined; - } -} - -PromiseInspection.prototype.value = function () { - if (!this.isFulfilled()) { - throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/hc1DLj\u000a"); - } - return this._settledValue; -}; - -PromiseInspection.prototype.error = -PromiseInspection.prototype.reason = function () { - if (!this.isRejected()) { - throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/hPuiwB\u000a"); - } - return this._settledValue; -}; - -PromiseInspection.prototype.isFulfilled = -Promise.prototype._isFulfilled = function () { - return (this._bitField & 268435456) > 0; -}; - -PromiseInspection.prototype.isRejected = -Promise.prototype._isRejected = function () { - return (this._bitField & 134217728) > 0; -}; - -PromiseInspection.prototype.isPending = -Promise.prototype._isPending = function () { - return (this._bitField & 402653184) === 0; -}; - -PromiseInspection.prototype.isResolved = -Promise.prototype._isResolved = function () { - return (this._bitField & 402653184) > 0; -}; - -Promise.prototype.isPending = function() { - return this._target()._isPending(); -}; - -Promise.prototype.isRejected = function() { - return this._target()._isRejected(); -}; - -Promise.prototype.isFulfilled = function() { - return this._target()._isFulfilled(); -}; - -Promise.prototype.isResolved = function() { - return this._target()._isResolved(); -}; - -Promise.prototype._value = function() { - return this._settledValue; -}; - -Promise.prototype._reason = function() { - this._unsetRejectionIsUnhandled(); - return this._settledValue; -}; - -Promise.prototype.value = function() { - var target = this._target(); - if (!target.isFulfilled()) { - throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/hc1DLj\u000a"); - } - return target._settledValue; -}; - -Promise.prototype.reason = function() { - var target = this._target(); - if (!target.isRejected()) { - throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/hPuiwB\u000a"); - } - target._unsetRejectionIsUnhandled(); - return target._settledValue; -}; - - -Promise.PromiseInspection = PromiseInspection; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/thenables.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/thenables.js deleted file mode 100644 index eadfffb59d76f4..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/thenables.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var util = require("./util.js"); -var errorObj = util.errorObj; -var isObject = util.isObject; - -function tryConvertToPromise(obj, context) { - if (isObject(obj)) { - if (obj instanceof Promise) { - return obj; - } - else if (isAnyBluebirdPromise(obj)) { - var ret = new Promise(INTERNAL); - obj._then( - ret._fulfillUnchecked, - ret._rejectUncheckedCheckError, - ret._progressUnchecked, - ret, - null - ); - return ret; - } - var then = util.tryCatch(getThen)(obj); - if (then === errorObj) { - if (context) context._pushContext(); - var ret = Promise.reject(then.e); - if (context) context._popContext(); - return ret; - } else if (typeof then === "function") { - return doThenable(obj, then, context); - } - } - return obj; -} - -function getThen(obj) { - return obj.then; -} - -var hasProp = {}.hasOwnProperty; -function isAnyBluebirdPromise(obj) { - return hasProp.call(obj, "_promise0"); -} - -function doThenable(x, then, context) { - var promise = new Promise(INTERNAL); - var ret = promise; - if (context) context._pushContext(); - promise._captureStackTrace(); - if (context) context._popContext(); - var synchronous = true; - var result = util.tryCatch(then).call(x, - resolveFromThenable, - rejectFromThenable, - progressFromThenable); - synchronous = false; - if (promise && result === errorObj) { - promise._rejectCallback(result.e, true, true); - promise = null; - } - - function resolveFromThenable(value) { - if (!promise) return; - promise._resolveCallback(value); - promise = null; - } - - function rejectFromThenable(reason) { - if (!promise) return; - promise._rejectCallback(reason, synchronous, true); - promise = null; - } - - function progressFromThenable(value) { - if (!promise) return; - if (typeof promise._progress === "function") { - promise._progress(value); - } - } - return ret; -} - -return tryConvertToPromise; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/timers.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/timers.js deleted file mode 100644 index ecf1b57658af5f..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/timers.js +++ /dev/null @@ -1,58 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var util = require("./util.js"); -var TimeoutError = Promise.TimeoutError; - -var afterTimeout = function (promise, message) { - if (!promise.isPending()) return; - if (typeof message !== "string") { - message = "operation timed out"; - } - var err = new TimeoutError(message); - util.markAsOriginatingFromRejection(err); - promise._attachExtraTrace(err); - promise._cancel(err); -}; - -var afterValue = function(value) { return delay(+this).thenReturn(value); }; -var delay = Promise.delay = function (value, ms) { - if (ms === undefined) { - ms = value; - value = undefined; - var ret = new Promise(INTERNAL); - setTimeout(function() { ret._fulfill(); }, ms); - return ret; - } - ms = +ms; - return Promise.resolve(value)._then(afterValue, null, null, ms, undefined); -}; - -Promise.prototype.delay = function (ms) { - return delay(this, ms); -}; - -function successClear(value) { - var handle = this; - if (handle instanceof Number) handle = +handle; - clearTimeout(handle); - return value; -} - -function failureClear(reason) { - var handle = this; - if (handle instanceof Number) handle = +handle; - clearTimeout(handle); - throw reason; -} - -Promise.prototype.timeout = function (ms, message) { - ms = +ms; - var ret = this.then().cancellable(); - ret._cancellationParent = this; - var handle = setTimeout(function timeoutTimeout() { - afterTimeout(ret, message); - }, ms); - return ret._then(successClear, failureClear, undefined, handle, undefined); -}; - -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/using.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/using.js deleted file mode 100644 index 957182d093cafd..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/using.js +++ /dev/null @@ -1,213 +0,0 @@ -"use strict"; -module.exports = function (Promise, apiRejection, tryConvertToPromise, - createContext) { - var TypeError = require("./errors.js").TypeError; - var inherits = require("./util.js").inherits; - var PromiseInspection = Promise.PromiseInspection; - - function inspectionMapper(inspections) { - var len = inspections.length; - for (var i = 0; i < len; ++i) { - var inspection = inspections[i]; - if (inspection.isRejected()) { - return Promise.reject(inspection.error()); - } - inspections[i] = inspection._settledValue; - } - return inspections; - } - - function thrower(e) { - setTimeout(function(){throw e;}, 0); - } - - function castPreservingDisposable(thenable) { - var maybePromise = tryConvertToPromise(thenable); - if (maybePromise !== thenable && - typeof thenable._isDisposable === "function" && - typeof thenable._getDisposer === "function" && - thenable._isDisposable()) { - maybePromise._setDisposable(thenable._getDisposer()); - } - return maybePromise; - } - function dispose(resources, inspection) { - var i = 0; - var len = resources.length; - var ret = Promise.defer(); - function iterator() { - if (i >= len) return ret.resolve(); - var maybePromise = castPreservingDisposable(resources[i++]); - if (maybePromise instanceof Promise && - maybePromise._isDisposable()) { - try { - maybePromise = tryConvertToPromise( - maybePromise._getDisposer().tryDispose(inspection), - resources.promise); - } catch (e) { - return thrower(e); - } - if (maybePromise instanceof Promise) { - return maybePromise._then(iterator, thrower, - null, null, null); - } - } - iterator(); - } - iterator(); - return ret.promise; - } - - function disposerSuccess(value) { - var inspection = new PromiseInspection(); - inspection._settledValue = value; - inspection._bitField = 268435456; - return dispose(this, inspection).thenReturn(value); - } - - function disposerFail(reason) { - var inspection = new PromiseInspection(); - inspection._settledValue = reason; - inspection._bitField = 134217728; - return dispose(this, inspection).thenThrow(reason); - } - - function Disposer(data, promise, context) { - this._data = data; - this._promise = promise; - this._context = context; - } - - Disposer.prototype.data = function () { - return this._data; - }; - - Disposer.prototype.promise = function () { - return this._promise; - }; - - Disposer.prototype.resource = function () { - if (this.promise().isFulfilled()) { - return this.promise().value(); - } - return null; - }; - - Disposer.prototype.tryDispose = function(inspection) { - var resource = this.resource(); - var context = this._context; - if (context !== undefined) context._pushContext(); - var ret = resource !== null - ? this.doDispose(resource, inspection) : null; - if (context !== undefined) context._popContext(); - this._promise._unsetDisposable(); - this._data = null; - return ret; - }; - - Disposer.isDisposer = function (d) { - return (d != null && - typeof d.resource === "function" && - typeof d.tryDispose === "function"); - }; - - function FunctionDisposer(fn, promise, context) { - this.constructor$(fn, promise, context); - } - inherits(FunctionDisposer, Disposer); - - FunctionDisposer.prototype.doDispose = function (resource, inspection) { - var fn = this.data(); - return fn.call(resource, resource, inspection); - }; - - function maybeUnwrapDisposer(value) { - if (Disposer.isDisposer(value)) { - this.resources[this.index]._setDisposable(value); - return value.promise(); - } - return value; - } - - Promise.using = function () { - var len = arguments.length; - if (len < 2) return apiRejection( - "you must pass at least 2 arguments to Promise.using"); - var fn = arguments[len - 1]; - if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - - var input; - var spreadArgs = true; - if (len === 2 && Array.isArray(arguments[0])) { - input = arguments[0]; - len = input.length; - spreadArgs = false; - } else { - input = arguments; - len--; - } - var resources = new Array(len); - for (var i = 0; i < len; ++i) { - var resource = input[i]; - if (Disposer.isDisposer(resource)) { - var disposer = resource; - resource = resource.promise(); - resource._setDisposable(disposer); - } else { - var maybePromise = tryConvertToPromise(resource); - if (maybePromise instanceof Promise) { - resource = - maybePromise._then(maybeUnwrapDisposer, null, null, { - resources: resources, - index: i - }, undefined); - } - } - resources[i] = resource; - } - - var promise = Promise.settle(resources) - .then(inspectionMapper) - .then(function(vals) { - promise._pushContext(); - var ret; - try { - ret = spreadArgs - ? fn.apply(undefined, vals) : fn.call(undefined, vals); - } finally { - promise._popContext(); - } - return ret; - }) - ._then( - disposerSuccess, disposerFail, undefined, resources, undefined); - resources.promise = promise; - return promise; - }; - - Promise.prototype._setDisposable = function (disposer) { - this._bitField = this._bitField | 262144; - this._disposer = disposer; - }; - - Promise.prototype._isDisposable = function () { - return (this._bitField & 262144) > 0; - }; - - Promise.prototype._getDisposer = function () { - return this._disposer; - }; - - Promise.prototype._unsetDisposable = function () { - this._bitField = this._bitField & (~262144); - this._disposer = undefined; - }; - - Promise.prototype.disposer = function (fn) { - if (typeof fn === "function") { - return new FunctionDisposer(fn, this, createContext()); - } - throw new TypeError(); - }; - -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/util.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/util.js deleted file mode 100644 index ea3934471ed7ef..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/util.js +++ /dev/null @@ -1,321 +0,0 @@ -"use strict"; -var es5 = require("./es5.js"); -var canEvaluate = typeof navigator == "undefined"; -var haveGetters = (function(){ - try { - var o = {}; - es5.defineProperty(o, "f", { - get: function () { - return 3; - } - }); - return o.f === 3; - } - catch (e) { - return false; - } - -})(); - -var errorObj = {e: {}}; -var tryCatchTarget; -function tryCatcher() { - try { - var target = tryCatchTarget; - tryCatchTarget = null; - return target.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } -} -function tryCatch(fn) { - tryCatchTarget = fn; - return tryCatcher; -} - -var inherits = function(Child, Parent) { - var hasProp = {}.hasOwnProperty; - - function T() { - this.constructor = Child; - this.constructor$ = Parent; - for (var propertyName in Parent.prototype) { - if (hasProp.call(Parent.prototype, propertyName) && - propertyName.charAt(propertyName.length-1) !== "$" - ) { - this[propertyName + "$"] = Parent.prototype[propertyName]; - } - } - } - T.prototype = Parent.prototype; - Child.prototype = new T(); - return Child.prototype; -}; - - -function isPrimitive(val) { - return val == null || val === true || val === false || - typeof val === "string" || typeof val === "number"; - -} - -function isObject(value) { - return !isPrimitive(value); -} - -function maybeWrapAsError(maybeError) { - if (!isPrimitive(maybeError)) return maybeError; - - return new Error(safeToString(maybeError)); -} - -function withAppended(target, appendee) { - var len = target.length; - var ret = new Array(len + 1); - var i; - for (i = 0; i < len; ++i) { - ret[i] = target[i]; - } - ret[i] = appendee; - return ret; -} - -function getDataPropertyOrDefault(obj, key, defaultValue) { - if (es5.isES5) { - var desc = Object.getOwnPropertyDescriptor(obj, key); - - if (desc != null) { - return desc.get == null && desc.set == null - ? desc.value - : defaultValue; - } - } else { - return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; - } -} - -function notEnumerableProp(obj, name, value) { - if (isPrimitive(obj)) return obj; - var descriptor = { - value: value, - configurable: true, - enumerable: false, - writable: true - }; - es5.defineProperty(obj, name, descriptor); - return obj; -} - -function thrower(r) { - throw r; -} - -var inheritedDataKeys = (function() { - var excludedPrototypes = [ - Array.prototype, - Object.prototype, - Function.prototype - ]; - - var isExcludedProto = function(val) { - for (var i = 0; i < excludedPrototypes.length; ++i) { - if (excludedPrototypes[i] === val) { - return true; - } - } - return false; - }; - - if (es5.isES5) { - var getKeys = Object.getOwnPropertyNames; - return function(obj) { - var ret = []; - var visitedKeys = Object.create(null); - while (obj != null && !isExcludedProto(obj)) { - var keys; - try { - keys = getKeys(obj); - } catch (e) { - return ret; - } - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (visitedKeys[key]) continue; - visitedKeys[key] = true; - var desc = Object.getOwnPropertyDescriptor(obj, key); - if (desc != null && desc.get == null && desc.set == null) { - ret.push(key); - } - } - obj = es5.getPrototypeOf(obj); - } - return ret; - }; - } else { - var hasProp = {}.hasOwnProperty; - return function(obj) { - if (isExcludedProto(obj)) return []; - var ret = []; - - /*jshint forin:false */ - enumeration: for (var key in obj) { - if (hasProp.call(obj, key)) { - ret.push(key); - } else { - for (var i = 0; i < excludedPrototypes.length; ++i) { - if (hasProp.call(excludedPrototypes[i], key)) { - continue enumeration; - } - } - ret.push(key); - } - } - return ret; - }; - } - -})(); - -var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; -function isClass(fn) { - try { - if (typeof fn === "function") { - var keys = es5.names(fn.prototype); - - var hasMethods = es5.isES5 && keys.length > 1; - var hasMethodsOtherThanConstructor = keys.length > 0 && - !(keys.length === 1 && keys[0] === "constructor"); - var hasThisAssignmentAndStaticMethods = - thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; - - if (hasMethods || hasMethodsOtherThanConstructor || - hasThisAssignmentAndStaticMethods) { - return true; - } - } - return false; - } catch (e) { - return false; - } -} - -function toFastProperties(obj) { - /*jshint -W027,-W055,-W031*/ - function f() {} - f.prototype = obj; - var l = 8; - while (l--) new f(); - return obj; - eval(obj); -} - -var rident = /^[a-z$_][a-z$_0-9]*$/i; -function isIdentifier(str) { - return rident.test(str); -} - -function filledRange(count, prefix, suffix) { - var ret = new Array(count); - for(var i = 0; i < count; ++i) { - ret[i] = prefix + i + suffix; - } - return ret; -} - -function safeToString(obj) { - try { - return obj + ""; - } catch (e) { - return "[no string representation]"; - } -} - -function markAsOriginatingFromRejection(e) { - try { - notEnumerableProp(e, "isOperational", true); - } - catch(ignore) {} -} - -function originatesFromRejection(e) { - if (e == null) return false; - return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || - e["isOperational"] === true); -} - -function canAttachTrace(obj) { - return obj instanceof Error && es5.propertyIsWritable(obj, "stack"); -} - -var ensureErrorObject = (function() { - if (!("stack" in new Error())) { - return function(value) { - if (canAttachTrace(value)) return value; - try {throw new Error(safeToString(value));} - catch(err) {return err;} - }; - } else { - return function(value) { - if (canAttachTrace(value)) return value; - return new Error(safeToString(value)); - }; - } -})(); - -function classString(obj) { - return {}.toString.call(obj); -} - -function copyDescriptors(from, to, filter) { - var keys = es5.names(from); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (filter(key)) { - try { - es5.defineProperty(to, key, es5.getDescriptor(from, key)); - } catch (ignore) {} - } - } -} - -var ret = { - isClass: isClass, - isIdentifier: isIdentifier, - inheritedDataKeys: inheritedDataKeys, - getDataPropertyOrDefault: getDataPropertyOrDefault, - thrower: thrower, - isArray: es5.isArray, - haveGetters: haveGetters, - notEnumerableProp: notEnumerableProp, - isPrimitive: isPrimitive, - isObject: isObject, - canEvaluate: canEvaluate, - errorObj: errorObj, - tryCatch: tryCatch, - inherits: inherits, - withAppended: withAppended, - maybeWrapAsError: maybeWrapAsError, - toFastProperties: toFastProperties, - filledRange: filledRange, - toString: safeToString, - canAttachTrace: canAttachTrace, - ensureErrorObject: ensureErrorObject, - originatesFromRejection: originatesFromRejection, - markAsOriginatingFromRejection: markAsOriginatingFromRejection, - classString: classString, - copyDescriptors: copyDescriptors, - hasDevTools: typeof chrome !== "undefined" && chrome && - typeof chrome.loadTimes === "function", - isNode: typeof process !== "undefined" && - classString(process).toLowerCase() === "[object process]" -}; -ret.isRecentNode = ret.isNode && (function() { - var version = process.versions.node.split(".").map(Number); - return (version[0] === 0 && version[1] > 10) || (version[0] > 0); -})(); - -if (ret.isNode) ret.toFastProperties(process); - -try {throw new Error(); } catch (e) {ret.lastLineError = e;} -module.exports = ret; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/package.json deleted file mode 100644 index 92e49170e89883..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/bluebird/package.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "name": "bluebird", - "description": "Full featured Promises/A+ implementation with exceptionally good performance", - "version": "2.10.1", - "keywords": [ - "promise", - "performance", - "promises", - "promises-a", - "promises-aplus", - "async", - "await", - "deferred", - "deferreds", - "future", - "flow control", - "dsl", - "fluent interface", - "parallel", - "thread", - "concurrency" - ], - "scripts": { - "lint": "node scripts/jshint.js", - "test": "node tools/test.js", - "istanbul": "istanbul", - "prepublish": "node tools/build.js --no-debug --main --zalgo --browser --minify", - "generate-browser-core": "node tools/build.js --features=core --no-debug --main --zalgo --browser --minify && mv js/browser/bluebird.js js/browser/bluebird.core.js && mv js/browser/bluebird.min.js js/browser/bluebird.core.min.js" - }, - "homepage": "https://github.com/petkaantonov/bluebird", - "repository": { - "type": "git", - "url": "git://github.com/petkaantonov/bluebird.git" - }, - "bugs": { - "url": "http://github.com/petkaantonov/bluebird/issues" - }, - "license": "MIT", - "author": { - "name": "Petka Antonov", - "email": "petka_antonov@hotmail.com", - "url": "http://github.com/petkaantonov/" - }, - "devDependencies": { - "acorn": "~0.6.0", - "baconjs": "^0.7.43", - "bluebird": "^2.9.2", - "body-parser": "^1.10.2", - "browserify": "^8.1.1", - "cli-table": "~0.3.1", - "co": "^4.2.0", - "cross-spawn": "^0.2.3", - "glob": "^4.3.2", - "grunt-saucelabs": "~8.4.1", - "highland": "^2.3.0", - "istanbul": "^0.3.5", - "jshint": "^2.6.0", - "jshint-stylish": "~0.2.0", - "mkdirp": "~0.5.0", - "mocha": "~2.1", - "open": "~0.0.5", - "optimist": "~0.6.1", - "rimraf": "~2.2.6", - "rx": "^2.3.25", - "serve-static": "^1.7.1", - "sinon": "~1.7.3", - "uglify-js": "~2.4.16", - "kefir": "^2.4.1" - }, - "main": "./js/main/bluebird.js", - "browser": "./js/browser/bluebird.js", - "files": [ - "js/browser", - "js/main", - "js/zalgo", - "zalgo.js" - ], - "gitHead": "41b23cce935e77b851e076928745ad4c3cebba42", - "_id": "bluebird@2.10.1", - "_shasum": "3aeb31bdd92e52df50cba95303e281f94448ce06", - "_from": "bluebird@>=2.9.30 <3.0.0", - "_npmVersion": "2.11.1", - "_nodeVersion": "2.3.0", - "_npmUser": { - "name": "esailija", - "email": "petka_antonov@hotmail.com" - }, - "maintainers": [ - { - "name": "esailija", - "email": "petka_antonov@hotmail.com" - } - ], - "dist": { - "shasum": "3aeb31bdd92e52df50cba95303e281f94448ce06", - "tarball": "http://registry.npmjs.org/bluebird/-/bluebird-2.10.1.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.1.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json index b6a9ceaea0fa60..f2e9595b8b5eb2 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json @@ -14,12 +14,14 @@ }, "maintainers": [ { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" }, { - "name": "jbnicolai", - "email": "jappelman@xebia.com" + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" } ], "engines": { @@ -56,25 +58,14 @@ "devDependencies": { "mocha": "*" }, - "gitHead": "18421cbe4a2d93359ec2599a894f704be126d066", + "readme": "# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)\n\n> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal\n\nYou probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.\n\n![](screenshot.png)\n\n\n## Install\n\n```\n$ npm install --save ansi-styles\n```\n\n\n## Usage\n\n```js\nvar ansi = require('ansi-styles');\n\nconsole.log(ansi.green.open + 'Hello world!' + ansi.green.close);\n```\n\n\n## API\n\nEach style has an `open` and `close` property.\n\n\n## Styles\n\n### Modifiers\n\n- `reset`\n- `bold`\n- `dim`\n- `italic` *(not widely supported)*\n- `underline`\n- `inverse`\n- `hidden`\n- `strikethrough` *(not widely supported)*\n\n### Colors\n\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue`\n- `magenta`\n- `cyan`\n- `white`\n- `gray`\n\n### Background colors\n\n- `bgBlack`\n- `bgRed`\n- `bgGreen`\n- `bgYellow`\n- `bgBlue`\n- `bgMagenta`\n- `bgCyan`\n- `bgWhite`\n\n\n## Advanced usage\n\nBy default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.\n\n- `ansi.modifiers`\n- `ansi.colors`\n- `ansi.bgColors`\n\n\n###### Example\n\n```js\nconsole.log(ansi.colors.green.open);\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", "bugs": { "url": "https://github.com/chalk/ansi-styles/issues" }, - "homepage": "https://github.com/chalk/ansi-styles", + "homepage": "https://github.com/chalk/ansi-styles#readme", "_id": "ansi-styles@2.1.0", "_shasum": "990f747146927b559a932bf92959163d60c0d0e2", - "_from": "ansi-styles@>=2.1.0 <3.0.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "0.12.4", - "_npmUser": { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - }, - "dist": { - "shasum": "990f747146927b559a932bf92959163d60c0d0e2", - "tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz", - "readme": "ERROR: No README data found!" + "_from": "ansi-styles@>=2.1.0 <3.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json index 813c9089d27760..b2bafb26a04f02 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json @@ -14,12 +14,14 @@ }, "maintainers": [ { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" }, { - "name": "jbnicolai", - "email": "jappelman@xebia.com" + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "http://jbnicolai.com" } ], "engines": { @@ -46,25 +48,14 @@ "devDependencies": { "mocha": "*" }, - "gitHead": "1e446e6b4449b5f1f8868cd31bf8fd25ee37fb4b", + "readme": "# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp)\n\n> Escape RegExp special characters\n\n\n## Install\n\n```sh\n$ npm install --save escape-string-regexp\n```\n\n\n## Usage\n\n```js\nvar escapeStringRegexp = require('escape-string-regexp');\n\nvar escapedString = escapeStringRegexp('how much $ for a unicorn?');\n//=> how much \\$ for a unicorn\\?\n\nnew RegExp(escapedString);\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", "bugs": { "url": "https://github.com/sindresorhus/escape-string-regexp/issues" }, - "homepage": "https://github.com/sindresorhus/escape-string-regexp", + "homepage": "https://github.com/sindresorhus/escape-string-regexp#readme", "_id": "escape-string-regexp@1.0.3", "_shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5", - "_from": "escape-string-regexp@>=1.0.2 <2.0.0", - "_npmVersion": "2.1.16", - "_nodeVersion": "0.10.35", - "_npmUser": { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - }, - "dist": { - "shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5", - "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz", - "readme": "ERROR: No README data found!" + "_from": "escape-string-regexp@>=1.0.2 <2.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js deleted file mode 100644 index 4906755bc93573..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = function () { - return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json deleted file mode 100644 index 7fc07677a044ac..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/package.json +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "ansi-regex", - "version": "2.0.0", - "description": "Regular expression for matching ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/ansi-regex.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "mocha test/test.js", - "view-supported": "node test/viewCodes.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "cli", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "command-line", - "text", - "regex", - "regexp", - "re", - "match", - "test", - "find", - "pattern" - ], - "devDependencies": { - "mocha": "*" - }, - "gitHead": "57c3f2941a73079fa8b081e02a522e3d29913e2f", - "bugs": { - "url": "https://github.com/sindresorhus/ansi-regex/issues" - }, - "homepage": "https://github.com/sindresorhus/ansi-regex", - "_id": "ansi-regex@2.0.0", - "_shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", - "_from": "ansi-regex@>=2.0.0 <3.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "c5061b6e0ef8a81775e50f5d66151bf6bf371107", - "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md deleted file mode 100644 index 1a4894ec1110e3..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,31 +0,0 @@ -# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex) - -> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install --save ansi-regex -``` - - -## Usage - -```js -var ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001b[4mcake\u001b[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001b[4mcake\u001b[0m'.match(ansiRegex()); -//=> ['\u001b[4m', '\u001b[0m'] -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json index d39a62eb9150d7..15f623780f02e6 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json @@ -14,12 +14,14 @@ }, "maintainers": [ { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" }, { - "name": "jbnicolai", - "email": "jappelman@xebia.com" + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" } ], "engines": { @@ -61,25 +63,14 @@ "devDependencies": { "ava": "0.0.4" }, - "gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9", + "readme": "# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi)\n\n> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\n## Install\n\n```\n$ npm install --save has-ansi\n```\n\n\n## Usage\n\n```js\nvar hasAnsi = require('has-ansi');\n\nhasAnsi('\\u001b[4mcake\\u001b[0m');\n//=> true\n\nhasAnsi('cake');\n//=> false\n```\n\n\n## Related\n\n- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module\n- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes\n- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes\n- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", "bugs": { "url": "https://github.com/sindresorhus/has-ansi/issues" }, - "homepage": "https://github.com/sindresorhus/has-ansi", + "homepage": "https://github.com/sindresorhus/has-ansi#readme", "_id": "has-ansi@2.0.0", "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", - "_from": "has-ansi@>=2.0.0 <3.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", - "tarball": "http://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "readme": "ERROR: No README data found!" + "_from": "has-ansi@>=2.0.0 <3.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/index.js deleted file mode 100644 index 099480fbfc54cb..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/index.js +++ /dev/null @@ -1,6 +0,0 @@ -'use strict'; -var ansiRegex = require('ansi-regex')(); - -module.exports = function (str) { - return typeof str === 'string' ? str.replace(ansiRegex, '') : str; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js deleted file mode 100644 index 4906755bc93573..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/index.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; -module.exports = function () { - return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g; -}; diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md deleted file mode 100644 index 1a4894ec1110e3..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/node_modules/ansi-regex/readme.md +++ /dev/null @@ -1,31 +0,0 @@ -# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex) - -> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install --save ansi-regex -``` - - -## Usage - -```js -var ansiRegex = require('ansi-regex'); - -ansiRegex().test('\u001b[4mcake\u001b[0m'); -//=> true - -ansiRegex().test('cake'); -//=> false - -'\u001b[4mcake\u001b[0m'.match(ansiRegex()); -//=> ['\u001b[4m', '\u001b[0m'] -``` - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/package.json deleted file mode 100644 index 2871d037908d62..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name": "strip-ansi", - "version": "3.0.0", - "description": "Strip ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/strip-ansi.git" - }, - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "maintainers": [ - { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - { - "name": "jbnicolai", - "email": "jappelman@xebia.com" - } - ], - "engines": { - "node": ">=0.10.0" - }, - "scripts": { - "test": "node test.js" - }, - "files": [ - "index.js" - ], - "keywords": [ - "strip", - "trim", - "remove", - "ansi", - "styles", - "color", - "colour", - "colors", - "terminal", - "console", - "string", - "tty", - "escape", - "formatting", - "rgb", - "256", - "shell", - "xterm", - "log", - "logging", - "command-line", - "text" - ], - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "devDependencies": { - "ava": "0.0.4" - }, - "gitHead": "3f05b9810e1438f946e2eb84ee854cc00b972e9e", - "bugs": { - "url": "https://github.com/sindresorhus/strip-ansi/issues" - }, - "homepage": "https://github.com/sindresorhus/strip-ansi", - "_id": "strip-ansi@3.0.0", - "_shasum": "7510b665567ca914ccb5d7e072763ac968be3724", - "_from": "strip-ansi@>=3.0.0 <4.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "7510b665567ca914ccb5d7e072763ac968be3724", - "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/readme.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/readme.md deleted file mode 100644 index 76091512df5e46..00000000000000 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/strip-ansi/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi) - -> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) - - -## Install - -``` -$ npm install --save strip-ansi -``` - - -## Usage - -```js -var stripAnsi = require('strip-ansi'); - -stripAnsi('\u001b[4mcake\u001b[0m'); -//=> 'cake' -``` - - -## Related - -- [strip-ansi-cli](https://github.com/sindresorhus/strip-ansi-cli) - CLI for this module -- [has-ansi](https://github.com/sindresorhus/has-ansi) - Check if a string has ANSI escape codes -- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes -- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json index 38a1ecb3cebb2a..c43b7aa8c3a54f 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json @@ -14,12 +14,14 @@ }, "maintainers": [ { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" }, { - "name": "jbnicolai", - "email": "jappelman@xebia.com" + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" } ], "engines": { @@ -55,25 +57,14 @@ "mocha": "*", "require-uncached": "^1.0.2" }, - "gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588", + "readme": "# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)\n\n> Detect whether a terminal supports color\n\n\n## Install\n\n```\n$ npm install --save supports-color\n```\n\n\n## Usage\n\n```js\nvar supportsColor = require('supports-color');\n\nif (supportsColor) {\n\tconsole.log('Terminal supports color');\n}\n```\n\nIt obeys the `--color` and `--no-color` CLI flags.\n\nFor situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.\n\n\n## Related\n\n- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module\n- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", + "readmeFilename": "readme.md", "bugs": { "url": "https://github.com/chalk/supports-color/issues" }, - "homepage": "https://github.com/chalk/supports-color", + "homepage": "https://github.com/chalk/supports-color#readme", "_id": "supports-color@2.0.0", "_shasum": "535d045ce6b6363fa40117084629995e9df324c7", - "_from": "supports-color@>=2.0.0 <3.0.0", - "_npmVersion": "2.11.2", - "_nodeVersion": "0.12.5", - "_npmUser": { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" - }, - "dist": { - "shasum": "535d045ce6b6363fa40117084629995e9df324c7", - "tarball": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" - }, - "directories": {}, "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "readme": "ERROR: No README data found!" + "_from": "supports-color@>=2.0.0 <3.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json index a6120d20c890b9..2ad36d4d983cab 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json @@ -9,16 +9,19 @@ }, "maintainers": [ { - "name": "sindresorhus", - "email": "sindresorhus@gmail.com" + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" }, { - "name": "jbnicolai", - "email": "jappelman@xebia.com" + "name": "Joshua Appelman", + "email": "jappelman@xebia.com", + "url": "jbnicolai.com" }, { - "name": "unicorn", - "email": "sindresorhus+unicorn@gmail.com" + "name": "JD Ballard", + "email": "i.am.qix@gmail.com", + "url": "github.com/qix-" } ], "engines": { @@ -79,25 +82,14 @@ "mocha" ] }, - "gitHead": "8b554e254e89c85c1fd04dcc444beeb15824e1a5", + "readme": "

      \n\t
      \n\t
      \n\t\"chalk\"\n\t
      \n\t
      \n\t
      \n

      \n\n> Terminal string styling done right\n\n[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk)\n[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master)\n[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4)\n\n\n[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.\n\n**Chalk is a clean and focused alternative.**\n\n![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png)\n\n\n## Why\n\n- Highly performant\n- Doesn't extend `String.prototype`\n- Expressive API\n- Ability to nest styles\n- Clean and focused\n- Auto-detects color support\n- Actively maintained\n- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015\n\n\n## Install\n\n```\n$ npm install --save chalk\n```\n\n\n## Usage\n\nChalk comes with an easy to use composable API where you just chain and nest the styles you want.\n\n```js\nvar chalk = require('chalk');\n\n// style a string\nchalk.blue('Hello world!');\n\n// combine styled and normal strings\nchalk.blue('Hello') + 'World' + chalk.red('!');\n\n// compose multiple styles using the chainable API\nchalk.blue.bgRed.bold('Hello world!');\n\n// pass in multiple arguments\nchalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');\n\n// nest styles\nchalk.red('Hello', chalk.underline.bgBlue('world') + '!');\n\n// nest styles of the same type even (color, underline, background)\nchalk.green(\n\t'I am a green line ' +\n\tchalk.blue.underline.bold('with a blue substring') +\n\t' that becomes green again!'\n);\n```\n\nEasily define your own themes.\n\n```js\nvar chalk = require('chalk');\nvar error = chalk.bold.red;\nconsole.log(error('Error!'));\n```\n\nTake advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data).\n\n```js\nvar name = 'Sindre';\nconsole.log(chalk.green('Hello %s'), name);\n//=> Hello Sindre\n```\n\n\n## API\n\n### chalk.`